CombinedText
stringlengths
4
3.42M
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S I N F O -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001, 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- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); -- No subprogram ordering check, due to logical grouping with Atree; use Atree; package body Sinfo is use Atree.Unchecked_Access; -- This package is one of the few packages which is allowed to make direct -- references to tree nodes (since it is in the business of providing a -- higher level of tree access which other clients are expected to use and -- which implements checks). use Atree_Private_Part; -- The only reason that we ask for direct access to the private part of -- the tree package is so that we can directly reference the Nkind field -- of nodes table entries. We do this since it helps the efficiency of -- the Sinfo debugging checks considerably (note that when we are checking -- Nkind values, we don't need to check for a valid node reference, because -- we will check that anyway when we reference the field). NT : Nodes.Table_Ptr renames Nodes.Table; -- A short hand abbreviation, useful for the debugging checks ---------------------------- -- Field Access Functions -- ---------------------------- function ABE_Is_Certain (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation); return Flag18 (N); end ABE_Is_Certain; function Abort_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Requeue_Statement); return Flag15 (N); end Abort_Present; function Abortable_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); return Node2 (N); end Abortable_Part; function Abstract_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); return Flag4 (N); end Abstract_Present; function Accept_Handler_Records (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); return List5 (N); end Accept_Handler_Records; function Accept_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); return Node2 (N); end Accept_Statement; function Access_Types_To_Process (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); return Elist2 (N); end Access_Types_To_Process; function Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Freeze_Entity or else NT (N).Nkind = N_Or_Else); return List1 (N); end Actions; function Activation_Chain_Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Node3 (N); end Activation_Chain_Entity; function Acts_As_Spec (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Subprogram_Body); return Flag4 (N); end Acts_As_Spec; function Aggregate_Bounds (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); return Node3 (N); end Aggregate_Bounds; function Aliased_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Constrained_Array_Definition or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Unconstrained_Array_Definition); return Flag4 (N); end Aliased_Present; function All_Others (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); return Flag11 (N); end All_Others; function All_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition); return Flag15 (N); end All_Present; function Alternatives (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement); return List4 (N); end Alternatives; function Ancestor_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Extension_Aggregate); return Node3 (N); end Ancestor_Part; function Array_Aggregate (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Representation_Clause); return Node3 (N); end Array_Aggregate; function Assignment_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind in N_Subexpr); return Flag15 (N); end Assignment_OK; function Associated_Node (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_Selected_Component); return Node4 (N); end Associated_Node; function At_End_Proc (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return Node1 (N); end At_End_Proc; function Attribute_Name (N : Node_Id) return Name_Id is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); return Name2 (N); end Attribute_Name; function Aux_Decls_Node (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Node5 (N); end Aux_Decls_Node; function Backwards_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag6 (N); end Backwards_OK; function Bad_Is_Detected (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); return Flag15 (N); end Bad_Is_Detected; function Body_Required (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Flag13 (N); end Body_Required; function Body_To_Inline (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Declaration); return Node3 (N); end Body_To_Inline; function Box_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Subprogram_Declaration); return Flag15 (N); end Box_Present; function By_Ref (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Return_Statement); return Flag5 (N); end By_Ref; function Char_Literal_Value (N : Node_Id) return Char_Code is begin pragma Assert (False or else NT (N).Nkind = N_Character_Literal); return Char_Code2 (N); end Char_Literal_Value; function Chars (N : Node_Id) return Name_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Chars); return Name1 (N); end Chars; function Choice_Parameter (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return Node2 (N); end Choice_Parameter; function Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); return List1 (N); end Choices; function Compile_Time_Known_Aggregate (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); return Flag18 (N); end Compile_Time_Known_Aggregate; function Component_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return List2 (N); end Component_Associations; function Component_Clauses (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); return List3 (N); end Component_Clauses; function Component_Items (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); return List3 (N); end Component_Items; function Component_List (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Variant); return Node1 (N); end Component_List; function Component_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node1 (N); end Component_Name; function Condition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Raise_Constraint_Error or else NT (N).Nkind = N_Raise_Program_Error or else NT (N).Nkind = N_Raise_Storage_Error or else NT (N).Nkind = N_Terminate_Alternative); return Node1 (N); end Condition; function Condition_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Iteration_Scheme); return List3 (N); end Condition_Actions; function Constant_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Object_Declaration); return Flag17 (N); end Constant_Present; function Constraint (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication); return Node3 (N); end Constraint; function Constraints (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Index_Or_Discriminant_Constraint); return List1 (N); end Constraints; function Context_Installed (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag13 (N); end Context_Installed; function Context_Items (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return List1 (N); end Context_Items; function Controlling_Argument (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return Node1 (N); end Controlling_Argument; function Conversion_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); return Flag14 (N); end Conversion_OK; function Corresponding_Body (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); return Node5 (N); end Corresponding_Body; function Corresponding_Generic_Association (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration); return Node5 (N); end Corresponding_Generic_Association; function Corresponding_Integer_Value (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); return Uint4 (N); end Corresponding_Integer_Value; function Corresponding_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_With_Clause); return Node5 (N); end Corresponding_Spec; function Corresponding_Stub (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); return Node3 (N); end Corresponding_Stub; function Dcheck_Function (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Variant); return Node5 (N); end Dcheck_Function; function Debug_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Node3 (N); end Debug_Statement; function Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return List2 (N); end Declarations; function Default_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); return Node5 (N); end Default_Expression; function Default_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Subprogram_Declaration); return Node2 (N); end Default_Name; function Defining_Identifier (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Implicit_Label_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Loop_Parameter_Specification or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); return Node1 (N); end Defining_Identifier; function Defining_Unit_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); return Node1 (N); end Defining_Unit_Name; function Delay_Alternative (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Timed_Entry_Call); return Node4 (N); end Delay_Alternative; function Delay_Finalize_Attach (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Flag14 (N); end Delay_Finalize_Attach; function Delay_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Delay_Alternative); return Node2 (N); end Delay_Statement; function Delta_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); return Node3 (N); end Delta_Expression; function Digits_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Digits_Constraint or else NT (N).Nkind = N_Floating_Point_Definition); return Node2 (N); end Digits_Expression; function Discr_Check_Funcs_Built (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); return Flag11 (N); end Discr_Check_Funcs_Built; function Discrete_Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Variant); return List4 (N); end Discrete_Choices; function Discrete_Range (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Slice); return Node4 (N); end Discrete_Range; function Discrete_Subtype_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification); return Node4 (N); end Discrete_Subtype_Definition; function Discrete_Subtype_Definitions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Constrained_Array_Definition); return List2 (N); end Discrete_Subtype_Definitions; function Discriminant_Specifications (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); return List4 (N); end Discriminant_Specifications; function Discriminant_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Specification); return Node5 (N); end Discriminant_Type; function Do_Access_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Slice); return Flag11 (N); end Do_Access_Check; function Do_Accessibility_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); return Flag13 (N); end Do_Accessibility_Check; function Do_Discriminant_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Selected_Component); return Flag13 (N); end Do_Discriminant_Check; function Do_Division_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Rem); return Flag13 (N); end Do_Division_Check; function Do_Length_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Op_And or else NT (N).Nkind = N_Op_Or or else NT (N).Nkind = N_Op_Xor or else NT (N).Nkind = N_Type_Conversion); return Flag4 (N); end Do_Length_Check; function Do_Overflow_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Type_Conversion); return Flag17 (N); end Do_Overflow_Check; function Do_Range_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag9 (N); end Do_Range_Check; function Do_Storage_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Subprogram_Body); return Flag17 (N); end Do_Storage_Check; function Do_Tag_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Return_Statement or else NT (N).Nkind = N_Type_Conversion); return Flag13 (N); end Do_Tag_Check; function Elaborate_All_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag15 (N); end Elaborate_All_Present; function Elaborate_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag4 (N); end Elaborate_Present; function Elaboration_Boolean (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Specification); return Node2 (N); end Elaboration_Boolean; function Else_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Expression); return List3 (N); end Else_Actions; function Else_Statements (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Selective_Accept); return List4 (N); end Else_Statements; function Elsif_Parts (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_If_Statement); return List3 (N); end Elsif_Parts; function Enclosing_Variant (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Variant); return Node2 (N); end Enclosing_Variant; function End_Label (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Task_Definition); return Node4 (N); end End_Label; function End_Span (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_If_Statement); return Uint5 (N); end End_Span; function Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Freeze_Entity); return Node4 (N); end Entity; function Entry_Body_Formal_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body); return Node5 (N); end Entry_Body_Formal_Part; function Entry_Call_Alternative (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_Timed_Entry_Call); return Node1 (N); end Entry_Call_Alternative; function Entry_Call_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Alternative); return Node1 (N); end Entry_Call_Statement; function Entry_Direct_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); return Node1 (N); end Entry_Direct_Name; function Entry_Index (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); return Node5 (N); end Entry_Index; function Entry_Index_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body_Formal_Part); return Node4 (N); end Entry_Index_Specification; function Etype (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Etype); return Node5 (N); end Etype; function Exception_Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return List4 (N); end Exception_Choices; function Exception_Handlers (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return List5 (N); end Exception_Handlers; function Exception_Junk (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Subtype_Declaration); return Flag11 (N); end Exception_Junk; function Expansion_Delayed (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return Flag11 (N); end Expansion_Delayed; function Explicit_Actual_Parameter (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); return Node3 (N); end Explicit_Actual_Parameter; function Explicit_Generic_Actual_Parameter (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Association); return Node1 (N); end Explicit_Generic_Actual_Parameter; function Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_Code_Statement or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Delay_Relative_Statement or else NT (N).Nkind = N_Delay_Until_Statement or else NT (N).Nkind = N_Discriminant_Association or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Modular_Type_Definition or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Pragma_Argument_Association or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Return_Statement or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Expression or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Node3 (N); end Expression; function Expressions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Conditional_Expression or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_Indexed_Component); return List1 (N); end Expressions; function First_Bit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node3 (N); end First_Bit; function First_Inlined_Subprogram (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Node3 (N); end First_Inlined_Subprogram; function First_Name (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag5 (N); end First_Name; function First_Named_Actual (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return Node4 (N); end First_Named_Actual; function First_Real_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return Node2 (N); end First_Real_Statement; function First_Subtype_Link (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); return Node5 (N); end First_Subtype_Link; function Float_Truncate (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); return Flag11 (N); end Float_Truncate; function Formal_Type_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration); return Node3 (N); end Formal_Type_Definition; function Forwards_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag5 (N); end Forwards_OK; function From_At_Mod (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); return Flag4 (N); end From_At_Mod; function Generic_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); return List3 (N); end Generic_Associations; function Generic_Formal_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration); return List2 (N); end Generic_Formal_Declarations; function Generic_Parent (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Specification); return Node5 (N); end Generic_Parent; function Generic_Parent_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Declaration); return Node4 (N); end Generic_Parent_Type; function Handled_Statement_Sequence (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Node4 (N); end Handled_Statement_Sequence; function Handler_List_Entry (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Node2 (N); end Handler_List_Entry; function Has_Created_Identifier (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Loop_Statement); return Flag15 (N); end Has_Created_Identifier; function Has_Dynamic_Length_Check (N : Node_Id) return Boolean is begin return Flag10 (N); end Has_Dynamic_Length_Check; function Has_Dynamic_Range_Check (N : Node_Id) return Boolean is begin return Flag12 (N); end Has_Dynamic_Range_Check; function Has_No_Elaboration_Code (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Flag17 (N); end Has_No_Elaboration_Code; function Has_Priority_Pragma (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Definition); return Flag6 (N); end Has_Priority_Pragma; function Has_Private_View (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Character_Literal or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier or else NT (N).Nkind = N_Operator_Symbol); return Flag11 (N); end Has_Private_View; function Has_Storage_Size_Pragma (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); return Flag5 (N); end Has_Storage_Size_Pragma; function Has_Task_Info_Pragma (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); return Flag7 (N); end Has_Task_Info_Pragma; function Has_Task_Name_Pragma (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); return Flag8 (N); end Has_Task_Name_Pragma; function Has_Wide_Character (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); return Flag11 (N); end Has_Wide_Character; function Hidden_By_Use_Clause (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); return Elist4 (N); end Hidden_By_Use_Clause; function High_Bound (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); return Node2 (N); end High_Bound; function Identifier (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Record_Representation_Clause or else NT (N).Nkind = N_Subprogram_Info); return Node1 (N); end Identifier; function Implicit_With (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag17 (N); end Implicit_With; function In_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag15 (N); end In_Present; function Includes_Infinities (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Range); return Flag11 (N); end Includes_Infinities; function Instance_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); return Node5 (N); end Instance_Spec; function Intval (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); return Uint3 (N); end Intval; function Is_Asynchronous_Call_Block (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); return Flag7 (N); end Is_Asynchronous_Call_Block; function Is_Component_Left_Opnd (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); return Flag13 (N); end Is_Component_Left_Opnd; function Is_Component_Right_Opnd (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); return Flag14 (N); end Is_Component_Right_Opnd; function Is_Controlling_Actual (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag16 (N); end Is_Controlling_Actual; function Is_Machine_Number (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); return Flag11 (N); end Is_Machine_Number; function Is_Overloaded (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag5 (N); end Is_Overloaded; function Is_Power_Of_2_For_Shift (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Expon); return Flag13 (N); end Is_Power_Of_2_For_Shift; function Is_Protected_Subprogram_Body (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); return Flag7 (N); end Is_Protected_Subprogram_Body; function Is_Static_Expression (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag6 (N); end Is_Static_Expression; function Is_Subprogram_Descriptor (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Flag16 (N); end Is_Subprogram_Descriptor; function Is_Task_Allocation_Block (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); return Flag6 (N); end Is_Task_Allocation_Block; function Is_Task_Master (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Flag5 (N); end Is_Task_Master; function Iteration_Scheme (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); return Node2 (N); end Iteration_Scheme; function Itype (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Itype_Reference); return Node1 (N); end Itype; function Kill_Range_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Flag11 (N); end Kill_Range_Check; function Label_Construct (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Implicit_Label_Declaration); return Node2 (N); end Label_Construct; function Last_Bit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node4 (N); end Last_Bit; function Last_Name (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag6 (N); end Last_Name; function Left_Opnd (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else or else NT (N).Nkind in N_Binary_Op); return Node2 (N); end Left_Opnd; function Library_Unit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_With_Clause); return Node4 (N); end Library_Unit; function Limited_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); return Flag17 (N); end Limited_Present; function Literals (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Type_Definition); return List1 (N); end Literals; function Loop_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); return List2 (N); end Loop_Actions; function Loop_Parameter_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Iteration_Scheme); return Node4 (N); end Loop_Parameter_Specification; function Low_Bound (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); return Node1 (N); end Low_Bound; function Mod_Clause (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); return Node2 (N); end Mod_Clause; function More_Ids (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag5 (N); end More_Ids; function Must_Not_Freeze (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind in N_Subexpr); return Flag8 (N); end Must_Not_Freeze; function Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Raise_Statement or else NT (N).Nkind = N_Requeue_Statement or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Subunit or else NT (N).Nkind = N_Variant_Part or else NT (N).Nkind = N_With_Clause or else NT (N).Nkind = N_With_Type_Clause); return Node2 (N); end Name; function Names (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Abort_Statement or else NT (N).Nkind = N_Use_Package_Clause); return List2 (N); end Names; function Next_Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); return Node2 (N); end Next_Entity; function Next_Named_Actual (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); return Node4 (N); end Next_Named_Actual; function Next_Rep_Item (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Pragma or else NT (N).Nkind = N_Record_Representation_Clause); return Node4 (N); end Next_Rep_Item; function Next_Use_Clause (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); return Node3 (N); end Next_Use_Clause; function No_Ctrl_Actions (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag7 (N); end No_Ctrl_Actions; function No_Entities_Ref_In_Spec (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag8 (N); end No_Entities_Ref_In_Spec; function No_Initialization (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Object_Declaration); return Flag13 (N); end No_Initialization; function Null_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_List or else NT (N).Nkind = N_Record_Definition); return Flag13 (N); end Null_Present; function Null_Record_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return Flag17 (N); end Null_Record_Present; function Object_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Node4 (N); end Object_Definition; function OK_For_Stream (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); return Flag4 (N); end OK_For_Stream; function Original_Discriminant (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Identifier); return Node2 (N); end Original_Discriminant; function Others_Discrete_Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); return List1 (N); end Others_Discrete_Choices; function Out_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag17 (N); end Out_Present; function Parameter_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return List3 (N); end Parameter_Associations; function Parameter_List_Truncated (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return Flag17 (N); end Parameter_List_Truncated; function Parameter_Specifications (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Specification); return List3 (N); end Parameter_Specifications; function Parameter_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); return Node2 (N); end Parameter_Type; function Parent_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); return Node4 (N); end Parent_Spec; function Position (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node2 (N); end Position; function Pragma_Argument_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return List2 (N); end Pragma_Argument_Associations; function Pragmas_After (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Terminate_Alternative); return List5 (N); end Pragmas_After; function Pragmas_Before (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Terminate_Alternative or else NT (N).Nkind = N_Triggering_Alternative); return List4 (N); end Pragmas_Before; function Prefix (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Reference or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Slice); return Node3 (N); end Prefix; function Present_Expr (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Variant); return Uint3 (N); end Present_Expr; function Prev_Ids (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag6 (N); end Prev_Ids; function Print_In_Hex (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); return Flag13 (N); end Print_In_Hex; function Private_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); return List3 (N); end Private_Declarations; function Private_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Formal_Derived_Type_Definition); return Flag15 (N); end Private_Present; function Procedure_To_Call (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Return_Statement); return Node4 (N); end Procedure_To_Call; function Proper_Body (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); return Node1 (N); end Proper_Body; function Protected_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration); return Node3 (N); end Protected_Definition; function Protected_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition); return Flag15 (N); end Protected_Present; function Raises_Constraint_Error (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag7 (N); end Raises_Constraint_Error; function Range_Constraint (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Digits_Constraint); return Node4 (N); end Range_Constraint; function Range_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Range_Constraint); return Node4 (N); end Range_Expression; function Real_Range_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Floating_Point_Definition or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); return Node4 (N); end Real_Range_Specification; function Realval (N : Node_Id) return Ureal is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); return Ureal3 (N); end Realval; function Record_Extension_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition); return Node3 (N); end Record_Extension_Part; function Redundant_Use (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier); return Flag13 (N); end Redundant_Use; function Return_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Return_Statement); return Node2 (N); end Return_Type; function Reverse_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Parameter_Specification); return Flag15 (N); end Reverse_Present; function Right_Opnd (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else); return Node3 (N); end Right_Opnd; function Rounded_Result (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Type_Conversion); return Flag18 (N); end Rounded_Result; function Scope (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); return Node3 (N); end Scope; function Select_Alternatives (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Selective_Accept); return List1 (N); end Select_Alternatives; function Selector_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Generic_Association or else NT (N).Nkind = N_Parameter_Association or else NT (N).Nkind = N_Selected_Component); return Node2 (N); end Selector_Name; function Selector_Names (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Association); return List1 (N); end Selector_Names; function Shift_Count_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Rotate_Left or else NT (N).Nkind = N_Op_Rotate_Right or else NT (N).Nkind = N_Op_Shift_Left or else NT (N).Nkind = N_Op_Shift_Right or else NT (N).Nkind = N_Op_Shift_Right_Arithmetic); return Flag4 (N); end Shift_Count_OK; function Source_Type (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); return Node1 (N); end Source_Type; function Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Subprogram_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); return Node1 (N); end Specification; function Statements (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Abortable_Part or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Triggering_Alternative); return List3 (N); end Statements; function Static_Processing_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); return Flag4 (N); end Static_Processing_OK; function Storage_Pool (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Return_Statement); return Node1 (N); end Storage_Pool; function Strval (N : Node_Id) return String_Id is begin pragma Assert (False or else NT (N).Nkind = N_Operator_Symbol or else NT (N).Nkind = N_String_Literal); return Str3 (N); end Strval; function Subtype_Indication (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Constrained_Array_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind = N_Unconstrained_Array_Definition); return Node5 (N); end Subtype_Indication; function Subtype_Mark (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Node4 (N); end Subtype_Mark; function Subtype_Marks (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Unconstrained_Array_Definition or else NT (N).Nkind = N_Use_Type_Clause); return List2 (N); end Subtype_Marks; function Tagged_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_With_Type_Clause); return Flag15 (N); end Tagged_Present; function Target_Type (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); return Node2 (N); end Target_Type; function Task_Body_Procedure (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Task_Type_Declaration); return Node2 (N); end Task_Body_Procedure; function Task_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); return Node3 (N); end Task_Definition; function Then_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Expression); return List2 (N); end Then_Actions; function Then_Statements (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_If_Statement); return List2 (N); end Then_Statements; function Treat_Fixed_As_Integer (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Op_Rem); return Flag14 (N); end Treat_Fixed_As_Integer; function Triggering_Alternative (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); return Node1 (N); end Triggering_Alternative; function Triggering_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Triggering_Alternative); return Node1 (N); end Triggering_Statement; function TSS_Elist (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); return Elist3 (N); end TSS_Elist; function Type_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); return Node3 (N); end Type_Definition; function Unit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Node2 (N); end Unit; function Unknown_Discriminants_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration); return Flag13 (N); end Unknown_Discriminants_Present; function Unreferenced_In_Spec (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag7 (N); end Unreferenced_In_Spec; function Variant_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); return Node4 (N); end Variant_Part; function Variants (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Variant_Part); return List1 (N); end Variants; function Visible_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); return List2 (N); end Visible_Declarations; function Was_Originally_Stub (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Flag13 (N); end Was_Originally_Stub; function Zero_Cost_Handling (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return Flag5 (N); end Zero_Cost_Handling; -------------------------- -- Field Set Procedures -- -------------------------- procedure Set_ABE_Is_Certain (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation); Set_Flag18 (N, Val); end Set_ABE_Is_Certain; procedure Set_Abort_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Requeue_Statement); Set_Flag15 (N, Val); end Set_Abort_Present; procedure Set_Abortable_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); Set_Node2_With_Parent (N, Val); end Set_Abortable_Part; procedure Set_Abstract_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); Set_Flag4 (N, Val); end Set_Abstract_Present; procedure Set_Accept_Handler_Records (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); Set_List5 (N, Val); -- semantic field, no parent set end Set_Accept_Handler_Records; procedure Set_Accept_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); Set_Node2_With_Parent (N, Val); end Set_Accept_Statement; procedure Set_Access_Types_To_Process (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); Set_Elist2 (N, Val); -- semantic field, no parent set end Set_Access_Types_To_Process; procedure Set_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Freeze_Entity or else NT (N).Nkind = N_Or_Else); Set_List1_With_Parent (N, Val); end Set_Actions; procedure Set_Activation_Chain_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Activation_Chain_Entity; procedure Set_Acts_As_Spec (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Subprogram_Body); Set_Flag4 (N, Val); end Set_Acts_As_Spec; procedure Set_Aggregate_Bounds (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Aggregate_Bounds; procedure Set_Aliased_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Constrained_Array_Definition or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Unconstrained_Array_Definition); Set_Flag4 (N, Val); end Set_Aliased_Present; procedure Set_All_Others (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); Set_Flag11 (N, Val); end Set_All_Others; procedure Set_All_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition); Set_Flag15 (N, Val); end Set_All_Present; procedure Set_Alternatives (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement); Set_List4_With_Parent (N, Val); end Set_Alternatives; procedure Set_Ancestor_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Extension_Aggregate); Set_Node3_With_Parent (N, Val); end Set_Ancestor_Part; procedure Set_Array_Aggregate (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Representation_Clause); Set_Node3_With_Parent (N, Val); end Set_Array_Aggregate; procedure Set_Assignment_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind in N_Subexpr); Set_Flag15 (N, Val); end Set_Assignment_OK; procedure Set_Associated_Node (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_Selected_Component); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Associated_Node; procedure Set_At_End_Proc (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_Node1 (N, Val); end Set_At_End_Proc; procedure Set_Attribute_Name (N : Node_Id; Val : Name_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); Set_Name2 (N, Val); end Set_Attribute_Name; procedure Set_Aux_Decls_Node (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Node5_With_Parent (N, Val); end Set_Aux_Decls_Node; procedure Set_Backwards_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag6 (N, Val); end Set_Backwards_OK; procedure Set_Bad_Is_Detected (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); Set_Flag15 (N, Val); end Set_Bad_Is_Detected; procedure Set_Body_Required (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Flag13 (N, Val); end Set_Body_Required; procedure Set_Body_To_Inline (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Declaration); Set_Node3 (N, Val); end Set_Body_To_Inline; procedure Set_Box_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Subprogram_Declaration); Set_Flag15 (N, Val); end Set_Box_Present; procedure Set_By_Ref (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Return_Statement); Set_Flag5 (N, Val); end Set_By_Ref; procedure Set_Char_Literal_Value (N : Node_Id; Val : Char_Code) is begin pragma Assert (False or else NT (N).Nkind = N_Character_Literal); Set_Char_Code2 (N, Val); end Set_Char_Literal_Value; procedure Set_Chars (N : Node_Id; Val : Name_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Chars); Set_Name1 (N, Val); end Set_Chars; procedure Set_Choice_Parameter (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_Node2_With_Parent (N, Val); end Set_Choice_Parameter; procedure Set_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); Set_List1_With_Parent (N, Val); end Set_Choices; procedure Set_Compile_Time_Known_Aggregate (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); Set_Flag18 (N, Val); end Set_Compile_Time_Known_Aggregate; procedure Set_Component_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_List2_With_Parent (N, Val); end Set_Component_Associations; procedure Set_Component_Clauses (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); Set_List3_With_Parent (N, Val); end Set_Component_Clauses; procedure Set_Component_Items (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); Set_List3_With_Parent (N, Val); end Set_Component_Items; procedure Set_Component_List (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Variant); Set_Node1_With_Parent (N, Val); end Set_Component_List; procedure Set_Component_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node1_With_Parent (N, Val); end Set_Component_Name; procedure Set_Condition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Raise_Constraint_Error or else NT (N).Nkind = N_Raise_Program_Error or else NT (N).Nkind = N_Raise_Storage_Error or else NT (N).Nkind = N_Terminate_Alternative); Set_Node1_With_Parent (N, Val); end Set_Condition; procedure Set_Condition_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Iteration_Scheme); Set_List3 (N, Val); -- semantic field, no parent set end Set_Condition_Actions; procedure Set_Constant_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Object_Declaration); Set_Flag17 (N, Val); end Set_Constant_Present; procedure Set_Constraint (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication); Set_Node3_With_Parent (N, Val); end Set_Constraint; procedure Set_Constraints (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Index_Or_Discriminant_Constraint); Set_List1_With_Parent (N, Val); end Set_Constraints; procedure Set_Context_Installed (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag13 (N, Val); end Set_Context_Installed; procedure Set_Context_Items (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_List1_With_Parent (N, Val); end Set_Context_Items; procedure Set_Controlling_Argument (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Controlling_Argument; procedure Set_Conversion_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); Set_Flag14 (N, Val); end Set_Conversion_OK; procedure Set_Corresponding_Body (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Corresponding_Body; procedure Set_Corresponding_Generic_Association (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Corresponding_Generic_Association; procedure Set_Corresponding_Integer_Value (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); Set_Uint4 (N, Val); -- semantic field, no parent set end Set_Corresponding_Integer_Value; procedure Set_Corresponding_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_With_Clause); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Corresponding_Spec; procedure Set_Corresponding_Stub (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); Set_Node3 (N, Val); end Set_Corresponding_Stub; procedure Set_Dcheck_Function (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Variant); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Dcheck_Function; procedure Set_Debug_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Node3_With_Parent (N, Val); end Set_Debug_Statement; procedure Set_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_List2_With_Parent (N, Val); end Set_Declarations; procedure Set_Default_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Default_Expression; procedure Set_Default_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Subprogram_Declaration); Set_Node2_With_Parent (N, Val); end Set_Default_Name; procedure Set_Defining_Identifier (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Implicit_Label_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Loop_Parameter_Specification or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node1_With_Parent (N, Val); end Set_Defining_Identifier; procedure Set_Defining_Unit_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); Set_Node1_With_Parent (N, Val); end Set_Defining_Unit_Name; procedure Set_Delay_Alternative (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Timed_Entry_Call); Set_Node4_With_Parent (N, Val); end Set_Delay_Alternative; procedure Set_Delay_Finalize_Attach (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Flag14 (N, Val); end Set_Delay_Finalize_Attach; procedure Set_Delay_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Delay_Alternative); Set_Node2_With_Parent (N, Val); end Set_Delay_Statement; procedure Set_Delta_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); Set_Node3_With_Parent (N, Val); end Set_Delta_Expression; procedure Set_Digits_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Digits_Constraint or else NT (N).Nkind = N_Floating_Point_Definition); Set_Node2_With_Parent (N, Val); end Set_Digits_Expression; procedure Set_Discr_Check_Funcs_Built (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); Set_Flag11 (N, Val); end Set_Discr_Check_Funcs_Built; procedure Set_Discrete_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Variant); Set_List4_With_Parent (N, Val); end Set_Discrete_Choices; procedure Set_Discrete_Range (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Slice); Set_Node4_With_Parent (N, Val); end Set_Discrete_Range; procedure Set_Discrete_Subtype_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification); Set_Node4_With_Parent (N, Val); end Set_Discrete_Subtype_Definition; procedure Set_Discrete_Subtype_Definitions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Constrained_Array_Definition); Set_List2_With_Parent (N, Val); end Set_Discrete_Subtype_Definitions; procedure Set_Discriminant_Specifications (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); Set_List4_With_Parent (N, Val); end Set_Discriminant_Specifications; procedure Set_Discriminant_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Specification); Set_Node5_With_Parent (N, Val); end Set_Discriminant_Type; procedure Set_Do_Access_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Slice); Set_Flag11 (N, Val); end Set_Do_Access_Check; procedure Set_Do_Accessibility_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); Set_Flag13 (N, Val); end Set_Do_Accessibility_Check; procedure Set_Do_Discriminant_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Selected_Component); Set_Flag13 (N, Val); end Set_Do_Discriminant_Check; procedure Set_Do_Division_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Rem); Set_Flag13 (N, Val); end Set_Do_Division_Check; procedure Set_Do_Length_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Op_And or else NT (N).Nkind = N_Op_Or or else NT (N).Nkind = N_Op_Xor or else NT (N).Nkind = N_Type_Conversion); Set_Flag4 (N, Val); end Set_Do_Length_Check; procedure Set_Do_Overflow_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Type_Conversion); Set_Flag17 (N, Val); end Set_Do_Overflow_Check; procedure Set_Do_Range_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag9 (N, Val); end Set_Do_Range_Check; procedure Set_Do_Storage_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Subprogram_Body); Set_Flag17 (N, Val); end Set_Do_Storage_Check; procedure Set_Do_Tag_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Return_Statement or else NT (N).Nkind = N_Type_Conversion); Set_Flag13 (N, Val); end Set_Do_Tag_Check; procedure Set_Elaborate_All_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag15 (N, Val); end Set_Elaborate_All_Present; procedure Set_Elaborate_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag4 (N, Val); end Set_Elaborate_Present; procedure Set_Elaboration_Boolean (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Specification); Set_Node2 (N, Val); end Set_Elaboration_Boolean; procedure Set_Else_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Expression); Set_List3 (N, Val); -- semantic field, no parent set end Set_Else_Actions; procedure Set_Else_Statements (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Selective_Accept); Set_List4_With_Parent (N, Val); end Set_Else_Statements; procedure Set_Elsif_Parts (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_If_Statement); Set_List3_With_Parent (N, Val); end Set_Elsif_Parts; procedure Set_Enclosing_Variant (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Variant); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Enclosing_Variant; procedure Set_End_Label (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Task_Definition); Set_Node4_With_Parent (N, Val); end Set_End_Label; procedure Set_End_Span (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_If_Statement); Set_Uint5 (N, Val); end Set_End_Span; procedure Set_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Freeze_Entity); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Entity; procedure Set_Entry_Body_Formal_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body); Set_Node5_With_Parent (N, Val); end Set_Entry_Body_Formal_Part; procedure Set_Entry_Call_Alternative (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_Timed_Entry_Call); Set_Node1_With_Parent (N, Val); end Set_Entry_Call_Alternative; procedure Set_Entry_Call_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Alternative); Set_Node1_With_Parent (N, Val); end Set_Entry_Call_Statement; procedure Set_Entry_Direct_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); Set_Node1_With_Parent (N, Val); end Set_Entry_Direct_Name; procedure Set_Entry_Index (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); Set_Node5_With_Parent (N, Val); end Set_Entry_Index; procedure Set_Entry_Index_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body_Formal_Part); Set_Node4_With_Parent (N, Val); end Set_Entry_Index_Specification; procedure Set_Etype (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Etype); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Etype; procedure Set_Exception_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_List4_With_Parent (N, Val); end Set_Exception_Choices; procedure Set_Exception_Handlers (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_List5_With_Parent (N, Val); end Set_Exception_Handlers; procedure Set_Exception_Junk (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Subtype_Declaration); Set_Flag11 (N, Val); end Set_Exception_Junk; procedure Set_Expansion_Delayed (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_Flag11 (N, Val); end Set_Expansion_Delayed; procedure Set_Explicit_Actual_Parameter (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); Set_Node3_With_Parent (N, Val); end Set_Explicit_Actual_Parameter; procedure Set_Explicit_Generic_Actual_Parameter (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Association); Set_Node1_With_Parent (N, Val); end Set_Explicit_Generic_Actual_Parameter; procedure Set_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_Code_Statement or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Delay_Relative_Statement or else NT (N).Nkind = N_Delay_Until_Statement or else NT (N).Nkind = N_Discriminant_Association or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Modular_Type_Definition or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Pragma_Argument_Association or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Return_Statement or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Expression or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Node3_With_Parent (N, Val); end Set_Expression; procedure Set_Expressions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Conditional_Expression or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_Indexed_Component); Set_List1_With_Parent (N, Val); end Set_Expressions; procedure Set_First_Bit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node3_With_Parent (N, Val); end Set_First_Bit; procedure Set_First_Inlined_Subprogram (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Node3 (N, Val); -- semantic field, no parent set end Set_First_Inlined_Subprogram; procedure Set_First_Name (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag5 (N, Val); end Set_First_Name; procedure Set_First_Named_Actual (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_Node4 (N, Val); -- semantic field, no parent set end Set_First_Named_Actual; procedure Set_First_Real_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_Node2 (N, Val); -- semantic field, no parent set end Set_First_Real_Statement; procedure Set_First_Subtype_Link (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); Set_Node5 (N, Val); -- semantic field, no parent set end Set_First_Subtype_Link; procedure Set_Float_Truncate (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); Set_Flag11 (N, Val); end Set_Float_Truncate; procedure Set_Formal_Type_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration); Set_Node3_With_Parent (N, Val); end Set_Formal_Type_Definition; procedure Set_Forwards_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag5 (N, Val); end Set_Forwards_OK; procedure Set_From_At_Mod (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); Set_Flag4 (N, Val); end Set_From_At_Mod; procedure Set_Generic_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); Set_List3_With_Parent (N, Val); end Set_Generic_Associations; procedure Set_Generic_Formal_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration); Set_List2_With_Parent (N, Val); end Set_Generic_Formal_Declarations; procedure Set_Generic_Parent (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Specification); Set_Node5 (N, Val); end Set_Generic_Parent; procedure Set_Generic_Parent_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Declaration); Set_Node4 (N, Val); end Set_Generic_Parent_Type; procedure Set_Handled_Statement_Sequence (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Node4_With_Parent (N, Val); end Set_Handled_Statement_Sequence; procedure Set_Handler_List_Entry (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Node2 (N, Val); end Set_Handler_List_Entry; procedure Set_Has_Created_Identifier (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Loop_Statement); Set_Flag15 (N, Val); end Set_Has_Created_Identifier; procedure Set_Has_Dynamic_Length_Check (N : Node_Id; Val : Boolean := True) is begin Set_Flag10 (N, Val); end Set_Has_Dynamic_Length_Check; procedure Set_Has_Dynamic_Range_Check (N : Node_Id; Val : Boolean := True) is begin Set_Flag12 (N, Val); end Set_Has_Dynamic_Range_Check; procedure Set_Has_No_Elaboration_Code (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Flag17 (N, Val); end Set_Has_No_Elaboration_Code; procedure Set_Has_Priority_Pragma (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Definition); Set_Flag6 (N, Val); end Set_Has_Priority_Pragma; procedure Set_Has_Private_View (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Character_Literal or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier or else NT (N).Nkind = N_Operator_Symbol); Set_Flag11 (N, Val); end Set_Has_Private_View; procedure Set_Has_Storage_Size_Pragma (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); Set_Flag5 (N, Val); end Set_Has_Storage_Size_Pragma; procedure Set_Has_Task_Info_Pragma (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); Set_Flag7 (N, Val); end Set_Has_Task_Info_Pragma; procedure Set_Has_Task_Name_Pragma (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); Set_Flag8 (N, Val); end Set_Has_Task_Name_Pragma; procedure Set_Has_Wide_Character (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); Set_Flag11 (N, Val); end Set_Has_Wide_Character; procedure Set_Hidden_By_Use_Clause (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); Set_Elist4 (N, Val); end Set_Hidden_By_Use_Clause; procedure Set_High_Bound (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); Set_Node2_With_Parent (N, Val); end Set_High_Bound; procedure Set_Identifier (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Record_Representation_Clause or else NT (N).Nkind = N_Subprogram_Info); Set_Node1_With_Parent (N, Val); end Set_Identifier; procedure Set_Implicit_With (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag17 (N, Val); end Set_Implicit_With; procedure Set_In_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag15 (N, Val); end Set_In_Present; procedure Set_Includes_Infinities (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Range); Set_Flag11 (N, Val); end Set_Includes_Infinities; procedure Set_Instance_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); Set_Node5 (N, Val); -- semantic field, no Parent set end Set_Instance_Spec; procedure Set_Intval (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); Set_Uint3 (N, Val); end Set_Intval; procedure Set_Is_Asynchronous_Call_Block (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); Set_Flag7 (N, Val); end Set_Is_Asynchronous_Call_Block; procedure Set_Is_Component_Left_Opnd (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); Set_Flag13 (N, Val); end Set_Is_Component_Left_Opnd; procedure Set_Is_Component_Right_Opnd (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); Set_Flag14 (N, Val); end Set_Is_Component_Right_Opnd; procedure Set_Is_Controlling_Actual (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag16 (N, Val); end Set_Is_Controlling_Actual; procedure Set_Is_Machine_Number (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); Set_Flag11 (N, Val); end Set_Is_Machine_Number; procedure Set_Is_Overloaded (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag5 (N, Val); end Set_Is_Overloaded; procedure Set_Is_Power_Of_2_For_Shift (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Expon); Set_Flag13 (N, Val); end Set_Is_Power_Of_2_For_Shift; procedure Set_Is_Protected_Subprogram_Body (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); Set_Flag7 (N, Val); end Set_Is_Protected_Subprogram_Body; procedure Set_Is_Static_Expression (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag6 (N, Val); end Set_Is_Static_Expression; procedure Set_Is_Subprogram_Descriptor (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Flag16 (N, Val); end Set_Is_Subprogram_Descriptor; procedure Set_Is_Task_Allocation_Block (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); Set_Flag6 (N, Val); end Set_Is_Task_Allocation_Block; procedure Set_Is_Task_Master (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Flag5 (N, Val); end Set_Is_Task_Master; procedure Set_Iteration_Scheme (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); Set_Node2_With_Parent (N, Val); end Set_Iteration_Scheme; procedure Set_Itype (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Itype_Reference); Set_Node1 (N, Val); -- no parent, semantic field end Set_Itype; procedure Set_Kill_Range_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Flag11 (N, Val); end Set_Kill_Range_Check; procedure Set_Label_Construct (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Implicit_Label_Declaration); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Label_Construct; procedure Set_Last_Bit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node4_With_Parent (N, Val); end Set_Last_Bit; procedure Set_Last_Name (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag6 (N, Val); end Set_Last_Name; procedure Set_Left_Opnd (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else or else NT (N).Nkind in N_Binary_Op); Set_Node2_With_Parent (N, Val); end Set_Left_Opnd; procedure Set_Library_Unit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_With_Clause); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Library_Unit; procedure Set_Limited_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); Set_Flag17 (N, Val); end Set_Limited_Present; procedure Set_Literals (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Type_Definition); Set_List1_With_Parent (N, Val); end Set_Literals; procedure Set_Loop_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); Set_List2 (N, Val); -- semantic field, no parent set end Set_Loop_Actions; procedure Set_Loop_Parameter_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Iteration_Scheme); Set_Node4_With_Parent (N, Val); end Set_Loop_Parameter_Specification; procedure Set_Low_Bound (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); Set_Node1_With_Parent (N, Val); end Set_Low_Bound; procedure Set_Mod_Clause (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); Set_Node2_With_Parent (N, Val); end Set_Mod_Clause; procedure Set_More_Ids (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag5 (N, Val); end Set_More_Ids; procedure Set_Must_Not_Freeze (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind in N_Subexpr); Set_Flag8 (N, Val); end Set_Must_Not_Freeze; procedure Set_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Raise_Statement or else NT (N).Nkind = N_Requeue_Statement or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Subunit or else NT (N).Nkind = N_Variant_Part or else NT (N).Nkind = N_With_Clause or else NT (N).Nkind = N_With_Type_Clause); Set_Node2_With_Parent (N, Val); end Set_Name; procedure Set_Names (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Abort_Statement or else NT (N).Nkind = N_Use_Package_Clause); Set_List2_With_Parent (N, Val); end Set_Names; procedure Set_Next_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Next_Entity; procedure Set_Next_Named_Actual (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Next_Named_Actual; procedure Set_Next_Rep_Item (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Pragma or else NT (N).Nkind = N_Record_Representation_Clause); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Next_Rep_Item; procedure Set_Next_Use_Clause (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Next_Use_Clause; procedure Set_No_Ctrl_Actions (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag7 (N, Val); end Set_No_Ctrl_Actions; procedure Set_No_Entities_Ref_In_Spec (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag8 (N, Val); end Set_No_Entities_Ref_In_Spec; procedure Set_No_Initialization (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Object_Declaration); Set_Flag13 (N, Val); end Set_No_Initialization; procedure Set_Null_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_List or else NT (N).Nkind = N_Record_Definition); Set_Flag13 (N, Val); end Set_Null_Present; procedure Set_Null_Record_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_Flag17 (N, Val); end Set_Null_Record_Present; procedure Set_Object_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Node4_With_Parent (N, Val); end Set_Object_Definition; procedure Set_OK_For_Stream (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); Set_Flag4 (N, Val); end Set_OK_For_Stream; procedure Set_Original_Discriminant (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Identifier); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Original_Discriminant; procedure Set_Others_Discrete_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); Set_List1_With_Parent (N, Val); end Set_Others_Discrete_Choices; procedure Set_Out_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag17 (N, Val); end Set_Out_Present; procedure Set_Parameter_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_List3_With_Parent (N, Val); end Set_Parameter_Associations; procedure Set_Parameter_List_Truncated (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_Flag17 (N, Val); end Set_Parameter_List_Truncated; procedure Set_Parameter_Specifications (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Specification); Set_List3_With_Parent (N, Val); end Set_Parameter_Specifications; procedure Set_Parameter_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); Set_Node2_With_Parent (N, Val); end Set_Parameter_Type; procedure Set_Parent_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Parent_Spec; procedure Set_Position (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node2_With_Parent (N, Val); end Set_Position; procedure Set_Pragma_Argument_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_List2_With_Parent (N, Val); end Set_Pragma_Argument_Associations; procedure Set_Pragmas_After (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Terminate_Alternative); Set_List5_With_Parent (N, Val); end Set_Pragmas_After; procedure Set_Pragmas_Before (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Terminate_Alternative or else NT (N).Nkind = N_Triggering_Alternative); Set_List4_With_Parent (N, Val); end Set_Pragmas_Before; procedure Set_Prefix (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Reference or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Slice); Set_Node3_With_Parent (N, Val); end Set_Prefix; procedure Set_Present_Expr (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Variant); Set_Uint3 (N, Val); end Set_Present_Expr; procedure Set_Prev_Ids (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag6 (N, Val); end Set_Prev_Ids; procedure Set_Print_In_Hex (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); Set_Flag13 (N, Val); end Set_Print_In_Hex; procedure Set_Private_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); Set_List3_With_Parent (N, Val); end Set_Private_Declarations; procedure Set_Private_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Formal_Derived_Type_Definition); Set_Flag15 (N, Val); end Set_Private_Present; procedure Set_Procedure_To_Call (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Return_Statement); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Procedure_To_Call; procedure Set_Proper_Body (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); Set_Node1_With_Parent (N, Val); end Set_Proper_Body; procedure Set_Protected_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration); Set_Node3_With_Parent (N, Val); end Set_Protected_Definition; procedure Set_Protected_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition); Set_Flag15 (N, Val); end Set_Protected_Present; procedure Set_Raises_Constraint_Error (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag7 (N, Val); end Set_Raises_Constraint_Error; procedure Set_Range_Constraint (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Digits_Constraint); Set_Node4_With_Parent (N, Val); end Set_Range_Constraint; procedure Set_Range_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Range_Constraint); Set_Node4_With_Parent (N, Val); end Set_Range_Expression; procedure Set_Real_Range_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Floating_Point_Definition or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); Set_Node4_With_Parent (N, Val); end Set_Real_Range_Specification; procedure Set_Realval (N : Node_Id; Val : Ureal) is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); Set_Ureal3 (N, Val); end Set_Realval; procedure Set_Record_Extension_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition); Set_Node3_With_Parent (N, Val); end Set_Record_Extension_Part; procedure Set_Redundant_Use (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier); Set_Flag13 (N, Val); end Set_Redundant_Use; procedure Set_Return_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Return_Statement); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Return_Type; procedure Set_Reverse_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Parameter_Specification); Set_Flag15 (N, Val); end Set_Reverse_Present; procedure Set_Right_Opnd (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else); Set_Node3_With_Parent (N, Val); end Set_Right_Opnd; procedure Set_Rounded_Result (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Type_Conversion); Set_Flag18 (N, Val); end Set_Rounded_Result; procedure Set_Scope (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Scope; procedure Set_Select_Alternatives (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Selective_Accept); Set_List1_With_Parent (N, Val); end Set_Select_Alternatives; procedure Set_Selector_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Generic_Association or else NT (N).Nkind = N_Parameter_Association or else NT (N).Nkind = N_Selected_Component); Set_Node2_With_Parent (N, Val); end Set_Selector_Name; procedure Set_Selector_Names (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Association); Set_List1_With_Parent (N, Val); end Set_Selector_Names; procedure Set_Shift_Count_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Rotate_Left or else NT (N).Nkind = N_Op_Rotate_Right or else NT (N).Nkind = N_Op_Shift_Left or else NT (N).Nkind = N_Op_Shift_Right or else NT (N).Nkind = N_Op_Shift_Right_Arithmetic); Set_Flag4 (N, Val); end Set_Shift_Count_OK; procedure Set_Source_Type (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Source_Type; procedure Set_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Subprogram_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); Set_Node1_With_Parent (N, Val); end Set_Specification; procedure Set_Statements (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Abortable_Part or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Triggering_Alternative); Set_List3_With_Parent (N, Val); end Set_Statements; procedure Set_Static_Processing_OK (N : Node_Id; Val : Boolean) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); Set_Flag4 (N, Val); end Set_Static_Processing_OK; procedure Set_Storage_Pool (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Return_Statement); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Storage_Pool; procedure Set_Strval (N : Node_Id; Val : String_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Operator_Symbol or else NT (N).Nkind = N_String_Literal); Set_Str3 (N, Val); end Set_Strval; procedure Set_Subtype_Indication (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Constrained_Array_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind = N_Unconstrained_Array_Definition); Set_Node5_With_Parent (N, Val); end Set_Subtype_Indication; procedure Set_Subtype_Mark (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Node4_With_Parent (N, Val); end Set_Subtype_Mark; procedure Set_Subtype_Marks (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Unconstrained_Array_Definition or else NT (N).Nkind = N_Use_Type_Clause); Set_List2_With_Parent (N, Val); end Set_Subtype_Marks; procedure Set_Tagged_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_With_Type_Clause); Set_Flag15 (N, Val); end Set_Tagged_Present; procedure Set_Target_Type (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Target_Type; procedure Set_Task_Body_Procedure (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Task_Body_Procedure; procedure Set_Task_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node3_With_Parent (N, Val); end Set_Task_Definition; procedure Set_Then_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Expression); Set_List2 (N, Val); -- semantic field, no parent set end Set_Then_Actions; procedure Set_Then_Statements (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_If_Statement); Set_List2_With_Parent (N, Val); end Set_Then_Statements; procedure Set_Treat_Fixed_As_Integer (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Op_Rem); Set_Flag14 (N, Val); end Set_Treat_Fixed_As_Integer; procedure Set_Triggering_Alternative (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); Set_Node1_With_Parent (N, Val); end Set_Triggering_Alternative; procedure Set_Triggering_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Triggering_Alternative); Set_Node1_With_Parent (N, Val); end Set_Triggering_Statement; procedure Set_TSS_Elist (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); Set_Elist3 (N, Val); -- semantic field, no parent set end Set_TSS_Elist; procedure Set_Type_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); Set_Node3_With_Parent (N, Val); end Set_Type_Definition; procedure Set_Unit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Node2_With_Parent (N, Val); end Set_Unit; procedure Set_Unknown_Discriminants_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration); Set_Flag13 (N, Val); end Set_Unknown_Discriminants_Present; procedure Set_Unreferenced_In_Spec (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag7 (N, Val); end Set_Unreferenced_In_Spec; procedure Set_Variant_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); Set_Node4_With_Parent (N, Val); end Set_Variant_Part; procedure Set_Variants (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Variant_Part); Set_List1_With_Parent (N, Val); end Set_Variants; procedure Set_Visible_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); Set_List2_With_Parent (N, Val); end Set_Visible_Declarations; procedure Set_Was_Originally_Stub (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Flag13 (N, Val); end Set_Was_Originally_Stub; procedure Set_Zero_Cost_Handling (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_Flag5 (N, Val); end Set_Zero_Cost_Handling; ------------------------- -- Iterator Procedures -- ------------------------- procedure Next_Entity (N : in out Node_Id) is begin N := Next_Entity (N); end Next_Entity; procedure Next_Named_Actual (N : in out Node_Id) is begin N := Next_Named_Actual (N); end Next_Named_Actual; procedure Next_Rep_Item (N : in out Node_Id) is begin N := Next_Rep_Item (N); end Next_Rep_Item; procedure Next_Use_Clause (N : in out Node_Id) is begin N := Next_Use_Clause (N); end Next_Use_Clause; ------------------ -- End_Location -- ------------------ function End_Location (N : Node_Id) return Source_Ptr is L : constant Uint := End_Span (N); begin if L = No_Uint then return No_Location; else return Source_Ptr (Int (Sloc (N)) + UI_To_Int (L)); end if; end End_Location; ---------------------- -- Set_End_Location -- ---------------------- procedure Set_End_Location (N : Node_Id; S : Source_Ptr) is begin Set_End_Span (N, UI_From_Int (Int (S) - Int (Sloc (N)))); end Set_End_Location; end Sinfo;
------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the Maxim Reznik, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ package body Asis.Gela.Elements.Pathes is function Condition_Expression (Element : If_Path_Node) return Asis.Expression is begin return Element.Condition_Expression; end Condition_Expression; procedure Set_Condition_Expression (Element : in out If_Path_Node; Value : in Asis.Expression) is begin Element.Condition_Expression := Value; end Set_Condition_Expression; function New_If_Path_Node (The_Context : ASIS.Context) return If_Path_Ptr is Result : If_Path_Ptr := new If_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_If_Path_Node; function Path_Kind (Element : If_Path_Node) return Asis.Path_Kinds is begin return An_If_Path; end; function Children (Element : access If_Path_Node) return Traverse_List is begin return ((False, Element.Condition_Expression'Access), (True, Asis.Element (Element.Sequence_Of_Statements))); end Children; function Clone (Element : If_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant If_Path_Ptr := new If_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access If_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Target.Condition_Expression := Copy (Cloner, Condition_Expression (Source.all), Asis.Element (Target)); Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; function New_Elsif_Path_Node (The_Context : ASIS.Context) return Elsif_Path_Ptr is Result : Elsif_Path_Ptr := new Elsif_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_Elsif_Path_Node; function Path_Kind (Element : Elsif_Path_Node) return Asis.Path_Kinds is begin return An_Elsif_Path; end; function Clone (Element : Elsif_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant Elsif_Path_Ptr := new Elsif_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access Elsif_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Target.Condition_Expression := Copy (Cloner, Condition_Expression (Source.all), Asis.Element (Target)); Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; function New_Else_Path_Node (The_Context : ASIS.Context) return Else_Path_Ptr is Result : Else_Path_Ptr := new Else_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_Else_Path_Node; function Path_Kind (Element : Else_Path_Node) return Asis.Path_Kinds is begin return An_Else_Path; end; function Clone (Element : Else_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant Else_Path_Ptr := new Else_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access Else_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; function Case_Statement_Alternative_Choices (Element : Case_Path_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List is begin return Primary_Choise_Lists.To_Element_List (Element.Case_Statement_Alternative_Choices, Include_Pragmas); end Case_Statement_Alternative_Choices; procedure Set_Case_Statement_Alternative_Choices (Element : in out Case_Path_Node; Value : in Asis.Element) is begin Element.Case_Statement_Alternative_Choices := Primary_Choise_Lists.List (Value); end Set_Case_Statement_Alternative_Choices; function Case_Statement_Alternative_Choices_List (Element : Case_Path_Node) return Asis.Element is begin return Asis.Element (Element.Case_Statement_Alternative_Choices); end Case_Statement_Alternative_Choices_List; function Pragmas (Element : Case_Path_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List is begin return Primary_Pragma_Lists.To_Element_List (Element.Pragmas, Include_Pragmas); end Pragmas; procedure Set_Pragmas (Element : in out Case_Path_Node; Value : in Asis.Element) is begin Element.Pragmas := Primary_Pragma_Lists.List (Value); end Set_Pragmas; function Pragmas_List (Element : Case_Path_Node) return Asis.Element is begin return Asis.Element (Element.Pragmas); end Pragmas_List; function New_Case_Path_Node (The_Context : ASIS.Context) return Case_Path_Ptr is Result : Case_Path_Ptr := new Case_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_Case_Path_Node; function Path_Kind (Element : Case_Path_Node) return Asis.Path_Kinds is begin return A_Case_Path; end; function Children (Element : access Case_Path_Node) return Traverse_List is begin return ((True, Asis.Element (Element.Case_Statement_Alternative_Choices)), (True, Asis.Element (Element.Pragmas)), (True, Asis.Element (Element.Sequence_Of_Statements))); end Children; function Clone (Element : Case_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant Case_Path_Ptr := new Case_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access Case_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Set_Case_Statement_Alternative_Choices (Target.all, Primary_Choise_Lists.Deep_Copy (Case_Statement_Alternative_Choices (Source.all), Cloner, Asis.Element (Target))); Set_Pragmas (Target.all, Primary_Pragma_Lists.Deep_Copy (Pragmas (Source.all), Cloner, Asis.Element (Target))); Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; function Guard (Element : Select_Path_Node) return Asis.Expression is begin return Element.Guard; end Guard; procedure Set_Guard (Element : in out Select_Path_Node; Value : in Asis.Expression) is begin Element.Guard := Value; end Set_Guard; function Pragmas (Element : Select_Path_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List is begin return Primary_Pragma_Lists.To_Element_List (Element.Pragmas, Include_Pragmas); end Pragmas; procedure Set_Pragmas (Element : in out Select_Path_Node; Value : in Asis.Element) is begin Element.Pragmas := Primary_Pragma_Lists.List (Value); end Set_Pragmas; function Pragmas_List (Element : Select_Path_Node) return Asis.Element is begin return Asis.Element (Element.Pragmas); end Pragmas_List; function New_Select_Path_Node (The_Context : ASIS.Context) return Select_Path_Ptr is Result : Select_Path_Ptr := new Select_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_Select_Path_Node; function Path_Kind (Element : Select_Path_Node) return Asis.Path_Kinds is begin return A_Select_Path; end; function Children (Element : access Select_Path_Node) return Traverse_List is begin return ((False, Element.Guard'Access), (True, Asis.Element (Element.Pragmas)), (True, Asis.Element (Element.Sequence_Of_Statements))); end Children; function Clone (Element : Select_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant Select_Path_Ptr := new Select_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access Select_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Target.Guard := Copy (Cloner, Guard (Source.all), Asis.Element (Target)); Set_Pragmas (Target.all, Primary_Pragma_Lists.Deep_Copy (Pragmas (Source.all), Cloner, Asis.Element (Target))); Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; function New_Or_Path_Node (The_Context : ASIS.Context) return Or_Path_Ptr is Result : Or_Path_Ptr := new Or_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_Or_Path_Node; function Path_Kind (Element : Or_Path_Node) return Asis.Path_Kinds is begin return An_Or_Path; end; function Clone (Element : Or_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant Or_Path_Ptr := new Or_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access Or_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Target.Guard := Copy (Cloner, Guard (Source.all), Asis.Element (Target)); Set_Pragmas (Target.all, Primary_Pragma_Lists.Deep_Copy (Pragmas (Source.all), Cloner, Asis.Element (Target))); Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; function New_Then_Abort_Path_Node (The_Context : ASIS.Context) return Then_Abort_Path_Ptr is Result : Then_Abort_Path_Ptr := new Then_Abort_Path_Node; begin Set_Enclosing_Compilation_Unit (Result.all, Current_Unit (The_Context.all)); return Result; end New_Then_Abort_Path_Node; function Path_Kind (Element : Then_Abort_Path_Node) return Asis.Path_Kinds is begin return A_Then_Abort_Path; end; function Clone (Element : Then_Abort_Path_Node; Parent : Asis.Element) return Asis.Element is Result : constant Then_Abort_Path_Ptr := new Then_Abort_Path_Node; begin Result.Enclosing_Element := Parent; Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit; Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited; Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance; Result.Start_Position := Element.Start_Position; Result.End_Position := Element.End_Position; Result.Enclosing_Compilation_Unit := Enclosing_Compilation_Unit (Parent.all); Result.Hash := Element.Hash; return Asis.Element (Result); end Clone; procedure Copy (Source : in Asis.Element; Target : access Then_Abort_Path_Node; Cloner : in Cloner_Class; Parent : in Asis.Element) is begin Set_Sequence_Of_Statements (Target.all, Primary_Statement_Lists.Deep_Copy (Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target))); end Copy; end Asis.Gela.Elements.Pathes;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M -- -- -- -- S p e c -- -- (PikeOS 5 PPC Version) -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a Jorvik version of this package for PPC PikeOS 5 targets pragma Restrictions (No_Exception_Registration); -- Disable exception name registration. This capability is not used because -- it is only required by exception stream attributes which are not supported -- in this run time. pragma Profile (Jorvik); -- This is a Jorvik run time package System is pragma Pure; -- Note that we take advantage of the implementation permission to make -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada -- 2005, this is Pure in any case (AI-362). pragma No_Elaboration_Code_All; -- Allow the use of that restriction in units that WITH this unit type Name is (SYSTEM_NAME_GNAT); System_Name : constant Name := SYSTEM_NAME_GNAT; -- System-Dependent Named Numbers Min_Int : constant := -2 ** (Standard'Max_Integer_Size - 1); Max_Int : constant := 2 ** (Standard'Max_Integer_Size - 1) - 1; Max_Binary_Modulus : constant := 2 ** Standard'Max_Integer_Size; Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1; Max_Base_Digits : constant := Long_Long_Float'Digits; Max_Digits : constant := Long_Long_Float'Digits; Max_Mantissa : constant := Standard'Max_Integer_Size - 1; Fine_Delta : constant := 2.0 ** (-Max_Mantissa); Tick : constant := 0.000_000_001; -- 1 ns -- Storage-related Declarations type Address is private; pragma Preelaborable_Initialization (Address); Null_Address : constant Address; Storage_Unit : constant := 8; Word_Size : constant := Standard'Word_Size; Memory_Size : constant := 2 ** Word_Size; -- Address comparison function "<" (Left, Right : Address) return Boolean; function "<=" (Left, Right : Address) return Boolean; function ">" (Left, Right : Address) return Boolean; function ">=" (Left, Right : Address) return Boolean; function "=" (Left, Right : Address) return Boolean; pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); pragma Import (Intrinsic, "="); -- Other System-Dependent Declarations type Bit_Order is (High_Order_First, Low_Order_First); Default_Bit_Order : constant Bit_Order := High_Order_First; pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning -- Priority-related Declarations (RM D.1) -- For simplicity there is a 1-1 correspondence between Ada and PikeOS -- priorities. PikeOS priority 0 is reserved by the idle thread, so not -- available to Ada. -- PikeOS priorities are 0 .. 255 -- Priorities greather than 245 are reserved to the system software (PSSW) -- This implementation reserves priorities 224-239 to interrupts -- Priorities 240-245 are reserved to HM and PikeOS exception handlers Max_Priority : constant Positive := 223; Max_Interrupt_Priority : constant Positive := 239; subtype Any_Priority is Integer range 1 .. Max_Interrupt_Priority; subtype Priority is Any_Priority range Any_Priority'First .. Max_Priority; subtype Interrupt_Priority is Any_Priority range Priority'Last + 1 .. Any_Priority'Last; Default_Priority : constant Priority := (Priority'First + Priority'Last) / 2; private type Address is mod Memory_Size; Null_Address : constant Address := 0; -------------------------------------- -- System Implementation Parameters -- -------------------------------------- -- These parameters provide information about the target that is used -- by the compiler. They are in the private part of System, where they -- can be accessed using the special circuitry in the Targparm unit -- whose source should be consulted for more detailed descriptions -- of the individual switch values. Atomic_Sync_Default : constant Boolean := False; Backend_Divide_Checks : constant Boolean := False; Backend_Overflow_Checks : constant Boolean := True; Command_Line_Args : constant Boolean := False; Configurable_Run_Time : constant Boolean := True; Denorm : constant Boolean := True; Duration_32_Bits : constant Boolean := False; Exit_Status_Supported : constant Boolean := True; Fractional_Fixed_Ops : constant Boolean := False; Frontend_Layout : constant Boolean := False; Machine_Overflows : constant Boolean := False; Machine_Rounds : constant Boolean := True; Preallocated_Stacks : constant Boolean := True; Signed_Zeros : constant Boolean := True; Stack_Check_Default : constant Boolean := False; Stack_Check_Probes : constant Boolean := True; Stack_Check_Limits : constant Boolean := False; Support_Aggregates : constant Boolean := True; Support_Composite_Assign : constant Boolean := True; Support_Composite_Compare : constant Boolean := True; Support_Long_Shifts : constant Boolean := True; Always_Compatible_Rep : constant Boolean := True; Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := False; Frontend_Exceptions : constant Boolean := False; ZCX_By_Default : constant Boolean := True; -- The linker switches ordering comes from a project -- generated with Codeo or pikeos-cloneproject. pragma Linker_Options ("-u_p4_entry" & ASCII.NUL & "-nostdlib" & ASCII.NUL & "-T../ld/ppc-pikeos5.ld" & ASCII.NUL & "-lp4ext" & ASCII.NUL & "-lgnat" & ASCII.NUL & "-lvm" & ASCII.NUL & "-lstand" & ASCII.NUL & "-lp4" & ASCII.NUL & "-lgcc"); end System;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2016-2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with STM32_SVD.PWR; use STM32_SVD.PWR; package STM32.Power_Control is -- This processor doesn't need to enable power control module. procedure Disable_Backup_Domain_Protection; procedure Enable_Backup_Domain_Protection; type Wakeup_Pin is (WKUP_1, WKUP_2, WKUP_3, WKUP_4, WKUP_5, WKUP_6); type Wakeup_Pin_List is array (Wakeup_Pin) of Wakeup_Pin; procedure Enable_Wakeup_Pin (Pin : Wakeup_Pin; Enabled : Boolean := True); -- When enabled, the wakeup pin (PA0) is used for wakeup from Standby mode -- and forced in input pull down configuration (rising edge on WKUP pin -- wakes-up the system from Standby mode). -- When disabled, the wakeup pin is used for general purpose I/O. An event -- on the wakeup pin does not wakeup the device from Standby mode. type Wakeup_Pin_Polarity is (Rising_Edge, Falling_Edge); type Wakeup_Pin_PullMode is (No_Pull_Up, Pull_Up, Pull_Down); procedure Set_Wakeup_Pin_Polarity (Pin : Wakeup_Pin; Pol : Wakeup_Pin_Polarity; Pull : Wakeup_Pin_PullMode); function Wakeup_Flag (Pin : Wakeup_Pin) return Boolean; -- This flag is set by hardware and cleared either by a system reset or by -- calling the Clear_Wakeup_Flag procedure. procedure Clear_Wakeup_Flag (Pin : Wakeup_Pin); procedure Clear_Wakeup_Flag (Pins : Wakeup_Pin_List); function Standby_Flag return Boolean; -- This flag is set by hardware and cleared only by a POR/PDR (power-on -- reset/power-down reset) or by calling the Clear_Standby_Flag procedure. procedure Clear_Standby_Flag; type System_Stop_Mode is (SVOS_Scale_5, SVOS_Scale_4, SVOS_Scale_3); -- VCORE voltage level in system Stop mode. for System_Stop_Mode use (SVOS_Scale_5 => 2#01#, SVOS_Scale_4 => 2#10#, SVOS_Scale_3 => 2#11#); procedure Set_System_Stop_Mode (Mode : System_Stop_Mode); -- Control the VCORE voltage level in system Stop mode, to obtain the best -- trade-off between power consumption and performance. type Low_Power_Mode is (Stop_0, Stop_1, Standby, Shutdown); for Low_Power_Mode use (Stop_0 => 2#000#, Stop_1 => 2#001#, Standby => 2#011#, Shutdown => 2#100#); procedure Set_Power_Down_Deepsleep (Enabled : Boolean := True); -- When enabled, the MCU enters Standby mode when CPU enters deepsleep. -- When disabled, the MCU enters Stop mode when CPU enters deepsleep. procedure Set_Low_Power_Deepsleep (Enabled : Boolean := True); -- When enabled, the voltage regulator is in low-power during MCU Stop mode. -- When disabled, the voltage regulator is on during MCU Stop mode. procedure Enter_Standby_Mode with No_Return; -- Clear the wakeup and standby flag, set the power-down on CPU deep sleep -- and trigger MCU deep sleep. -- MCU gets out of standby with a reset, so this procedure does not return. end STM32.Power_Control;
-- #include "impact.d3.striding_Mesh.triangle_index_vertex_array.h" package body impact.d3.striding_Mesh.triangle_index_vertex_array -- -- -- is procedure addIndexedMesh (Self : in out Item; mesh : in btIndexedMesh) is begin Self.m_indexedMeshes.append (mesh); -- Self.m_indexedMeshes[m_indexedMeshes.size()-1].m_indexType = indexType; end addIndexedMesh; overriding function getNumSubParts (Self : in Item) return Natural is begin return Natural (Self.m_indexedMeshes.Length); end getNumSubParts; function getIndexedMeshArray (Self : access Item) return access IndexedMeshArray is begin return Self.m_indexedMeshes'Access; end getIndexedMeshArray; overriding procedure destruct (Self : in out Item) is begin null; end destruct; overriding procedure getLockedVertexIndexBase (Self : in out Item; vertexbase : out impact.d3.Containers.real_Pointer; stride : in out Integer; indexbase : out swig.Pointers.unsigned_Pointer; indexstride : in out Integer; numfaces : in out Integer; subpart : in Integer := 0) is pragma Assert (subpart < Self.getNumSubParts); mesh : btIndexedMesh renames Self.m_indexedMeshes (subpart); begin -- numverts := mesh.m_numVertices; vertexbase := mesh.m_vertexBase; -- vertexStride := mesh.m_vertexStride; numfaces := mesh.m_numTriangles; indexbase := mesh.m_triangleIndexBase; indexstride := mesh.m_triangleIndexStride; -- indicestype := mesh.m_indexType; -- type = mesh.m_vertexType; end getLockedVertexIndexBase; overriding procedure getLockedReadOnlyVertexIndexBase (Self : in Item; vertexbase : out impact.d3.Containers.real_Pointer; numverts : out Integer; stride : out Integer; indexbase : out swig.Pointers.unsigned_Pointer; -- unsigned_char_Pointer; indexstride : out Integer; numfaces : out Integer; subpart : in Integer := 0) is mesh : btIndexedMesh renames Self.m_indexedMeshes (subpart); begin numverts := mesh.m_numVertices; vertexbase := mesh.m_vertexBase; -- type = mesh.m_vertexType; Stride := mesh.m_vertexStride; numfaces := mesh.m_numTriangles; indexbase := mesh.m_triangleIndexBase; indexstride := mesh.m_triangleIndexStride; -- indicestype := mesh.m_indexType; end getLockedReadOnlyVertexIndexBase; overriding procedure unLockVertexBase (Self : in out Item; subpart : in Integer) is pragma Unreferenced (Self, subpart); begin return; end unLockVertexBase; overriding procedure unLockReadOnlyVertexBase (Self : in Item; subpart : in Integer) is pragma Unreferenced (Self, subpart); begin return; end unLockReadOnlyVertexBase; overriding procedure setPremadeAabb (Self : in out Item; aabbMin, aabbMax : in math.Vector_3) is begin Self.m_aabbMin := aabbMin; Self.m_aabbMax := aabbMax; Self.m_hasAabb := True; end setPremadeAabb; overriding procedure getPremadeAabb (Self : in Item; aabbMin, aabbMax : out math.Vector_3) is begin aabbMin := Self.m_aabbMin; aabbMax := Self.m_aabbMax; end getPremadeAabb; overriding function hasPremadeAabb (Self : in Item) return Boolean is begin return Self.m_hasAabb; end hasPremadeAabb; end impact.d3.striding_Mesh.triangle_index_vertex_array; -- Just to be backwards compatible ... -- -- impact.d3.striding_Mesh.triangle_index_vertex_array::impact.d3.striding_Mesh.triangle_index_vertex_array(int numTriangles,int* triangleIndexBase,int triangleIndexStride,int numVertices,impact.d3.Scalar* vertexBase,int vertexStride) -- : m_hasAabb(0) -- { -- btIndexedMesh mesh; -- -- mesh.m_numTriangles = numTriangles; -- mesh.m_triangleIndexBase = (const unsigned char *)triangleIndexBase; -- mesh.m_triangleIndexStride = triangleIndexStride; -- mesh.m_numVertices = numVertices; -- mesh.m_vertexBase = (const unsigned char *)vertexBase; -- mesh.m_vertexStride = vertexStride; -- -- addIndexedMesh(mesh); -- -- }
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2018, Fabien Chouteau -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package AGATE.Arch.RISCV is function CPU_Frequency return Word; function Stvec return Word with Inline_Always; procedure Write_Stvec (Val : Word) with Inline_Always; function Mtvec return Word with Inline_Always; procedure Write_Mtvec (Val : Word) with Inline_Always; function Mscratch return Word with Inline_Always; procedure Write_Mcratch (Val : Word) with Inline_Always; function Mbadaddr return Word with Inline_Always; function Mcycle_Low return Word with Inline_Always; function Mcycle_Hi return Word with Inline_Always; type Mstatus_Reg is record UIE : Boolean; SIE : Boolean; HIE : Boolean; MIE : Boolean; UPIE : Boolean; SPIE : Boolean; HPIE : Boolean; MPIE : Boolean; SPP : Bit; HPP : UInt2; MPP : UInt2; FS : UInt2; XS : UInt2; MPRV : Boolean; PUM : Boolean; MXR : Boolean; WPRI_1 : UInt4; -- Reserved Writes Preserve Values, Reads Ignore VM : UInt5; WPRI_2 : UInt2; -- Reserved Writes Preserve Values, Reads Ignore SD : Boolean; end record with Size => 32; for Mstatus_Reg use record UIE at 0 range 0 .. 0; SIE at 0 range 1 .. 1; HIE at 0 range 2 .. 2; MIE at 0 range 3 .. 3; UPIE at 0 range 4 .. 4; SPIE at 0 range 5 .. 5; HPIE at 0 range 6 .. 6; MPIE at 0 range 7 .. 7; SPP at 0 range 8 .. 8; HPP at 0 range 9 .. 10; MPP at 0 range 11 .. 12; FS at 0 range 13 .. 14; XS at 0 range 15 .. 16; MPRV at 0 range 17 .. 17; PUM at 0 range 18 .. 18; MXR at 0 range 19 .. 19; WPRI_1 at 0 range 20 .. 23; VM at 0 range 24 .. 28; WPRI_2 at 0 range 29 .. 30; SD at 0 range 31 .. 31; end record; function Mstatus return Mstatus_Reg with Inline_Always; procedure Write_Mstatus (Val : Mstatus_Reg) with Inline_Always; type Interrupt_Register is record USI : Boolean; SSI : Boolean; HSI : Boolean; MSI : Boolean; UTI : Boolean; STI : Boolean; HTI : Boolean; MTI : Boolean; UEI : Boolean; SEI : Boolean; HEI : Boolean; MEI : Boolean; Reserved : UInt18; end record with Size => 32; for Interrupt_Register use record USI at 0 range 0 .. 0; SSI at 0 range 1 .. 1; HSI at 0 range 2 .. 2; MSI at 0 range 3 .. 3; UTI at 0 range 4 .. 4; STI at 0 range 5 .. 5; HTI at 0 range 6 .. 6; MTI at 0 range 7 .. 7; UEI at 0 range 8 .. 8; SEI at 0 range 9 .. 9; HEI at 0 range 10 .. 10; MEI at 0 range 11 .. 11; Reserved at 0 range 12 .. 31; end record; function Mip return Interrupt_Register with Inline_Always; procedure Write_Mip (Val : Interrupt_Register) with Inline_Always; function Mie return Interrupt_Register with Inline_Always; procedure Write_Mie (Val : Interrupt_Register) with Inline_Always; end AGATE.Arch.RISCV;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . W I D _ B O O L -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2005, 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- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.Wid_Bool is ------------------- -- Width_Boolean -- ------------------- function Width_Boolean (Lo, Hi : Boolean) return Natural is begin if Lo > Hi then return 0; elsif Lo = False then return 5; else return 4; end if; end Width_Boolean; end System.Wid_Bool;
-- WORDS, a Latin dictionary, by Colonel William Whitaker (USAF, Retired) -- -- Copyright William A. Whitaker (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is Copyrighted -- (c). Permission is hereby freely given for any and all use of program -- and data. You can sell it as your own, but at least tell me. -- -- This version is distributed without obligation, but the developer -- would appreciate comments and suggestions. -- -- All parts of the WORDS system, source code and data files, are made freely -- available to anyone who wishes to use them, for whatever purpose. separate (Latin_Utils.Inflections_Package) package body Noun_Record_IO is --------------------------------------------------------------------------- procedure Get (File : in File_Type; Item : out Noun_Record) is Spacer : Character := ' '; pragma Unreferenced (Spacer); begin Decn_Record_IO.Get (File, Item.Decl); Get (File, Spacer); Case_Type_IO.Get (File, Item.Of_Case); Get (File, Spacer); Number_Type_IO.Get (File, Item.Number); Get (File, Spacer); Gender_Type_IO.Get (File, Item.Gender); end Get; --------------------------------------------------------------------------- procedure Get (Item : out Noun_Record) is Spacer : Character := ' '; pragma Unreferenced (Spacer); begin Decn_Record_IO.Get (Item.Decl); Get (Spacer); Case_Type_IO.Get (Item.Of_Case); Get (Spacer); Number_Type_IO.Get (Item.Number); Get (Spacer); Gender_Type_IO.Get (Item.Gender); end Get; --------------------------------------------------------------------------- procedure Put (File : in File_Type; Item : in Noun_Record) is begin Decn_Record_IO.Put (File, Item.Decl); Put (File, ' '); Case_Type_IO.Put (File, Item.Of_Case); Put (File, ' '); Number_Type_IO.Put (File, Item.Number); Put (File, ' '); Gender_Type_IO.Put (File, Item.Gender); end Put; --------------------------------------------------------------------------- procedure Put (Item : in Noun_Record) is begin Decn_Record_IO.Put (Item.Decl); Put (' '); Case_Type_IO.Put (Item.Of_Case); Put (' '); Number_Type_IO.Put (Item.Number); Put (' '); Gender_Type_IO.Put (Item.Gender); end Put; --------------------------------------------------------------------------- procedure Get (Source : in String; Target : out Noun_Record; Last : out Integer ) is -- Used for computing lower bound of substrings Low : Integer := Source'First - 1; begin Decn_Record_IO.Get (Source (Low + 1 .. Source'Last), Target.Decl, Low); Low := Low + 1; Case_Type_IO.Get (Source (Low + 1 .. Source'Last), Target.Of_Case, Low); Low := Low + 1; Number_Type_IO.Get (Source (Low + 1 .. Source'Last), Target.Number, Low); Low := Low + 1; Gender_Type_IO.Get (Source (Low + 1 .. Source'Last), Target.Gender, Last); end Get; --------------------------------------------------------------------------- procedure Put (Target : out String; Item : in Noun_Record ) is -- Used for computing bounds of substrings Low : Integer := Target'First - 1; High : Integer := 0; begin -- Put Decn_Record High := Low + Decn_Record_IO.Default_Width; Decn_Record_IO.Put (Target (Low + 1 .. High), Item.Decl); -- Put Case_Type Low := High + 1; Target (Low) := ' '; High := Low + Case_Type_IO.Default_Width; Case_Type_IO.Put (Target (Low + 1 .. High), Item.Of_Case); -- Put Number_Type Low := High + 1; Target (Low) := ' '; High := Low + Number_Type_IO.Default_Width; Number_Type_IO.Put (Target (Low + 1 .. High), Item.Number); -- Put Gender_Type Low := High + 1; Target (Low) := ' '; High := Low + Gender_Type_IO.Default_Width; Gender_Type_IO.Put (Target (Low + 1 .. High), Item.Gender); -- Fill remainder of String Target (High + 1 .. Target'Last) := (others => ' '); end Put; --------------------------------------------------------------------------- end Noun_Record_IO;
pragma License (Unrestricted); -- implementation unit specialized for POSIX (Darwin, FreeBSD, or Linux) with Ada.IO_Exceptions; with Ada.IO_Modes; with Ada.Streams; with System.Native_IO; with C.termios; package System.Native_Text_IO is pragma Preelaborate; subtype Handle_Type is Native_IO.Handle_Type; -- file management Default_External : constant Ada.IO_Modes.File_External := Ada.IO_Modes.UTF_8; Default_New_Line : constant Ada.IO_Modes.File_New_Line := Ada.IO_Modes.LF; type Packed_Form is record Stream_Form : Native_IO.Packed_Form; External : Ada.IO_Modes.File_External_Spec; New_Line : Ada.IO_Modes.File_New_Line_Spec; end record; pragma Suppress_Initialization (Packed_Form); pragma Pack (Packed_Form); -- read / write subtype Buffer_Type is String (1 .. 6); -- one code-point of UTF-8 subtype DBCS_Buffer_Type is String (1 .. 6); -- unused procedure To_UTF_8 ( Buffer : aliased DBCS_Buffer_Type; Last : Natural; Out_Buffer : out Buffer_Type; Out_Last : out Natural) with Import, Convention => Ada, External_Name => "__drake_program_error"; procedure To_DBCS ( Buffer : Buffer_Type; Last : Natural; Out_Buffer : aliased out DBCS_Buffer_Type; Out_Last : out Natural) with Import, Convention => Ada, External_Name => "__drake_program_error"; procedure Write_Just ( Handle : Handle_Type; Item : String); -- terminal procedure Terminal_Get ( Handle : Handle_Type; Item : Address; Length : Ada.Streams.Stream_Element_Offset; Out_Length : out Ada.Streams.Stream_Element_Offset) -- -1 when error renames Native_IO.Read; procedure Terminal_Get_Immediate ( Handle : Handle_Type; Item : Address; Length : Ada.Streams.Stream_Element_Offset; Out_Length : out Ada.Streams.Stream_Element_Offset) -- -1 when error renames Native_IO.Read; procedure Terminal_Put ( Handle : Handle_Type; Item : Address; Length : Ada.Streams.Stream_Element_Offset; Out_Length : out Ada.Streams.Stream_Element_Offset) -- -1 when error renames Native_IO.Write; procedure Terminal_Size ( Handle : Handle_Type; Line_Length, Page_Length : out Natural); procedure Set_Terminal_Size ( Handle : Handle_Type; Line_Length, Page_Length : Natural); procedure Terminal_View ( Handle : Handle_Type; Left, Top : out Positive; Right, Bottom : out Natural); function Use_Terminal_Position (Handle : Handle_Type) return Boolean; procedure Terminal_Position ( Handle : Handle_Type; Col, Line : out Positive); procedure Set_Terminal_Position ( Handle : Handle_Type; Col, Line : Positive); procedure Set_Terminal_Col ( Handle : Handle_Type; To : Positive); procedure Terminal_Clear ( Handle : Handle_Type); subtype Setting is C.termios.struct_termios; procedure Set_Non_Canonical_Mode ( Handle : Handle_Type; Wait : Boolean; Saved_Settings : aliased out Setting); procedure Restore ( Handle : Handle_Type; Settings : aliased Setting); subtype Output_State is Natural; -- stacking count procedure Save_State (Handle : Handle_Type; To_State : out Output_State); procedure Reset_State (Handle : Handle_Type; From_State : Output_State); -- exceptions Status_Error : exception renames Ada.IO_Exceptions.Status_Error; Device_Error : exception renames Ada.IO_Exceptions.Device_Error; Data_Error : exception renames Ada.IO_Exceptions.Data_Error; end System.Native_Text_IO;
----------------------------------------------------------------------- -- css-commands-list -- List command for CSS tools -- Copyright (C) 2018, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package CSS.Commands.List is -- ------------------------------ -- List Command -- ------------------------------ -- This command lists some information about the CSS files. type Command is new CSS.Commands.Command with null record; -- Execute the command with the arguments. overriding procedure Execute (Cmd : in out Command; Name : in String; Args : in Argument_List'Class; Context : in out CSS.Commands.Context_Type); -- Write the help associated with the command. overriding procedure Help (Cmd : in out Command; Name : in String; Context : in out CSS.Commands.Context_Type); end CSS.Commands.List;
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; with glib.Values; with System; with glib; with System; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_gsturi_h is -- arg-macro: function GST_URI_TYPE_IS_VALID (type) -- return (type) = GST_URI_SRC or else (type) = GST_URI_SINK; -- unsupported macro: GST_TYPE_URI_HANDLER (gst_uri_handler_get_type ()) -- arg-macro: function GST_URI_HANDLER (obj) -- return G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_URI_HANDLER, GstURIHandler); -- arg-macro: function GST_IS_URI_HANDLER (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_URI_HANDLER); -- arg-macro: function GST_URI_HANDLER_GET_INTERFACE (obj) -- return G_TYPE_INSTANCE_GET_INTERFACE ((obj), GST_TYPE_URI_HANDLER, GstURIHandlerInterface); -- GStreamer -- * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> -- * 2000 Wim Taymans <wtay@chello.be> -- * -- * gsturi.h: Header for uri to element mappings -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- --* -- * GstURIType: -- * @GST_URI_UNKNOWN : The URI direction is unknown -- * @GST_URI_SINK : The URI is a consumer. -- * @GST_URI_SRC : The URI is a producer. -- * -- * The different types of URI direction. -- type GstURIType is (GST_URI_UNKNOWN, GST_URI_SINK, GST_URI_SRC); pragma Convention (C, GstURIType); -- gst/gsturi.h:46 --* -- * GST_URI_TYPE_IS_VALID: -- * @type: A #GstURIType -- * -- * Tests if the type direction is valid. -- -- uri handler functions --* -- * GstURIHandler: -- * -- * Opaque #GstURIHandler structure. -- -- skipped empty struct u_GstURIHandler -- skipped empty struct GstURIHandler type GstURIHandlerInterface; type u_GstURIHandlerInterface_u_gst_reserved_array is array (0 .. 1) of System.Address; --subtype GstURIHandlerInterface is u_GstURIHandlerInterface; -- gst/gsturi.h:68 --* -- * GstURIHandlerInterface: -- * @parent: The parent interface type -- * @get_type: Method to tell whether the element handles source or sink URI. -- * @get_protocols: Method to return the list of protocols handled by the element. -- * @get_uri: Method to return the URI currently handled by the element. -- * @set_uri: Method to set a new URI. -- * @get_type_full: Variant of get_type which takes a GType argument. This is -- * for use by bindings that need to pass context when creating a URI Handler. -- * If implemented, get_type will be used in preference to get_type_full. -- * Since: 0.10.15. -- * @get_protocols_full: Variant of get_protocols which takes a GType argument. -- * This is for use by bindings that need to pass context when creating a URI -- * Handler. If implemented, get_protocols will be used in preference to -- * get_protocols_full. Since: 0.10.15. -- * -- * Any #GstElement using this interface should implement these methods. -- type GstURIHandlerInterface is record parent : aliased GStreamer.GST_Low_Level.glib_2_0_gobject_gtype_h.GTypeInterface; -- gst/gsturi.h:89 new_uri : access procedure (arg1 : System.Address; arg2 : access GLIB.gchar); -- gst/gsturi.h:94 get_type : access function return GstURIType; -- gst/gsturi.h:105 get_protocols : access function return System.Address; -- gst/gsturi.h:106 get_uri : access function (arg1 : System.Address) return access GLIB.gchar; -- gst/gsturi.h:109 set_uri : access function (arg1 : System.Address; arg2 : access GLIB.gchar) return GLIB.gboolean; -- gst/gsturi.h:111 get_type_full : access function (arg1 : GLIB.GType) return GstURIType; -- gst/gsturi.h:113 get_protocols_full : access function (arg1 : GLIB.GType) return System.Address; -- gst/gsturi.h:114 u_gst_reserved : u_GstURIHandlerInterface_u_gst_reserved_array; -- gst/gsturi.h:120 end record; pragma Convention (C_Pass_By_Copy, GstURIHandlerInterface); -- gst/gsturi.h:88 --< private > -- signals -- idea for the future ? -- gboolean (* require_password) (GstURIHandler * handler, -- gchar ** username, -- gchar ** password); -- -- vtable --< public > -- querying capabilities -- using the interface --< private > -- we might want to add functions here to query features, -- * someone with gnome-vfs knowledge go ahead -- general URI functions function gst_uri_protocol_is_valid (protocol : access GLIB.gchar) return GLIB.gboolean; -- gst/gsturi.h:125 pragma Import (C, gst_uri_protocol_is_valid, "gst_uri_protocol_is_valid"); function gst_uri_protocol_is_supported (c_type : GstURIType; protocol : access GLIB.gchar) return GLIB.gboolean; -- gst/gsturi.h:126 pragma Import (C, gst_uri_protocol_is_supported, "gst_uri_protocol_is_supported"); function gst_uri_is_valid (uri : access GLIB.gchar) return GLIB.gboolean; -- gst/gsturi.h:128 pragma Import (C, gst_uri_is_valid, "gst_uri_is_valid"); function gst_uri_get_protocol (uri : access GLIB.gchar) return access GLIB.gchar; -- gst/gsturi.h:129 pragma Import (C, gst_uri_get_protocol, "gst_uri_get_protocol"); function gst_uri_has_protocol (uri : access GLIB.gchar; protocol : access GLIB.gchar) return GLIB.gboolean; -- gst/gsturi.h:130 pragma Import (C, gst_uri_has_protocol, "gst_uri_has_protocol"); function gst_uri_get_location (uri : access GLIB.gchar) return access GLIB.gchar; -- gst/gsturi.h:132 pragma Import (C, gst_uri_get_location, "gst_uri_get_location"); function gst_uri_construct (protocol : access GLIB.gchar; location : access GLIB.gchar) return access GLIB.gchar; -- gst/gsturi.h:133 pragma Import (C, gst_uri_construct, "gst_uri_construct"); function gst_filename_to_uri (filename : access GLIB.gchar; error : System.Address) return access GLIB.gchar; -- gst/gsturi.h:136 pragma Import (C, gst_filename_to_uri, "gst_filename_to_uri"); function gst_element_make_from_uri (c_type : GstURIType; uri : access GLIB.gchar; elementname : access GLIB.gchar) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h.GstElement; -- gst/gsturi.h:139 pragma Import (C, gst_element_make_from_uri, "gst_element_make_from_uri"); -- accessing the interface function gst_uri_handler_get_type return GLIB.GType; -- gst/gsturi.h:144 pragma Import (C, gst_uri_handler_get_type, "gst_uri_handler_get_type"); function gst_uri_handler_get_uri_type (handler : System.Address) return GLIB.guint; -- gst/gsturi.h:146 pragma Import (C, gst_uri_handler_get_uri_type, "gst_uri_handler_get_uri_type"); function gst_uri_handler_get_protocols (handler : System.Address) return System.Address; -- gst/gsturi.h:147 pragma Import (C, gst_uri_handler_get_protocols, "gst_uri_handler_get_protocols"); function gst_uri_handler_get_uri (handler : System.Address) return access GLIB.gchar; -- gst/gsturi.h:148 pragma Import (C, gst_uri_handler_get_uri, "gst_uri_handler_get_uri"); function gst_uri_handler_set_uri (handler : System.Address; uri : access GLIB.gchar) return GLIB.gboolean; -- gst/gsturi.h:149 pragma Import (C, gst_uri_handler_set_uri, "gst_uri_handler_set_uri"); procedure gst_uri_handler_new_uri (handler : System.Address; uri : access GLIB.gchar); -- gst/gsturi.h:151 pragma Import (C, gst_uri_handler_new_uri, "gst_uri_handler_new_uri"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_gsturi_h;
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Generic_Tuple_Hash; generic with package TupleHash is new Keccak.Generic_Tuple_Hash(<>); package TupleHash_Runner is procedure Run_Tests (File_Name : in String; XOF : in Boolean; Num_Passed : out Natural; Num_Failed : out Natural); end TupleHash_Runner;
----------------------------------------------------------------------- -- components-utils-escape -- Escape generated content produced by component children -- Copyright (C) 2011, 2012, 2014 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ASF.Components.Core; with ASF.Contexts.Faces; with ASF.Contexts.Writer; package ASF.Components.Utils.Escapes is -- Name of the attribute that control the escape mode. -- When the attribute is set to 'xml', the content is escaped using XML -- escape rules. Otherwise, the content is escaped using Javascript rules. ESCAPE_MODE_NAME : constant String := "mode"; -- ------------------------------ -- UIEscape -- ------------------------------ -- The <b>UIEscape</b> component catches the rendering of child components to -- perform specific escape actions on the content. type UIEscape is new ASF.Components.Core.UIComponentBase with private; -- Write the content that was collected by rendering the inner children. -- Escape the content using Javascript escape rules. procedure Write_Content (UI : in UIEscape; Writer : in out Contexts.Writer.Response_Writer'Class; Content : in String; Context : in out ASF.Contexts.Faces.Faces_Context'Class); -- Encode the children components in a local buffer. overriding procedure Encode_Children (UI : in UIEscape; Context : in out ASF.Contexts.Faces.Faces_Context'Class); private type UIEscape is new ASF.Components.Core.UIComponentBase with null record; end ASF.Components.Utils.Escapes;
----------------------------------------------------------------------- -- keystore-marshallers -- Data marshaller for the keystore -- Copyright (C) 2019 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Streams; with Ada.Calendar; with Interfaces; with Util.Encoders.AES; with Keystore.Buffers; private package Keystore.Marshallers is use Ada.Streams; BT_TYPE_HEADER_SIZE : constant := 16; SIZE_U16 : constant := 2; SIZE_U32 : constant := 4; SIZE_U64 : constant := 8; SIZE_DATE : constant := SIZE_U64; SIZE_HMAC : constant := 32; SIZE_KIND : constant := SIZE_U32; SIZE_BLOCK : constant := SIZE_U32; SIZE_SECRET : constant := 32; SIZE_IV : constant := 16; subtype Block_Count is Buffers.Block_Count; subtype Block_Number is Buffers.Block_Number; subtype Block_Index is Buffers.Block_Index; subtype Buffer_Size is Buffers.Buffer_Size; subtype Block_Type is Stream_Element_Array (Block_Index); BT_HEADER_START : constant Block_Index := Block_Index'First; BT_DATA_START : constant Block_Index := BT_HEADER_START + BT_TYPE_HEADER_SIZE; type Marshaller is limited record Buffer : Keystore.Buffers.Storage_Buffer; Pos : Block_Index := Block_Type'First; end record; -- Set the block header with the tag and wallet identifier. procedure Set_Header (Into : in out Marshaller; Tag : in Interfaces.Unsigned_16; Id : in Keystore.Wallet_Identifier) with Post => Into.Pos = BT_DATA_START - 1; procedure Set_Header (Into : in out Marshaller; Value : in Interfaces.Unsigned_32) with Pre => Into.Pos = Block_Type'First; procedure Put_Unsigned_16 (Into : in out Marshaller; Value : in Interfaces.Unsigned_16) with Pre => Into.Pos <= Block_Type'Last - 2; procedure Put_Unsigned_32 (Into : in out Marshaller; Value : in Interfaces.Unsigned_32) with Pre => Into.Pos <= Block_Type'Last - 4; procedure Put_Unsigned_64 (Into : in out Marshaller; Value : in Interfaces.Unsigned_64) with Pre => Into.Pos <= Block_Type'Last - 8; procedure Put_Kind (Into : in out Marshaller; Value : in Entry_Type) with Pre => Into.Pos <= Block_Type'Last - 2; procedure Put_Block_Number (Into : in out Marshaller; Value : in Block_Number) with Pre => Into.Pos <= Block_Type'Last - 4; procedure Put_Block_Index (Into : in out Marshaller; Value : in Block_Index) with Pre => Into.Pos <= Block_Type'Last - 2; procedure Put_Buffer_Size (Into : in out Marshaller; Value : in Buffer_Size) with Pre => Into.Pos <= Block_Type'Last - 2; procedure Put_String (Into : in out Marshaller; Value : in String) with Pre => Into.Pos <= Block_Type'Last - 4 - Value'Length; procedure Put_Date (Into : in out Marshaller; Value : in Ada.Calendar.Time) with Pre => Into.Pos <= Block_Type'Last - 8; procedure Put_Storage_Block (Into : in out Marshaller; Value : in Buffers.Storage_Block) with Pre => Into.Pos <= Block_Type'Last - 8; procedure Put_Secret (Into : in out Marshaller; Value : in Secret_Key; Protect_Key : in Secret_Key; Protect_IV : in Secret_Key) with Pre => Into.Pos <= Block_Type'Last - Value.Length; procedure Put_HMAC_SHA256 (Into : in out Marshaller; Key : in Secret_Key; Content : in Ada.Streams.Stream_Element_Array) with Pre => Into.Pos <= Block_Type'Last - SIZE_HMAC; procedure Put_UUID (Into : in out Marshaller; Value : in UUID_Type) with Pre => Into.Pos <= Block_Type'Last - 16; function Get_Header (From : in out Marshaller) return Interfaces.Unsigned_32 with Post => From.Pos = Block_Type'First + 3; function Get_Header_16 (From : in out Marshaller) return Interfaces.Unsigned_16 with Post => From.Pos = Block_Type'First + 1; function Get_Unsigned_16 (From : in out Marshaller) return Interfaces.Unsigned_16 with Pre => From.Pos <= Block_Type'Last - 2; function Get_Unsigned_32 (From : in out Marshaller) return Interfaces.Unsigned_32 with Pre => From.Pos <= Block_Type'Last - 4; function Get_Unsigned_64 (From : in out Marshaller) return Interfaces.Unsigned_64 with Pre => From.Pos <= Block_Type'Last - 8; function Get_String (From : in out Marshaller; Length : in Natural) return String with Pre => Stream_Element_Offset (Length) < Block_Type'Last and From.Pos <= Block_Type'Length - Stream_Element_Offset (Length); function Get_Date (From : in out Marshaller) return Ada.Calendar.Time with Pre => From.Pos <= Block_Type'Last - 8; function Get_Kind (From : in out Marshaller) return Entry_Type with Pre => From.Pos <= Block_Type'Last - 2; function Get_Block_Number (From : in out Marshaller) return Block_Count is (Block_Count (Get_Unsigned_32 (From))); function Get_Storage_Block (From : in out Marshaller) return Buffers.Storage_Block with Pre => From.Pos <= Block_Type'Last - 8; function Get_Block_Index (From : in out Marshaller) return Block_Index is (Block_Index (Get_Unsigned_16 (From))); function Get_Buffer_Size (From : in out Marshaller) return Buffer_Size is (Buffer_Size (Get_Unsigned_16 (From))); procedure Get_Secret (From : in out Marshaller; Secret : out Secret_Key; Protect_Key : in Secret_Key; Protect_IV : in Secret_Key); procedure Get_UUID (From : in out Marshaller; UUID : out UUID_Type) with Pre => From.Pos <= Block_Type'Last - 16; procedure Get_Data (From : in out Marshaller; Size : in Ada.Streams.Stream_Element_Offset; Data : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) with Pre => From.Pos <= Block_Type'Last - Size; procedure Skip (From : in out Marshaller; Count : in Block_Index) with Pre => From.Pos <= Block_Type'Last - Count; end Keystore.Marshallers;
-- C47004A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- WHEN THE TYPE MARK IN A QUALIFIED EXPRESSION DENOTES AN INTEGER -- TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN THE VALUE OF THE -- OPERAND DOES NOT LIE WITHIN THE RANGE OF THE TYPE MARK. -- RJW 7/23/86 WITH REPORT; USE REPORT; PROCEDURE C47004A IS BEGIN TEST( "C47004A", "WHEN THE TYPE MARK IN A QUALIFIED " & "EXPRESSION DENOTES AN INTEGER " & "TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED " & "WHEN THE VALUE OF THE OPERAND DOES NOT LIE " & "WITHIN THE RANGE OF THE TYPE MARK" ); DECLARE TYPE INT IS RANGE -10 .. 10; SUBTYPE SINT IS INT RANGE -5 .. 5; FUNCTION IDENT (I : INT) RETURN INT IS BEGIN RETURN INT (IDENT_INT (INTEGER (I))); END; BEGIN IF SINT'(IDENT (10)) = 5 THEN FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE SINT - 1"); ELSE FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE SINT - 2"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " & "OF SUBTYPE SINT" ); END; DECLARE SUBTYPE SINTEGER IS INTEGER RANGE -10 .. 10; BEGIN IF SINTEGER'(IDENT_INT (20)) = 15 THEN FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE SINTEGER - 1"); ELSE FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE SINTEGER - 2"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " & "OF SUBTYPE SINTEGER" ); END; DECLARE TYPE NINTEGER IS NEW INTEGER; SUBTYPE SNINT IS NINTEGER RANGE -10 .. 10; FUNCTION IDENT (I : NINTEGER) RETURN NINTEGER IS BEGIN RETURN NINTEGER (IDENT_INT (INTEGER (I))); END; BEGIN IF SNINT'(IDENT (-20)) = -10 THEN FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE SNINT - 1"); ELSE FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE SNINT - 2"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " & "OF SUBTYPE SNINT" ); END; RESULT; END C47004A;
-- This spec has been automatically generated from STM32F7x9.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.SPI is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR1_BR_Field is HAL.UInt3; -- control register 1 type CR1_Register is record -- Clock phase CPHA : Boolean := False; -- Clock polarity CPOL : Boolean := False; -- Master selection MSTR : Boolean := False; -- Baud rate control BR : CR1_BR_Field := 16#0#; -- SPI enable SPE : Boolean := False; -- Frame format LSBFIRST : Boolean := False; -- Internal slave select SSI : Boolean := False; -- Software slave management SSM : Boolean := False; -- Receive only RXONLY : Boolean := False; -- Data frame format DFF : Boolean := False; -- CRC transfer next CRCNEXT : Boolean := False; -- Hardware CRC calculation enable CRCEN : Boolean := False; -- Output enable in bidirectional mode BIDIOE : Boolean := False; -- Bidirectional data mode enable BIDIMODE : Boolean := False; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR1_Register use record CPHA at 0 range 0 .. 0; CPOL at 0 range 1 .. 1; MSTR at 0 range 2 .. 2; BR at 0 range 3 .. 5; SPE at 0 range 6 .. 6; LSBFIRST at 0 range 7 .. 7; SSI at 0 range 8 .. 8; SSM at 0 range 9 .. 9; RXONLY at 0 range 10 .. 10; DFF at 0 range 11 .. 11; CRCNEXT at 0 range 12 .. 12; CRCEN at 0 range 13 .. 13; BIDIOE at 0 range 14 .. 14; BIDIMODE at 0 range 15 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- Data size type CR2_DS_Field is ( Size_4Bit, Size_5Bit, Size_6Bit, Size_7Bit, Size_8Bit, Size_9Bit, Size_10Bit, Size_11Bit, Size_12Bit, Size_13Bit, Size_14Bit, Size_15Bit, Size_16Bit) with Size => 4; for CR2_DS_Field use (Size_4Bit => 3, Size_5Bit => 4, Size_6Bit => 5, Size_7Bit => 6, Size_8Bit => 7, Size_9Bit => 8, Size_10Bit => 9, Size_11Bit => 10, Size_12Bit => 11, Size_13Bit => 12, Size_14Bit => 13, Size_15Bit => 14, Size_16Bit => 15); -- FIFO reception threshold type CR2_FRXTH_Field is ( -- RXNE event is generated if the FIFO level is greater than or equal to -- 1/2 (16-bit). Half, -- RXNE event is generated if the FIFO level is greater than or equal to -- 1/4 (8-bit). Quarter) with Size => 1; for CR2_FRXTH_Field use (Half => 0, Quarter => 1); -- Last DMA transfer for reception type CR2_LDMA_RX_Field is ( -- Number of data to transfer is even. Even, -- Number of data is odd. Odd) with Size => 1; for CR2_LDMA_RX_Field use (Even => 0, Odd => 1); -- Last DMA transfer for transmission type CR2_LDMA_TX_Field is ( -- Number of data to transfer is even. Even, -- Number of data is odd. Odd) with Size => 1; for CR2_LDMA_TX_Field use (Even => 0, Odd => 1); -- control register 2 type CR2_Register is record -- Rx buffer DMA enable RXDMAEN : Boolean := False; -- Tx buffer DMA enable TXDMAEN : Boolean := False; -- SS output enable SSOE : Boolean := False; -- NSS pulse management NSSP : Boolean := False; -- Frame format FRF : Boolean := False; -- Error interrupt enable ERRIE : Boolean := False; -- RX buffer not empty interrupt enable RXNEIE : Boolean := False; -- Tx buffer empty interrupt enable TXEIE : Boolean := False; -- Data size DS : CR2_DS_Field := STM32_SVD.SPI.Size_8Bit; -- FIFO reception threshold FRXTH : CR2_FRXTH_Field := STM32_SVD.SPI.Half; -- Last DMA transfer for reception LDMA_RX : CR2_LDMA_RX_Field := STM32_SVD.SPI.Even; -- Last DMA transfer for transmission LDMA_TX : CR2_LDMA_TX_Field := STM32_SVD.SPI.Even; -- unspecified Reserved_15_31 : HAL.UInt17 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR2_Register use record RXDMAEN at 0 range 0 .. 0; TXDMAEN at 0 range 1 .. 1; SSOE at 0 range 2 .. 2; NSSP at 0 range 3 .. 3; FRF at 0 range 4 .. 4; ERRIE at 0 range 5 .. 5; RXNEIE at 0 range 6 .. 6; TXEIE at 0 range 7 .. 7; DS at 0 range 8 .. 11; FRXTH at 0 range 12 .. 12; LDMA_RX at 0 range 13 .. 13; LDMA_TX at 0 range 14 .. 14; Reserved_15_31 at 0 range 15 .. 31; end record; -- FIFO reception level type SR_FRLVL_Field is ( -- FIFO is empty. Fifo_Empty, -- 1/4 FIFO. Fifo_Quarter, -- 1/2 FIFO. Fifo_Half, -- FIFO full. Fifo_Full) with Size => 2; for SR_FRLVL_Field use (Fifo_Empty => 0, Fifo_Quarter => 1, Fifo_Half => 2, Fifo_Full => 3); -- FIFO transmission level type SR_FTLVL_Field is ( -- FIFO is empty. Fifo_Empty, -- 1/4 FIFO. Fifo_Quarter, -- 1/2 FIFO. Fifo_Half, -- FIFO full. Fifo_Full) with Size => 2; for SR_FTLVL_Field use (Fifo_Empty => 0, Fifo_Quarter => 1, Fifo_Half => 2, Fifo_Full => 3); -- status register type SR_Register is record -- Read-only. Receive buffer not empty RXNE : Boolean := False; -- Read-only. Transmit buffer empty TXE : Boolean := True; -- Read-only. Channel side CHSIDE : Boolean := False; -- Read-only. Underrun flag UDR : Boolean := False; -- CRC error flag CRCERR : Boolean := False; -- Read-only. Mode fault MODF : Boolean := False; -- Read-only. Overrun flag OVR : Boolean := False; -- Read-only. Busy flag BSY : Boolean := False; -- Read-only. TI frame format error TIFRFE : Boolean := False; -- Read-only. FIFO reception level FRLVL : SR_FRLVL_Field := STM32_SVD.SPI.Fifo_Empty; -- Read-only. FIFO transmission level FTLVL : SR_FTLVL_Field := STM32_SVD.SPI.Fifo_Empty; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SR_Register use record RXNE at 0 range 0 .. 0; TXE at 0 range 1 .. 1; CHSIDE at 0 range 2 .. 2; UDR at 0 range 3 .. 3; CRCERR at 0 range 4 .. 4; MODF at 0 range 5 .. 5; OVR at 0 range 6 .. 6; BSY at 0 range 7 .. 7; TIFRFE at 0 range 8 .. 8; FRLVL at 0 range 9 .. 10; FTLVL at 0 range 11 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; subtype DR_DR_Field is HAL.UInt16; -- data register type DR_Register is record -- Data register DR : DR_DR_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DR_Register use record DR at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype CRCPR_CRCPOLY_Field is HAL.UInt16; -- CRC polynomial register type CRCPR_Register is record -- CRC polynomial register CRCPOLY : CRCPR_CRCPOLY_Field := 16#7#; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CRCPR_Register use record CRCPOLY at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype RXCRCR_RxCRC_Field is HAL.UInt16; -- RX CRC register type RXCRCR_Register is record -- Read-only. Rx CRC register RxCRC : RXCRCR_RxCRC_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for RXCRCR_Register use record RxCRC at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype TXCRCR_TxCRC_Field is HAL.UInt16; -- TX CRC register type TXCRCR_Register is record -- Read-only. Tx CRC register TxCRC : TXCRCR_TxCRC_Field; -- unspecified Reserved_16_31 : HAL.UInt16; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for TXCRCR_Register use record TxCRC at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype I2SCFGR_DATLEN_Field is HAL.UInt2; subtype I2SCFGR_I2SSTD_Field is HAL.UInt2; subtype I2SCFGR_I2SCFG_Field is HAL.UInt2; -- I2S configuration register type I2SCFGR_Register is record -- Channel length (number of bits per audio channel) CHLEN : Boolean := False; -- Data length to be transferred DATLEN : I2SCFGR_DATLEN_Field := 16#0#; -- Steady state clock polarity CKPOL : Boolean := False; -- I2S standard selection I2SSTD : I2SCFGR_I2SSTD_Field := 16#0#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- PCM frame synchronization PCMSYNC : Boolean := False; -- I2S configuration mode I2SCFG : I2SCFGR_I2SCFG_Field := 16#0#; -- I2S Enable I2SE : Boolean := False; -- I2S mode selection I2SMOD : Boolean := False; -- Asynchronous start enable ASTRTEN : Boolean := False; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for I2SCFGR_Register use record CHLEN at 0 range 0 .. 0; DATLEN at 0 range 1 .. 2; CKPOL at 0 range 3 .. 3; I2SSTD at 0 range 4 .. 5; Reserved_6_6 at 0 range 6 .. 6; PCMSYNC at 0 range 7 .. 7; I2SCFG at 0 range 8 .. 9; I2SE at 0 range 10 .. 10; I2SMOD at 0 range 11 .. 11; ASTRTEN at 0 range 12 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; subtype I2SPR_I2SDIV_Field is HAL.UInt8; -- I2S prescaler register type I2SPR_Register is record -- I2S Linear prescaler I2SDIV : I2SPR_I2SDIV_Field := 16#A#; -- Odd factor for the prescaler ODD : Boolean := False; -- Master clock output enable MCKOE : Boolean := False; -- unspecified Reserved_10_31 : HAL.UInt22 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for I2SPR_Register use record I2SDIV at 0 range 0 .. 7; ODD at 0 range 8 .. 8; MCKOE at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Serial peripheral interface type SPI_Peripheral is record -- control register 1 CR1 : aliased CR1_Register; -- control register 2 CR2 : aliased CR2_Register; -- status register SR : aliased SR_Register; -- data register DR : aliased DR_Register; -- CRC polynomial register CRCPR : aliased CRCPR_Register; -- RX CRC register RXCRCR : aliased RXCRCR_Register; -- TX CRC register TXCRCR : aliased TXCRCR_Register; -- I2S configuration register I2SCFGR : aliased I2SCFGR_Register; -- I2S prescaler register I2SPR : aliased I2SPR_Register; end record with Volatile; for SPI_Peripheral use record CR1 at 16#0# range 0 .. 31; CR2 at 16#4# range 0 .. 31; SR at 16#8# range 0 .. 31; DR at 16#C# range 0 .. 31; CRCPR at 16#10# range 0 .. 31; RXCRCR at 16#14# range 0 .. 31; TXCRCR at 16#18# range 0 .. 31; I2SCFGR at 16#1C# range 0 .. 31; I2SPR at 16#20# range 0 .. 31; end record; -- Serial peripheral interface SPI1_Periph : aliased SPI_Peripheral with Import, Address => System'To_Address (16#40013000#); -- Serial peripheral interface SPI2_Periph : aliased SPI_Peripheral with Import, Address => System'To_Address (16#40003800#); -- Serial peripheral interface SPI3_Periph : aliased SPI_Peripheral with Import, Address => System'To_Address (16#40003C00#); -- Serial peripheral interface SPI4_Periph : aliased SPI_Peripheral with Import, Address => System'To_Address (16#40013400#); -- Serial peripheral interface SPI5_Periph : aliased SPI_Peripheral with Import, Address => System'To_Address (16#40015000#); -- Serial peripheral interface SPI6_Periph : aliased SPI_Peripheral with Import, Address => System'To_Address (16#40015400#); end STM32_SVD.SPI;
------------------------------------------------------------------------------ -- -- -- Internet Protocol Suite Package -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with Ada.IO_Exceptions; with INET.IP.Lookup; with INET.Internal.UNIX_Sockets; package body INET.TCP.TLS is End_Error: exception renames Ada.IO_Exceptions.End_Error; -- -- TLS_Connection -- ------------- -- Secured -- ------------- function Secured (Connection: TLS_Connection) return Boolean is (Connection.TLS_Go); ---------- -- Read -- ---------- procedure Receive_Immediate_Wrapper (Connection: in out TLS_Connection; Buffer : out Stream_Element_Array; Last : out Stream_Element_Offset; Status : out INET.Internal.UNIX_Sockets.Operation_Status; Errno : out Interfaces.C.int) with Inline is use INET.Internal.UNIX_Sockets; begin if not Connection.TLS_Go then raise Program_Error with "Attempt to Read from an unsecured TLS_Connection"; elsif Connection.Read_Down then raise End_Error with "TLS: Read direction has been shutdown"; end if; Connection.Context.TLS_Receive_Immediate (Buffer => Buffer, Last => Last); Status := OK; Errno := 0; -- These are really specific to the "standard" implementation in INET.TCP -- which we are borrowing. In the case of TLS, if something goes wrong, -- it is usually pretty catestrophic, so we just propegate the exception -- as it arrives. If we get here, everything appears to be normal. end Receive_Immediate_Wrapper; ---------------------------------------------------------------------- procedure Read_Actual is new Generic_Read (Connection_Type => TLS_Connection, Connection_Receive_Immediate => Receive_Immediate_Wrapper); procedure Read (Stream: in out TLS_Connection; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) renames Read_Actual; -------------------- -- Read_Immediate -- -------------------- procedure Read_Immediate (Stream: in out TLS_Connection; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin if not Stream.TLS_Go then raise Program_Error with "Attempt to Read from an unsecured TLS_Connection"; elsif Stream.Read_Down then raise End_Error with "TLS: Read direction has been shutdown"; end if; Stream.Context.TLS_Receive_Immediate (Buffer => Item, Last => Last); end Read_Immediate; ----------- -- Write -- ----------- procedure Send_Immediate_Wrapper (Connection: in out TLS_Connection; Buffer : in Stream_Element_Array; Last : out Stream_Element_Offset; Status : out INET.Internal.UNIX_Sockets.Operation_Status; Errno : out Interfaces.C.int) with Inline is use INET.Internal.UNIX_Sockets; begin if not Connection.TLS_Go then raise Program_Error with "Attempt to Write to an unsecured TLS_Connection"; elsif Connection.Write_Down then raise End_Error with "TLS: Write direction has been shutdown"; end if; Connection.Context.TLS_Send_Immediate (Buffer => Buffer, Last => Last); Status := OK; Errno := 0; -- These are really specific to the "standard" implementation in INET.TCP -- which we are borrowing. In the case of TLS, if something goes wrong, -- it is usually pretty catestrophic, so we just propegate the exception -- as it arrives. If we get here, everything appears to be normal. end Send_Immediate_Wrapper; ---------------------------------------------------------------------- procedure Write_Actual is new Generic_Write (Connection_Type => TLS_Connection, Connection_Send_Immediate => Send_Immediate_Wrapper); procedure Write (Stream: in out TLS_Connection; Item : in Stream_Element_Array) renames Write_Actual; --------------------- -- Write_Immediate -- --------------------- procedure Write_Immediate (Stream: in out TLS_Connection; Item : in Stream_Element_Array; Last : out Stream_Element_Offset) is begin if not Stream.TLS_Go then raise Program_Error with "Attempt to Write to an unsecured TLS_Connection"; elsif Stream.Write_Down then raise End_Error with "TLS: Write direction has been shutdown"; end if; Stream.Context.TLS_Send_Immediate (Buffer => Item, Last => Last); end Write_Immediate; -------------- -- Shutdown -- -------------- procedure Shutdown (Connection: in out TLS_Connection) is begin Connection.Context.Shutdown; TCP_Connection(Connection).Shutdown; Connection.TLS_Go := False; Connection.Read_Down := True; Connection.Write_Down := True; exception when TLS_Error => null; -- Sometimes the remote peer closes the connection without a close -- notify. We do not want to propegate this out when we shutdown end Shutdown; ------------------- -- Shutdown_Read -- ------------------- procedure Shutdown_Read (Connection: in out TLS_Connection) is begin if Connection.Write_Down then Connection.Shutdown; else Connection.Read_Down := True; end if; end Shutdown_Read; -------------------- -- Shutdown_Write -- -------------------- procedure Shutdown_Write (Connection: in out TLS_Connection) is begin if Connection.Read_Down then Connection.Shutdown; else Connection.Write_Down := True; end if; end Shutdown_Write; -- -- TLS_Client_Connection -- ------------- -- Connect -- ------------- procedure Connect_Actual (Connection : in out TLS_Client_Connection; Address : in IP.IP_Address; Port : in TCP_Port; Server_Name: in String) with Inline is begin Connection.Shutdown; TCP_Connection (Connection).Connect (Address, Port); Connection.TLS_Go := False; Connection.Read_Down := False; Connection.Write_Down := False; Connection.Secure (Server_Name); exception when others => Connection.Shutdown; raise; end Connect_Actual; ---------------------------------------------------------------------- procedure Connect (Connection: in out TLS_Client_Connection; Address : in IP.IP_Address; Port : in TCP_Port) is begin raise Program_Error with "TLS client connections must provide a host name for the remote peer."; end; ---------------------------------------------------------------------- procedure Connect (Connection : in out TLS_Client_Connection; Address : in IP.IP_Address; Port : in TCP_Port; Server_Name: in String) is begin if Server_Name'Length = 0 then raise Constraint_Error with "SNI Server name must not be an empty string."; end if; Connect_Actual (Connection, Address, Port, Server_Name); end; ---------------------------------------------------------------------- overriding procedure Connect (Connection: in out TLS_Client_Connection; Host_Name : in String; Port : in TCP_Port) is use INET.IP.Lookup; Query : IP_Lookup; Result: IP_Lookup_Entry; begin Query.Lookup (Host_Name => Host_Name, Protocol => Proto_TCP); if not Query.Has_More_Entries then raise TCP_Lookup_Failed with "Lookup of host """ & Host_Name & """ failed."; end if; Query.Pop (Result); Connection.Connect (Address => Result.Address, Port => Port, Server_Name => Host_Name); end Connect; ---------------------------------------------------------------------- overriding procedure Connect (Connection : in out TLS_Client_Connection; Host_Name : in String; Port : in TCP_Port; Version : in IP.IP_Version) is use INET.IP.Lookup; Query : IP_Lookup; Result: IP_Lookup_Entry; begin Query.Lookup (Host_Name => Host_Name, Protocol => Proto_TCP, Version => Version); if not Query.Has_More_Entries then raise TCP_Lookup_Failed with "Lookup of host """ & Host_Name & """ failed."; end if; Query.Pop (Result); Connection.Connect (Address => Result.Address, Port => Port, Server_Name => Host_Name); end Connect; ------------ -- Secure -- ------------ procedure Secure (Connection : in out TLS_Client_Connection; Server_Name: in String) is begin if Server_Name'Length = 0 then raise Constraint_Error with "SNI Server name must not be an empty string."; elsif Connection.Write_Down and Connection.Read_Down then raise Program_Error with "Secure cannot be invoked on a shutdown connection."; elsif Connection.TLS_Go then Connection.Context.Handshake (Socket => Connection.Socket, Timeout => Explicit_Handshake_Timeout); else pragma Assert (not Connection.Context.Available); if Server_Name'Length > 0 then Connection.Context.Establish (Configuration => Connection.Configuration.all, Server_Name => Server_Name, Socket => Connection.Socket, Timeout => Explicit_Handshake_Timeout); else Connection.Context.Establish (Configuration => Connection.Configuration.all, Socket => Connection.Socket, Timeout => Explicit_Handshake_Timeout); end if; Connection.TLS_Go := True; Connection.Read_Down := False; Connection.Write_Down := False; end if; exception when others => Connection.Shutdown; raise; end Secure; -- -- TLS_Server_Connection -- ------------- -- Connect -- ------------- procedure No_Connect with Inline, No_Return is begin raise Program_Error with "Connect not allowed on TLS_Server_Connection objects."; end; ---------------------------------------------------------------------- procedure Connect (Connection: in out TLS_Server_Connection; Address : in IP.IP_Address; Port : in TCP_Port) is begin No_Connect; end; ---------------------------------------------------------------------- procedure Connect (Connection: in out TLS_Server_Connection; Host_Name : in String; Port : in TCP_Port) is begin No_Connect; end; ---------------------------------------------------------------------- procedure Connect (Connection : in out TLS_Server_Connection; Host_Name : in String; Port : in TCP_Port; Version : in IP.IP_Version) is begin No_Connect; end; ------------ -- Secure -- ------------ procedure Secure (Connection : in out TLS_Server_Connection; Configuration: in TLS_Server_Configuration'Class) is -- This one is a bit unusual, since we need to make a single-use -- TLS_Listener_Context, since libtls needs that to generate a -- context for a server-side connection. This is part of the reason -- why already Secured TLS_Server_Connections are not allowed. -- -- Normally, with a TLS_Listener.Dequeue, we'd use that as the -- listener. -- -- This Secure is specifically here to allow for negotiated upgrades -- to TLS, such as in SMTP with STARTTLS Source_Context: INET.Internal.TLS.TLS_Listener_Context; begin if Connection.Write_Down and Connection.Read_Down then raise Program_Error with "Secure cannot be invoked on a shutdown connection."; elsif Connection.TLS_Go then raise Program_Error with "Secure cannot be invoked on Secured TLS_Server_Connection " & "objects. "; end if; Source_Context.Configure (Configuration); Connection.Context.Establish (Listener_Context => Source_Context, Socket => Connection.Socket, Timeout => Explicit_Handshake_Timeout); Connection.TLS_Go := True; Connection.Read_Down := False; Connection.Write_Down := False; exception when others => Connection.Shutdown; raise; end Secure; --------------- -- Re_Secure -- --------------- procedure Re_secure (Connection: in out TLS_Server_Connection) is begin if Connection.Write_Down and Connection.Read_Down then raise Program_Error with "Re_Secure cannot be invoked on a shutdown connection."; elsif not Connection.TLS_Go then raise Program_Error with "Re_Secure cannot be invoked unless the TLS_Server_Connection " & "object is already Secured"; end if; Connection.Context.Handshake (Socket => Connection.Socket, Timeout => Explicit_Handshake_Timeout); exception when others => Connection.Shutdown; raise; end Re_Secure; -- -- TLS_Listener -- ---------- -- Bind -- ---------- procedure Bind (Listener: in out TLS_Listener; Address : in IP.IP_Address; Port : in TCP_Port) is begin TCP_Listener (Listener).Bind (Address, Port); Listener.Context.Configure (Listener.Configuration.all); end Bind; ------------- -- Dequeue -- ------------- procedure Dequeue (Listener : in out TLS_Listener; Connection: in out TCP_Connection'Class) is begin if Connection not in TLS_Server_Connection'Class then raise Program_Error with "TLS_Listener.Dequeue must be target an object of " & "TLS_Server_Connection'Class only."; end if; Connection.Shutdown; TCP_Listener (Listener).Dequeue (Connection); declare TLS_Connection: TLS_Server_Connection'Class renames TLS_Server_Connection'Class (Connection); begin TLS_Connection.Context.Establish (Listener_Context => Listener.Context, Socket => TLS_Connection.Socket, Timeout => Explicit_Handshake_Timeout); TLS_Connection.TLS_Go := True; TLS_Connection.Read_Down := False; TLS_Connection.Write_Down := False; exception when others => TLS_Connection.Shutdown; raise; end; end Dequeue; ---------------------------------------------------------------------- function Dequeue (Listener: in out TLS_Listener) return TCP_Connection'Class is begin return New_Connection: TLS_Server_Connection do Listener.Dequeue (New_Connection); end return; end Dequeue; end INET.TCP.TLS;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . D I S P A T C H I N G . N O N _ P R E E M P T I V E -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- This unit is not implemented in typical GNAT implementations that lie on -- top of operating systems, because it is infeasible to implement in such -- environments. -- If a target environment provides appropriate support for this package, -- then the Unimplemented_Unit pragma should be removed from this spec and -- an appropriate body provided. package Ada.Dispatching.Non_Preemptive is pragma Preelaborate (Non_Preemptive); pragma Unimplemented_Unit; procedure Yield_To_Higher; procedure Yield_To_Same_Or_Higher renames Yield; end Ada.Dispatching.Non_Preemptive;
-- This file is generated by SWIG. Please do not modify by hand. -- with xcb.xcb_request_error_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_length_error_t is -- Item -- subtype Item is xcb.xcb_request_error_t.Item; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_length_error_t.Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_length_error_t.Item, Element_Array => xcb.xcb_length_error_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_length_error_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_length_error_t.Pointer, Element_Array => xcb.xcb_length_error_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_length_error_t;
----------------------------------------------------------------------- -- Util.Serialize.Mappers.Record_Mapper -- Mapper for record types -- Copyright (C) 2010, 2011, 2012 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Beans.Objects; with Util.Serialize.IO; generic type Element_Type (<>) is limited private; type Element_Type_Access is access all Element_Type; type Fields is (<>); -- The <b>Set_Member</b> procedure will be called by the mapper when a mapping associated -- with <b>Field</b> is recognized. The <b>Value</b> holds the value that was extracted -- according to the mapping. The <b>Set_Member</b> procedure should save in the target -- object <b>Into</b> the value. If an error is detected, the procedure can raise the -- <b>Util.Serialize.Mappers.Field_Error</b> exception. The exception message will be -- reported by the IO reader as an error. with procedure Set_Member (Into : in out Element_Type; Field : in Fields; Value : in Util.Beans.Objects.Object); -- Adding a second function/procedure as generic parameter makes the -- Vector_Mapper generic package fail to instantiate a valid package. -- The failure occurs in Vector_Mapper in the 'with package Element_Mapper' instantiation. -- -- with function Get_Member (From : in Element_Type; -- Field : in Fields) return Util.Beans.Objects.Object; package Util.Serialize.Mappers.Record_Mapper is type Get_Member_Access is access function (From : in Element_Type; Field : in Fields) return Util.Beans.Objects.Object; -- Procedure to give access to the <b>Element_Type</b> object from the context. type Process_Object is not null access procedure (Ctx : in out Util.Serialize.Contexts.Context'Class; Attr : in Mapping'Class; Value : in Util.Beans.Objects.Object; Process : not null access procedure (Attr : in Mapping'Class; Item : in out Element_Type; Value : in Util.Beans.Objects.Object)); type Proxy_Object is not null access procedure (Attr : in Mapping'Class; Element : in out Element_Type; Value : in Util.Beans.Objects.Object); -- Set the attribute member described by the <b>Attr</b> mapping -- into the value passed in <b>Element</b>. This operation will call -- the package parameter function of the same name. procedure Set_Member (Attr : in Mapping'Class; Element : in out Element_Type; Value : in Util.Beans.Objects.Object); -- ----------------------- -- Data context -- ----------------------- -- Data context to get access to the target element. type Element_Data is new Util.Serialize.Contexts.Data with private; type Element_Data_Access is access all Element_Data'Class; -- Get the element object. function Get_Element (Data : in Element_Data) return Element_Type_Access; -- Set the element object. When <b>Release</b> is set, the element <b>Element</b> -- will be freed when the reader context is deleted (by <b>Finalize</b>). procedure Set_Element (Data : in out Element_Data; Element : in Element_Type_Access; Release : in Boolean := False); -- Finalize the object when it is removed from the reader context. -- If the <b>Release</b> parameter was set, the target element will be freed. overriding procedure Finalize (Data : in out Element_Data); -- ----------------------- -- Record mapper -- ----------------------- type Mapper is new Util.Serialize.Mappers.Mapper with private; type Mapper_Access is access all Mapper'Class; -- Execute the mapping operation on the object associated with the current context. -- The object is extracted from the context and the <b>Execute</b> operation is called. procedure Execute (Handler : in Mapper; Map : in Mapping'Class; Ctx : in out Util.Serialize.Contexts.Context'Class; Value : in Util.Beans.Objects.Object); -- Add a mapping for setting a member. When the attribute rule defined by <b>Path</b> -- is matched, the <b>Set_Member</b> procedure will be called with the value and the -- <b>Field</b> identification. procedure Add_Mapping (Into : in out Mapper; Path : in String; Field : in Fields); -- Add a mapping associated with the path and described by a mapper object. -- The <b>Proxy</b> procedure is in charge of giving access to the target -- object used by the <b>Map</b> mapper. procedure Add_Mapping (Into : in out Mapper; Path : in String; Map : in Util.Serialize.Mappers.Mapper_Access; Proxy : in Proxy_Object); -- Clone the <b>Handler</b> instance and get a copy of that single object. overriding function Clone (Handler : in Mapper) return Util.Serialize.Mappers.Mapper_Access; -- procedure Bind (Into : in out Mapper; Getter : in Get_Member_Access); procedure Bind (Into : in out Mapper; From : in Mapper_Access); function Get_Getter (From : in Mapper) return Get_Member_Access; -- Set the element in the context. When <b>Release</b> is set, the element <b>Element</b> -- will be freed when the reader context is deleted (by <b>Finalize</b>). procedure Set_Context (Ctx : in out Util.Serialize.Contexts.Context'Class; Element : in Element_Type_Access; Release : in Boolean := False); -- Build a default mapping based on the <b>Fields</b> enumeration. -- The enumeration name is used for the mapping name with the optional <b>FIELD_</b> -- prefix stripped. procedure Add_Default_Mapping (Into : in out Mapper); -- Write the element on the stream using the mapper description. procedure Write (Handler : in Mapper; Stream : in out Util.Serialize.IO.Output_Stream'Class; Element : in Element_Type); -- Write the element on the stream using the mapper description. procedure Write (Handler : in Util.Serialize.Mappers.Mapper'Class; Getter : in Get_Member_Access; Stream : in out Util.Serialize.IO.Output_Stream'Class; Element : in Element_Type); private type Element_Data is new Util.Serialize.Contexts.Data with record Element : Element_Type_Access; Release : Boolean; end record; type Mapper is new Util.Serialize.Mappers.Mapper with record Execute : Proxy_Object := Set_Member'Access; Get_Member : Get_Member_Access; end record; type Attribute_Mapping is new Mapping with record Index : Fields; end record; type Attribute_Mapping_Access is access all Attribute_Mapping'Class; procedure Set_Member (Attr : in Attribute_Mapping; Element : in out Element_Type; Value : in Util.Beans.Objects.Object); type Proxy_Mapper is new Mapper with null record; type Proxy_Mapper_Access is access all Proxy_Mapper'Class; -- Find the mapper associated with the given name. -- Returns null if there is no mapper. overriding function Find_Mapper (Controller : in Proxy_Mapper; Name : in String; Attribute : in Boolean := False) return Util.Serialize.Mappers.Mapper_Access; end Util.Serialize.Mappers.Record_Mapper;
------------------------------------------------------------------------------ -- AGAR CORE LIBRARY -- -- A G A R . T I M E R -- -- S p e c -- ------------------------------------------------------------------------------ with Interfaces; with Interfaces.C; with Interfaces.C.Strings; with Agar.Event; with System; -- -- Interface to the Agar timer facility (AG_Timer(3) in C). Agar timers are -- generally attached to a parent Agar object. Detaching the parent object from -- its parent VFS has the effect of cancelling any active timers. -- -- Unless Agar was initialized with the Software_Timers option, Agar timers -- are implemented using the "best" available hardware interface on the current -- platform (such as BSD kqueue(2), POSIX select(2) or Linux timerfd). The -- Software_Timers option enforces a delay loop and timing wheel in software. -- package Agar.Timer is package C renames Interfaces.C; package CS renames Interfaces.C.Strings; package EV renames Agar.Event; TIMER_NAME_MAX : constant Natural := $AG_TIMER_NAME_MAX; type Timer_Private is array (1 .. $SIZEOF_AG_TimerPvt) of aliased Interfaces.Unsigned_8 with Convention => C; for Timer_Private'Size use $SIZEOF_AG_TimerPvt * System.Storage_Unit; type Timer_Name is array (1 .. TIMER_NAME_MAX) of aliased c.char with Convention => C; type Timer; type Timer_Access is access all Timer with Convention => C; subtype Timer_not_null_Access is not null Timer_Access; type Timer_Callback is access function (Timer : Timer_Access; Event : EV.Event_Access) return Interfaces.Unsigned_32 with Convention => C; subtype Timer_not_null_Callback is not null Timer_Callback; type Timer is limited record Callback_Args : EV.Event; -- Callback arguments Callback_Func : Timer_Callback; -- Callback function Private_Data : Timer_Private; -- Private data Parent_Object : System.Address; -- Parent object Flags : C.unsigned; Identifier : C.int; -- Unique identifier Expiration_Time : Interfaces.Unsigned_32; -- Expires in this long (ticks) Interval : Interfaces.Unsigned_32; -- Timer interval (ticks) Name : Timer_Name; -- Optional name ID end record with Convention => C; procedure Init_Timer (Timer : in Timer_not_null_Access; Name : in String); -- Initialize an (initially unattached) timer. function Add_Timer (Timer : in Timer_not_null_Access; Interval : in Interfaces.Unsigned_32; Func : in Timer_Callback) return Boolean; -- Start a global timer not attached to a specific object. function Add_Timer (Interval : in Interfaces.Unsigned_32; Func : in Timer_Callback) return Boolean; -- Start a global, auto-allocated timer not attached to a specific object. private procedure AG_InitTimer (Timer : in Timer_not_null_Access; Name : in CS.chars_ptr; Flags : in C.unsigned) with Import, Convention => C, Link_Name => "AG_InitTimer"; function AG_AddTimer (Object : in System.Address; Timer : in Timer_not_null_Access; Interval : in Interfaces.Unsigned_32; Func : in Timer_Callback; Flags : in C.unsigned; Format : in CS.chars_ptr) return C.int with Import, Convention => C, Link_Name => "AG_AddTimer"; function AG_AddTimerAuto (Object : in System.Address; Interval : in Interfaces.Unsigned_32; Func : in Timer_Callback; Format : in CS.chars_ptr) return Timer_Access with Import, Convention => C, Link_Name => "AG_AddTimerAuto"; end Agar.Timer;
-- Lambda Calculus interpreter -- --------------------------- -- Parses and reduces Lamdba Calculus statements. -- -- Source: -- lambda - definitions and helper functions -- lambda_REPL - [This file] REPL and command line parsers -- lambda_parser - parse tree generator -- lambda_reducer - optimises and reduces lambda expressions -- with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Text_IO; use Ada.Text_IO; with Ada.Text_IO.Unbounded_IO; with Ada.Strings; use Ada.Strings; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Exceptions; use Ada.Exceptions; with Ada.IO_Exceptions; with Ada.Containers; use Ada.Containers; with Ada.Containers.Multiway_Trees; with lambda; use lambda; with lambda_parser; use lambda_parser; with lambda_reducer; use lambda_reducer; Package body Lambda_REPL is -- The Read|Evaulate|Print Loop procedure REPL is I : Instructions.Tree := Instructions.Empty_Tree; Prompt : constant string := "Unbounded> "; S : Statement (1..Max_Statement_Length); L : Natural; begin -- TBD: Load the environment context -- (environment settings, eg trace on/off) -- (library of Synonyms) L := 0; loop L := L+1; begin --Put(Integer'Image(L) & " " & Prompt); Put(Prompt); -- Read a line S := Get_Statement; New_Line; -- parse the line if not parse_Commands(S) then I := parse_Statement(S); Log_Format(I); -- reduce the line I := reduce(I); Log_Format(I); -- print the line Put_Line("-> " & format(I)); end if; exception when Ada.IO_Exceptions.END_ERROR => New_Line; exit; when E: others => Put_Line(Exception_Name(E) & ": " & Exception_Message(E) & " in " & Ada.Strings.Fixed.Trim(Source => S, Side => Both) ); end; end loop; Put_Line("Bye"); -- TBD: Save the environment context if required end; -- Command line Lambda expression parser procedure Evaluate ( S : in Statement ) is begin null; end; -- Parse commands from the REPL -- -- Commands are: -- : "EXIT" | "QUIT" : Exit -- : "HELP" : Print the help/usage message -- : "LS" : List saved expressions -- : "RM <symbol>" : Delete an expression -- : "TRACE" : Display tracing level -- : "TRACE <feature> " : Set verbose tracing for [ON|OFF|PARSE|REDUCE|FORMAT] functions function parse_Commands( S: Statement ) return Boolean is X : SU.Unbounded_String; Token : String := Empty_Statement; From : Natural := 1; -- REPL command tokeniser -- Command => the statement to tokenise -- From => current position in the Command. Returns = when end of Command reached -- Token => next token extracted from the Command -- procedure Next_Token( Command : Statement; From : in out Natural; Token : out Statement ) is Cmd_Set : Character_Set := To_Set( Sequence => "ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz"); First : Positive; Last : Natural; begin Find_Token(Command, Cmd_Set, From, Inside, First, Last); if Last = 0 then Token := Empty_Statement; From := 0; else Token := Ada.Strings.Fixed.Head( Command(First..Last), Max_Statement_Length, ' '); if Last < Command'Last then From := Last + 1; else From := 0; end if; end if; end; begin From := 1; next_token(S, From, Token); X := SU.To_Unbounded_String(To_Upper(trim(Token, Both))); if X = "EXIT" OR X = "QUIT" then Log("Exit"); raise Ada.IO_Exceptions.END_ERROR; elsif X = "LS" then Log("List saved expressions"); List_Synonyms; return True; elsif X = "RM" then Log("Remove synonym"); loop next_token(S, From, Token); exit when From = 0; Remove_Synonym(Token); end loop; return True; -- This is a little ugly elsif X = "TRACE" then loop next_token(S, From, Token); exit when From = 0; X := SU.To_Unbounded_String(To_Upper(trim(Token, Both))); if X = "PARSE" then Trace_Parse := not Trace_Parse; elsif X = "REDUCE" then Trace_Reduce := not Trace_Reduce; elsif X = "FORMAT" then Trace_Format := not Trace_Format; elsif X = "ON" then Trace := TRUE; elsif X = "OFF" then Trace := FALSE; else raise Syntax_Error with "Invalid parameter: " & To_String(X); end if; end loop; if Trace then Put(". Trace on"); if Trace_Parse then Put(" - PARSE"); end if; if Trace_Reduce then Put(" - REDUCE"); end if; if Trace_Format then Put(" - FORMAT"); end if; new_line; else Put_Line(". Trace off"); end if; return True; elsif X = "HELP" then Put_Line("EXIT | QUIT : Exit Unbounded"); Put_Line("HELP : Display this message"); Put_Line("LS : List all saved expressions"); Put_Line("RM <symbol> : Delete an expression"); Put_Line("TRACE : Display the tracing level"); Put_Line("TRACE <feature> : Set verbose tracing [ON|OFF|PARSE|REDUCE|FORMAT]"); return True; end if; return False; end parse_Commands; -- ========================================================================================== -- Private functions -- ========================================================================================== -- -- Input a Lambda statement function Get_Statement return Statement is Buffer : SU.Unbounded_String := SU.Null_Unbounded_String; begin Buffer := Ada.Text_IO.Unbounded_IO.Get_Line; return Ada.Strings.Fixed.Head(Source => SU.To_String(Buffer), Count => Max_Statement_Length, Pad => ' '); end Get_Statement; end Lambda_REPL;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2016, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with HAL.Touch_Panel; with HAL.Framebuffer; private with FT5336; private with STM32.Device; private with STM32.I2C; private with STM32.GPIO; package Touch_Panel_FT5336 is type Touch_Panel is limited new HAL.Touch_Panel.Touch_Panel_Device with private; function Initialize (This : in out Touch_Panel; Orientation : HAL.Framebuffer.Display_Orientation := HAL.Framebuffer.Default) return Boolean; procedure Initialize (This : in out Touch_Panel; Orientation : HAL.Framebuffer.Display_Orientation := HAL.Framebuffer.Default); procedure Set_Orientation (This : in out Touch_Panel; Orientation : HAL.Framebuffer.Display_Orientation); private TP_I2C : STM32.I2C.I2C_Port renames STM32.Device.I2C_3; TP_I2C_SDA : STM32.GPIO.GPIO_Point renames STM32.Device.PH7; TP_I2C_SCL : STM32.GPIO.GPIO_Point renames STM32.Device.PH8; TP_I2C_AF : STM32.GPIO_Alternate_Function renames STM32.Device.GPIO_AF_I2C3_4; type Touch_Panel is limited new FT5336.FT5336_Device (Port => TP_I2C'Access, I2C_Addr => 16#70#) with null record; end Touch_Panel_FT5336;
-- MIT License -- -- Copyright (c) 2021 Glen Cornell <glen.m.cornell@gmail.com> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in all -- copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- SOFTWARE. with Sockets.Can; with Sockets.Can_Frame; with Print_Can_Frame; procedure Stream_Reader is Socket : Sockets.Can.Socket_Type; Can_Stream : aliased Sockets.Can.Can_Stream; Frame : Sockets.Can_Frame.Can_Frame; If_Name : constant String := "vcan0"; begin Socket := Sockets.Can.Open(If_Name); Sockets.Can.Create_Stream (Can_Stream, Socket); loop Sockets.Can_Frame.Can_Frame'Read (Can_Stream'Access, Frame); Print_Can_Frame (Frame, If_Name); end loop; end Stream_Reader;
----------------------------------------------------------------------- -- events-tests -- Unit tests for AWA events -- Copyright (C) 2012, 2019 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with AWA.Tests; private with Util.Beans.Methods; package AWA.Events.Services.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new AWA.Tests.Test with null record; -- Test searching an event name in the definition list. procedure Test_Find_Event (T : in out Test); -- Test the Get_Event_Type_Name internal operation. procedure Test_Get_Event_Name (T : in out Test); -- Test creation and initialization of event manager. procedure Test_Initialize (T : in out Test); -- Test adding an action. procedure Test_Add_Action (T : in out Test); -- Test dispatching synchronous event to a global bean. procedure Test_Dispatch_Synchronous (T : in out Test); -- Test dispatching event through a fifo queue. procedure Test_Dispatch_Fifo (T : in out Test); -- Test dispatching event through a database queue. procedure Test_Dispatch_Persist (T : in out Test); -- Test dispatching synchronous event to a dynamic bean (created on demand). procedure Test_Dispatch_Synchronous_Dyn (T : in out Test); -- Test dispatching synchronous event to a dynamic bean and raise an exception in the action. procedure Test_Dispatch_Synchronous_Raise (T : in out Test); procedure Dispatch_Event (T : in out Test; Kind : in Event_Index; Expect_Count : in Natural; Expect_Prio : in Natural); private type Action_Bean is new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record Count : Natural := 0; Priority : Integer := 0; Raise_Exception : Boolean := False; end record; type Action_Bean_Access is access all Action_Bean'Class; -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. overriding function Get_Value (From : in Action_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the value identified by the name. -- If the name cannot be found, the method should raise the No_Value -- exception. overriding procedure Set_Value (From : in out Action_Bean; Name : in String; Value : in Util.Beans.Objects.Object); overriding function Get_Method_Bindings (From : in Action_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; procedure Event_Action (From : in out Action_Bean; Event : in AWA.Events.Module_Event'Class); function Create_Action_Bean return Util.Beans.Basic.Readonly_Bean_Access; end AWA.Events.Services.Tests;
pragma SPARK_Mode; with Types; use Types; with Interfaces; use Interfaces; -- @summary -- Interface to Arduino Wire library -- -- @description -- Provides an interface to the Arudino Wire library. This is used for -- I2C busses. -- package Wire is -- Return result of a transmission -- @value Success success -- @value Data_Too_Long data too long to fit in transmit buffer -- @value Rx_NACK_Addr received NACK on transmit of address -- @value Rx_NACK_Data received NACK on transmit of data -- @value Other_Err other error type Transmission_Status_Index is (Success, Data_Too_Long, Rx_NACK_Addr, Rx_NACK_Data, Other_Err); Transmission_Status : array (Transmission_Status_Index) of Byte := (Success => 0, Data_Too_Long => 1, Rx_NACK_Addr => 2, Rx_NACK_Data => 3, Other_Err => 4); -- Translates a Byte to Transmission_Status_Index -- @param BB the byte to cast -- @return the Transmission_Status_Index corresponding to the value in BB function Byte2TSI (BB : Byte) return Transmission_Status_Index; -- Initiate the Wire library and join the I2C bus as a master. procedure Init_Master with Global => null; pragma Import (C, Init_Master, "Wire_Begin_Master"); -- Initiate the Wire library and join the I2C bus as a slave -- @param Addr the 7-bit slave address procedure Init_Slave (Addr : Byte) with Global => null; pragma Import (C, Init_Slave, "Wire_Begin_Slave"); -- This function modifies the clock frequency for I2C communication. -- @param Freq the value (in Hertz) of desired communication clock procedure SetClock (Freq : Unsigned_32) with Global => null; pragma Import (C, SetClock, "Wire_SetClock"); -- Read a byte from the Reg register on the device at Addr -- @param Addr the address of the device to access -- @param Reg the register to access on the device -- @return the Byte read from the device function Read_Byte (Addr : Byte; Reg : Byte) return Byte; -- Read multiple bytes from the device at Addr start at register Reg -- @param Addr the address of the device to access -- @param Reg the starting register to access on the device -- @param Data an array of Bytes read from the registers procedure Read_Bytes (Addr : Byte; Reg : Byte; Data : out Byte_Array) with Global => Transmission_Status, Pre => (Data'Length > 0); pragma Annotate (GNATprove, False_Positive, """Data"" might not be initialized", String'("Data is properly initialized by this loop")); -- Write a byte to the register Reg on the device at Addr -- @param Addr the address of the device to write to -- @param Reg the register to write to on the device -- @param Data the data to write to the device -- @return the status of the write transaction function Write_Byte (Addr : Byte; Reg : Byte; Data : Byte) return Transmission_Status_Index; private -- Used by the master to request bytes from a slave device. -- Ada wrapper around imported RequestFrom_C -- @param Addr the 7-bit address of the device to request bytes from -- @param Quant the number of bytes to request -- @param Stop true will send a stop message after the request, releasing -- the bus. false will continually send a restart after the request, -- keeping the connection active. -- @return the number of bytes returned from the slave device function RequestFrom (Addr : Byte; Quant : Byte; Stop : Boolean) return Byte; -- See documentation for RequestFrom function RequestFrom_C (Addr : Byte; Quant : Byte; Stop : Byte) return Byte with Global => null; pragma Import (C, RequestFrom_C, "Wire_RequestFrom"); -- Begin a transmission to the I2C slave device with the given address -- @param Addr the 7-bit address of the device to transmit to procedure BeginTransmission (Addr : Byte) with Global => null; pragma Import (C, BeginTransmission, "Wire_BeginTransmission"); -- Ends a transmission to a slave device that was begun by -- BeginTransmission () and transmits the bytes that were queued -- by write (). Ada wrapper around EndTransmission_C -- @param Stop true will send a stop message, releasing the bus after -- transmission. false will send a restart, keeping the connection active -- @return byte, which indicates the status of the transmission function EndTransmission (Stop : Boolean) return Byte; -- See documentation for EndTransmission function EndTransmission_C (Stop : Byte) return Byte with Global => null; pragma Import (C, EndTransmission_C, "Wire_EndTransmission"); -- Queues bytes for transmission from a master to slave device -- @param Val a value to send as a single byte -- @return will return the number of bytes written function Write_Value (Val : Byte) return Byte with Global => null; pragma Import (C, Write_Value, "Wire_Write_Value"); -- Returns the number of bytes available for retrieval with read() -- @return The number of bytes available for reading. function Available return Integer with Global => null; pragma Import (C, Available, "Wire_Available"); -- Reads a byte that was transmitted from a slave device to a master -- @return The next byte received function Read return Byte with Global => null; pragma Import (C, Read, "Wire_Read"); end Wire;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with Ada.Directories; with Ada.Direct_IO; with Ada.Text_IO; with HelperText; package body File_Operations is package DIR renames Ada.Directories; package TIO renames Ada.Text_IO; package HT renames HelperText; -------------------------------------------------------------------------------------------- -- get_file_contents -------------------------------------------------------------------------------------------- function get_file_contents (dossier : String) return String is File_Size : constant Natural := Natural (DIR.Size (dossier)); begin if File_Size = 0 then return ""; end if; declare subtype File_String is String (1 .. File_Size); package File_String_IO is new Ada.Direct_IO (File_String); file_handle : File_String_IO.File_Type; contents : File_String; attempts : Natural := 0; begin -- The introduction of variants causes a buildsheet to be scanned once per variant. -- It's possible (even common) for simultaneous requests to scan the same buildsheet to -- occur. Thus, if the file is already open, wait and try again (up to 5 times) loop begin File_String_IO.Open (File => file_handle, Mode => File_String_IO.In_File, Name => dossier); exit; exception when File_String_IO.Status_Error | File_String_IO.Use_Error => if attempts = 5 then raise file_handling with "get_file_contents: failed open: " & dossier; end if; attempts := attempts + 1; delay 0.1; end; end loop; File_String_IO.Read (File => file_handle, Item => contents); File_String_IO.Close (file_handle); return contents; exception when others => if File_String_IO.Is_Open (file_handle) then File_String_IO.Close (file_handle); end if; raise file_handling with "get_file_contents(" & dossier & ") failed"; end; exception when Storage_Error => raise file_handling with "get_file_contents(" & dossier & ") failed to allocate memory"; end get_file_contents; -------------------------------------------------------------------------------------------- -- dump_contents_to_file -------------------------------------------------------------------------------------------- procedure dump_contents_to_file (contents : String; dossier : String) is File_Size : Natural := contents'Length; subtype File_String is String (1 .. File_Size); package File_String_IO is new Ada.Direct_IO (File_String); file_handle : File_String_IO.File_Type; begin mkdirp_from_filename (dossier); File_String_IO.Create (File => file_handle, Mode => File_String_IO.Out_File, Name => dossier); File_String_IO.Write (File => file_handle, Item => contents); File_String_IO.Close (file_handle); exception when Storage_Error => if File_String_IO.Is_Open (file_handle) then File_String_IO.Close (file_handle); end if; raise file_handling with "dump_contents_to_file(" & dossier & ") failed to allocate memory"; when others => if File_String_IO.Is_Open (file_handle) then File_String_IO.Close (file_handle); end if; raise file_handling with "dump_contents_to_file(" & dossier & ") error"; end dump_contents_to_file; -------------------------------------------------------------------------------------------- -- create_subdirectory -------------------------------------------------------------------------------------------- procedure create_subdirectory (extraction_directory : String; subdirectory : String) is abspath : String := extraction_directory & "/" & subdirectory; begin if subdirectory = "" then return; end if; if not DIR.Exists (abspath) then DIR.Create_Directory (abspath); end if; end create_subdirectory; -------------------------------------------------------------------------------------------- -- head_n1 -------------------------------------------------------------------------------------------- function head_n1 (filename : String) return String is handle : TIO.File_Type; begin TIO.Open (File => handle, Mode => TIO.In_File, Name => filename); if TIO.End_Of_File (handle) then TIO.Close (handle); return ""; end if; declare line : constant String := TIO.Get_Line (handle); begin TIO.Close (handle); return line; end; end head_n1; -------------------------------------------------------------------------------------------- -- create_pidfile -------------------------------------------------------------------------------------------- procedure create_pidfile (pidfile : String) is pidtext : constant String := HT.int2str (Get_PID); handle : TIO.File_Type; begin TIO.Create (File => handle, Mode => TIO.Out_File, Name => pidfile); TIO.Put_Line (handle, pidtext); TIO.Close (handle); end create_pidfile; -------------------------------------------------------------------------------------------- -- destroy_pidfile -------------------------------------------------------------------------------------------- procedure destroy_pidfile (pidfile : String) is begin if DIR.Exists (pidfile) then DIR.Delete_File (pidfile); end if; exception when others => null; end destroy_pidfile; -------------------------------------------------------------------------------------------- -- mkdirp_from_filename -------------------------------------------------------------------------------------------- procedure mkdirp_from_filename (filename : String) is condir : String := DIR.Containing_Directory (Name => filename); begin DIR.Create_Path (New_Directory => condir); end mkdirp_from_filename; -------------------------------------------------------------------------------------------- -- concatenate_file -------------------------------------------------------------------------------------------- procedure concatenate_file (basefile : String; another_file : String) is handle : TIO.File_Type; begin if not DIR.Exists (another_file) then raise file_handling with "concatenate_file: new_file does not exist => " & another_file; end if; if DIR.Exists (basefile) then TIO.Open (File => handle, Mode => TIO.Append_File, Name => basefile); declare contents : constant String := get_file_contents (another_file); begin TIO.Put (handle, contents); end; TIO.Close (handle); else DIR.Copy_File (Source_Name => another_file, Target_Name => basefile); end if; exception when others => if TIO.Is_Open (handle) then TIO.Close (handle); end if; raise file_handling; end concatenate_file; -------------------------------------------------------------------------------------------- -- create_cookie -------------------------------------------------------------------------------------------- procedure create_cookie (fullpath : String) is subtype File_String is String (1 .. 1); package File_String_IO is new Ada.Direct_IO (File_String); file_handle : File_String_IO.File_Type; begin mkdirp_from_filename (fullpath); File_String_IO.Create (File => file_handle, Mode => File_String_IO.Out_File, Name => fullpath); File_String_IO.Close (file_handle); exception when others => raise file_handling; end create_cookie; -------------------------------------------------------------------------------------------- -- replace_directory_contents -------------------------------------------------------------------------------------------- procedure replace_directory_contents (source_directory : String; target_directory : String; pattern : String) is search : DIR.Search_Type; dirent : DIR.Directory_Entry_Type; filter : constant DIR.Filter_Type := (DIR.Ordinary_File => True, others => False); begin if not DIR.Exists (target_directory) then return; end if; DIR.Start_Search (Search => search, Directory => target_directory, Pattern => pattern, Filter => filter); while DIR.More_Entries (search) loop DIR.Get_Next_Entry (search, dirent); declare SN : constant String := DIR.Simple_Name (dirent); oldfile : constant String := target_directory & "/" & SN; newfile : constant String := source_directory & "/" & SN; begin if DIR.Exists (newfile) then DIR.Copy_File (Source_Name => newfile, Target_Name => oldfile); end if; exception when others => TIO.Put_Line ("Failed to copy " & newfile & " over to " & oldfile); end; end loop; DIR.End_Search (search); end replace_directory_contents; -------------------------------------------------------------------------------------------- -- convert_ORIGIN_in_runpath -------------------------------------------------------------------------------------------- function convert_ORIGIN_in_runpath (filename : String; runpath : String) return String is ORIGIN : constant String := "$ORIGIN"; begin if not HT.contains (runpath, ORIGIN) then return runpath; end if; declare basedir : constant String := HT.head (filename, "/"); new_runpath : HT.Text := HT.replace_substring (US => HT.SUS (runpath), old_string => ORIGIN, new_string => basedir); begin return HT.USS (new_runpath); end; end convert_ORIGIN_in_runpath; end File_Operations;
with Numerics, Ada.Text_IO; use Numerics, Ada.Text_IO; package Molecular_Dynamics is use Real_Functions, Real_IO, Int_IO; type BC_Vectype is array (Nat range <>) of Boolean; function Verlet (R : in Pos2D_Vector; R_New : in Pos2D_Vector; Is_BC : in BC_Vectype; Dt : in Real) return Pos2D_Vector; function Calculate_Forces (R : in Pos2D_Vector; Is_BC : in BC_Vectype) return Pos2D_Vector; function LJ_Force (From : in Pos2D; To : in Pos2D) return Pos2D; procedure Initialize_Lattice (N, M : in Nat; Vac : in Nat; Lattice : out Pos2d_Vector; Is_BC : out BC_Vectype; Sides : in Boolean := False); procedure Output (R : in Pos2D_Vector; File : in File_Type); function Spring_Force (From : in Pos2D; To : in Pos2D) return Pos2D is (To - From); end Molecular_Dynamics;
-- { dg-do compile } -- { dg-options "-O2" } procedure boolean_subtype is subtype Component_T is Boolean; function Condition return Boolean is begin return True; end; V : Integer := 0; function Component_Value return Integer is begin V := V + 1; return V; end; Most_Significant : Component_T := False; Least_Significant : Component_T := True; begin if Condition then Most_Significant := True; end if; if Condition then Least_Significant := Component_T'Val (Component_Value); end if; if Least_Significant < Most_Significant then Least_Significant := Most_Significant; end if; if Least_Significant /= True then raise Program_Error; end if; end;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2015-2018, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This package provides interface to configure Skikedog's servlet container -- during application startup. ------------------------------------------------------------------------------ with Spikedog.HTTP_Session_Managers; package Spikedog.Servlet_Contexts is pragma Preelaborate; type Spikedog_Servlet_Context is limited interface; not overriding procedure Set_Session_Manager (Self : in out Spikedog_Servlet_Context; Manager : not null Spikedog.HTTP_Session_Managers.HTTP_Session_Manager_Access) is abstract; end Spikedog.Servlet_Contexts;
------------------------------------------------------------------------------ -- Copyright (c) 2016-2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ package body Natools.Smaz is use type Ada.Streams.Stream_Element_Offset; procedure Find_Entry (Dict : in Dictionary; Template : in String; Index : out Ada.Streams.Stream_Element; Length : out Natural); -- Try to find the longest entry in Dict that is a prefix of Template, -- setting Length to 0 when no such entry exists. function To_String (Data : in Ada.Streams.Stream_Element_Array) return String; -- Convert a stream element array into a string function Verbatim_Size (Dict : Dictionary; Original_Size : Natural) return Ada.Streams.Stream_Element_Count; -- Return the number of bytes needed by the verbatim encoding -- of Original_Size bytes. ------------------------------ -- Local Helper Subprograms -- ------------------------------ procedure Find_Entry (Dict : in Dictionary; Template : in String; Index : out Ada.Streams.Stream_Element; Length : out Natural) is I : Ada.Streams.Stream_Element; N : Natural; begin Index := Ada.Streams.Stream_Element'Last; Length := 0; for Last in reverse Template'Range loop N := Dict.Hash (Template (Template'First .. Last)); if N <= Natural (Dict.Dict_Last) then I := Ada.Streams.Stream_Element (N); if Dict_Entry (Dict, I) = Template (Template'First .. Last) then Index := I; Length := 1 + Last - Template'First; return; end if; end if; end loop; end Find_Entry; function To_String (Data : in Ada.Streams.Stream_Element_Array) return String is begin return Result : String (1 .. Data'Length) do for I in Result'Range loop Result (I) := Character'Val (Data (Data'First + Ada.Streams.Stream_Element_Offset (I - 1))); end loop; end return; end To_String; function Verbatim_Size (Dict : Dictionary; Original_Size : Natural) return Ada.Streams.Stream_Element_Count is Verbatim1_Max_Size : constant Ada.Streams.Stream_Element_Count := Ada.Streams.Stream_Element_Count (Ada.Streams.Stream_Element'Last - Dict.Dict_Last) - Boolean'Pos (Dict.Variable_Length_Verbatim); Verbatim2_Max_Size : constant Ada.Streams.Stream_Element_Count := Ada.Streams.Stream_Element_Count (Ada.Streams.Stream_Element'Last) + Verbatim1_Max_Size; Remaining : Ada.Streams.Stream_Element_Count := Ada.Streams.Stream_Element_Count (Original_Size); Overhead : Ada.Streams.Stream_Element_Count := 0; begin if Dict.Variable_Length_Verbatim then if Remaining >= Verbatim2_Max_Size then declare Full_Blocks : constant Ada.Streams.Stream_Element_Count := Remaining / Verbatim2_Max_Size; begin Overhead := Overhead + 2 * Full_Blocks; Remaining := Remaining - Verbatim2_Max_Size * Full_Blocks; end; end if; if Remaining > Verbatim1_Max_Size then Overhead := Overhead + 2; Remaining := 0; end if; end if; declare Block_Count : constant Ada.Streams.Stream_Element_Count := (Remaining + Verbatim1_Max_Size - 1) / Verbatim1_Max_Size; begin Overhead := Overhead + Block_Count; end; return Overhead + Ada.Streams.Stream_Element_Count (Original_Size); end Verbatim_Size; ---------------------- -- Public Interface -- ---------------------- function Dict_Entry (Dict : in Dictionary; Index : in Ada.Streams.Stream_Element) return String is First : constant Positive := Dict.Offsets (Index); Last : Natural := Dict.Values'Last; begin if Index + 1 in Dict.Offsets'Range then Last := Dict.Offsets (Index + 1) - 1; end if; return Dict.Values (First .. Last); end Dict_Entry; function Compressed_Upper_Bound (Dict : in Dictionary; Input : in String) return Ada.Streams.Stream_Element_Count is begin return Verbatim_Size (Dict, Input'Length); end Compressed_Upper_Bound; procedure Compress (Dict : in Dictionary; Input : in String; Output_Buffer : out Ada.Streams.Stream_Element_Array; Output_Last : out Ada.Streams.Stream_Element_Offset) is procedure Find_Entry; Verbatim1_Max_Size : constant Natural := Natural (Ada.Streams.Stream_Element'Last - Dict.Dict_Last) - Boolean'Pos (Dict.Variable_Length_Verbatim); Verbatim2_Max_Size : constant Natural := Natural (Ada.Streams.Stream_Element'Last) + Verbatim1_Max_Size; Input_Index : Positive := Input'First; Length : Natural; Word : Ada.Streams.Stream_Element; procedure Find_Entry is begin Find_Entry (Dict, Input (Input_Index .. Natural'Min (Input_Index + Dict.Max_Word_Length - 1, Input'Last)), Word, Length); end Find_Entry; Previous_Verbatim_Beginning : Natural := 0; Previous_Verbatim_Last : Ada.Streams.Stream_Element_Offset := 0; begin Output_Last := Output_Buffer'First - 1; Find_Entry; Main_Loop : while Input_Index in Input'Range loop Data_In_Dict : while Length > 0 loop Output_Last := Output_Last + 1; Output_Buffer (Output_Last) := Word; Input_Index := Input_Index + Length; exit Main_Loop when Input_Index not in Input'Range; Find_Entry; end loop Data_In_Dict; Verbatim_Block : declare Beginning : Positive := Input_Index; Verbatim_Length, Block_Length : Natural; begin Verbatim_Scan : while Length = 0 and Input_Index in Input'Range loop Input_Index := Input_Index + 1; Find_Entry; end loop Verbatim_Scan; Verbatim_Length := Input_Index - Beginning; if Previous_Verbatim_Beginning > 0 and then Output_Last + Verbatim_Size (Dict, Verbatim_Length) >= Previous_Verbatim_Last + Verbatim_Size (Dict, Input_Index - Previous_Verbatim_Beginning) then Beginning := Previous_Verbatim_Beginning; Output_Last := Previous_Verbatim_Last; Verbatim_Length := Input_Index - Beginning; else Previous_Verbatim_Beginning := Beginning; Previous_Verbatim_Last := Output_Last; end if; Verbatim_Encode : while Verbatim_Length > 0 loop if Dict.Variable_Length_Verbatim and then Verbatim_Length > Verbatim1_Max_Size then Block_Length := Natural'Min (Verbatim_Length, Verbatim2_Max_Size); Output_Buffer (Output_Last + 1) := Ada.Streams.Stream_Element'Last; Output_Buffer (Output_Last + 2) := Ada.Streams.Stream_Element (Block_Length - Verbatim1_Max_Size); Output_Last := Output_Last + 2; else Block_Length := Natural'Min (Verbatim_Length, Verbatim1_Max_Size); Output_Last := Output_Last + 1; Output_Buffer (Output_Last) := Ada.Streams.Stream_Element'Last - Ada.Streams.Stream_Element (Block_Length - 1 + Boolean'Pos (Dict.Variable_Length_Verbatim)); end if; Verbatim_Copy : for I in Beginning .. Beginning + Block_Length - 1 loop Output_Last := Output_Last + 1; Output_Buffer (Output_Last) := Character'Pos (Input (I)); end loop Verbatim_Copy; Verbatim_Length := Verbatim_Length - Block_Length; Beginning := Beginning + Block_Length; end loop Verbatim_Encode; end Verbatim_Block; end loop Main_Loop; end Compress; function Compress (Dict : in Dictionary; Input : in String) return Ada.Streams.Stream_Element_Array is Result : Ada.Streams.Stream_Element_Array (1 .. Compressed_Upper_Bound (Dict, Input)); Last : Ada.Streams.Stream_Element_Offset; begin Compress (Dict, Input, Result, Last); return Result (Result'First .. Last); end Compress; function Decompressed_Length (Dict : in Dictionary; Input : in Ada.Streams.Stream_Element_Array) return Natural is Result : Natural := 0; Verbatim_Code_Count : constant Ada.Streams.Stream_Element_Offset := Ada.Streams.Stream_Element_Offset (Ada.Streams.Stream_Element'Last - Dict.Dict_Last); Input_Index : Ada.Streams.Stream_Element_Offset := Input'First; Input_Byte : Ada.Streams.Stream_Element; Verbatim_Length : Ada.Streams.Stream_Element_Offset; begin while Input_Index in Input'Range loop Input_Byte := Input (Input_Index); if Input_Byte in Dict.Offsets'Range then Result := Result + Dict_Entry (Dict, Input_Byte)'Length; Input_Index := Input_Index + 1; else if not Dict.Variable_Length_Verbatim then Verbatim_Length := Ada.Streams.Stream_Element_Offset (Ada.Streams.Stream_Element'Last - Input_Byte) + 1; elsif Input_Byte < Ada.Streams.Stream_Element'Last then Verbatim_Length := Ada.Streams.Stream_Element_Offset (Ada.Streams.Stream_Element'Last - Input_Byte); else Input_Index := Input_Index + 1; Verbatim_Length := Ada.Streams.Stream_Element_Offset (Input (Input_Index)) + Verbatim_Code_Count - 1; end if; Result := Result + Positive (Verbatim_Length); Input_Index := Input_Index + Verbatim_Length + 1; end if; end loop; return Result; end Decompressed_Length; procedure Decompress (Dict : in Dictionary; Input : in Ada.Streams.Stream_Element_Array; Output_Buffer : out String; Output_Last : out Natural) is procedure Append (S : in String); procedure Append (S : in Ada.Streams.Stream_Element_Array); procedure Append (S : in String) is begin Output_Buffer (Output_Last + 1 .. Output_Last + S'Length) := S; Output_Last := Output_Last + S'Length; end Append; procedure Append (S : in Ada.Streams.Stream_Element_Array) is begin Append (To_String (S)); end Append; Verbatim_Code_Count : constant Ada.Streams.Stream_Element_Offset := Ada.Streams.Stream_Element_Offset (Ada.Streams.Stream_Element'Last - Dict.Dict_Last); Input_Index : Ada.Streams.Stream_Element_Offset := Input'First; Input_Byte : Ada.Streams.Stream_Element; Verbatim_Length : Ada.Streams.Stream_Element_Offset; begin Output_Last := Output_Buffer'First - 1; while Input_Index in Input'Range loop Input_Byte := Input (Input_Index); if Input_Byte in Dict.Offsets'Range then Append (Dict_Entry (Dict, Input_Byte)); Input_Index := Input_Index + 1; else if not Dict.Variable_Length_Verbatim then Verbatim_Length := Ada.Streams.Stream_Element_Offset (Ada.Streams.Stream_Element'Last - Input_Byte) + 1; elsif Input_Byte < Ada.Streams.Stream_Element'Last then Verbatim_Length := Ada.Streams.Stream_Element_Offset (Ada.Streams.Stream_Element'Last - Input_Byte); else Input_Index := Input_Index + 1; Verbatim_Length := Ada.Streams.Stream_Element_Offset (Input (Input_Index)) + Verbatim_Code_Count - 1; end if; Append (Input (Input_Index + 1 .. Input_Index + Verbatim_Length)); Input_Index := Input_Index + Verbatim_Length + 1; end if; end loop; end Decompress; function Decompress (Dict : in Dictionary; Input : in Ada.Streams.Stream_Element_Array) return String is Result : String (1 .. Decompressed_Length (Dict, Input)); Last : Natural; begin Decompress (Dict, Input, Result, Last); pragma Assert (Last = Result'Last); return Result; end Decompress; end Natools.Smaz;
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h; with glib; with glib.Values; with System; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; with System; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstrtpbuffer_h is GST_RTP_VERSION : constant := 2; -- gst/rtp/gstrtpbuffer.h:37 -- GStreamer -- * Copyright (C) <2005> Philippe Khalaf <burger@speedy.org> -- * <2005> Wim Taymans <wim@fluendo.com> -- * -- * gstrtpbuffer.h: various helper functions to manipulate buffers -- * with RTP payload. -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- --* -- * GST_RTP_VERSION: -- * -- * The supported RTP version 2. -- -- creating buffers procedure gst_rtp_buffer_allocate_data (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; payload_len : GLIB.guint; pad_len : GLIB.guint8; csrc_count : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:40 pragma Import (C, gst_rtp_buffer_allocate_data, "gst_rtp_buffer_allocate_data"); function gst_rtp_buffer_new_take_data (data : System.Address; len : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:43 pragma Import (C, gst_rtp_buffer_new_take_data, "gst_rtp_buffer_new_take_data"); function gst_rtp_buffer_new_copy_data (data : System.Address; len : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:44 pragma Import (C, gst_rtp_buffer_new_copy_data, "gst_rtp_buffer_new_copy_data"); function gst_rtp_buffer_new_allocate (payload_len : GLIB.guint; pad_len : GLIB.guint8; csrc_count : GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:45 pragma Import (C, gst_rtp_buffer_new_allocate, "gst_rtp_buffer_new_allocate"); function gst_rtp_buffer_new_allocate_len (packet_len : GLIB.guint; pad_len : GLIB.guint8; csrc_count : GLIB.guint8) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:46 pragma Import (C, gst_rtp_buffer_new_allocate_len, "gst_rtp_buffer_new_allocate_len"); function gst_rtp_buffer_list_from_buffer (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return System.Address; -- gst/rtp/gstrtpbuffer.h:48 pragma Import (C, gst_rtp_buffer_list_from_buffer, "gst_rtp_buffer_list_from_buffer"); function gst_rtp_buffer_calc_header_len (csrc_count : GLIB.guint8) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:51 pragma Import (C, gst_rtp_buffer_calc_header_len, "gst_rtp_buffer_calc_header_len"); function gst_rtp_buffer_calc_packet_len (payload_len : GLIB.guint; pad_len : GLIB.guint8; csrc_count : GLIB.guint8) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:52 pragma Import (C, gst_rtp_buffer_calc_packet_len, "gst_rtp_buffer_calc_packet_len"); function gst_rtp_buffer_calc_payload_len (packet_len : GLIB.guint; pad_len : GLIB.guint8; csrc_count : GLIB.guint8) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:53 pragma Import (C, gst_rtp_buffer_calc_payload_len, "gst_rtp_buffer_calc_payload_len"); function gst_rtp_buffer_validate_data (data : access GLIB.guint8; len : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:55 pragma Import (C, gst_rtp_buffer_validate_data, "gst_rtp_buffer_validate_data"); function gst_rtp_buffer_validate (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:56 pragma Import (C, gst_rtp_buffer_validate, "gst_rtp_buffer_validate"); function gst_rtp_buffer_list_validate (list : System.Address) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:57 pragma Import (C, gst_rtp_buffer_list_validate, "gst_rtp_buffer_list_validate"); procedure gst_rtp_buffer_set_packet_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; len : GLIB.guint); -- gst/rtp/gstrtpbuffer.h:59 pragma Import (C, gst_rtp_buffer_set_packet_len, "gst_rtp_buffer_set_packet_len"); function gst_rtp_buffer_get_packet_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:60 pragma Import (C, gst_rtp_buffer_get_packet_len, "gst_rtp_buffer_get_packet_len"); function gst_rtp_buffer_get_header_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:62 pragma Import (C, gst_rtp_buffer_get_header_len, "gst_rtp_buffer_get_header_len"); function gst_rtp_buffer_get_version (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:64 pragma Import (C, gst_rtp_buffer_get_version, "gst_rtp_buffer_get_version"); procedure gst_rtp_buffer_set_version (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; version : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:65 pragma Import (C, gst_rtp_buffer_set_version, "gst_rtp_buffer_set_version"); function gst_rtp_buffer_get_padding (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:67 pragma Import (C, gst_rtp_buffer_get_padding, "gst_rtp_buffer_get_padding"); procedure gst_rtp_buffer_set_padding (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; padding : GLIB.gboolean); -- gst/rtp/gstrtpbuffer.h:68 pragma Import (C, gst_rtp_buffer_set_padding, "gst_rtp_buffer_set_padding"); procedure gst_rtp_buffer_pad_to (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; len : GLIB.guint); -- gst/rtp/gstrtpbuffer.h:69 pragma Import (C, gst_rtp_buffer_pad_to, "gst_rtp_buffer_pad_to"); function gst_rtp_buffer_get_extension (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:71 pragma Import (C, gst_rtp_buffer_get_extension, "gst_rtp_buffer_get_extension"); procedure gst_rtp_buffer_set_extension (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; extension : GLIB.gboolean); -- gst/rtp/gstrtpbuffer.h:72 pragma Import (C, gst_rtp_buffer_set_extension, "gst_rtp_buffer_set_extension"); function gst_rtp_buffer_get_extension_data (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; bits : access GLIB.guint16; data : System.Address; wordlen : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:73 pragma Import (C, gst_rtp_buffer_get_extension_data, "gst_rtp_buffer_get_extension_data"); function gst_rtp_buffer_set_extension_data (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; bits : GLIB.guint16; length : GLIB.guint16) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:75 pragma Import (C, gst_rtp_buffer_set_extension_data, "gst_rtp_buffer_set_extension_data"); function gst_rtp_buffer_get_ssrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:77 pragma Import (C, gst_rtp_buffer_get_ssrc, "gst_rtp_buffer_get_ssrc"); function gst_rtp_buffer_list_get_ssrc (list : System.Address) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:78 pragma Import (C, gst_rtp_buffer_list_get_ssrc, "gst_rtp_buffer_list_get_ssrc"); procedure gst_rtp_buffer_set_ssrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; ssrc : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:79 pragma Import (C, gst_rtp_buffer_set_ssrc, "gst_rtp_buffer_set_ssrc"); procedure gst_rtp_buffer_list_set_ssrc (list : System.Address; ssrc : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:80 pragma Import (C, gst_rtp_buffer_list_set_ssrc, "gst_rtp_buffer_list_set_ssrc"); function gst_rtp_buffer_get_csrc_count (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:82 pragma Import (C, gst_rtp_buffer_get_csrc_count, "gst_rtp_buffer_get_csrc_count"); function gst_rtp_buffer_get_csrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; idx : GLIB.guint8) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:83 pragma Import (C, gst_rtp_buffer_get_csrc, "gst_rtp_buffer_get_csrc"); procedure gst_rtp_buffer_set_csrc (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; idx : GLIB.guint8; csrc : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:84 pragma Import (C, gst_rtp_buffer_set_csrc, "gst_rtp_buffer_set_csrc"); function gst_rtp_buffer_get_marker (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:86 pragma Import (C, gst_rtp_buffer_get_marker, "gst_rtp_buffer_get_marker"); procedure gst_rtp_buffer_set_marker (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; marker : GLIB.gboolean); -- gst/rtp/gstrtpbuffer.h:87 pragma Import (C, gst_rtp_buffer_set_marker, "gst_rtp_buffer_set_marker"); function gst_rtp_buffer_get_payload_type (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:89 pragma Import (C, gst_rtp_buffer_get_payload_type, "gst_rtp_buffer_get_payload_type"); function gst_rtp_buffer_list_get_payload_type (list : System.Address) return GLIB.guint8; -- gst/rtp/gstrtpbuffer.h:90 pragma Import (C, gst_rtp_buffer_list_get_payload_type, "gst_rtp_buffer_list_get_payload_type"); procedure gst_rtp_buffer_set_payload_type (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; payload_type : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:91 pragma Import (C, gst_rtp_buffer_set_payload_type, "gst_rtp_buffer_set_payload_type"); procedure gst_rtp_buffer_list_set_payload_type (list : System.Address; payload_type : GLIB.guint8); -- gst/rtp/gstrtpbuffer.h:92 pragma Import (C, gst_rtp_buffer_list_set_payload_type, "gst_rtp_buffer_list_set_payload_type"); function gst_rtp_buffer_get_seq (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint16; -- gst/rtp/gstrtpbuffer.h:94 pragma Import (C, gst_rtp_buffer_get_seq, "gst_rtp_buffer_get_seq"); function gst_rtp_buffer_list_get_seq (list : System.Address) return GLIB.guint16; -- gst/rtp/gstrtpbuffer.h:95 pragma Import (C, gst_rtp_buffer_list_get_seq, "gst_rtp_buffer_list_get_seq"); procedure gst_rtp_buffer_set_seq (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; seq : GLIB.guint16); -- gst/rtp/gstrtpbuffer.h:96 pragma Import (C, gst_rtp_buffer_set_seq, "gst_rtp_buffer_set_seq"); function gst_rtp_buffer_list_set_seq (list : System.Address; seq : GLIB.guint16) return GLIB.guint16; -- gst/rtp/gstrtpbuffer.h:97 pragma Import (C, gst_rtp_buffer_list_set_seq, "gst_rtp_buffer_list_set_seq"); function gst_rtp_buffer_get_timestamp (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:99 pragma Import (C, gst_rtp_buffer_get_timestamp, "gst_rtp_buffer_get_timestamp"); function gst_rtp_buffer_list_get_timestamp (list : System.Address) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:100 pragma Import (C, gst_rtp_buffer_list_get_timestamp, "gst_rtp_buffer_list_get_timestamp"); procedure gst_rtp_buffer_set_timestamp (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; timestamp : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:101 pragma Import (C, gst_rtp_buffer_set_timestamp, "gst_rtp_buffer_set_timestamp"); procedure gst_rtp_buffer_list_set_timestamp (list : System.Address; timestamp : GLIB.guint32); -- gst/rtp/gstrtpbuffer.h:102 pragma Import (C, gst_rtp_buffer_list_set_timestamp, "gst_rtp_buffer_list_set_timestamp"); function gst_rtp_buffer_get_payload_buffer (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:104 pragma Import (C, gst_rtp_buffer_get_payload_buffer, "gst_rtp_buffer_get_payload_buffer"); function gst_rtp_buffer_get_payload_subbuffer (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; offset : GLIB.guint; len : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/rtp/gstrtpbuffer.h:105 pragma Import (C, gst_rtp_buffer_get_payload_subbuffer, "gst_rtp_buffer_get_payload_subbuffer"); function gst_rtp_buffer_get_payload_len (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:107 pragma Import (C, gst_rtp_buffer_get_payload_len, "gst_rtp_buffer_get_payload_len"); function gst_rtp_buffer_list_get_payload_len (list : System.Address) return GLIB.guint; -- gst/rtp/gstrtpbuffer.h:108 pragma Import (C, gst_rtp_buffer_list_get_payload_len, "gst_rtp_buffer_list_get_payload_len"); function gst_rtp_buffer_get_payload (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer) return System.Address; -- gst/rtp/gstrtpbuffer.h:109 pragma Import (C, gst_rtp_buffer_get_payload, "gst_rtp_buffer_get_payload"); -- some helpers function gst_rtp_buffer_default_clock_rate (payload_type : GLIB.guint8) return GLIB.guint32; -- gst/rtp/gstrtpbuffer.h:112 pragma Import (C, gst_rtp_buffer_default_clock_rate, "gst_rtp_buffer_default_clock_rate"); function gst_rtp_buffer_compare_seqnum (seqnum1 : GLIB.guint16; seqnum2 : GLIB.guint16) return GLIB.gint; -- gst/rtp/gstrtpbuffer.h:113 pragma Import (C, gst_rtp_buffer_compare_seqnum, "gst_rtp_buffer_compare_seqnum"); function gst_rtp_buffer_ext_timestamp (exttimestamp : access GLIB.guint64; timestamp : GLIB.guint32) return GLIB.guint64; -- gst/rtp/gstrtpbuffer.h:114 pragma Import (C, gst_rtp_buffer_ext_timestamp, "gst_rtp_buffer_ext_timestamp"); function gst_rtp_buffer_get_extension_onebyte_header (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; id : GLIB.guint8; nth : GLIB.guint; data : System.Address; size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:116 pragma Import (C, gst_rtp_buffer_get_extension_onebyte_header, "gst_rtp_buffer_get_extension_onebyte_header"); function gst_rtp_buffer_get_extension_twobytes_header (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; appbits : access GLIB.guint8; id : GLIB.guint8; nth : GLIB.guint; data : System.Address; size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:121 pragma Import (C, gst_rtp_buffer_get_extension_twobytes_header, "gst_rtp_buffer_get_extension_twobytes_header"); function gst_rtp_buffer_add_extension_onebyte_header (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; id : GLIB.guint8; data : System.Address; size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:128 pragma Import (C, gst_rtp_buffer_add_extension_onebyte_header, "gst_rtp_buffer_add_extension_onebyte_header"); function gst_rtp_buffer_add_extension_twobytes_header (buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; appbits : GLIB.guint8; id : GLIB.guint8; data : System.Address; size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:132 pragma Import (C, gst_rtp_buffer_add_extension_twobytes_header, "gst_rtp_buffer_add_extension_twobytes_header"); function gst_rtp_buffer_list_get_extension_onebyte_header (bufferlist : System.Address; group_idx : GLIB.guint; id : GLIB.guint8; nth : GLIB.guint; data : System.Address; size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:138 pragma Import (C, gst_rtp_buffer_list_get_extension_onebyte_header, "gst_rtp_buffer_list_get_extension_onebyte_header"); function gst_rtp_buffer_list_get_extension_twobytes_header (bufferlist : System.Address; group_idx : GLIB.guint; appbits : access GLIB.guint8; id : GLIB.guint8; nth : GLIB.guint; data : System.Address; size : access GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:144 pragma Import (C, gst_rtp_buffer_list_get_extension_twobytes_header, "gst_rtp_buffer_list_get_extension_twobytes_header"); function gst_rtp_buffer_list_add_extension_onebyte_header (it : System.Address; id : GLIB.guint8; data : System.Address; size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:152 pragma Import (C, gst_rtp_buffer_list_add_extension_onebyte_header, "gst_rtp_buffer_list_add_extension_onebyte_header"); function gst_rtp_buffer_list_add_extension_twobytes_header (it : System.Address; appbits : GLIB.guint8; id : GLIB.guint8; data : System.Address; size : GLIB.guint) return GLIB.gboolean; -- gst/rtp/gstrtpbuffer.h:156 pragma Import (C, gst_rtp_buffer_list_add_extension_twobytes_header, "gst_rtp_buffer_list_add_extension_twobytes_header"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtp_gstrtpbuffer_h;
-- -- Copyright 2021 (C) Jeremy Grosser <jeremy@synack.me> -- -- SPDX-License-Identifier: BSD-3-Clause -- with HAL.UART; with System; package Last_Chance_Handler is procedure Initialize (UART : not null HAL.UART.Any_UART_Port); procedure Last_Chance_Handler (Source_Location : System.Address; Line : Integer) with No_Return, Export, Convention => C, External_Name => "__gnat_last_chance_handler"; end Last_Chance_Handler;
----------------------------------------------------------------------- -- are-tests -- Various tests for the are tool (based on examples) -- Copyright (C) 2021 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Text_IO; with Ada.Directories; with Ada.Strings.Maps; with Util.Test_Caller; package body Are.Tests is package Caller is new Util.Test_Caller (Test, "Are.Examples"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test examples c-config", Test_Example_C_Config'Access); Caller.Add_Test (Suite, "Test examples c-help", Test_Example_C_Help'Access); Caller.Add_Test (Suite, "Test examples c-lines", Test_Example_C_Lines'Access); Caller.Add_Test (Suite, "Test examples ada-config", Test_Example_Ada_Config'Access); Caller.Add_Test (Suite, "Test examples ada-help", Test_Example_Ada_Help'Access); Caller.Add_Test (Suite, "Test examples ada-lines", Test_Example_Ada_Lines'Access); if Ada.Directories.Exists ("/usr/bin/go") then Caller.Add_Test (Suite, "Test examples go-config", Test_Example_Go_Config'Access); Caller.Add_Test (Suite, "Test examples go-help", Test_Example_Go_Help'Access); end if; Caller.Add_Test (Suite, "Test Are.Convert_To_Lines_1", Test_Convert_Lines_1'Access); Caller.Add_Test (Suite, "Test Are.Convert_To_Lines_2", Test_Convert_Lines_2'Access); end Add_Tests; procedure Test_Example_C_Config (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/c-config clean", Result, Status => 0); T.Execute ("make -C examples/c-config ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/c-config/show-config" & Are.Testsuite.EXE, Result, Status => 0); Util.Tests.Assert_Matches (T, ".*Example of embedded configuration.*", Result, "Invalid C show-config"); end Test_Example_C_Config; procedure Test_Example_Ada_Config (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/ada-config clean", Result, Status => 0); T.Execute ("make -C examples/ada-config ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/ada-config/show_config" & Are.Testsuite.EXE, Result, Status => 0); Util.Tests.Assert_Matches (T, ".*Example of embedded configuration.*", Result, "Invalid Ada show_config"); end Test_Example_Ada_Config; procedure Test_Example_Go_Config (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/go-config clean", Result, Status => 0); T.Execute ("make -C examples/go-config ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/go-config/show-config", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*Example of embedded configuration.*", Result, "Invalid Go show-config"); end Test_Example_Go_Config; procedure Test_Example_C_Help (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/c-help clean", Result, Status => 0); T.Execute ("make -C examples/c-help ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/c-help/show-help" & Are.Testsuite.EXE, Result, Status => 0); Util.Tests.Assert_Matches (T, ".*sh.*", Result, "Invalid C show-help: sh missing"); Util.Tests.Assert_Matches (T, ".*extract.*", Result, "Invalid C show-help: extract missing"); T.Execute ("examples/c-help/show-help sh", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*shell.*", Result, "Invalid C show-help: sh"); T.Execute ("examples/c-help/show-help extract", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*extract files.*", Result, "Invalid C show-help: extract"); end Test_Example_C_Help; procedure Test_Example_C_Lines (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/c-lines clean", Result, Status => 0); T.Execute ("make -C examples/c-lines ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/c-lines/show-script" & Are.Testsuite.EXE, Result, Status => 0); Util.Tests.Assert_Matches (T, "Create SQLite 7 lines.*", Result, "Invalid C show-script: SQL statement"); Util.Tests.Assert_Matches (T, "Drop SQLite 4 lines.*", Result, "Invalid C show-script: SQL statement"); end Test_Example_C_Lines; procedure Test_Example_Ada_Help (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/ada-help clean", Result, Status => 0); T.Execute ("make -C examples/ada-help ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/ada-help/show_help" & Are.Testsuite.EXE, Result, Status => 0); Util.Tests.Assert_Matches (T, ".*sh.*", Result, "Invalid Ada show-help: sh missing"); Util.Tests.Assert_Matches (T, ".*extract.*", Result, "Invalid Ada show-help: extract missing"); T.Execute ("examples/ada-help/show_help sh", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*shell.*", Result, "Invalid Ada show-help: sh"); T.Execute ("examples/ada-help/show_help extract", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*extract files.*", Result, "Invalid Ada show-help: extract"); end Test_Example_Ada_Help; procedure Test_Example_Ada_Lines (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/ada-lines clean", Result, Status => 0); T.Execute ("make -C examples/ada-lines ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/ada-lines/show_script" & Are.Testsuite.EXE, Result, Status => 0); Util.Tests.Assert_Matches (T, "Create SQLite 7 lines.*", Result, "Invalid Ada show_script: SQL statement"); Util.Tests.Assert_Matches (T, "Drop SQLite 4 lines.*", Result, "Invalid Ada show_script: SQL statement"); end Test_Example_Ada_Lines; procedure Test_Example_Go_Help (T : in out Test) is Result : Ada.Strings.Unbounded.Unbounded_String; begin T.Execute ("make -C examples/go-help clean", Result, Status => 0); T.Execute ("make -C examples/go-help ARE=../../bin/are", Result, Status => 0); T.Execute ("examples/go-help/show-help", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*sh.*", Result, "Invalid Go show-help: sh missing"); Util.Tests.Assert_Matches (T, ".*extract.*", Result, "Invalid Go show-help: extract missing"); T.Execute ("examples/go-help/show-help sh", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*shell.*", Result, "Invalid Go show-help: sh"); T.Execute ("examples/go-help/show-help extract", Result, Status => 0); Util.Tests.Assert_Matches (T, ".*extract files.*", Result, "Invalid Go show-help: extract"); end Test_Example_Go_Help; procedure Test_Convert_Lines_1 (T : in out Test) is use Ada.Strings.Maps; Resource : Resource_Type; Lines : Util.Strings.Vectors.Vector; File : File_Info; begin Resource.Add_File ("lines", "regtests/files/lines-1.txt"); Resource.Separators := To_Set (ASCII.CR) or To_Set (ASCII.LF); File := Resource.Files.First_Element; Resource.Convert_To_Lines (File, Lines); Util.Tests.Assert_Equals (T, 9, Natural (Lines.Length), "Invalid number of lines"); for I in 1 .. 9 loop Util.Tests.Assert_Equals (T, "line" & Util.Strings.Image (I), Lines.Element (I), "Invalid line"); end loop; end Test_Convert_Lines_1; procedure Test_Convert_Lines_2 (T : in out Test) is use Ada.Strings.Maps; Resource : Resource_Type; Lines : Util.Strings.Vectors.Vector; File : File_Info; begin Resource.Add_File ("lines", "regtests/files/lines-2.txt"); Resource.Separators := To_Set (";"); -- Remove newlines and contiguous spaces. Are.Add_Line_Filter (Resource, "[\r\n]", ""); Are.Add_Line_Filter (Resource, "[ \t][ \t]+", " "); -- Remove C comments. Are.Add_Line_Filter (Resource, "/\*[^/]*\*/", ""); -- Remove contiguous spaces (can happen after C comment removal). Are.Add_Line_Filter (Resource, "[ \t][ \t]+", " "); File := Resource.Files.First_Element; Resource.Convert_To_Lines (File, Lines); Util.Tests.Assert_Equals (T, 5, Natural (Lines.Length), "Invalid number of lines"); for I in 1 .. 5 loop Ada.Text_IO.Put_Line (Lines.Element (I)); end loop; Util.Tests.Assert_Equals (T, "pragma synchronous=OFF", Lines.Element (1), "Invalid line 1"); Util.Tests.Assert_Equals (T, "CREATE TABLE IF NOT EXISTS entity_type ( `id`" & " INTEGER PRIMARY KEY AUTOINCREMENT, `name`" & " VARCHAR(127) UNIQUE )", Lines.Element (2), "Invalid line 2"); Util.Tests.Assert_Equals (T, "CREATE TABLE IF NOT EXISTS sequence ( `name`" & " VARCHAR(127) UNIQUE NOT NULL, `version` INTEGER NOT NULL," & " `value` BIGINT NOT NULL, `block_size` BIGINT NOT NULL," & " PRIMARY KEY (`name`))", Lines.Element (3), "Invalid line 3"); Util.Tests.Assert_Equals (T, "INSERT OR IGNORE INTO entity_type (name) VALUES" & " (""entity_type"")", Lines.Element (4), "Invalid line 4"); Util.Tests.Assert_Equals (T, "INSERT OR IGNORE INTO entity_type (name) VALUES" & " (""sequence"")", Lines.Element (5), "Invalid line 5"); end Test_Convert_Lines_2; end Are.Tests;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f4xx_hal_dma.h -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief Header file of DMA HAL module. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ -- This file provides definitions for the DMA controllers on the STM32F4 (ARM -- Cortex M4F) microcontrollers from ST Microelectronics. -- See Application Note AN4031: "Using the STM32F2 and STM32F4 DMA controller" -- and Reference Manual RM0090: "STM32F405xx/07xx, STM32F415xx/17xx, -- STM32F42xxx and STM32F43xxx advanced ARM-based 32-bit MCUs" In the -- application note, see especially section four, titled "Tips and -- warnings while programming the DMA controller" -- The basic call sequence, given a Controller and a Stream, is as follows: -- 1) Configure -- Configures the Controller and Stream per application requirements. This -- is the primary setup call, specifying the static characteristics of all -- the transfers to be performed on the stream, such as the direction, the -- channel, and so forth. The Controller is disabled after the call. -- 2) Configure_Data_Flow -- Sets the dynamic parameters of a given transfer, i.e., the source and -- destination addresses and the number of data items to transfer. -- 3) Enable -- Enables transfers on the Controller and Stream. Transfers will begin -- immediately unless programmed otherwise. -- You can enable some or all DMA interrupts prior to the call to Enable, if -- required by your usage. -- Ensure all the status flags are cleared prior to the call to Enable, since -- a transfer will then begin. This can be accomplished by relying on the fact -- that the board has just powered-up, by a call to Reset, or by a call to -- Clear_All_Status. -- Note that there are convenience routines that do steps two and three: -- Start_Transfer -- Start_Transfer_with_Interrupts pragma Restrictions (No_Elaboration_Code); with System; use System; with Ada.Real_Time; use Ada.Real_Time; private with STM32_SVD.DMA; package STM32.DMA with SPARK_Mode => Off is type DMA_Controller is limited private; -- Do not change the order of the enumerals in the types in this package. -- The underlying canonical representation values are required. type DMA_Stream_Selector is (Stream_1, Stream_2, Stream_3, Stream_4, Stream_5, Stream_6, Stream_7, Stream_8); procedure Enable (This : DMA_Controller; Stream : DMA_Stream_Selector) with Inline; -- Before enabling a stream to start a new transfer, the event status flags -- corresponding to the stream must be cleared. Note that the unit may not -- be enabled by the time the call returns. function Enabled (This : DMA_Controller; Stream : DMA_Stream_Selector) return Boolean with Inline; procedure Disable (This : DMA_Controller; Stream : DMA_Stream_Selector) with Post => not Enabled (This, Stream), Inline; procedure Reset (This : in out DMA_Controller; Stream : DMA_Stream_Selector) with Post => not Enabled (This, Stream) and Operating_Mode (This, Stream) = Normal_Mode and Current_Items_Number (This, Stream) = 0 and Selected_Channel (This, Stream) = Channel_1 and Transfer_Direction (This, Stream) = Peripheral_To_Memory and not Circular_Mode (This, Stream) and Memory_Data_Width (This, Stream) = Bytes and Peripheral_Data_Width (This, Stream) = Bytes and Priority (This, Stream) = Priority_Low and (for all Flag in DMA_Status_Flag => not Status (This, Stream, Flag)) and (for all Interrupt in DMA_Interrupt => not Interrupt_Enabled (This, Stream, Interrupt)); -- In addition, -- M_Burst = Memory_Burst_Single and -- P_Burst = Peripheral_Burst_Single and -- P_Inc_Offset_Size = 0 and -- M_Inc_Mode = False and -- P_Inc_Mode = False -- Also clears the FIFO control register bits except sets bits to show FIFO -- is empty, and to set the FIFO filling threshold selection to 1/2 full. procedure Set_Double_Buffer_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector; Enable : Boolean); -- In double-buffer mode the stream has two memory pointers for SxM0AR and -- SxM1AR, and the DMA controller swaps from one memory target to another -- at each and of transaction. -- To avoid any error condition, it is advised to change the base address -- as soon as the TCIF flag is asserted because, at this point, the targeted -- memory must have changed from memory 0 to 1 (or from 1 to 0) depending on -- the value of CT in the DMA_SxCR register. -- For all the other modes (except the double-buffer mode), the memory -- address registers are write-protected as soon as the stream is enabled. -- See RM0433 rev 7 Chapter 15.3.11 "Double-buffer mode" pg 644. procedure Set_Bufferable_Transfer (This : DMA_Controller; Stream : DMA_Stream_Selector; Enable : Boolean); -- This bit must be set to 1 if the DMA stream manages UART/USART/LPUART -- transfers. type DMA_Device is (Memory, Peripheral); type DMA_Burst_Transfer_Mode is (Single_Transfer, Increment_4_Beats, Increment_8_Beats, Increment_16_Beats); procedure Set_Burst_Mode_Transfer (This : DMA_Controller; Stream : DMA_Stream_Selector; Device : DMA_Device; Mode : DMA_Burst_Transfer_Mode) with Pre => not Enabled (This, Stream); -- See RM0433 rev 7 Chapter 15.3.13 "Single and burst mode transfers" pg 647. procedure Configure_Data_Flow (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address; Data_Count : UInt16) with Pre => not Enabled (This, Stream) and Valid_Addresses (Source, Destination) and Compatible_Alignments (This, Stream, Source, Destination); -- Sets the source and destination arguments within the specified stream, -- based on the direction previously specified by a call to procedure -- Configure. -- -- Sets the number of data items to be transferred (from 0 to 65535) on -- the specified stream in the next transfer. This is the volume of data to -- be transferred from source to destination. The number specified depends -- only on the peripheral data format, as specified by the record component -- Peripheral_Data_Format passed to a call to Configure. The value to be -- specified is computed as follows: -- -- If the peripheral data format is in units of bytes, the value is -- equal to the total number of bytes contained in the data to be sent. -- -- If the peripheral data format is in units of half-words, the value is -- 1/2 the total number of bytes contained in the data to be sent. -- -- If the peripheral data format is in units of words, the value is -- 1/4 the total number of bytes contained in the data to be sent. -- -- For example, to send a sequence of characters to a USART, the USART -- peripheral format will be in units of bytes so the Data_Count argument -- will be the number of characters (bytes) in the string to be sent. -- In contrast, on a memory-to-memory transfer the most efficient approach -- is to work in units of words. One would therefore specify word units for -- the source and destination formats and then specify 1/4 the total number -- of bytes involved (assuming a four-UInt8 word). procedure Start_Transfer (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address; Data_Count : UInt16) with Pre => Valid_Addresses (Source, Destination) and Compatible_Alignments (This, Stream, Source, Destination) and (for all Flag in DMA_Status_Flag => (not Status (This, Stream, Flag))); -- Convenience routine: disables the stream, calls Configure_Data_Flow, -- and then enables the stream to start the transfer. DMA interrupts are -- not enabled by this routine, but could be enabled prior to the call. -- The requirement to clear the flags first is due to the fact that -- the transfer begins immediately at the end of this routine. The -- value specified for Data_Count is as described for procedure -- Configure_Data_Flow. type DMA_Interrupt is (Transfer_Error_Interrupt, Half_Transfer_Complete_Interrupt, Transfer_Complete_Interrupt, Direct_Mode_Error_Interrupt); procedure Enable_Interrupt (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : DMA_Interrupt) with Post => Interrupt_Enabled (This, Stream, Source); -- The postcondition should not be relied upon completely because it is -- possible, under just the wrong conditions, for the interrupt to be -- disabled immediately, prior to return from this routine function Interrupt_Enabled (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : DMA_Interrupt) return Boolean with Inline; procedure Disable_Interrupt (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : DMA_Interrupt) with Post => not Interrupt_Enabled (This, Stream, Source); type Interrupt_Selections is array (DMA_Interrupt) of Boolean; procedure Start_Transfer_with_Interrupts (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address; Data_Count : UInt16; Enabled_Interrupts : Interrupt_Selections := (others => True)) with Pre => Valid_Addresses (Source, Destination) and Compatible_Alignments (This, Stream, Source, Destination) and (for all Flag in DMA_Status_Flag => (not Status (This, Stream, Flag))); -- Convenience routine: disables the stream, calls Configure_Data_Flow, -- enables the selected DMA interrupts (by default, all of them), and -- then enables the stream to start the transfer. All the selected DMA -- interrupts are enabled, all the others are left unchanged. Interrupts -- are selected for enablement by having a True value in the array at their -- index location. The requirement to clear the flags first is due to the -- fact that the transfer begins immediately at the end of this routine. -- The value specified for Data_Count is as described for procedure -- Configure_Data_Flow. type DMA_Error_Code is (DMA_No_Error, DMA_Transfer_Error, DMA_Timeout_Error, DMA_Device_Error); procedure Abort_Transfer (This : DMA_Controller; Stream : DMA_Stream_Selector; Result : out DMA_Error_Code) with Post => not Enabled (This, Stream); -- Disables the specified stream and then waits until the request is -- effective. If a stream is disabled while a data transfer is ongoing, the -- current datum will be transferred and the stream will be disabled only -- after the transfer of this single datum completes. type DMA_Transfer_Level is (Full_Transfer, Half_Transfer); procedure Poll_For_Completion (This : in out DMA_Controller; Stream : DMA_Stream_Selector; Expected_Level : DMA_Transfer_Level; Timeout : Time_Span; Result : out DMA_Error_Code); type DMA_Status_Flag is (FIFO_Error_Indicated, Direct_Mode_Error_Indicated, Transfer_Error_Indicated, Half_Transfer_Complete_Indicated, Transfer_Complete_Indicated); function Status (This : DMA_Controller; Stream : DMA_Stream_Selector; Flag : DMA_Status_Flag) return Boolean with Inline; -- Returns whether the specified status flag is indicated procedure Clear_Status (This : in out DMA_Controller; Stream : DMA_Stream_Selector; Flag : DMA_Status_Flag) with Inline, Post => not Status (This, Stream, Flag); procedure Clear_All_Status (This : in out DMA_Controller; Stream : DMA_Stream_Selector) with Post => (for all Indicated in DMA_Status_Flag => not Status (This, Stream, Indicated)); procedure Set_Items_Number (This : DMA_Controller; Stream : DMA_Stream_Selector; Data_Count : UInt16) with Pre => not Enabled (This, Stream), Post => Current_Items_Number (This, Stream) = Data_Count, Inline; -- Sets the number of data items to be transferred on the stream. -- The Data_Count parameter specifies the number of data items to be -- transferred (from 0 to 65535) on the next transfer. The value is -- as described for procedure Configure_Data_Flow. function Items_Transferred (This : DMA_Controller; Stream : DMA_Stream_Selector) return UInt16; -- Returns the number of items transferred. function Current_Items_Number (This : DMA_Controller; Stream : DMA_Stream_Selector) return UInt16 with Inline; -- Returns the value of the NDT register. Should not be used directly, -- as the meaning changes depending on transfer mode. rather use -- Items_Transferred(). function Circular_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector) return Boolean with Inline; type DMA_Channel_Selector is (Channel_0, Channel_1, Channel_2, Channel_3, Channel_4, Channel_5, Channel_6, Channel_7); function Selected_Channel (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Channel_Selector with Inline; type DMA_Data_Transfer_Direction is (Peripheral_To_Memory, Memory_To_Peripheral, Memory_To_Memory); function Transfer_Direction (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Data_Transfer_Direction with Inline; -- Note that DMA_1 and DMA_2 are able to do Memory_To_Memory transfers, -- and that in these directions the circular mode is not allowed and the -- internal FIFO must be enabled. type DMA_Data_Transfer_Widths is (Bytes, -- 8 bits HalfWords, -- 16 bits Words); -- 32 bits function Peripheral_Data_Width (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Data_Transfer_Widths with Inline; function Memory_Data_Width (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Data_Transfer_Widths with Inline; type DMA_Mode is (Normal_Mode, Peripheral_Flow_Control_Mode, Circular_Mode); function Operating_Mode (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Mode with Inline; type DMA_Priority_Level is (Priority_Low, Priority_Medium, Priority_High, Priority_Very_High); function Priority (This : DMA_Controller; Stream : DMA_Stream_Selector) return DMA_Priority_Level with Inline; type DMA_Memory_Burst is (Memory_Burst_Single, Memory_Burst_Inc4, Memory_Burst_Inc8, Memory_Burst_Inc16); type DMA_Peripheral_Burst is (Peripheral_Burst_Single, Peripheral_Burst_Inc4, Peripheral_Burst_Inc8, Peripheral_Burst_Inc16); type DMA_Stream_Configuration is record -- These are the static, non-varying properties of the transactions -- occurring on the streams to which they are applied (by a call to -- Configure). Other, varying, properties are specified procedurally. -- -- You are not required to specify a value for every component because -- some are only referenced depending on the values for others. Note, -- however, that the default values specified do not represent a valid -- configuration as a whole. Channel : DMA_Channel_Selector := DMA_Channel_Selector'First; -- The channel in the multiplexed connections of controllers, streams, -- and peripherals. It is vital to note that not all peripherals can -- be connected to all streams. The possibilities are organized by -- channels, per controller, as specified by the ST Micro Reference -- Manual RM0433 rev 7 Chapter 15.3.5 "DMA Request Mapping" tables. Direction : DMA_Data_Transfer_Direction := DMA_Data_Transfer_Direction'First; Increment_Peripheral_Address : Boolean := False; -- Whether the peripheral address value should be incremented -- automatically after each transfer Increment_Memory_Address : Boolean := False; -- Whether the memory address value should be incremented automatically -- after each transfer Peripheral_Data_Format : DMA_Data_Transfer_Widths := DMA_Data_Transfer_Widths'First; -- The units of data (the format) in which the peripheral side of the -- transaction is expressed. For example, a USART would work in terms -- of bytes. See the description in Configure_Data_Flow. Memory_Data_Format : DMA_Data_Transfer_Widths := DMA_Data_Transfer_Widths'First; -- The units of data (the format) in which the memory side of the -- transaction is expressed. See the description in Configure_Data_Flow. Operation_Mode : DMA_Mode := DMA_Mode'First; -- Note that the circular buffer mode cannot be used if memory-to-memory -- data transfer is configured on the selected Stream Priority : DMA_Priority_Level := DMA_Priority_Level'First; -- The relative priority of the given stream to all other streams Memory_Burst_Size : DMA_Memory_Burst := DMA_Memory_Burst'First; -- Specifies the amount of data to be transferred in a single non- -- interruptible transaction. Note: The burst mode is possible only if -- the address increment mode is enabled. Peripheral_Burst_Size : DMA_Peripheral_Burst := DMA_Peripheral_Burst'First; -- Specifies the the amount of data to be transferred in -- a single non-interruptible transaction. Note: The burst mode is -- possible only if the address increment mode is enabled. end record; procedure Configure (This : DMA_Controller; Stream : DMA_Stream_Selector; Config : DMA_Stream_Configuration) with Post => not Enabled (This, Stream); -- This is the primary stream configuration facility. All the static -- properties of the transfers for the given stream are specified here, -- and in some cases, nowhere else (such as the channel). The required -- relationships between the parameters specified in the record are -- not checked, other than by the hardware itself. -- -- Note that not all required properties are specified here. In particular, -- because they can vary per transfer, the source and destination -- addresses, as well as the number of data items to be transferred, -- are specified procedurally via calls to Configure_Data_Flow. function Valid_Addresses (Source, Destination : Address) return Boolean is (Source /= Null_Address and Destination /= Null_Address and Source /= Destination); -- Basic sanity checking for the values function Aligned (This : Address; Width : DMA_Data_Transfer_Widths) return Boolean with Inline; -- Returns whether the address is aligned on a word, half-word, or UInt8 -- boundary function Compatible_Alignments (This : DMA_Controller; Stream : DMA_Stream_Selector; Source : Address; Destination : Address) return Boolean is (case Transfer_Direction (This, Stream) is when Peripheral_To_Memory | Memory_To_Memory => Aligned (Source, Peripheral_Data_Width (This, Stream)) and Aligned (Destination, Memory_Data_Width (This, Stream)), when Memory_To_Peripheral => Aligned (Source, Memory_Data_Width (This, Stream)) and Aligned (Destination, Peripheral_Data_Width (This, Stream))); -- Based on Ref Manual Table 44 and associated text, checks the alignments -- of the addresses against the Peripheral_Data_Format (P_Data_Size) and -- Memory_Data_Format (M_Data_Size) values for the given stream. We use an -- expression function because the semantics are meant to be part of the -- spec of the package, visible as a precondition. private type DMA_Controller is new STM32_SVD.DMA.DMA_Peripheral; end STM32.DMA;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . T A S K _ I N F O -- -- -- -- B o d y -- -- -- -- Copyright (C) 2007-2020, 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the Windows (native) version of this module with System.OS_Interface; pragma Unreferenced (System.OS_Interface); -- System.OS_Interface is not used today, but the protocol between the -- run-time and the binder is that any tasking application uses -- System.OS_Interface, so notify the binder with this "with" clause. package body System.Task_Info is N_CPU : Natural := 0; pragma Atomic (N_CPU); -- Cache CPU number. Use pragma Atomic to avoid a race condition when -- setting N_CPU in Number_Of_Processors below. -------------------------- -- Number_Of_Processors -- -------------------------- function Number_Of_Processors return Positive is begin if N_CPU = 0 then declare SI : aliased Win32.SYSTEM_INFO; begin Win32.GetSystemInfo (SI'Access); N_CPU := Positive (SI.dwNumberOfProcessors); end; end if; return N_CPU; end Number_Of_Processors; end System.Task_Info;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Defining_Identifiers; with Program.Elements.Definitions; with Program.Elements.Formal_Type_Definitions; with Program.Elements.Aspect_Specifications; with Program.Elements.Formal_Type_Declarations; with Program.Element_Visitors; package Program.Nodes.Formal_Type_Declarations is pragma Preelaborate; type Formal_Type_Declaration is new Program.Nodes.Node and Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration and Program.Elements.Formal_Type_Declarations .Formal_Type_Declaration_Text with private; function Create (Type_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Discriminant_Part : Program.Elements.Definitions.Definition_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Definition : not null Program.Elements.Formal_Type_Definitions .Formal_Type_Definition_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Formal_Type_Declaration; type Implicit_Formal_Type_Declaration is new Program.Nodes.Node and Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration with private; function Create (Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Discriminant_Part : Program.Elements.Definitions.Definition_Access; Definition : not null Program.Elements.Formal_Type_Definitions .Formal_Type_Definition_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Formal_Type_Declaration with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Formal_Type_Declaration is abstract new Program.Nodes.Node and Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration with record Name : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; Discriminant_Part : Program.Elements.Definitions.Definition_Access; Definition : not null Program.Elements.Formal_Type_Definitions .Formal_Type_Definition_Access; Aspects : Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; end record; procedure Initialize (Self : in out Base_Formal_Type_Declaration'Class); overriding procedure Visit (Self : not null access Base_Formal_Type_Declaration; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Name (Self : Base_Formal_Type_Declaration) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access; overriding function Discriminant_Part (Self : Base_Formal_Type_Declaration) return Program.Elements.Definitions.Definition_Access; overriding function Definition (Self : Base_Formal_Type_Declaration) return not null Program.Elements.Formal_Type_Definitions .Formal_Type_Definition_Access; overriding function Aspects (Self : Base_Formal_Type_Declaration) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access; overriding function Is_Formal_Type_Declaration (Self : Base_Formal_Type_Declaration) return Boolean; overriding function Is_Declaration (Self : Base_Formal_Type_Declaration) return Boolean; type Formal_Type_Declaration is new Base_Formal_Type_Declaration and Program.Elements.Formal_Type_Declarations .Formal_Type_Declaration_Text with record Type_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Is_Token : not null Program.Lexical_Elements .Lexical_Element_Access; With_Token : Program.Lexical_Elements.Lexical_Element_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Formal_Type_Declaration_Text (Self : in out Formal_Type_Declaration) return Program.Elements.Formal_Type_Declarations .Formal_Type_Declaration_Text_Access; overriding function Type_Token (Self : Formal_Type_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Is_Token (Self : Formal_Type_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function With_Token (Self : Formal_Type_Declaration) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Semicolon_Token (Self : Formal_Type_Declaration) return not null Program.Lexical_Elements.Lexical_Element_Access; type Implicit_Formal_Type_Declaration is new Base_Formal_Type_Declaration with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; end record; overriding function To_Formal_Type_Declaration_Text (Self : in out Implicit_Formal_Type_Declaration) return Program.Elements.Formal_Type_Declarations .Formal_Type_Declaration_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Formal_Type_Declaration) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Formal_Type_Declaration) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Formal_Type_Declaration) return Boolean; end Program.Nodes.Formal_Type_Declarations;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . T E X T _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2017, 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Uart I/O for Raspberry PI 2 with System; with Interfaces.Raspberry_Pi; with System.Machine_Code; package body System.Text_IO is use Interfaces; use Interfaces.Raspberry_Pi; --------- -- Get -- --------- function Get return Character is begin return Character'Val (MU_IO); end Get; ---------------- -- Initialize -- ---------------- procedure Initialize is Sel : Unsigned_32; begin Initialized := True; -- Enable mini uart Aux_ENB := Aux_ENB or 1; -- 8 bit MU_LCR := 3; -- 115200 MU_BAUD := 270; -- Use GPIO 14 & 15 Sel := GPIO_Registers.GPFSEL1; -- GPIO14: alt5 Sel := Sel and not (7 * 2**12); Sel := Sel or (2 * 2**12); -- GPIO15: alt5 Sel := Sel and not (7 * 2**15); Sel := Sel or (2 * 2**15); GPIO_Registers.GPFSEL1 := Sel; -- Disable pull-up/down on all GPIOs. GPIO_Registers.GPPUD := 0; -- Clock pull-up for I in 1 .. 150 loop System.Machine_Code.Asm ("nop", Volatile => True); end loop; GPIO_Registers.GPPUDCLK0 := 2**14 + 2**15; for I in 1 .. 150 loop System.Machine_Code.Asm ("nop", Volatile => True); end loop; GPIO_Registers.GPPUDCLK0 := 0; -- Clear FIFO MU_IER := 6; -- Enable Tx and Rx MU_CNTL := 3; end Initialize; ----------------- -- Is_Rx_Ready -- ----------------- function Is_Rx_Ready return Boolean is begin return (MU_LSR and 16#01#) /= 0; end Is_Rx_Ready; ----------------- -- Is_Tx_Ready -- ----------------- function Is_Tx_Ready return Boolean is begin return (MU_LSR and 16#20#) /= 0; end Is_Tx_Ready; --------- -- Put -- --------- procedure Put (C : Character) is begin -- Send the character MU_IO := Character'Pos (C); end Put; ---------------------------- -- Use_Cr_Lf_For_New_Line -- ---------------------------- function Use_Cr_Lf_For_New_Line return Boolean is begin return True; end Use_Cr_Lf_For_New_Line; end System.Text_IO;
------------------------------------------------------------------------------ -- A d a r u n - t i m e s p e c i f i c a t i o n -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of ada.ads file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ with Ada.Strings.Wide_Wide_Maps; package Ada.Strings.Wide_Wide_Unbounded is pragma Preelaborate (Wide_Wide_Unbounded); type Unbounded_Wide_Wide_String is private; pragma Preelaborable_Initialization (Unbounded_Wide_Wide_String); Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String; function Length (Source : in Unbounded_Wide_Wide_String) return Natural; type Wide_Wide_String_Access is access all Wide_Wide_String; procedure Free (X : in out Wide_Wide_String_Access); -- Conversion, Concatenation, and Selection functions function To_Unbounded_Wide_Wide_String (Source : in Wide_Wide_String) return Unbounded_Wide_Wide_String; function To_Unbounded_Wide_Wide_String (Length : in Natural) return Unbounded_Wide_Wide_String; function To_Wide_Wide_String (Source : in Unbounded_Wide_Wide_String) return Wide_Wide_String; procedure Set_Unbounded_Wide_Wide_String (Target : out Unbounded_Wide_Wide_String; Source : in Wide_Wide_String); procedure Append (Source : in out Unbounded_Wide_Wide_String; New_Item : in Unbounded_Wide_Wide_String); procedure Append (Source : in out Unbounded_Wide_Wide_String; New_Item : in Wide_Wide_String); procedure Append (Source : in out Unbounded_Wide_Wide_String; New_Item : in Wide_Wide_Character); function "&" (Left, Right : in Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; function "&" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_String) return Unbounded_Wide_Wide_String; function "&" (Left : in Wide_Wide_String; Right : in Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; function "&" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_Character) return Unbounded_Wide_Wide_String; function "&" (Left : in Wide_Wide_Character; Right : in Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; function Element (Source : in Unbounded_Wide_Wide_String; Index : in Positive) return Wide_Wide_Character; procedure Replace_Element (Source : in out Unbounded_Wide_Wide_String; Index : in Positive; By : in Wide_Wide_Character); function Slice (Source : in Unbounded_Wide_Wide_String; Low : in Positive; High : in Natural) return Wide_Wide_String; function Unbounded_Slice (Source : in Unbounded_Wide_Wide_String; Low : in Positive; High : in Natural) return Unbounded_Wide_Wide_String; procedure Unbounded_Slice (Source : in Unbounded_Wide_Wide_String; Target : out Unbounded_Wide_Wide_String; Low : in Positive; High : in Natural); function "=" (Left, Right : in Unbounded_Wide_Wide_String) return Boolean; function "=" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_String) return Boolean; function "=" (Left : in Wide_Wide_String; Right : in Unbounded_Wide_Wide_String) return Boolean; function "<" (Left, Right : in Unbounded_Wide_Wide_String) return Boolean; function "<" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_String) return Boolean; function "<" (Left : in Wide_Wide_String; Right : in Unbounded_Wide_Wide_String) return Boolean; function "<=" (Left, Right : in Unbounded_Wide_Wide_String) return Boolean; function "<=" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_String) return Boolean; function "<=" (Left : in Wide_Wide_String; Right : in Unbounded_Wide_Wide_String) return Boolean; function ">" (Left, Right : in Unbounded_Wide_Wide_String) return Boolean; function ">" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_String) return Boolean; function ">" (Left : in Wide_Wide_String; Right : in Unbounded_Wide_Wide_String) return Boolean; function ">=" (Left, Right : in Unbounded_Wide_Wide_String) return Boolean; function ">=" (Left : in Unbounded_Wide_Wide_String; Right : in Wide_Wide_String) return Boolean; function ">=" (Left : in Wide_Wide_String; Right : in Unbounded_Wide_Wide_String) return Boolean; -- Search subprograms function Index (Source : in Unbounded_Wide_Wide_String; Pattern : in Wide_Wide_String; From : in Positive; Going : in Direction := Forward; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural; function Index (Source : in Unbounded_Wide_Wide_String; Pattern : in Wide_Wide_String; From : in Positive; Going : in Direction := Forward; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural; function Index (Source : in Unbounded_Wide_Wide_String; Pattern : in Wide_Wide_String; Going : in Direction := Forward; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural; function Index (Source : in Unbounded_Wide_Wide_String; Pattern : in Wide_Wide_String; Going : in Direction := Forward; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural; function Index (Source : in Unbounded_Wide_Wide_String; Set : in Wide_Wide_Maps.Wide_Wide_Character_Set; From : in Positive; Test : in Membership := Inside; Going : in Direction := Forward) return Natural; function Index (Source : in Unbounded_Wide_Wide_String; Set : in Wide_Wide_Maps.Wide_Wide_Character_Set; Test : in Membership := Inside; Going : in Direction := Forward) return Natural; function Index_Non_Blank (Source : in Unbounded_Wide_Wide_String; From : in Positive; Going : in Direction := Forward) return Natural; function Index_Non_Blank (Source : in Unbounded_Wide_Wide_String; Going : in Direction := Forward) return Natural; function Count (Source : in Unbounded_Wide_Wide_String; Pattern : in Wide_Wide_String; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural; function Count (Source : in Unbounded_Wide_Wide_String; Pattern : in Wide_Wide_String; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural; function Count (Source : in Unbounded_Wide_Wide_String; Set : in Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural; procedure Find_Token (Source : in Unbounded_Wide_Wide_String; Set : in Wide_Wide_Maps.Wide_Wide_Character_Set; Test : in Membership; First : out Positive; Last : out Natural); -- Wide_Wide_String translation subprograms function Translate (Source : in Unbounded_Wide_Wide_String; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping) return Unbounded_Wide_Wide_String; procedure Translate (Source : in out Unbounded_Wide_Wide_String; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping); function Translate (Source : in Unbounded_Wide_Wide_String; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Unbounded_Wide_Wide_String; procedure Translate (Source : in out Unbounded_Wide_Wide_String; Mapping : in Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function); -- Wide_Wide_String transformation subprograms function Replace_Slice (Source : in Unbounded_Wide_Wide_String; Low : in Positive; High : in Natural; By : in Wide_Wide_String) return Unbounded_Wide_Wide_String; procedure Replace_Slice (Source : in out Unbounded_Wide_Wide_String; Low : in Positive; High : in Natural; By : in Wide_Wide_String); function Insert (Source : in Unbounded_Wide_Wide_String; Before : in Positive; New_Item : in Wide_Wide_String) return Unbounded_Wide_Wide_String; procedure Insert (Source : in out Unbounded_Wide_Wide_String; Before : in Positive; New_Item : in Wide_Wide_String); function Overwrite (Source : in Unbounded_Wide_Wide_String; Position : in Positive; New_Item : in Wide_Wide_String) return Unbounded_Wide_Wide_String; procedure Overwrite (Source : in out Unbounded_Wide_Wide_String; Position : in Positive; New_Item : in Wide_Wide_String); function Delete (Source : in Unbounded_Wide_Wide_String; From : in Positive; Through : in Natural) return Unbounded_Wide_Wide_String; procedure Delete (Source : in out Unbounded_Wide_Wide_String; From : in Positive; Through : in Natural); function Trim (Source : in Unbounded_Wide_Wide_String; Side : in Trim_End) return Unbounded_Wide_Wide_String; procedure Trim (Source : in out Unbounded_Wide_Wide_String; Side : in Trim_End); function Trim (Source : in Unbounded_Wide_Wide_String; Left : in Wide_Wide_Maps.Wide_Wide_Character_Set; Right : in Wide_Wide_Maps.Wide_Wide_Character_Set) return Unbounded_Wide_Wide_String; procedure Trim (Source : in out Unbounded_Wide_Wide_String; Left : in Wide_Wide_Maps.Wide_Wide_Character_Set; Right : in Wide_Wide_Maps.Wide_Wide_Character_Set); function Head (Source : in Unbounded_Wide_Wide_String; Count : in Natural; Pad : in Wide_Wide_Character := Wide_Wide_Space) return Unbounded_Wide_Wide_String; procedure Head (Source : in out Unbounded_Wide_Wide_String; Count : in Natural; Pad : in Wide_Wide_Character := Wide_Wide_Space); function Tail (Source : in Unbounded_Wide_Wide_String; Count : in Natural; Pad : in Wide_Wide_Character := Wide_Wide_Space) return Unbounded_Wide_Wide_String; procedure Tail (Source : in out Unbounded_Wide_Wide_String; Count : in Natural; Pad : in Wide_Wide_Character := Wide_Wide_Space); function "*" (Left : in Natural; Right : in Wide_Wide_Character) return Unbounded_Wide_Wide_String; function "*" (Left : in Natural; Right : in Wide_Wide_String) return Unbounded_Wide_Wide_String; function "*" (Left : in Natural; Right : in Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; private pragma Import (Ada, Unbounded_Wide_Wide_String); pragma Import (Ada, Null_Unbounded_Wide_Wide_String); end Ada.Strings.Wide_Wide_Unbounded;
-- This package was generated by the Ada_Drivers_Library project wizard script package ADL_Config is Vendor : constant String := "STMicro"; -- From board definition Max_Mount_Points : constant := 2; -- From default value Max_Mount_Name_Length : constant := 128; -- From default value Runtime_Profile : constant String := "ravenscar-sfp"; -- From command line Device_Name : constant String := "STM32F429ZITx"; -- From board definition Device_Family : constant String := "STM32F4"; -- From board definition Runtime_Name : constant String := "ravenscar-sfp-stm32f429disco"; -- From default value Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition CPU_Core : constant String := "ARM Cortex-M4F"; -- From mcu definition Board : constant String := "STM32F429_Discovery"; -- From command line Has_ZFP_Runtime : constant String := "False"; -- From board definition Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition High_Speed_External_Clock : constant := 8000000; -- From board definition Max_Path_Length : constant := 1024; -- From default value Runtime_Name_Suffix : constant String := "stm32f429disco"; -- From board definition Architecture : constant String := "ARM"; -- From board definition end ADL_Config;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A reply action is an action that accepts a set of return values and a -- value containing return information produced by a previous accept call -- action. The reply action returns the values to the caller of the previous -- call, completing execution of the call. ------------------------------------------------------------------------------ with AMF.UML.Actions; limited with AMF.UML.Input_Pins.Collections; limited with AMF.UML.Triggers; package AMF.UML.Reply_Actions is pragma Preelaborate; type UML_Reply_Action is limited interface and AMF.UML.Actions.UML_Action; type UML_Reply_Action_Access is access all UML_Reply_Action'Class; for UML_Reply_Action_Access'Storage_Size use 0; not overriding function Get_Reply_To_Call (Self : not null access constant UML_Reply_Action) return AMF.UML.Triggers.UML_Trigger_Access is abstract; -- Getter of ReplyAction::replyToCall. -- -- The trigger specifying the operation whose call is being replied to. not overriding procedure Set_Reply_To_Call (Self : not null access UML_Reply_Action; To : AMF.UML.Triggers.UML_Trigger_Access) is abstract; -- Setter of ReplyAction::replyToCall. -- -- The trigger specifying the operation whose call is being replied to. not overriding function Get_Reply_Value (Self : not null access constant UML_Reply_Action) return AMF.UML.Input_Pins.Collections.Set_Of_UML_Input_Pin is abstract; -- Getter of ReplyAction::replyValue. -- -- A list of pins containing the reply values of the operation. These -- values are returned to the caller. not overriding function Get_Return_Information (Self : not null access constant UML_Reply_Action) return AMF.UML.Input_Pins.UML_Input_Pin_Access is abstract; -- Getter of ReplyAction::returnInformation. -- -- A pin containing the return information value produced by an earlier -- AcceptCallAction. not overriding procedure Set_Return_Information (Self : not null access UML_Reply_Action; To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is abstract; -- Setter of ReplyAction::returnInformation. -- -- A pin containing the return information value produced by an earlier -- AcceptCallAction. end AMF.UML.Reply_Actions;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.UML_Elements; with AMF.Standard_Profile_L2.Creates; with AMF.UML.Behavioral_Features; with AMF.UML.Usages; with AMF.Visitors; package AMF.Internals.Standard_Profile_L2_Creates is type Standard_Profile_L2_Create_Proxy is limited new AMF.Internals.UML_Elements.UML_Element_Base and AMF.Standard_Profile_L2.Creates.Standard_Profile_L2_Create with null record; overriding function Get_Base_Behavioral_Feature (Self : not null access constant Standard_Profile_L2_Create_Proxy) return AMF.UML.Behavioral_Features.UML_Behavioral_Feature_Access; -- Getter of Create::base_BehavioralFeature. -- overriding procedure Set_Base_Behavioral_Feature (Self : not null access Standard_Profile_L2_Create_Proxy; To : AMF.UML.Behavioral_Features.UML_Behavioral_Feature_Access); -- Setter of Create::base_BehavioralFeature. -- overriding function Get_Base_Usage (Self : not null access constant Standard_Profile_L2_Create_Proxy) return AMF.UML.Usages.UML_Usage_Access; -- Getter of Create::base_Usage. -- overriding procedure Set_Base_Usage (Self : not null access Standard_Profile_L2_Create_Proxy; To : AMF.UML.Usages.UML_Usage_Access); -- Setter of Create::base_Usage. -- overriding procedure Enter_Element (Self : not null access constant Standard_Profile_L2_Create_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); overriding procedure Leave_Element (Self : not null access constant Standard_Profile_L2_Create_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); overriding procedure Visit_Element (Self : not null access constant Standard_Profile_L2_Create_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); end AMF.Internals.Standard_Profile_L2_Creates;
with Ada.Text_IO, Ada.Containers.Vectors; procedure RPN_Calculator is package IIO is new Ada.Text_IO.Float_IO(Float); package Float_Vec is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Float); Stack: Float_Vec.Vector; Input: String := Ada.Text_IO.Get_Line; Cursor: Positive := Input'First; New_Cursor: Positive; begin loop -- read spaces while Cursor <= Input'Last and then Input(Cursor)=' ' loop Cursor := Cursor + 1; end loop; exit when Cursor > Input'Last; New_Cursor := Cursor; while New_Cursor <= Input'Last and then Input(New_Cursor) /= ' ' loop New_Cursor := New_Cursor + 1; end loop; -- try to read a number and push it to the stack declare Last: Positive; Value: Float; X, Y: Float; begin IIO.Get(From => Input(Cursor .. New_Cursor - 1), Item => Value, Last => Last); Stack.Append(Value); Cursor := New_Cursor; exception -- if reading the number fails, try to read an operator token when others => Y := Stack.Last_Element; Stack.Delete_Last; -- pick two elements X := Stack.Last_Element; Stack.Delete_Last; -- from the stack case Input(Cursor) is when '+' => Stack.Append(X+Y); when '-' => Stack.Append(X-Y); when '*' => Stack.Append(X*Y); when '/' => Stack.Append(X/Y); when '^' => Stack.Append(X ** Integer(Float'Rounding(Y))); when others => raise Program_Error with "unecpected token '" & Input(Cursor) & "' at column" & Integer'Image(Cursor); end case; Cursor := New_Cursor; end; for I in Stack.First_Index .. Stack.Last_Index loop Ada.Text_IO.Put(" "); IIO.Put(Stack.Element(I), Aft => 5, Exp => 0); end loop; Ada.Text_IO.New_Line; end loop; Ada.Text_IO.Put("Result = "); IIO.Put(Item => Stack.Last_Element, Aft => 5, Exp => 0); end RPN_Calculator;
-- Copyright 2014-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Pck; use Pck; procedure Foo is Result1 : Data_Type; GGG1 : GADataType'Class := GADataType'Class (Result1); begin Do_Nothing (GGG1'Address); -- BREAK end Foo;
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- with Ada.IO_Exceptions; package Ada.Streams.Stream_IO is pragma Preelaborate(Stream_IO); type Stream_Access is access all Root_Stream_Type'Class; type File_Type is limited private; type File_Mode is (In_File, Out_File, Append_File); type Count is range 0 .. implementation_defined; subtype Positive_Count is Count range 1 .. Count'Last; -- Index into file, in stream elements. procedure Create (File : in out File_Type; Mode : in File_Mode := Out_File; Name : in String := ""; Form : in String := ""); procedure Open (File : in out File_Type; Mode : in File_Mode; Name : in String; Form : in String := ""); procedure Close (File : in out File_Type); procedure Delete (File : in out File_Type); procedure Reset (File : in out File_Type; Mode : in File_Mode); procedure Reset (File : in out File_Type); function Mode (File : in File_Type) return File_Mode; function Name (File : in File_Type) return String; function Form (File : in File_Type) return String; function Is_Open (File : in File_Type) return Boolean; function End_Of_File (File : in File_Type) return Boolean; function Stream (File : in File_Type) return Stream_Access; -- Return stream access for use with T'Input and T'Output -- Read array of stream elements from file procedure Read (File : in File_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset; From : in Positive_Count); procedure Read (File : in File_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset); -- Write array of stream elements into file procedure Write (File : in File_Type; Item : in Stream_Element_Array; To : in Positive_Count); procedure Write (File : in File_Type; Item : in Stream_Element_Array); -- Operations on position within file procedure Set_Index(File : in File_Type; To : in Positive_Count); function Index(File : in File_Type) return Positive_Count; function Size (File : in File_Type) return Count; procedure Set_Mode(File : in out File_Type; Mode : in File_Mode); procedure Flush(File : in out File_Type); -- exceptions Status_Error : exception renames IO_Exceptions.Status_Error; Mode_Error : exception renames IO_Exceptions.Mode_Error; Name_Error : exception renames IO_Exceptions.Name_Error; Use_Error : exception renames IO_Exceptions.Use_Error; Device_Error : exception renames IO_Exceptions.Device_Error; End_Error : exception renames IO_Exceptions.End_Error; Data_Error : exception renames IO_Exceptions.Data_Error; private pragma Import (Ada, File_Type); end Ada.Streams.Stream_IO;
-- { dg-do run } with Init7; use Init7; with Text_IO; use Text_IO; with Dump; procedure S7 is A1 : R1 := My_R1; A2 : R2 := My_R2; N1 : Nested1; N2 : Nested2; C1 : Integer; C2 : Integer; C3 : Integer; begin Put ("A1 :"); Dump (A1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A1 : 78 56 34 12 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } Put ("A2 :"); Dump (A2'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } N1 := A1.N; C1 := N1.C1; C2 := N1.C2; C3 := N1.C3; Put_Line("C1 :" & C1'Img); -- { dg-output "C1 : 11206674.*\n" } Put_Line("C2 :" & C2'Img); -- { dg-output "C2 : 13434932.*\n" } Put_Line("C3 :" & C3'Img); -- { dg-output "C3 : 15663190.*\n" } N1.C1 := C1; N1.C2 := C2; N1.C3 := C3; A1.N := N1; N2 := A2.N; C1 := N2.C1; C2 := N2.C2; C3 := N2.C3; Put_Line("C1 :" & C1'Img); -- { dg-output "C1 : 11206674.*\n" } Put_Line("C2 :" & C2'Img); -- { dg-output "C2 : 13434932.*\n" } Put_Line("C3 :" & C3'Img); -- { dg-output "C3 : 15663190.*\n" } N2.C1 := C1; N2.C2 := C2; N2.C3 := C3; A2.N := N2; Put ("A1 :"); Dump (A1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A1 : 78 56 34 12 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } Put ("A2 :"); Dump (A2'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } end;
-- Copyright 2005 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -- MA 02110-1301, USA procedure P is type Index is (One, Two, Three); type Table is array (Integer range 1 .. 3) of Integer; type ETable is array (Index) of Integer; type RTable is array (Index range Two .. Three) of Integer; type UTable is array (Positive range <>) of Integer; type PTable is array (Index) of Boolean; pragma Pack (PTable); function Get_UTable (I : Integer) return UTable is begin return Utable'(1 => I, 2 => 2, 3 => 3); end Get_UTable; One_Two_Three : Table := (1, 2, 3); E_One_Two_Three : ETable := (1, 2, 3); R_Two_Three : RTable := (2, 3); U_One_Two_Three : UTable := Get_UTable (1); P_One_Two_Three : PTable := (False, True, True); Few_Reps : UTable := (1, 2, 3, 3, 3, 3, 3, 4, 5); Many_Reps : UTable := (1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5); Empty : array (1 .. 0) of Integer := (others => 0); begin One_Two_Three (1) := 4; -- START E_One_Two_Three (One) := 4; R_Two_Three (Two) := 4; U_One_Two_Three (U_One_Two_Three'First) := 4; P_One_Two_Three (One) := True; Few_Reps (Few_Reps'First) := 2; Many_Reps (Many_Reps'First) := 2; Empty := (others => 1); end P;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B B . B O A R D _ P A R A M E T E R S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2012, AdaCore -- -- -- -- 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- -- The port of GNARL to bare board targets was initially developed by the -- -- Real-Time Systems Group at the Technical University of Madrid. -- -- -- ------------------------------------------------------------------------------ -- This package defines board parameters for the powerpc 8349e. package System.BB.Board_Parameters is pragma Pure; IMMRBAR : constant := 16#ff40_0000#; CCSRBAR : constant := IMMRBAR; -- Address of the IMMRBAR. Unfortunately, this cannot be guessed -------------------- -- Hardware clock -- -------------------- Clock_Frequency : constant Positive := 264_000_000 / 4; -- Frequency of the system clock for the decrementer timer end System.BB.Board_Parameters;
-- part of AdaYaml, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "copying.txt" generic type Instance is limited new Refcount_Base with private; type Reference is tagged private; type Accessor (Data : not null access Instance) is limited private; with function Value (Object : Reference) return Accessor; with function Next (Object : in out Instance) return Event; package Yaml.Stream_Concept is pragma Warnings (Off, Next); pragma Warnings (Off, Value); -- to not burden ourselves with too much dynamic dispatching, we define a -- Stream as anything that is able to instantiate this package. any consumer -- of a stream shall take as generic parameter an instance of this package. end Yaml.Stream_Concept;
-- C45632A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT FOR PREDEFINED TYPE INTEGER, CONSTRAINT_ERROR -- IS RAISED FOR ABS (INTEGER'FIRST) IF -- -INTEGER'LAST > INTEGER'FIRST. -- *** NOTE: This test has been modified since ACVC version 1.11 to -- 9X -- *** remove incompatibilities associated with the transition -- 9X -- *** to Ada 9X. -- 9X -- *** -- 9X -- HISTORY: -- RJW 02/10/86 CREATED ORIGINAL TEST. -- JET 12/30/87 UPDATED HEADER FORMAT AND ADDED CODE TO -- PREVENT OPTIMIZATION. -- MRM 03/30/93 REMOVED NUMERIC ERROR FOR 9X COMPATIBILITY WITH REPORT; USE REPORT; PROCEDURE C45632A IS I : INTEGER := IDENT_INT (INTEGER'FIRST); BEGIN TEST ( "C45632A", "CHECK THAT FOR PREDEFINED TYPE INTEGER " & "CONSTRAINT_ERROR IS RAISED " & "FOR ABS (INTEGER'FIRST) IF -INTEGER'LAST > " & "INTEGER'FIRST" ); BEGIN IF - INTEGER'LAST > INTEGER'FIRST THEN BEGIN IF EQUAL (ABS I, I) THEN NULL; ELSE FAILED ( "WRONG RESULT FOR ABS" ); END IF; FAILED ( "EXCEPTION NOT RAISED" ); EXCEPTION WHEN CONSTRAINT_ERROR => COMMENT ( "CONSTRAINT_ERROR RAISED" ); WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED" ); END; ELSE COMMENT ( "-INTEGER'LAST <= INTEGER'FIRST" ); END IF; END; RESULT; END C45632A;
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Generic_CSHAKE; generic with package CSHAKE is new Keccak.Generic_CSHAKE(<>); package CSHAKE_Runner is procedure Run_Tests (File_Name : in String; Num_Passed : out Natural; Num_Failed : out Natural); end CSHAKE_Runner;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Declarations; with Program.Lexical_Elements; with Program.Elements.Defining_Identifiers; with Program.Elements.Known_Discriminant_Parts; with Program.Elements.Aspect_Specifications; with Program.Elements.Expressions; with Program.Elements.Task_Definitions; package Program.Elements.Task_Type_Declarations is pragma Pure (Program.Elements.Task_Type_Declarations); type Task_Type_Declaration is limited interface and Program.Elements.Declarations.Declaration; type Task_Type_Declaration_Access is access all Task_Type_Declaration'Class with Storage_Size => 0; not overriding function Name (Self : Task_Type_Declaration) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Access is abstract; not overriding function Discriminant_Part (Self : Task_Type_Declaration) return Program.Elements.Known_Discriminant_Parts .Known_Discriminant_Part_Access is abstract; not overriding function Aspects (Self : Task_Type_Declaration) return Program.Elements.Aspect_Specifications .Aspect_Specification_Vector_Access is abstract; not overriding function Progenitors (Self : Task_Type_Declaration) return Program.Elements.Expressions.Expression_Vector_Access is abstract; not overriding function Definition (Self : Task_Type_Declaration) return not null Program.Elements.Task_Definitions.Task_Definition_Access is abstract; type Task_Type_Declaration_Text is limited interface; type Task_Type_Declaration_Text_Access is access all Task_Type_Declaration_Text'Class with Storage_Size => 0; not overriding function To_Task_Type_Declaration_Text (Self : in out Task_Type_Declaration) return Task_Type_Declaration_Text_Access is abstract; not overriding function Task_Token (Self : Task_Type_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Type_Token (Self : Task_Type_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function With_Token (Self : Task_Type_Declaration_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Is_Token (Self : Task_Type_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function New_Token (Self : Task_Type_Declaration_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function With_Token_2 (Self : Task_Type_Declaration_Text) return Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Semicolon_Token (Self : Task_Type_Declaration_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Task_Type_Declarations;
pragma SPARK_Mode(ON); with Types; use Types; package gpsModule with SPARK_Mode is Top_Left : constant Types.Point := (667271.0, 6398091.0, 0.0); Bottom_Right : constant Types.Point := (677862.0, 6397724.0, 0.0); function gpstest(Position : Types.Point) return Boolean with Post => (if Gpstest'Result then (Position.X > Top_Left.X and Position.Y < Top_Left.Y and Position.X < Bottom_Right.X and Position.Y > Bottom_Right.Y)) and (if not Gpstest'Result then not (Position.X > Top_Left.X and Position.Y < Top_Left.Y and Position.X < Bottom_Right.X and Position.Y > Bottom_Right.Y)), Global => null; end gpsModule;
------------------------------------------------------------------------------ -- Copyright (c) 2015-2017, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Lithium.Line_Parsers provides a stream-based S-expression parser which -- -- reads the input stream line by line, to allow mixed content. -- ------------------------------------------------------------------------------ with Ada.Streams; with Natools.S_Expressions.Atom_Buffers; with Natools.S_Expressions.Parsers; package Lithium.Line_Parsers is pragma Preelaborate; procedure Append_Line (Line : in out Natools.S_Expressions.Atom_Buffers.Atom_Buffer; Source : in out Ada.Streams.Root_Stream_Type'Class; Finished : out Boolean); type Parser (Source : access Ada.Streams.Root_Stream_Type'Class) is limited new Natools.S_Expressions.Parsers.Parser with private; pragma Preelaborable_Initialization (Parser); overriding procedure Read_More (Self : in out Parser; Buffer : out Natools.S_Expressions.Atom_Buffers.Atom_Buffer); private type Parser (Source : access Ada.Streams.Root_Stream_Type'Class) is limited new Natools.S_Expressions.Parsers.Parser with null record; end Lithium.Line_Parsers;
package GPR_Tools is VERSION : constant String := "2.0.3"; end GPR_Tools;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 2000,2004 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000 -- Version Control -- $Revision: 1.5 $ -- $Date: 2004/08/21 21:37:00 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Interfaces.C; with System.Storage_Elements; with System.Address_To_Access_Conversions; with Ada.Text_IO; -- with Ada.Real_Time; use Ada.Real_Time; -- TODO is there a way to use Real_Time or Ada.Calendar in place of -- gettimeofday? -- Demonstrate pads. procedure ncurses2.demo_pad is type timestruct is record seconds : Integer; microseconds : Integer; end record; type myfunc is access function (w : Window) return Key_Code; function gettime return timestruct; procedure do_h_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Column_Position); procedure do_v_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Line_Position); function padgetch (win : Window) return Key_Code; function panner_legend (line : Line_Position) return Boolean; procedure panner_legend (line : Line_Position); procedure panner_h_cleanup (from_y : Line_Position; from_x : Column_Position; to_x : Column_Position); procedure panner_v_cleanup (from_y : Line_Position; from_x : Column_Position; to_y : Line_Position); procedure panner (pad : Window; top_xp : Column_Position; top_yp : Line_Position; portyp : Line_Position; portxp : Column_Position; pgetc : myfunc); function gettime return timestruct is retval : timestruct; use Interfaces.C; type timeval is record tv_sec : long; tv_usec : long; end record; pragma Convention (C, timeval); -- TODO function from_timeval is new Ada.Unchecked_Conversion( -- timeval_a, System.Storage_Elements.Integer_Address); -- should Interfaces.C.Pointers be used here? package myP is new System.Address_To_Access_Conversions (timeval); use myP; t : constant Object_Pointer := new timeval; function gettimeofday (TP : System.Storage_Elements.Integer_Address; TZP : System.Storage_Elements.Integer_Address) return int; pragma Import (C, gettimeofday, "gettimeofday"); tmp : int; begin tmp := gettimeofday (System.Storage_Elements.To_Integer (myP.To_Address (t)), System.Storage_Elements.To_Integer (myP.To_Address (null))); if tmp < 0 then retval.seconds := 0; retval.microseconds := 0; else retval.seconds := Integer (t.tv_sec); retval.microseconds := Integer (t.tv_usec); end if; return retval; end gettime; -- in C, The behavior of mvhline, mvvline for negative/zero length is -- unspecified, though we can rely on negative x/y values to stop the -- macro. Except Ada makes Line_Position(-1) = Natural - 1 so forget it. procedure do_h_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Column_Position) is begin if to > x then Move_Cursor (Line => y, Column => x); Horizontal_Line (Line_Size => Natural (to - x), Line_Symbol => c); end if; end do_h_line; procedure do_v_line (y : Line_Position; x : Column_Position; c : Attributed_Character; to : Line_Position) is begin if to > y then Move_Cursor (Line => y, Column => x); Vertical_Line (Line_Size => Natural (to - y), Line_Symbol => c); end if; end do_v_line; function padgetch (win : Window) return Key_Code is c : Key_Code; c2 : Character; begin c := Getchar (win); c2 := Code_To_Char (c); case c2 is when '!' => ShellOut (False); return Key_Refresh; when Character'Val (Character'Pos ('r') mod 16#20#) => -- CTRL('r') End_Windows; Refresh; return Key_Refresh; when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') return Key_Refresh; when 'U' => return Key_Cursor_Up; when 'D' => return Key_Cursor_Down; when 'R' => return Key_Cursor_Right; when 'L' => return Key_Cursor_Left; when '+' => return Key_Insert_Line; when '-' => return Key_Delete_Line; when '>' => return Key_Insert_Char; when '<' => return Key_Delete_Char; -- when ERR=> /* FALLTHRU */ when 'q' => return (Key_Exit); when others => return (c); end case; end padgetch; show_panner_legend : Boolean := True; function panner_legend (line : Line_Position) return Boolean is legend : constant array (0 .. 3) of String (1 .. 61) := ( "Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags) ", "Use ! to shell-out. Toggle legend:?, timer:t, scroll mark:s.", "Use +,- (or j,k) to grow/shrink the panner vertically. ", "Use <,> (or h,l) to grow/shrink the panner horizontally. "); legendsize : constant := 4; n : constant Integer := legendsize - Integer (Lines - line); begin if line < Lines and n >= 0 then Move_Cursor (Line => line, Column => 0); if show_panner_legend then Add (Str => legend (n)); end if; Clear_To_End_Of_Line; return show_panner_legend; end if; return False; end panner_legend; procedure panner_legend (line : Line_Position) is begin if not panner_legend (line) then Beep; end if; end panner_legend; procedure panner_h_cleanup (from_y : Line_Position; from_x : Column_Position; to_x : Column_Position) is begin if not panner_legend (from_y) then do_h_line (from_y, from_x, Blank2, to_x); end if; end panner_h_cleanup; procedure panner_v_cleanup (from_y : Line_Position; from_x : Column_Position; to_y : Line_Position) is begin if not panner_legend (from_y) then do_v_line (from_y, from_x, Blank2, to_y); end if; end panner_v_cleanup; procedure panner (pad : Window; top_xp : Column_Position; top_yp : Line_Position; portyp : Line_Position; portxp : Column_Position; pgetc : myfunc) is function f (y : Line_Position) return Line_Position; function f (x : Column_Position) return Column_Position; function greater (y1, y2 : Line_Position) return Integer; function greater (x1, x2 : Column_Position) return Integer; top_x : Column_Position := top_xp; top_y : Line_Position := top_yp; porty : Line_Position := portyp; portx : Column_Position := portxp; -- f[x] returns max[x - 1, 0] function f (y : Line_Position) return Line_Position is begin if y > 0 then return y - 1; else return y; -- 0 end if; end f; function f (x : Column_Position) return Column_Position is begin if x > 0 then return x - 1; else return x; -- 0 end if; end f; function greater (y1, y2 : Line_Position) return Integer is begin if y1 > y2 then return 1; else return 0; end if; end greater; function greater (x1, x2 : Column_Position) return Integer is begin if x1 > x2 then return 1; else return 0; end if; end greater; pymax : Line_Position; basey : Line_Position := 0; pxmax : Column_Position; basex : Column_Position := 0; c : Key_Code; scrollers : Boolean := True; before, after : timestruct; timing : Boolean := True; package floatio is new Ada.Text_IO.Float_IO (Long_Float); begin Get_Size (pad, pymax, pxmax); Allow_Scrolling (Mode => False); -- we don't want stdscr to scroll! c := Key_Refresh; loop -- During shell-out, the user may have resized the window. Adjust -- the port size of the pad to accommodate this. Ncurses -- automatically resizes all of the normal windows to fit on the -- new screen. if top_x > Columns then top_x := Columns; end if; if portx > Columns then portx := Columns; end if; if top_y > Lines then top_y := Lines; end if; if porty > Lines then porty := Lines; end if; case c is when Key_Refresh | Character'Pos ('?') => if c = Key_Refresh then Erase; else -- '?' show_panner_legend := not show_panner_legend; end if; panner_legend (Lines - 4); panner_legend (Lines - 3); panner_legend (Lines - 2); panner_legend (Lines - 1); when Character'Pos ('t') => timing := not timing; if not timing then panner_legend (Lines - 1); end if; when Character'Pos ('s') => scrollers := not scrollers; -- Move the top-left corner of the pad, keeping the -- bottom-right corner fixed. when Character'Pos ('h') => -- increase-columns: move left edge to left if top_x <= 0 then Beep; else panner_v_cleanup (top_y, top_x, porty); top_x := top_x - 1; end if; when Character'Pos ('j') => -- decrease-lines: move top-edge down if top_y >= porty then Beep; else if top_y /= 0 then panner_h_cleanup (top_y - 1, f (top_x), portx); end if; top_y := top_y + 1; end if; when Character'Pos ('k') => -- increase-lines: move top-edge up if top_y <= 0 then Beep; else top_y := top_y - 1; panner_h_cleanup (top_y, top_x, portx); end if; when Character'Pos ('l') => -- decrease-columns: move left-edge to right if top_x >= portx then Beep; else if top_x /= 0 then panner_v_cleanup (f (top_y), top_x - 1, porty); end if; top_x := top_x + 1; end if; -- Move the bottom-right corner of the pad, keeping the -- top-left corner fixed. when Key_Insert_Char => -- increase-columns: move right-edge to right if portx >= pxmax or portx >= Columns then Beep; else panner_v_cleanup (f (top_y), portx - 1, porty); portx := portx + 1; -- C had ++portx instead of portx++, weird. end if; when Key_Insert_Line => -- increase-lines: move bottom-edge down if porty >= pymax or porty >= Lines then Beep; else panner_h_cleanup (porty - 1, f (top_x), portx); porty := porty + 1; end if; when Key_Delete_Char => -- decrease-columns: move bottom edge up if portx <= top_x then Beep; else portx := portx - 1; panner_v_cleanup (f (top_y), portx, porty); end if; when Key_Delete_Line => -- decrease-lines if porty <= top_y then Beep; else porty := porty - 1; panner_h_cleanup (porty, f (top_x), portx); end if; when Key_Cursor_Left => -- pan leftwards if basex > 0 then basex := basex - 1; else Beep; end if; when Key_Cursor_Right => -- pan rightwards -- if (basex + portx - (pymax > porty) < pxmax) if basex + portx - Column_Position (greater (pymax, porty)) < pxmax then -- if basex + portx < pxmax or -- (pymax > porty and basex + portx - 1 < pxmax) then basex := basex + 1; else Beep; end if; when Key_Cursor_Up => -- pan upwards if basey > 0 then basey := basey - 1; else Beep; end if; when Key_Cursor_Down => -- pan downwards -- same as if (basey + porty - (pxmax > portx) < pymax) if basey + porty - Line_Position (greater (pxmax, portx)) < pymax then -- if (basey + porty < pymax) or -- (pxmax > portx and basey + porty - 1 < pymax) then basey := basey + 1; else Beep; end if; when Character'Pos ('H') | Key_Home | Key_Find => basey := 0; when Character'Pos ('E') | Key_End | Key_Select => if pymax < porty then basey := 0; else basey := pymax - porty; end if; when others => Beep; end case; -- more writing off the screen. -- Interestingly, the exception is not handled if -- we put a block around this. -- delcare --begin if top_y /= 0 and top_x /= 0 then Add (Line => top_y - 1, Column => top_x - 1, Ch => ACS_Map (ACS_Upper_Left_Corner)); end if; if top_x /= 0 then do_v_line (top_y, top_x - 1, ACS_Map (ACS_Vertical_Line), porty); end if; if top_y /= 0 then do_h_line (top_y - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); end if; -- exception when Curses_Exception => null; end; -- in C was ... pxmax > portx - 1 if scrollers and pxmax >= portx then declare length : constant Column_Position := portx - top_x - 1; lowend, highend : Column_Position; begin -- Instead of using floats, I'll use integers only. lowend := top_x + (basex * length) / pxmax; highend := top_x + ((basex + length) * length) / pxmax; do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), lowend); if highend < portx then Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => True); do_h_line (porty - 1, lowend, Blank2, highend + 1); Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => False); do_h_line (porty - 1, highend + 1, ACS_Map (ACS_Horizontal_Line), portx); end if; end; else do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); end if; if scrollers and pymax >= porty then declare length : constant Line_Position := porty - top_y - 1; lowend, highend : Line_Position; begin lowend := top_y + (basey * length) / pymax; highend := top_y + ((basey + length) * length) / pymax; do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), lowend); if highend < porty then Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => True); do_v_line (lowend, portx - 1, Blank2, highend + 1); Switch_Character_Attribute (Attr => (Reverse_Video => True, others => False), On => False); do_v_line (highend + 1, portx - 1, ACS_Map (ACS_Vertical_Line), porty); end if; end; else do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), porty); end if; if top_y /= 0 then Add (Line => top_y - 1, Column => portx - 1, Ch => ACS_Map (ACS_Upper_Right_Corner)); end if; if top_x /= 0 then Add (Line => porty - 1, Column => top_x - 1, Ch => ACS_Map (ACS_Lower_Left_Corner)); end if; declare begin -- Here is another place where it is possible -- to write to the corner of the screen. Add (Line => porty - 1, Column => portx - 1, Ch => ACS_Map (ACS_Lower_Right_Corner)); exception when Curses_Exception => null; end; before := gettime; Refresh_Without_Update; declare -- the C version allows the panel to have a zero height -- wich raise the exception begin Refresh_Without_Update ( pad, basey, basex, top_y, top_x, porty - Line_Position (greater (pxmax, portx)) - 1, portx - Column_Position (greater (pymax, porty)) - 1); exception when Curses_Exception => null; end; Update_Screen; if timing then declare s : String (1 .. 7); elapsed : Long_Float; begin after := gettime; elapsed := (Long_Float (after.seconds - before.seconds) + Long_Float (after.microseconds - before.microseconds) / 1.0e6); Move_Cursor (Line => Lines - 1, Column => Columns - 20); floatio.Put (s, elapsed, Aft => 3, Exp => 0); Add (Str => s); Refresh; end; end if; c := pgetc (pad); exit when c = Key_Exit; end loop; Allow_Scrolling (Mode => True); end panner; Gridsize : constant := 3; Gridcount : Integer := 0; Pad_High : constant Line_Count := 200; Pad_Wide : constant Column_Count := 200; panpad : Window := New_Pad (Pad_High, Pad_Wide); begin if panpad = Null_Window then Cannot ("cannot create requested pad"); return; end if; for i in 0 .. Pad_High - 1 loop for j in 0 .. Pad_Wide - 1 loop if i mod Gridsize = 0 and j mod Gridsize = 0 then if i = 0 or j = 0 then Add (panpad, '+'); else -- depends on ASCII? Add (panpad, Ch => Character'Val (Character'Pos ('A') + Gridcount mod 26)); Gridcount := Gridcount + 1; end if; elsif i mod Gridsize = 0 then Add (panpad, '-'); elsif j mod Gridsize = 0 then Add (panpad, '|'); else declare -- handle the write to the lower right corner error begin Add (panpad, ' '); exception when Curses_Exception => null; end; end if; end loop; end loop; panner_legend (Lines - 4); panner_legend (Lines - 3); panner_legend (Lines - 2); panner_legend (Lines - 1); Set_KeyPad_Mode (panpad, True); -- Make the pad (initially) narrow enough that a trace file won't wrap. -- We'll still be able to widen it during a test, since that's required -- for testing boundaries. panner (panpad, 2, 2, Lines - 5, Columns - 15, padgetch'Access); Delete (panpad); End_Windows; -- Hmm, Erase after End_Windows Erase; end ncurses2.demo_pad;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName/> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>call_Loop_LB2D_shift</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>slice_stream_V_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>in_stream.V.value.V</originalName> <rtlName/> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>24</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>out_stream_V_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>out_stream.V.value.V</originalName> <rtlName/> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>72</bitwidth> </Value> <direction>1</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>36</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>3</id> <name>buffer_1_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>buffer[1].value.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>62</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>4</id> <name>buffer_0_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>buffer[0].value.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>63</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>9</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>64</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>11</id> <name>n1</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>n1</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>65</item> <item>66</item> <item>68</item> <item>69</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>12</id> <name>tmp_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second class_id="12" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="13" tracking_level="0" version="0"> <first class_id="14" tracking_level="0" version="0"> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_1_fu_113_p2</rtlName> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>70</item> <item>72</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>14</id> <name>n1_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName>n1</originalName> <rtlName>n1_1_fu_119_p2</rtlName> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>73</item> <item>75</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>15</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>76</item> <item>77</item> <item>78</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>19</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>92</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>21</id> <name>i_0_i_i</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>i</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>80</item> <item>81</item> <item>82</item> <item>83</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>22</id> <name>tmp_3</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_3_fu_125_p2</rtlName> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>84</item> <item>86</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>24</id> <name>i</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName>i</originalName> <rtlName>i_fu_131_p2</rtlName> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>87</item> <item>88</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>25</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>89</item> <item>90</item> <item>91</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>30</id> <name>tmp_value_V_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>40</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>100</item> <item>101</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>31</id> <name>tmp</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>42</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_fu_137_p4</rtlName> <coreName/> </Obj> <bitwidth>10</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>103</item> <item>104</item> <item>105</item> <item>107</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>32</id> <name>icmp</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>42</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>icmp_fu_147_p2</rtlName> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>108</item> <item>110</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>33</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>42</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>111</item> <item>112</item> <item>113</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>35</id> <name>buffer_1_value_V_lo_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>114</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>36</id> <name>buffer_0_value_V_lo</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>115</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>37</id> <name>tmp_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_2_fu_159_p1</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>116</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>38</id> <name>tmp_4</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_4_fu_163_p1</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>117</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>39</id> <name>tmp_5</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_5_fu_167_p1</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>118</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>40</id> <name>p_Result_5_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>p_Result_5_1_fu_171_p4</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>120</item> <item>121</item> <item>123</item> <item>125</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>41</id> <name>p_Result_5_1_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>p_Result_5_1_1_fu_181_p4</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>126</item> <item>127</item> <item>128</item> <item>129</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>42</id> <name>p_Result_5_1_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>p_Result_5_1_2_fu_191_p4</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>130</item> <item>131</item> <item>132</item> <item>133</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>43</id> <name>p_Result_5_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>p_Result_5_2_fu_201_p4</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>134</item> <item>135</item> <item>137</item> <item>139</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>44</id> <name>p_Result_5_2_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>p_Result_5_2_1_fu_211_p4</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>140</item> <item>141</item> <item>142</item> <item>143</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>45</id> <name>p_Result_5_2_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>p_Result_5_2_2_fu_221_p4</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>144</item> <item>145</item> <item>146</item> <item>147</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>46</id> <name>tmp_value_V</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName>out_stream_V_value_V_din</rtlName> <coreName/> </Obj> <bitwidth>72</bitwidth> </Value> <oprand_edges> <count>10</count> <item_version>0</item_version> <item>149</item> <item>150</item> <item>151</item> <item>152</item> <item>153</item> <item>154</item> <item>155</item> <item>156</item> <item>157</item> <item>158</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>47</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>52</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>160</item> <item>161</item> <item>162</item> </oprand_edges> <opcode>write</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>48</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>53</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>53</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>163</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>50</id> <name>buffer_1_value_V_lo</name> <fileName>../../../lib_files/Stencil.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>75</lineNumber> <contextFuncName>operator=</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>3</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>37</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> <item> <first> <first>../../../lib_files/Stencil.h</first> <second>operator=</second> </first> <second>75</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>93</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>52</id> <name/> <fileName>../../../lib_files/Stencil.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>75</lineNumber> <contextFuncName>operator=</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>3</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>37</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> <item> <first> <first>../../../lib_files/Stencil.h</first> <second>operator=</second> </first> <second>75</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>94</item> <item>95</item> <item>278</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>53</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>40</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>96</item> <item>97</item> <item>276</item> <item>277</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>54</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;1920, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>98</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>57</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>79</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>59</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_39"> <Value> <Obj> <type>2</type> <id>61</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_40"> <Value> <Obj> <type>2</type> <id>67</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_41"> <Value> <Obj> <type>2</type> <id>71</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1078</content> </item> <item class_id_reference="16" object_id="_42"> <Value> <Obj> <type>2</type> <id>74</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_43"> <Value> <Obj> <type>2</type> <id>85</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1920</content> </item> <item class_id_reference="16" object_id="_44"> <Value> <Obj> <type>2</type> <id>106</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>10</content> </item> <item class_id_reference="16" object_id="_45"> <Value> <Obj> <type>2</type> <id>109</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>10</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_46"> <Value> <Obj> <type>2</type> <id>122</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>8</content> </item> <item class_id_reference="16" object_id="_47"> <Value> <Obj> <type>2</type> <id>124</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>15</content> </item> <item class_id_reference="16" object_id="_48"> <Value> <Obj> <type>2</type> <id>136</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>16</content> </item> <item class_id_reference="16" object_id="_49"> <Value> <Obj> <type>2</type> <id>138</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>23</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_50"> <Obj> <type>3</type> <id>10</id> <name>newFuncRoot</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>3</count> <item_version>0</item_version> <item>3</item> <item>4</item> <item>9</item> </node_objs> </item> <item class_id_reference="18" object_id="_51"> <Obj> <type>3</type> <id>16</id> <name>.preheader</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>11</item> <item>12</item> <item>14</item> <item>15</item> </node_objs> </item> <item class_id_reference="18" object_id="_52"> <Obj> <type>3</type> <id>20</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>19</item> </node_objs> </item> <item class_id_reference="18" object_id="_53"> <Obj> <type>3</type> <id>26</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>21</item> <item>22</item> <item>24</item> <item>25</item> </node_objs> </item> <item class_id_reference="18" object_id="_54"> <Obj> <type>3</type> <id>34</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>30</item> <item>31</item> <item>32</item> <item>33</item> </node_objs> </item> <item class_id_reference="18" object_id="_55"> <Obj> <type>3</type> <id>49</id> <name>.preheader.i.i.preheader.0</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>14</count> <item_version>0</item_version> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> </node_objs> </item> <item class_id_reference="18" object_id="_56"> <Obj> <type>3</type> <id>55</id> <name>._crit_edge.i.i</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>50</item> <item>52</item> <item>53</item> <item>54</item> </node_objs> </item> <item class_id_reference="18" object_id="_57"> <Obj> <type>3</type> <id>58</id> <name>linebuffer_1D&lt;1920ul, 3ul, 1ul, 1ul, 1ul, 3ul, unsigned char&gt;.exit</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>57</item> </node_objs> </item> <item class_id_reference="18" object_id="_58"> <Obj> <type>3</type> <id>60</id> <name>.exitStub</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>59</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>91</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_59"> <id>62</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>3</sink_obj> </item> <item class_id_reference="20" object_id="_60"> <id>63</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>4</sink_obj> </item> <item class_id_reference="20" object_id="_61"> <id>64</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>9</sink_obj> </item> <item class_id_reference="20" object_id="_62"> <id>65</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_63"> <id>66</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_64"> <id>68</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_65"> <id>69</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_66"> <id>70</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_67"> <id>72</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_68"> <id>73</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_69"> <id>75</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_70"> <id>76</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_71"> <id>77</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_72"> <id>78</id> <edge_type>2</edge_type> <source_obj>60</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_73"> <id>79</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_74"> <id>80</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_75"> <id>81</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_76"> <id>82</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_77"> <id>83</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_78"> <id>84</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_79"> <id>86</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_80"> <id>87</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_81"> <id>88</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_82"> <id>89</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_83"> <id>90</id> <edge_type>2</edge_type> <source_obj>34</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_84"> <id>91</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_85"> <id>92</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_86"> <id>93</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_87"> <id>94</id> <edge_type>1</edge_type> <source_obj>50</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_88"> <id>95</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_89"> <id>96</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_90"> <id>97</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_91"> <id>98</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_92"> <id>101</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_93"> <id>104</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_94"> <id>105</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_95"> <id>107</id> <edge_type>1</edge_type> <source_obj>106</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_96"> <id>108</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_97"> <id>110</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_98"> <id>111</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_99"> <id>112</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_100"> <id>113</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_101"> <id>114</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_102"> <id>115</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_103"> <id>116</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_104"> <id>117</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_105"> <id>118</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_106"> <id>121</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_107"> <id>123</id> <edge_type>1</edge_type> <source_obj>122</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_108"> <id>125</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_109"> <id>127</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_110"> <id>128</id> <edge_type>1</edge_type> <source_obj>122</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_111"> <id>129</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_112"> <id>131</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_113"> <id>132</id> <edge_type>1</edge_type> <source_obj>122</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_114"> <id>133</id> <edge_type>1</edge_type> <source_obj>124</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_115"> <id>135</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_116"> <id>137</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_117"> <id>139</id> <edge_type>1</edge_type> <source_obj>138</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_118"> <id>141</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_119"> <id>142</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_120"> <id>143</id> <edge_type>1</edge_type> <source_obj>138</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_121"> <id>145</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_122"> <id>146</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_123"> <id>147</id> <edge_type>1</edge_type> <source_obj>138</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_124"> <id>150</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_125"> <id>151</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_126"> <id>152</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_127"> <id>153</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_128"> <id>154</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_129"> <id>155</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_130"> <id>156</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_131"> <id>157</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_132"> <id>158</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_133"> <id>161</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_134"> <id>162</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_135"> <id>163</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_136"> <id>265</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_137"> <id>266</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_138"> <id>267</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_139"> <id>268</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_140"> <id>269</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_141"> <id>270</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_142"> <id>271</id> <edge_type>2</edge_type> <source_obj>34</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_143"> <id>272</id> <edge_type>2</edge_type> <source_obj>34</source_obj> <sink_obj>49</sink_obj> </item> <item class_id_reference="20" object_id="_144"> <id>273</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_145"> <id>274</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_146"> <id>275</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_147"> <id>276</id> <edge_type>4</edge_type> <source_obj>50</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_148"> <id>277</id> <edge_type>4</edge_type> <source_obj>35</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_149"> <id>278</id> <edge_type>4</edge_type> <source_obj>36</source_obj> <sink_obj>52</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_150"> <mId>1</mId> <mTag>call_Loop_LB2D_shift</mTag> <mType>0</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>7</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>2072995</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_151"> <mId>2</mId> <mTag>Entry</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>10</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_152"> <mId>3</mId> <mTag>LB2D_shift</mTag> <mType>1</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>4</item> <item>5</item> <item>6</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>1078</mMinTripCount> <mMaxTripCount>1078</mMaxTripCount> <mMinLatency>2072994</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_153"> <mId>4</mId> <mTag>Region 1</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>16</item> <item>20</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_154"> <mId>5</mId> <mTag>LB1D_shiftreg</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>4</count> <item_version>0</item_version> <item>26</item> <item>34</item> <item>49</item> <item>55</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>1920</mMinTripCount> <mMaxTripCount>1920</mMaxTripCount> <mMinLatency>1920</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_155"> <mId>6</mId> <mTag>Region 2</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>58</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_156"> <mId>7</mId> <mTag>Return</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>60</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_157"> <states class_id="25" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_158"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_159"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_160"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_161"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_162"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_163"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_164"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_165"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_166"> <id>2</id> <operations> <count>9</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_167"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_168"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_169"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_170"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_171"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_172"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_173"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_174"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_175"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_176"> <id>3</id> <operations> <count>8</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_177"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_178"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_179"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_180"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_181"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_182"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_183"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_184"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_185"> <id>4</id> <operations> <count>23</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_186"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_187"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_188"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_189"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_190"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_191"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_192"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_193"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_194"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_195"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_196"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_197"> <id>42</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_198"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_199"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_200"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_201"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_202"> <id>47</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_203"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_204"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_205"> <id>51</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_206"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_207"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_208"> <id>54</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_209"> <id>5</id> <operations> <count>2</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_210"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_211"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_212"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>30</id> <sop class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_213"> <inState>2</inState> <outState>3</outState> <condition> <id>32</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item class_id="34" tracking_level="0" version="0"> <first class_id="35" tracking_level="0" version="0"> <first>12</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_214"> <inState>5</inState> <outState>2</outState> <condition> <id>40</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_215"> <inState>4</inState> <outState>3</outState> <condition> <id>42</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_216"> <inState>3</inState> <outState>5</outState> <condition> <id>41</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>22</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_217"> <inState>3</inState> <outState>4</outState> <condition> <id>43</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>22</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="36" tracking_level="1" version="0" object_id="_218"> <dp_component_resource class_id="37" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_resource> <dp_expression_resource> <count>10</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>ap_block_pp0_stage0_flag00001001 ( and ) </first> <second class_id="39" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="40" tracking_level="0" version="0"> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>ap_block_state1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>ap_block_state4_pp0_stage0_iter1 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>ap_enable_pp0 ( xor ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>2</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter1 ( xor ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>2</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>i_fu_131_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>11</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>38</second> </item> <item> <first>LUT</first> <second>16</second> </item> </second> </item> <item> <first>icmp_fu_147_p2 ( icmp ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>10</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>5</second> </item> </second> </item> <item> <first>n1_1_fu_119_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>11</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>38</second> </item> <item> <first>LUT</first> <second>16</second> </item> </second> </item> <item> <first>tmp_1_fu_113_p2 ( icmp ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>11</second> </item> <item> <first>(1P1)</first> <second>11</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>6</second> </item> </second> </item> <item> <first>tmp_3_fu_125_p2 ( icmp ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>11</second> </item> <item> <first>(1P1)</first> <second>9</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>6</second> </item> </second> </item> </dp_expression_resource> <dp_fifo_resource> <count>0</count> <item_version>0</item_version> </dp_fifo_resource> <dp_memory_resource> <count>0</count> <item_version>0</item_version> </dp_memory_resource> <dp_multiplexer_resource> <count>7</count> <item_version>0</item_version> <item> <first>ap_NS_fsm</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>5</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>5</second> </item> <item> <first>LUT</first> <second>27</second> </item> </second> </item> <item> <first>ap_done</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>3</second> </item> <item> <first>LUT</first> <second>15</second> </item> </second> </item> <item> <first>i_0_i_i_reg_102</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>11</second> </item> <item> <first>(2Count)</first> <second>22</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>n1_reg_91</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>11</second> </item> <item> <first>(2Count)</first> <second>22</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>out_stream_V_value_V_blk_n</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>slice_stream_V_value_V_blk_n</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>2</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> </dp_multiplexer_resource> <dp_register_resource> <count>11</count> <item_version>0</item_version> <item> <first>ap_CS_fsm</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>4</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>4</second> </item> </second> </item> <item> <first>ap_done_reg</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>buffer_0_value_V_fu_74</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>24</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>24</second> </item> </second> </item> <item> <first>buffer_1_value_V_fu_70</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>24</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>24</second> </item> </second> </item> <item> <first>i_0_i_i_reg_102</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>11</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>11</second> </item> </second> </item> <item> <first>icmp_reg_298</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>n1_1_reg_284</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>11</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>11</second> </item> </second> </item> <item> <first>n1_reg_91</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>11</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>11</second> </item> </second> </item> <item> <first>tmp_3_reg_289</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> </dp_register_resource> <dp_component_map class_id="41" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_map> <dp_expression_map> <count>5</count> <item_version>0</item_version> <item class_id="42" tracking_level="0" version="0"> <first>i_fu_131_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>icmp_fu_147_p2 ( icmp ) </first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>n1_1_fu_119_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>tmp_1_fu_113_p2 ( icmp ) </first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>tmp_3_fu_125_p2 ( icmp ) </first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> </dp_expression_map> <dp_fifo_map> <count>0</count> <item_version>0</item_version> </dp_fifo_map> <dp_memory_map> <count>0</count> <item_version>0</item_version> </dp_memory_map> </res> <node_label_latency class_id="43" tracking_level="0" version="0"> <count>36</count> <item_version>0</item_version> <item class_id="44" tracking_level="0" version="0"> <first>3</first> <second class_id="45" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>4</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>53</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>54</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>1</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="46" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="47" tracking_level="0" version="0"> <first>10</first> <second class_id="48" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>20</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>26</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>34</first> <second> <first>2</first> <second>3</second> </second> </item> <item> <first>49</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>55</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>58</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>60</first> <second> <first>1</first> <second>1</second> </second> </item> </bblk_ent_exit> <regions class_id="49" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="50" tracking_level="1" version="0" object_id="_219"> <region_name>LB1D_shiftreg</region_name> <basic_blocks> <count>4</count> <item_version>0</item_version> <item>26</item> <item>34</item> <item>49</item> <item>55</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>2</pipe_depth> </item> </regions> <dp_fu_nodes class_id="51" tracking_level="0" version="0"> <count>27</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>70</first> <second> <count>1</count> <item_version>0</item_version> <item>3</item> </second> </item> <item> <first>74</first> <second> <count>1</count> <item_version>0</item_version> <item>4</item> </second> </item> <item> <first>78</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>84</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>95</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>106</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>113</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>119</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>125</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>131</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>137</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>147</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>153</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>156</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>159</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>163</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>167</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>171</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>181</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>191</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>201</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>211</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>221</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>231</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> <item> <first>254</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>262</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="54" tracking_level="0" version="0"> <count>20</count> <item_version>0</item_version> <item class_id="55" tracking_level="0" version="0"> <first>buffer_0_value_V_fu_74</first> <second> <count>1</count> <item_version>0</item_version> <item>4</item> </second> </item> <item> <first>buffer_1_value_V_fu_70</first> <second> <count>1</count> <item_version>0</item_version> <item>3</item> </second> </item> <item> <first>i_0_i_i_phi_fu_106</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>i_fu_131</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>icmp_fu_147</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>n1_1_fu_119</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>n1_phi_fu_95</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>p_Result_5_1_1_fu_181</first> <second> <count>1</count> <item_version>0</item_version> <item>41</item> </second> </item> <item> <first>p_Result_5_1_2_fu_191</first> <second> <count>1</count> <item_version>0</item_version> <item>42</item> </second> </item> <item> <first>p_Result_5_1_fu_171</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>p_Result_5_2_1_fu_211</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>p_Result_5_2_2_fu_221</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>p_Result_5_2_fu_201</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>tmp_1_fu_113</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>tmp_2_fu_159</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>tmp_3_fu_125</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>tmp_4_fu_163</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>tmp_5_fu_167</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>tmp_fu_137</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>tmp_value_V_fu_231</first> <second> <count>1</count> <item_version>0</item_version> <item>46</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>7</count> <item_version>0</item_version> <item> <first>StgValue_46_write_fu_84</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> <item> <first>StgValue_50_store_fu_257</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>StgValue_51_store_fu_262</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>buffer_0_value_V_lo_load_fu_156</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>buffer_1_value_V_lo_1_load_fu_153</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>buffer_1_value_V_lo_load_fu_254</first> <second> <count>1</count> <item_version>0</item_version> <item>50</item> </second> </item> <item> <first>tmp_value_V_1_read_fu_78</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="56" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>9</count> <item_version>0</item_version> <item> <first>91</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>102</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>267</first> <second> <count>1</count> <item_version>0</item_version> <item>3</item> </second> </item> <item> <first>274</first> <second> <count>1</count> <item_version>0</item_version> <item>4</item> </second> </item> <item> <first>280</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>284</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>289</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>293</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>298</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>9</count> <item_version>0</item_version> <item> <first>buffer_0_value_V_reg_274</first> <second> <count>1</count> <item_version>0</item_version> <item>4</item> </second> </item> <item> <first>buffer_1_value_V_reg_267</first> <second> <count>1</count> <item_version>0</item_version> <item>3</item> </second> </item> <item> <first>i_0_i_i_reg_102</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>i_reg_293</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>icmp_reg_298</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>n1_1_reg_284</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>n1_reg_91</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>tmp_1_reg_280</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> <item> <first>tmp_3_reg_289</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>2</count> <item_version>0</item_version> <item> <first>91</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> <item> <first>102</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>2</count> <item_version>0</item_version> <item> <first>i_0_i_i_reg_102</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>n1_reg_91</first> <second> <count>1</count> <item_version>0</item_version> <item>11</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="57" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="58" tracking_level="0" version="0"> <first>out_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>write</first> <second> <count>1</count> <item_version>0</item_version> <item>47</item> </second> </item> </second> </item> <item> <first>slice_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="59" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>1</first> <second>FIFO_SRL</second> </item> <item> <first>2</first> <second>FIFO_SRL</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
-- Copyright 2019-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pack is procedure Do_Nothing (S : String); end Pack;
-- C95078A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT AN EXCEPTION RAISED DURING THE EXECUTION OF AN ACCEPT -- STATEMENT CAN BE HANDLED WITHIN THE ACCEPT BODY. -- *** NOTE: This test has been modified since ACVC version 1.11 to -- 9X -- *** remove incompatibilities associated with the transition -- 9X -- *** to Ada 9X. -- 9X -- *** -- 9X -- HISTORY: -- DHH 03/21/88 CREATED ORIGINAL TEST. -- MRM 03/30/93 REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY WITH REPORT; USE REPORT; PROCEDURE C95078A IS BEGIN TEST("C95078A", "CHECK THAT AN EXCEPTION RAISED DURING THE " & "EXECUTION OF AN ACCEPT STATEMENT CAN BE " & "HANDLED WITHIN THE ACCEPT BODY"); DECLARE O,PT,QT,R,S,TP,B,C,D :INTEGER := 0; TASK TYPE PROG_ERR IS ENTRY START(M,N,A : IN OUT INTEGER); ENTRY STOP; END PROG_ERR; TASK T IS ENTRY START(M,N,A : IN OUT INTEGER); ENTRY STOP; END T; TYPE REC IS RECORD B : PROG_ERR; END RECORD; TYPE ACC IS ACCESS PROG_ERR; SUBTYPE X IS INTEGER RANGE 1 .. 10; PACKAGE P IS OBJ : REC; END P; TASK BODY PROG_ERR IS FAULT : X; BEGIN ACCEPT START(M,N,A : IN OUT INTEGER) DO BEGIN M := IDENT_INT(1); FAULT := IDENT_INT(11); FAULT := IDENT_INT(FAULT); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED("UNEXPECTED ERROR RAISED - " & "CONSTRAINT - TASK TYPE"); END; -- EXCEPTION BEGIN N := IDENT_INT(1); FAULT := IDENT_INT(5); FAULT := FAULT/IDENT_INT(0); FAULT := IDENT_INT(FAULT); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED("UNEXPECTED ERROR RAISED - " & "CONSTRAINT - TASK TYPE"); END; -- EXCEPTION A := IDENT_INT(1); END START; ACCEPT STOP; END PROG_ERR; TASK BODY T IS FAULT : X; BEGIN ACCEPT START(M,N,A : IN OUT INTEGER) DO BEGIN M := IDENT_INT(1); FAULT := IDENT_INT(11); FAULT := IDENT_INT(FAULT); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED("UNEXPECTED ERROR RAISED - " & "CONSTRAINT - TASK"); END; -- EXCEPTION BEGIN N := IDENT_INT(1); FAULT := IDENT_INT(5); FAULT := FAULT/IDENT_INT(0); FAULT := IDENT_INT(FAULT); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED("UNEXPECTED ERROR RAISED - " & "CONSTRAINT - TASK"); END; -- EXCEPTION A := IDENT_INT(1); END START; ACCEPT STOP; END T; PACKAGE BODY P IS BEGIN OBJ.B.START(O,PT,B); OBJ.B.STOP; IF O /= IDENT_INT(1) OR PT /= IDENT_INT(1) THEN FAILED("EXCEPTION HANDLER NEVER ENTERED " & "PROPERLY - TASK TYPE OBJECT"); END IF; IF B /= IDENT_INT(1) THEN FAILED("TASK NOT EXITED PROPERLY - TASK TYPE " & "OBJECT"); END IF; END P; PACKAGE Q IS OBJ : ACC; END Q; PACKAGE BODY Q IS BEGIN OBJ := NEW PROG_ERR; OBJ.START(QT,R,C); OBJ.STOP; IF QT /= IDENT_INT(1) OR R /= IDENT_INT(1) THEN FAILED("EXCEPTION HANDLER NEVER ENTERED " & "PROPERLY - ACCESS TASK TYPE"); END IF; IF C /= IDENT_INT(1) THEN FAILED("TASK NOT EXITED PROPERLY - ACCESS TASK " & "TYPE"); END IF; END; BEGIN T.START(S,TP,D); T.STOP; IF S /= IDENT_INT(1) OR TP /= IDENT_INT(1) THEN FAILED("EXCEPTION HANDLER NEVER ENTERED PROPERLY " & "- TASK"); END IF; IF D /= IDENT_INT(1) THEN FAILED("TASK NOT EXITED PROPERLY - TASK"); END IF; END; -- DECLARE RESULT; EXCEPTION WHEN OTHERS => FAILED("EXCEPTION NOT HANDLED INSIDE ACCEPT BODY"); RESULT; END C95078A;
package SubmarineSubSystem with SPARK_Mode is type Operational is (On, Off); -- Can Submarine Operate? type DoSomething is (Fire, CantFire); -- Test for actions can only be done once, -- Nuclear Submarine is operational. --Door Duntionality types type AirDoorOne is (Closed, Open); -- Airlock door One closed or open type AirDoorTwo is (Closed, Open); -- Airlock door Two Closed or open type DoorOneLock is (Locked, Unlocked); -- Airlock door One Locked or Unlocked type DoorTwoLock is (Locked, Unlocked); -- Airlock door Two Locked or Unlocked -- Depth Sensor types type DepthDive is (Dive, Surface); type DepthStage is (Nominal, Warning, Danger); type DepthLevel is new Integer range 0..10; -- Oxyegen System types type OxygenState is (High, Low); type OxygenWarning is (Oxygen_Fine, Oxygen_Warning); type OxygenTank is new Integer range 0..100; -- Reactor System types type ReactorTemp is (Fine, Overheating); -- Submarine variables type Submarine is record GoodToGo : Operational; OpTest : DoSomething; ClosingOne : AirDoorOne; ClosingTwo : AirDoorTwo; LockingOne : DoorOneLock; LockingTwo : DoorTwoLock; DDive : DepthDive; DStage : DepthStage; DLevel : DepthLevel; OState : OxygenState; OWarning : OxygenWarning; OTank : OxygenTank; RTemp : ReactorTemp; end record; -- Record of NuclearSubmarine NuclearSubmarine : Submarine := (GoodToGo => Off, ClosingOne => Open, ClosingTwo => Closed, LockingOne => Unlocked, LockingTwo => Unlocked, OpTest => CantFire, DDive => Surface, DStage => Nominal, DLevel => 0, OState => High, OWarning => Oxygen_Fine, OTank => 100, RTemp => Fine); -- Try to Start Submarine procedure StartSubmarine with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = Off and then NuclearSubmarine.ClosingOne = Closed and then NuclearSubmarine.LockingOne = Locked and then NuclearSubmarine.ClosingTwo = Closed and then NuclearSubmarine.LockingTwo = Locked, Post => NuclearSubmarine.GoodToGo = On; -- Can only do if Submarine is operational, TEST! procedure SubmarineAction with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.ClosingOne = Closed and then NuclearSubmarine.LockingOne = Locked and then NuclearSubmarine.ClosingTwo = Closed and then NuclearSubmarine.LockingTwo = Locked, Post => NuclearSubmarine.OpTest = Fire; ----------------------------------------------------------------------------------------------- -----------------------------------DOOR FUNCTIONALITY------------------------------------------ ----------------------------------------------------------------------------------------------- -- Airlock Door One can only open if Airlock Door Two is Closed. And Vide Versa -- These Checks are made in procedures: D1Close, D2Close, D1Open and D2 Open -- Airlock Door One Close procedure D1Close with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.ClosingOne = Open and then NuclearSubmarine.ClosingTwo = Closed, Post => NuclearSubmarine.ClosingOne = Closed; -- Airlock Door Two Close procedure D2Close with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.ClosingTwo = Open and then NuclearSubmarine.ClosingOne = Closed, Post => NuclearSubmarine.ClosingTwo = Closed; --Airlock Door One Lock procedure D1Lock with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.ClosingOne = Closed and then NuclearSubmarine.LockingOne = Unlocked, Post => NuclearSubmarine.LockingOne = Locked; -- Airlock Door Two Lock procedure D2Lock with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.ClosingTwo = Closed and then NuclearSubmarine.LockingTwo = Unlocked, Post => NuclearSubmarine.LockingTwo = Locked; --Airlock Door One Open procedure D1Open with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.LockingOne = Unlocked and then NuclearSubmarine.ClosingOne = Closed and then NuclearSubmarine.ClosingTwo = Closed, Post => NuclearSubmarine.ClosingOne = Open; -- Airlock Door Two Open procedure D2Open with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.LockingTwo = Unlocked and then NuclearSubmarine.ClosingTwo = Closed and then NuclearSubmarine.ClosingOne = Closed, Post => NuclearSubmarine.ClosingTwo = Open; --Airlock Door One Unlock procedure D1Unlock with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.ClosingOne = Closed and then NuclearSubmarine.LockingOne = Locked, Post => NuclearSubmarine.ClosingOne = Closed and then NuclearSubmarine.LockingOne = Unlocked; -- Airlock Door Two Unlock procedure D2Unlock with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.ClosingTwo = Closed and then NuclearSubmarine.LockingTwo = Locked, Post => NuclearSubmarine.ClosingTwo = Closed and then NuclearSubmarine.LockingTwo = Unlocked; ----------------------------------------------------------------------------------------------- -----------------------------------END OF DOOR FUNCTIONALITY----------------------------------- ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- -----------------------------------DEPTH SENSOR FUNCTIONALITY---------------------------------- ----------------------------------------------------------------------------------------------- -- Gauges Depth Meter to see if Submarine is Nominal, Warning or Danger stage procedure DepthMeterCheck with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire, Post => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire; -- Changes the depth of the Submarine. Cannnot go above 9. procedure ChangeDepth with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Dive and then NuclearSubmarine.DLevel < 8, Post => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Dive and then NuclearSubmarine.DLevel /= 0; -- Checks if Submarine can Dive procedure DiveOrNot with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Surface and then NuclearSubmarine.RTemp = Fine, Post => NuclearSubmarine.DDive = Dive; -- Allows submarine to resurface procedure Resurface with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Dive, Post=> NuclearSubmarine.DDive = Surface and then NuclearSubmarine.OTank = 100; ----------------------------------------------------------------------------------------------- --------------------------- END OF DEPTH SENSOR FUNCTIONALITY---------------------------------- ----------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------- ----------------------------------- OXYGEN FUNCTIONALITY -------------------------------------- ----------------------------------------------------------------------------------------------- -- Checks the integer value in OTank procedure OxygenReserveCheck with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.OTank <= 0, Post => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.OTank <= 0; --This procedure will consume 10 oxygen out of OTank procedure ConsumeOxygen with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Dive and then NuclearSubmarine.OTank >= 10, Post => NuclearSubmarine.GoodToGo = On and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Dive and then NuclearSubmarine.OTank >= 0; ----------------------------------------------------------------------------------------------- ------------------------------- END OF OXYGEN FUNCTIONALITY --------------------------------- ----------------------------------------------------------------------------------------------- -- Post condition MIGHT fail here. Look at Comments from in submarinesubsystem.adb -- Code line 242 to 247 for clarification. -- This procedure will still pass "Bronze" level of Proofing procedure ReactorOverheatRoutine with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = on and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.RTemp = Fine and then NuclearSubmarine.DDive = Dive, Post => NuclearSubmarine.GoodToGo = on and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.RTemp = Fine and then NuclearSubmarine.RTemp = Overheating; procedure CoolReactor with Global => (In_Out => NuclearSubmarine), Pre => NuclearSubmarine.GoodToGo = on and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Surface and then NuclearSubmarine.RTemp = Overheating, Post => NuclearSubmarine.GoodToGo = on and then NuclearSubmarine.OpTest = Fire and then NuclearSubmarine.DDive = Surface and then NuclearSubmarine.RTemp = Fine; ----------------------------------------------------------------------------------------------- ------------------------------- END OF REACTOR FUNCTIONALITY --------------------------------- ----------------------------------------------------------------------------------------------- end SubmarineSubSystem;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Write_Link_Actions.Collections is pragma Preelaborate; package UML_Write_Link_Action_Collections is new AMF.Generic_Collections (UML_Write_Link_Action, UML_Write_Link_Action_Access); type Set_Of_UML_Write_Link_Action is new UML_Write_Link_Action_Collections.Set with null record; Empty_Set_Of_UML_Write_Link_Action : constant Set_Of_UML_Write_Link_Action; type Ordered_Set_Of_UML_Write_Link_Action is new UML_Write_Link_Action_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Write_Link_Action : constant Ordered_Set_Of_UML_Write_Link_Action; type Bag_Of_UML_Write_Link_Action is new UML_Write_Link_Action_Collections.Bag with null record; Empty_Bag_Of_UML_Write_Link_Action : constant Bag_Of_UML_Write_Link_Action; type Sequence_Of_UML_Write_Link_Action is new UML_Write_Link_Action_Collections.Sequence with null record; Empty_Sequence_Of_UML_Write_Link_Action : constant Sequence_Of_UML_Write_Link_Action; private Empty_Set_Of_UML_Write_Link_Action : constant Set_Of_UML_Write_Link_Action := (UML_Write_Link_Action_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Write_Link_Action : constant Ordered_Set_Of_UML_Write_Link_Action := (UML_Write_Link_Action_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Write_Link_Action : constant Bag_Of_UML_Write_Link_Action := (UML_Write_Link_Action_Collections.Bag with null record); Empty_Sequence_Of_UML_Write_Link_Action : constant Sequence_Of_UML_Write_Link_Action := (UML_Write_Link_Action_Collections.Sequence with null record); end AMF.UML.Write_Link_Actions.Collections;
----------------------------------------------------------------------- -- akt-callbacks -- Callbacks for Ada Keystore GTK application -- Copyright (C) 2019, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Gtk.Main; with Gtk.Widget; with Gtk.GEntry; with Gtk.File_Filter; with Gtk.File_Chooser; with Gtk.File_Chooser_Dialog; with Gtk.Spin_Button; with Gtk.Window; with Util.Log.Loggers; with Keystore; package body AKT.Callbacks is use type Gtk.Spin_Button.Gtk_Spin_Button; use type Gtk.GEntry.Gtk_Entry; use type Gtk.Widget.Gtk_Widget; -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AKT.Callbacks"); App : AKT.Windows.Application_Access; function Get_Widget (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class; Name : in String) return Gtk.Widget.Gtk_Widget is (Gtk.Widget.Gtk_Widget (Object.Get_Object (Name))); function Get_Entry (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class; Name : in String) return Gtk.GEntry.Gtk_Entry is (Gtk.GEntry.Gtk_Entry (Object.Get_Object (Name))); function Get_Spin_Button (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class; Name : in String) return Gtk.Spin_Button.Gtk_Spin_Button is (Gtk.Spin_Button.Gtk_Spin_Button (Object.Get_Object (Name))); -- ------------------------------ -- Initialize and register the callbacks. -- ------------------------------ procedure Initialize (Application : in AKT.Windows.Application_Access; Builder : in Gtkada.Builder.Gtkada_Builder) is begin App := Application; -- AKT.Callbacks.Application := Application; Builder.Register_Handler (Handler_Name => "menu-quit", Handler => AKT.Callbacks.On_Menu_Quit'Access); -- Open file from menu and dialog. Builder.Register_Handler (Handler_Name => "menu-open", Handler => AKT.Callbacks.On_Menu_Open'Access); Builder.Register_Handler (Handler_Name => "open-file", Handler => AKT.Callbacks.On_Open_File'Access); Builder.Register_Handler (Handler_Name => "cancel-open-file", Handler => AKT.Callbacks.On_Cancel_Open_File'Access); -- Create file from menu and dialog. Builder.Register_Handler (Handler_Name => "menu-new", Handler => AKT.Callbacks.On_Menu_New'Access); Builder.Register_Handler (Handler_Name => "create-file", Handler => AKT.Callbacks.On_Create_File'Access); Builder.Register_Handler (Handler_Name => "cancel-create-file", Handler => AKT.Callbacks.On_Cancel_Create_File'Access); Builder.Register_Handler (Handler_Name => "window-close", Handler => AKT.Callbacks.On_Close_Window'Access); Builder.Register_Handler (Handler_Name => "about", Handler => AKT.Callbacks.On_Menu_About'Access); Builder.Register_Handler (Handler_Name => "close-about", Handler => AKT.Callbacks.On_Close_About'Access); Builder.Register_Handler (Handler_Name => "close-password", Handler => AKT.Callbacks.On_Close_Password'Access); Builder.Register_Handler (Handler_Name => "tool-edit", Handler => AKT.Callbacks.On_Tool_Edit'Access); Builder.Register_Handler (Handler_Name => "tool-lock", Handler => AKT.Callbacks.On_Tool_Lock'Access); Builder.Register_Handler (Handler_Name => "tool-unlock", Handler => AKT.Callbacks.On_Tool_Unlock'Access); Builder.Register_Handler (Handler_Name => "tool-save", Handler => AKT.Callbacks.On_Tool_Save'Access); Builder.Register_Handler (Handler_Name => "tool-add", Handler => AKT.Callbacks.On_Tool_Add'Access); Builder.Register_Handler (Handler_Name => "dialog-password-ok", Handler => AKT.Callbacks.On_Dialog_Password_Ok'Access); end Initialize; -- ------------------------------ -- Callback executed when the "quit" action is executed from the menu. -- ------------------------------ procedure On_Menu_Quit (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); begin Gtk.Main.Main_Quit; end On_Menu_Quit; -- ------------------------------ -- Callback executed when the "about" action is executed from the menu. -- ------------------------------ procedure On_Menu_About (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is About : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "about"); begin About.Show; end On_Menu_About; -- ------------------------------ -- Callback executed when the "menu-new" action is executed from the file menu. -- ------------------------------ procedure On_Menu_New (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Chooser : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "create_file_chooser"); Filter : Gtk.File_Filter.Gtk_File_Filter; File_Chooser : Gtk.File_Chooser.Gtk_File_Chooser; begin if Chooser /= null then File_Chooser := Gtk.File_Chooser_Dialog."+" (Gtk.File_Chooser_Dialog.Gtk_File_Chooser_Dialog (Chooser)); Gtk.File_Filter.Gtk_New (Filter); Gtk.File_Filter.Add_Pattern (Filter, "*.akt"); Gtk.File_Filter.Set_Name (Filter, "Keystore Files"); Gtk.File_Chooser.Add_Filter (File_Chooser, Filter); Gtk.File_Filter.Gtk_New (Filter); Gtk.File_Filter.Add_Pattern (Filter, "*"); Gtk.File_Filter.Set_Name (Filter, "All Files"); Gtk.File_Chooser.Add_Filter (File_Chooser, Filter); end if; Chooser.Show; end On_Menu_New; -- ------------------------------ -- Callback executed when the "menu-open" action is executed from the file menu. -- ------------------------------ procedure On_Menu_Open (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Chooser : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "open_file_chooser"); Filter : Gtk.File_Filter.Gtk_File_Filter; File_Chooser : Gtk.File_Chooser.Gtk_File_Chooser; begin if Chooser /= null then File_Chooser := Gtk.File_Chooser_Dialog."+" (Gtk.File_Chooser_Dialog.Gtk_File_Chooser_Dialog (Chooser)); Gtk.File_Filter.Gtk_New (Filter); Gtk.File_Filter.Add_Pattern (Filter, "*.akt"); Gtk.File_Filter.Set_Name (Filter, "Keystore Files"); Gtk.File_Chooser.Add_Filter (File_Chooser, Filter); Gtk.File_Filter.Gtk_New (Filter); Gtk.File_Filter.Add_Pattern (Filter, "*"); Gtk.File_Filter.Set_Name (Filter, "All Files"); Gtk.File_Chooser.Add_Filter (File_Chooser, Filter); end if; Chooser.Show; end On_Menu_Open; -- ------------------------------ -- Callback executed when the "tool-add" action is executed from the toolbar. -- ------------------------------ procedure On_Tool_Add (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); begin App.Save_Current; App.Refresh_Toolbar; end On_Tool_Add; -- ------------------------------ -- Callback executed when the "tool-save" action is executed from the toolbar. -- ------------------------------ procedure On_Tool_Save (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); begin App.Save_Current; App.Refresh_Toolbar; end On_Tool_Save; -- ------------------------------ -- Callback executed when the "tool-edit" action is executed from the toolbar. -- ------------------------------ procedure On_Tool_Edit (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); begin App.Edit_Current; App.Refresh_Toolbar; end On_Tool_Edit; -- ------------------------------ -- Callback executed when the "tool-lock" action is executed from the toolbar. -- ------------------------------ procedure On_Tool_Lock (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is pragma Unreferenced (Object); begin if not App.Is_Locked then App.Lock; end if; end On_Tool_Lock; -- ------------------------------ -- Callback executed when the "tool-unlock" action is executed from the toolbar. -- ------------------------------ procedure On_Tool_Unlock (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Password_Dialog : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "password_dialog"); Widget : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "main"); begin if App.Is_Locked and then Password_Dialog /= null then Gtk.Window.Set_Transient_For (Gtk.Window.Gtk_Window (Password_Dialog), Gtk.Window.Gtk_Window (Widget)); Password_Dialog.Show; end if; end On_Tool_Unlock; -- ------------------------------ -- Callback executed when the "open-file" action is executed from the open_file dialog. -- ------------------------------ procedure On_Open_File (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Chooser : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "open_file_chooser"); Password : constant Gtk.GEntry.Gtk_Entry := Get_Entry (Object, "open_file_password"); Filename : constant Gtk.GEntry.Gtk_Entry := Get_Entry (Object, "open_file_name"); File_Chooser : Gtk.File_Chooser.Gtk_File_Chooser; begin if Chooser /= null and Password /= null and Filename /= null then if Gtk.GEntry.Get_Text (Password) = "" then App.Message ("Password is empty"); else Chooser.Hide; File_Chooser := Gtk.File_Chooser_Dialog."+" (Gtk.File_Chooser_Dialog.Gtk_File_Chooser_Dialog (Chooser)); Log.Info ("Selected file {0}", Gtk.File_Chooser.Get_Filename (File_Chooser)); App.Open_File (Path => Gtk.File_Chooser.Get_Filename (File_Chooser), Password => Keystore.Create (Gtk.GEntry.Get_Text (Password))); end if; end if; end On_Open_File; -- ------------------------------ -- Callback executed when the "cancel-open-file" action is executed from the open_file dialog. -- ------------------------------ procedure On_Cancel_Open_File (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Chooser : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "open_file_chooser"); begin Chooser.Hide; end On_Cancel_Open_File; -- ------------------------------ -- Callback executed when the "create-file" action is executed from the open_file dialog. -- ------------------------------ procedure On_Create_File (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Chooser : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "create_file_chooser"); Password : constant Gtk.GEntry.Gtk_Entry := Get_Entry (Object, "create_file_password"); Filename : constant Gtk.GEntry.Gtk_Entry := Get_Entry (Object, "create_file_name"); Count : constant Gtk.Spin_Button.Gtk_Spin_Button := Get_Spin_Button (Object, "split_data_count"); File_Chooser : Gtk.File_Chooser.Gtk_File_Chooser; begin if Chooser /= null and Password /= null then if Gtk.GEntry.Get_Text (Password) = "" then App.Message ("Password is empty"); else Chooser.Hide; File_Chooser := Gtk.File_Chooser_Dialog."+" (Gtk.File_Chooser_Dialog.Gtk_File_Chooser_Dialog (Chooser)); Log.Info ("Selected file {0}", Gtk.File_Chooser.Get_Filename (File_Chooser)); App.Create_File (Path => Gtk.GEntry.Get_Text (Filename), Storage_Count => Natural (Count.Get_Value_As_Int), Password => Keystore.Create (Gtk.GEntry.Get_Text (Password))); end if; end if; end On_Create_File; -- ------------------------------ -- Callback executed when the "cancel-create-file" action is executed -- from the open_file dialog. -- ------------------------------ procedure On_Cancel_Create_File (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Chooser : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "create_file_chooser"); begin Chooser.Hide; end On_Cancel_Create_File; -- ------------------------------ -- Callback executed when the "delete-event" action is executed from the main window. -- ------------------------------ function On_Close_Window (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) return Boolean is pragma Unreferenced (Object); begin Gtk.Main.Main_Quit; return True; end On_Close_Window; -- ------------------------------ -- Callback executed when the "close-about" action is executed from the about box. -- ------------------------------ procedure On_Close_About (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is About : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "about"); begin About.Hide; end On_Close_About; -- ------------------------------ -- Callback executed when the "close-password" action is executed from the password dialog. -- ------------------------------ procedure On_Close_Password (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Password_Dialog : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "password_dialog"); begin if Password_Dialog /= null then Password_Dialog.Hide; end if; end On_Close_Password; -- ------------------------------ -- Callback executed when the "dialog-password-ok" action is executed from the password dialog. -- ------------------------------ procedure On_Dialog_Password_Ok (Object : access Gtkada.Builder.Gtkada_Builder_Record'Class) is Password_Dialog : constant Gtk.Widget.Gtk_Widget := Get_Widget (Object, "password_dialog"); Password : constant Gtk.GEntry.Gtk_Entry := Get_Entry (Object, "password"); begin if Password_Dialog /= null and Password /= null then if Gtk.GEntry.Get_Text (Password) = "" then App.Message ("Password is empty"); else Password_Dialog.Hide; App.Unlock (Password => Keystore.Create (Gtk.GEntry.Get_Text (Password))); end if; end if; end On_Dialog_Password_Ok; end AKT.Callbacks;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S . -- -- S P E C I F I C -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2005, Free Software Fundation, Inc. -- -- -- -- GNARL 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- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a POSIX-like version of this package. separate (System.Task_Primitives.Operations) package body Specific is ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is pragma Warnings (Off, Environment_Task); Result : Interfaces.C.int; begin Result := pthread_key_create (ATCB_Key'Access, null); pragma Assert (Result = 0); end Initialize; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean is begin return pthread_getspecific (ATCB_Key) /= System.Null_Address; end Is_Valid_Task; --------- -- Set -- --------- procedure Set (Self_Id : Task_Id) is Result : Interfaces.C.int; begin Result := pthread_setspecific (ATCB_Key, To_Address (Self_Id)); pragma Assert (Result = 0); end Set; ---------- -- Self -- ---------- function Self return Task_Id is begin return To_Task_Id (pthread_getspecific (ATCB_Key)); end Self; end Specific;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2018, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32g474xx.h -- -- @author Julio C. Gobbi -- -- @version V1.0.0 -- -- @date 24-August-2021 -- -- @brief CMSIS STM32F334xx Device Peripheral Access Layer Header File. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ -- This file provides declarations for devices on the STM32G474xx MCUs -- manufactured by ST Microelectronics. For example, an STM32G474RE. with System; use System; -- Enable for SPI, COMP and OPAMP with STM32_SVD; use STM32_SVD; with STM32_SVD.COMP; -- Enable for COMP with STM32_SVD.OPAMP; -- Enable for OPAMP with STM32_SVD.SAI; -- Enable for SAI with STM32.GPIO; use STM32.GPIO; with STM32.ADC; use STM32.ADC; with STM32.DAC; use STM32.DAC; with STM32.CRC; use STM32.CRC; with STM32.RNG; use STM32.RNG; with STM32.CORDIC; use STM32.CORDIC; with STM32.FMAC; use STM32.FMAC; with STM32.DMA; use STM32.DMA; with STM32.USARTs; use STM32.USARTs; with STM32.SPI; use STM32.SPI; with STM32.SPI.DMA; use STM32.SPI.DMA; with STM32.I2C; use STM32.I2C; with STM32.I2S; use STM32.I2S; with STM32.RTC; use STM32.RTC; with STM32.Timers; use STM32.Timers; with STM32.LPTimers; use STM32.LPTimers; with STM32.HRTimers; use STM32.HRTimers; with STM32.OPAMP; use STM32.OPAMP; with STM32.COMP; use STM32.COMP; with STM32.CAN; use STM32.CAN; package STM32.Device is pragma Elaborate_Body; Unknown_Device : exception; -- Raised by the routines below for a device passed as an actual parameter -- when that device is not present on the given hardware instance. ----------------------- -- CPU Clock Sources -- ----------------------- HSE_VALUE : constant := 24_000_000; -- High-Speed external oscillator in Hz LSE_VALUE : constant := 32_768; -- Low-Speed external oscillator in Hz HSI_VALUE : constant := 16_000_000; -- High-Speed internal oscillator in Hz -- HSI48_VALUE : constant := 48_000_000; -- High-Speed internal 48 MHz oscillator in Hz LSI_VALUE : constant := 32_000; -- Low-Speed internal oscillator in Hz I2SCLK : constant := 12_288_000; -- I2S_CKIN external frequency ---------- -- GPIO -- ---------- procedure Enable_Clock (This : aliased GPIO_Port); procedure Enable_Clock (Point : GPIO_Point); procedure Enable_Clock (Points : GPIO_Points); procedure Reset (This : aliased GPIO_Port) with Inline; procedure Reset (Point : GPIO_Point) with Inline; procedure Reset (Points : GPIO_Points) with Inline; function GPIO_Port_Representation (Port : GPIO_Port) return UInt4 with Inline; GPIO_A : aliased GPIO_Port with Import, Volatile, Address => GPIOA_Base; GPIO_B : aliased GPIO_Port with Import, Volatile, Address => GPIOB_Base; GPIO_C : aliased GPIO_Port with Import, Volatile, Address => GPIOC_Base; GPIO_D : aliased GPIO_Port with Import, Volatile, Address => GPIOD_Base; GPIO_E : aliased GPIO_Port with Import, Volatile, Address => GPIOE_Base; GPIO_F : aliased GPIO_Port with Import, Volatile, Address => GPIOF_Base; GPIO_G : aliased GPIO_Port with Import, Volatile, Address => GPIOG_Base; PA0 : aliased GPIO_Point := (GPIO_A'Access, Pin_0); PA1 : aliased GPIO_Point := (GPIO_A'Access, Pin_1); PA2 : aliased GPIO_Point := (GPIO_A'Access, Pin_2); PA3 : aliased GPIO_Point := (GPIO_A'Access, Pin_3); PA4 : aliased GPIO_Point := (GPIO_A'Access, Pin_4); PA5 : aliased GPIO_Point := (GPIO_A'Access, Pin_5); PA6 : aliased GPIO_Point := (GPIO_A'Access, Pin_6); PA7 : aliased GPIO_Point := (GPIO_A'Access, Pin_7); PA8 : aliased GPIO_Point := (GPIO_A'Access, Pin_8); PA9 : aliased GPIO_Point := (GPIO_A'Access, Pin_9); PA10 : aliased GPIO_Point := (GPIO_A'Access, Pin_10); PA11 : aliased GPIO_Point := (GPIO_A'Access, Pin_11); PA12 : aliased GPIO_Point := (GPIO_A'Access, Pin_12); PA13 : aliased GPIO_Point := (GPIO_A'Access, Pin_13); PA14 : aliased GPIO_Point := (GPIO_A'Access, Pin_14); PA15 : aliased GPIO_Point := (GPIO_A'Access, Pin_15); PB0 : aliased GPIO_Point := (GPIO_B'Access, Pin_0); PB1 : aliased GPIO_Point := (GPIO_B'Access, Pin_1); PB2 : aliased GPIO_Point := (GPIO_B'Access, Pin_2); PB3 : aliased GPIO_Point := (GPIO_B'Access, Pin_3); PB4 : aliased GPIO_Point := (GPIO_B'Access, Pin_4); PB5 : aliased GPIO_Point := (GPIO_B'Access, Pin_5); PB6 : aliased GPIO_Point := (GPIO_B'Access, Pin_6); PB7 : aliased GPIO_Point := (GPIO_B'Access, Pin_7); PB8 : aliased GPIO_Point := (GPIO_B'Access, Pin_8); PB9 : aliased GPIO_Point := (GPIO_B'Access, Pin_9); PB10 : aliased GPIO_Point := (GPIO_B'Access, Pin_10); PB11 : aliased GPIO_Point := (GPIO_B'Access, Pin_11); PB12 : aliased GPIO_Point := (GPIO_B'Access, Pin_12); PB13 : aliased GPIO_Point := (GPIO_B'Access, Pin_13); PB14 : aliased GPIO_Point := (GPIO_B'Access, Pin_14); PB15 : aliased GPIO_Point := (GPIO_B'Access, Pin_15); PC0 : aliased GPIO_Point := (GPIO_C'Access, Pin_0); PC1 : aliased GPIO_Point := (GPIO_C'Access, Pin_1); PC2 : aliased GPIO_Point := (GPIO_C'Access, Pin_2); PC3 : aliased GPIO_Point := (GPIO_C'Access, Pin_3); PC4 : aliased GPIO_Point := (GPIO_C'Access, Pin_4); PC5 : aliased GPIO_Point := (GPIO_C'Access, Pin_5); PC6 : aliased GPIO_Point := (GPIO_C'Access, Pin_6); PC7 : aliased GPIO_Point := (GPIO_C'Access, Pin_7); PC8 : aliased GPIO_Point := (GPIO_C'Access, Pin_8); PC9 : aliased GPIO_Point := (GPIO_C'Access, Pin_9); PC10 : aliased GPIO_Point := (GPIO_C'Access, Pin_10); PC11 : aliased GPIO_Point := (GPIO_C'Access, Pin_11); PC12 : aliased GPIO_Point := (GPIO_C'Access, Pin_12); PC13 : aliased GPIO_Point := (GPIO_C'Access, Pin_13); PC14 : aliased GPIO_Point := (GPIO_C'Access, Pin_14); PC15 : aliased GPIO_Point := (GPIO_C'Access, Pin_15); PD0 : aliased GPIO_Point := (GPIO_D'Access, Pin_0); PD1 : aliased GPIO_Point := (GPIO_D'Access, Pin_1); PD2 : aliased GPIO_Point := (GPIO_D'Access, Pin_2); PD3 : aliased GPIO_Point := (GPIO_D'Access, Pin_3); PD4 : aliased GPIO_Point := (GPIO_D'Access, Pin_4); PD5 : aliased GPIO_Point := (GPIO_D'Access, Pin_5); PD6 : aliased GPIO_Point := (GPIO_D'Access, Pin_6); PD7 : aliased GPIO_Point := (GPIO_D'Access, Pin_7); PD8 : aliased GPIO_Point := (GPIO_D'Access, Pin_8); PD9 : aliased GPIO_Point := (GPIO_D'Access, Pin_9); PD10 : aliased GPIO_Point := (GPIO_D'Access, Pin_10); PD11 : aliased GPIO_Point := (GPIO_D'Access, Pin_11); PD12 : aliased GPIO_Point := (GPIO_D'Access, Pin_12); PD13 : aliased GPIO_Point := (GPIO_D'Access, Pin_13); PD14 : aliased GPIO_Point := (GPIO_D'Access, Pin_14); PD15 : aliased GPIO_Point := (GPIO_D'Access, Pin_15); PE0 : aliased GPIO_Point := (GPIO_E'Access, Pin_0); PE1 : aliased GPIO_Point := (GPIO_E'Access, Pin_1); PE2 : aliased GPIO_Point := (GPIO_E'Access, Pin_2); PE3 : aliased GPIO_Point := (GPIO_E'Access, Pin_3); PE4 : aliased GPIO_Point := (GPIO_E'Access, Pin_4); PE5 : aliased GPIO_Point := (GPIO_E'Access, Pin_5); PE6 : aliased GPIO_Point := (GPIO_E'Access, Pin_6); PE7 : aliased GPIO_Point := (GPIO_E'Access, Pin_7); PE8 : aliased GPIO_Point := (GPIO_E'Access, Pin_8); PE9 : aliased GPIO_Point := (GPIO_E'Access, Pin_9); PE10 : aliased GPIO_Point := (GPIO_E'Access, Pin_10); PE11 : aliased GPIO_Point := (GPIO_E'Access, Pin_11); PE12 : aliased GPIO_Point := (GPIO_E'Access, Pin_12); PE13 : aliased GPIO_Point := (GPIO_E'Access, Pin_13); PE14 : aliased GPIO_Point := (GPIO_E'Access, Pin_14); PE15 : aliased GPIO_Point := (GPIO_E'Access, Pin_15); PF0 : aliased GPIO_Point := (GPIO_F'Access, Pin_0); PF1 : aliased GPIO_Point := (GPIO_F'Access, Pin_1); PF2 : aliased GPIO_Point := (GPIO_F'Access, Pin_2); PF3 : aliased GPIO_Point := (GPIO_F'Access, Pin_3); PF4 : aliased GPIO_Point := (GPIO_F'Access, Pin_4); PF5 : aliased GPIO_Point := (GPIO_F'Access, Pin_5); PF6 : aliased GPIO_Point := (GPIO_F'Access, Pin_6); PF7 : aliased GPIO_Point := (GPIO_F'Access, Pin_7); PF8 : aliased GPIO_Point := (GPIO_F'Access, Pin_8); PF9 : aliased GPIO_Point := (GPIO_F'Access, Pin_9); PF10 : aliased GPIO_Point := (GPIO_F'Access, Pin_10); PF11 : aliased GPIO_Point := (GPIO_F'Access, Pin_11); PF12 : aliased GPIO_Point := (GPIO_F'Access, Pin_12); PF13 : aliased GPIO_Point := (GPIO_F'Access, Pin_13); PF14 : aliased GPIO_Point := (GPIO_F'Access, Pin_14); PF15 : aliased GPIO_Point := (GPIO_F'Access, Pin_15); PG0 : aliased GPIO_Point := (GPIO_G'Access, Pin_0); PG1 : aliased GPIO_Point := (GPIO_G'Access, Pin_1); PG2 : aliased GPIO_Point := (GPIO_G'Access, Pin_2); PG3 : aliased GPIO_Point := (GPIO_G'Access, Pin_3); PG4 : aliased GPIO_Point := (GPIO_G'Access, Pin_4); PG5 : aliased GPIO_Point := (GPIO_G'Access, Pin_5); PG6 : aliased GPIO_Point := (GPIO_G'Access, Pin_6); PG7 : aliased GPIO_Point := (GPIO_G'Access, Pin_7); PG8 : aliased GPIO_Point := (GPIO_G'Access, Pin_8); PG9 : aliased GPIO_Point := (GPIO_G'Access, Pin_9); PG10 : aliased GPIO_Point := (GPIO_G'Access, Pin_10); PG11 : aliased GPIO_Point := (GPIO_G'Access, Pin_11); PG12 : aliased GPIO_Point := (GPIO_G'Access, Pin_12); PG13 : aliased GPIO_Point := (GPIO_G'Access, Pin_13); PG14 : aliased GPIO_Point := (GPIO_G'Access, Pin_14); PG15 : aliased GPIO_Point := (GPIO_G'Access, Pin_15); GPIO_AF_RTC_50Hz_0 : constant GPIO_Alternate_Function; GPIO_AF_MCO_0 : constant GPIO_Alternate_Function; GPIO_AF_TAMPER_0 : constant GPIO_Alternate_Function; GPIO_AF_SWJ_0 : constant GPIO_Alternate_Function; GPIO_AF_TRACE_0 : constant GPIO_Alternate_Function; GPIO_AF_TIM2_1 : constant GPIO_Alternate_Function; GPIO_AF_TIM5_1 : constant GPIO_Alternate_Function; GPIO_AF_TIM15_1 : constant GPIO_Alternate_Function; GPIO_AF_TIM16_1 : constant GPIO_Alternate_Function; GPIO_AF_TIM17_1 : constant GPIO_Alternate_Function; GPIO_AF_LPTIM1_1 : constant GPIO_Alternate_Function; GPIO_AF_I2C1_2 : constant GPIO_Alternate_Function; GPIO_AF_I2C3_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM2_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM3_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM4_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM5_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM15_2 : constant GPIO_Alternate_Function; GPIO_AF_TIM20_2 : constant GPIO_Alternate_Function; GPIO_AF_COMP1_2 : constant GPIO_Alternate_Function; GPIO_AF_SPI1_3 : constant GPIO_Alternate_Function; GPIO_AF_I2C3_3 : constant GPIO_Alternate_Function; GPIO_AF_I2C4_3 : constant GPIO_Alternate_Function; GPIO_AF_SAI1_3 : constant GPIO_Alternate_Function; GPIO_AF_USB_3 : constant GPIO_Alternate_Function; GPIO_AF_HRTIM1_3 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_3 : constant GPIO_Alternate_Function; GPIO_AF_TIM15_3 : constant GPIO_Alternate_Function; GPIO_AF_TIM20_3 : constant GPIO_Alternate_Function; GPIO_AF_COMP3_3 : constant GPIO_Alternate_Function; GPIO_AF_I2C1_4 : constant GPIO_Alternate_Function; GPIO_AF_I2C2_4 : constant GPIO_Alternate_Function; GPIO_AF_I2C3_4 : constant GPIO_Alternate_Function; GPIO_AF_I2C4_4 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_4 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_4 : constant GPIO_Alternate_Function; GPIO_AF_TIM16_4 : constant GPIO_Alternate_Function; GPIO_AF_TIM17_4 : constant GPIO_Alternate_Function; GPIO_AF_SPI1_5 : constant GPIO_Alternate_Function; GPIO_AF_SPI2_5 : constant GPIO_Alternate_Function; GPIO_AF_SPI3_5 : constant GPIO_Alternate_Function; GPIO_AF_SPI4_5 : constant GPIO_Alternate_Function; GPIO_AF_I2S2_5 : constant GPIO_Alternate_Function; GPIO_AF_I2S3_5 : constant GPIO_Alternate_Function; GPIO_AF_I2C4_5 : constant GPIO_Alternate_Function; GPIO_AF_UART4_5 : constant GPIO_Alternate_Function; GPIO_AF_UART5_5 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_5 : constant GPIO_Alternate_Function; GPIO_AF_INFRARED_5 : constant GPIO_Alternate_Function; GPIO_AF_SPI2_6 : constant GPIO_Alternate_Function; GPIO_AF_SPI3_6 : constant GPIO_Alternate_Function; GPIO_AF_I2S2_6 : constant GPIO_Alternate_Function; GPIO_AF_I2S3_6 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_6 : constant GPIO_Alternate_Function; GPIO_AF_TIM5_6 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_6 : constant GPIO_Alternate_Function; GPIO_AF_TIM20_6 : constant GPIO_Alternate_Function; GPIO_AF_INFRARED_6 : constant GPIO_Alternate_Function; GPIO_AF_USART1_7 : constant GPIO_Alternate_Function; GPIO_AF_USART2_7 : constant GPIO_Alternate_Function; GPIO_AF_USART3_7 : constant GPIO_Alternate_Function; GPIO_AF_FDCAN_7 : constant GPIO_Alternate_Function; GPIO_AF_COMP5_7 : constant GPIO_Alternate_Function; GPIO_AF_COMP6_7 : constant GPIO_Alternate_Function; GPIO_AF_COMP7_7 : constant GPIO_Alternate_Function; GPIO_AF_I2C3_8 : constant GPIO_Alternate_Function; GPIO_AF_I2C4_8 : constant GPIO_Alternate_Function; GPIO_AF_UART4_8 : constant GPIO_Alternate_Function; GPIO_AF_UART5_8 : constant GPIO_Alternate_Function; GPIO_AF_LPUART1_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP1_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP2_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP3_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP4_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP5_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP6_8 : constant GPIO_Alternate_Function; GPIO_AF_COMP7_8 : constant GPIO_Alternate_Function; GPIO_AF_FDCAN1_9 : constant GPIO_Alternate_Function; GPIO_AF_FDCAN2_9 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_9 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_9 : constant GPIO_Alternate_Function; GPIO_AF_TIM15_9 : constant GPIO_Alternate_Function; GPIO_AF_SPI1_10 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_10 : constant GPIO_Alternate_Function; GPIO_AF_TIM2_10 : constant GPIO_Alternate_Function; GPIO_AF_TIM3_10 : constant GPIO_Alternate_Function; GPIO_AF_TIM4_10 : constant GPIO_Alternate_Function; GPIO_AF_TIM7_10 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_10 : constant GPIO_Alternate_Function; GPIO_AF_LPTIM1_11 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_11 : constant GPIO_Alternate_Function; GPIO_AF_TIM8_11 : constant GPIO_Alternate_Function; GPIO_AF_FDCAN1_11 : constant GPIO_Alternate_Function; GPIO_AF_FDCAN3_11 : constant GPIO_Alternate_Function; GPIO_AF_FMC_12 : constant GPIO_Alternate_Function; GPIO_AF_LPUART1_12 : constant GPIO_Alternate_Function; GPIO_AF_SAI1_12 : constant GPIO_Alternate_Function; GPIO_AF_HRTIM1_12 : constant GPIO_Alternate_Function; GPIO_AF_TIM1_12 : constant GPIO_Alternate_Function; GPIO_AF_SAI1_13 : constant GPIO_Alternate_Function; GPIO_AF_HRTIM1_13 : constant GPIO_Alternate_Function; GPIO_AF_OPAMP2_13 : constant GPIO_Alternate_Function; GPIO_AF_UART4_14 : constant GPIO_Alternate_Function; GPIO_AF_UART5_14 : constant GPIO_Alternate_Function; GPIO_AF_SAI1_14 : constant GPIO_Alternate_Function; GPIO_AF_TIM2_14 : constant GPIO_Alternate_Function; GPIO_AF_TIM15_14 : constant GPIO_Alternate_Function; GPIO_AF_UCPD1_14 : constant GPIO_Alternate_Function; GPIO_AF_EVENTOUT_15 : constant GPIO_Alternate_Function; --------- -- ADC -- --------- ADC_1 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC1_Base; ADC_2 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC2_Base; ADC_3 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC3_Base; ADC_4 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC4_Base; ADC_5 : aliased Analog_To_Digital_Converter with Volatile, Import, Address => ADC5_Base; Temperature_Channel : constant Analog_Input_Channel := 16; Temperature_Sensor : constant ADC_Point := (ADC_1'Access, Channel => Temperature_Channel); -- The internal temperature sensor (VTS) is intenally connected to -- ADC1_INP16 and ADC5_INP4. See RM0440 rev 6 pg 621 chapter 21.4.11. -- The VSENSESEL bit in the ADCxCCR register is used to switch to the -- temperature sensor. -- see RM0440 rev 6 pg 683, section 21.4.31, also pg 606. VRef_Channel : constant Analog_Input_Channel := 18; VRef_Sensor : constant ADC_Point := (ADC_1'Access, Channel => VRef_Channel); -- The internal reference voltage (VREFINT) is internally connected -- to ADC1_INP18, ADC3_INP18, ADC4_INP18 and ADC5_INP18. -- The VREFEN bit in the ADCxCCR register is used to switch to VREFINT. -- see RM0440 rev 6 pg 686, section 21.4.33, also pg 606. VBat_Channel : constant Analog_Input_Channel := 17; VBat_Sensor : constant ADC_Point := (ADC_1'Access, Channel => VBat_Channel); -- The internal temperature sensor (VTS) is intenally connected to -- ADC1_INP17, ADC3_INP17 and ADC5_INP17. See RM0440 rev 6 pg 621 -- chapter 21.4.11. -- The VBATSEL bit in the ADCxCCR register is used to switch to the -- battery voltage. VBat : constant ADC_Point := (ADC_1'Access, Channel => VBat_Channel); VBat_Bridge_Divisor : constant := 3; -- The VBAT pin is internally connected to a bridge divider. The actual -- voltage is the raw conversion value * the divisor. See section 21.4.32, -- pg 685 of the RM0440 rev 6. procedure Enable_Clock (This : aliased Analog_To_Digital_Converter); procedure Reset_All_ADC_Units; type ADC_Clock_Source is (SYSCLK, PLLP); procedure Select_Clock_Source (This : Analog_To_Digital_Converter; Source : ADC_Clock_Source); -- Set ADC12 or ADC345 Clock Mux Source. function Read_Clock_Source (This : Analog_To_Digital_Converter) return ADC_Clock_Source; -- Return ADC12 or ADC345 Clock Mux Source. --------- -- DAC -- --------- DAC_1 : aliased Digital_To_Analog_Converter with Import, Volatile, Address => DAC1_Base; DAC_2 : aliased Digital_To_Analog_Converter with Import, Volatile, Address => DAC2_Base; DAC_3 : aliased Digital_To_Analog_Converter with Import, Volatile, Address => DAC3_Base; DAC_4 : aliased Digital_To_Analog_Converter with Import, Volatile, Address => DAC4_Base; DAC_1_OUT_1_IO : GPIO_Point renames PA4; DAC_1_OUT_2_IO : GPIO_Point renames PA5; DAC_2_OUT_1_IO : GPIO_Point renames PA6; procedure Enable_Clock (This : aliased Digital_To_Analog_Converter) with Inline; procedure Reset (This : aliased Digital_To_Analog_Converter) with Inline; ----------- -- Audio -- ----------- subtype SAI_Port is STM32_SVD.SAI.SAI_Peripheral; SAI_1 : SAI_Port renames STM32_SVD.SAI.SAI_Periph; procedure Enable_Clock (This : SAI_Port); procedure Reset (This : SAI_Port); type SAI_Clock_Source is (SYSCLK, PLLQ, I2S_CKIN, HSI16); procedure Select_Clock_Source (This : SAI_Port; Source : SAI_Clock_Source); -- Set SAI Clock Mux source. function Read_Clock_Source (This : SAI_Port) return SAI_Clock_Source; -- Return SAI Clock Mux source. function Get_Clock_Frequency (This : SAI_Port) return UInt32; --------- -- CRC -- --------- CRC_Unit : CRC_32 with Import, Volatile, Address => CRC_Base; procedure Enable_Clock (This : CRC_32) with Inline; procedure Disable_Clock (This : CRC_32) with Inline; procedure Reset (This : CRC_32); --------- -- RNG -- --------- RNG_Unit : RNG_Generator with Import, Volatile, Address => RNG_Base; procedure Enable_Clock (This : RNG_Generator) with Inline; procedure Disable_Clock (This : RNG_Generator) with Inline; procedure Reset (This : RNG_Generator); ------------ -- CORDIC -- ------------ CORDIC_Unit : CORDIC_Coprocessor with Import, Volatile, Address => CORDIC_Base; procedure Enable_Clock (This : CORDIC_Coprocessor) with Inline; procedure Disable_Clock (This : CORDIC_Coprocessor) with Inline; procedure Reset (This : CORDIC_Coprocessor); ---------- -- FMAC -- ---------- FMAC_Unit : FMAC_Accelerator with Import, Volatile, Address => FMAC_Base; procedure Enable_Clock (This : FMAC_Accelerator) with Inline; procedure Disable_Clock (This : FMAC_Accelerator) with Inline; procedure Reset (This : FMAC_Accelerator); --------- -- DMA -- --------- DMA_1 : aliased DMA_Controller with Import, Volatile, Address => DMA1_Base; DMA_2 : aliased DMA_Controller with Import, Volatile, Address => DMA2_Base; procedure Enable_Clock (This : aliased DMA_Controller); procedure Reset (This : aliased DMA_Controller); ----------- -- USART -- ----------- Internal_USART_1 : aliased Internal_USART with Import, Volatile, Address => USART1_Base; Internal_USART_2 : aliased Internal_USART with Import, Volatile, Address => USART2_Base; Internal_USART_3 : aliased Internal_USART with Import, Volatile, Address => USART3_Base; Internal_UART_4 : aliased Internal_USART with Import, Volatile, Address => UART4_Base; Internal_UART_5 : aliased Internal_USART with Import, Volatile, Address => UART5_Base; Internal_LPUART_1 : aliased Internal_USART with Import, Volatile, Address => LPUART1_Base; USART_1 : aliased USART (Internal_USART_1'Access); USART_2 : aliased USART (Internal_USART_2'Access); USART_3 : aliased USART (Internal_USART_3'Access); UART_4 : aliased USART (Internal_UART_4'Access); UART_5 : aliased USART (Internal_UART_5'Access); LPUART_1 : aliased USART (Internal_LPUART_1'Access); procedure Enable_Clock (This : aliased USART); procedure Reset (This : aliased USART); type USART_Clock_Source is (PCLK, SYSCLK, HSI16, LSE); -- Option USART1 USART2345 -- PCLK PCLK2 PCLK1 procedure Select_Clock_Source (This : aliased USART; Source : USART_Clock_Source); function Read_Clock_Source (This : aliased USART) return USART_Clock_Source; function Get_Clock_Frequency (This : USART) return UInt32 with Inline; -- Returns USART clock frequency, in Hertz. --------- -- CAN -- --------- CAN_1 : aliased CAN_Controller with Volatile, Import, Address => FDCAN1_Base; CAN_2 : aliased CAN_Controller with Volatile, Import, Address => FDCAN2_Base; CAN_3 : aliased CAN_Controller with Volatile, Import, Address => FDCAN3_Base; procedure Enable_Clock (This : aliased CAN_Controller); -- There is only one clock for the three CANs. procedure Reset (This : aliased CAN_Controller); -- There is only one reset for the three CANs. type CAN_Clock_Source is (HSE, PLLQ, PCLK); -- Option CAN123 -- PCLK PCLK1 procedure Select_Clock_Source (This : aliased CAN_Controller; Source : CAN_Clock_Source); function Read_Clock_Source (This : aliased CAN_Controller) return CAN_Clock_Source; --------- -- I2C -- --------- Internal_I2C_Port_1 : aliased Internal_I2C_Port with Import, Volatile, Address => I2C1_Base; Internal_I2C_Port_2 : aliased Internal_I2C_Port with Import, Volatile, Address => I2C2_Base; Internal_I2C_Port_3 : aliased Internal_I2C_Port with Import, Volatile, Address => I2C3_Base; Internal_I2C_Port_4 : aliased Internal_I2C_Port with Import, Volatile, Address => I2C4_Base; type I2C_Port_Id is (I2C_Id_1, I2C_Id_2, I2C_Id_3, I2C_Id_4); I2C_1 : aliased I2C_Port (Internal_I2C_Port_1'Access); I2C_2 : aliased I2C_Port (Internal_I2C_Port_2'Access); I2C_3 : aliased I2C_Port (Internal_I2C_Port_3'Access); I2C_4 : aliased I2C_Port (Internal_I2C_Port_4'Access); -- I2C_1_DMA : aliased I2C_Port_DMA (Internal_I2C_Port_1'Access); -- I2C_2_DMA : aliased I2C_Port_DMA (Internal_I2C_Port_2'Access); -- I2C_3_DMA : aliased I2C_Port_DMA (Internal_I2C_Port_3'Access); -- I2C_4_DMA : aliased I2C_Port_DMA (Internal_I2C_Port_4'Access); function As_Port_Id (Port : I2C_Port'Class) return I2C_Port_Id with Inline; procedure Enable_Clock (This : aliased I2C_Port'Class); procedure Enable_Clock (This : I2C_Port_Id); procedure Reset (This : I2C_Port'Class); procedure Reset (This : I2C_Port_Id); type I2C_Clock_Source is (PCLK, SYSCLK, HSI16); procedure Select_Clock_Source (This : I2C_Port'Class; Source : I2C_Clock_Source); procedure Select_Clock_Source (This : I2C_Port_Id; Source : I2C_Clock_Source); -- Set I2C Clock Mux source. function Read_Clock_Source (This : I2C_Port'Class) return I2C_Clock_Source; function Read_Clock_Source (This : I2C_Port_Id) return I2C_Clock_Source; -- Return I2C Clock Mux source. --------- -- SPI -- --------- Internal_SPI_1 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI1_Base; Internal_SPI_2 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI2_Base; Internal_SPI_3 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI3_Base; Internal_SPI_4 : aliased Internal_SPI_Port with Import, Volatile, Address => SPI4_Base; SPI_1 : aliased SPI_Port (Internal_SPI_1'Access); SPI_2 : aliased SPI_Port (Internal_SPI_2'Access); SPI_3 : aliased SPI_Port (Internal_SPI_3'Access); SPI_4 : aliased SPI_Port (Internal_SPI_4'Access); SPI_1_DMA : aliased SPI_Port_DMA (Internal_SPI_1'Access); SPI_2_DMA : aliased SPI_Port_DMA (Internal_SPI_2'Access); SPI_3_DMA : aliased SPI_Port_DMA (Internal_SPI_3'Access); SPI_4_DMA : aliased SPI_Port_DMA (Internal_SPI_4'Access); procedure Enable_Clock (This : SPI_Port'Class); procedure Reset (This : SPI_Port'Class); type SPI_Clock_Source is (SYSCLK, PLLQ, I2S_CKIN, HSI16); procedure Select_Clock_Source (This : SPI_Port'Class; Source : SPI_Clock_Source) with Pre => This'Address = SPI2_Base or This'Address = SPI3_Base, Post => Read_Clock_Source (This) = Source; -- Set SPI Clock Mux source (the same source for SPI2 .. SPI3). function Read_Clock_Source (This : SPI_Port'Class) return SPI_Clock_Source with Pre => This'Address = SPI2_Base or This'Address = SPI3_Base; -- Return SPI Clock Mux source. --------- -- I2S -- --------- Internal_I2S_2 : aliased Internal_I2S_Port with Import, Volatile, Address => SPI2_Base; Internal_I2S_3 : aliased Internal_I2S_Port with Import, Volatile, Address => SPI3_Base; I2S_2 : aliased I2S_Port (Internal_I2S_2'Access, Extended => False); I2S_3 : aliased I2S_Port (Internal_I2S_3'Access, Extended => False); procedure Enable_Clock (This : I2S_Port); -- The I2S_2 and I2S_3 peripherals use the SPI interface hardware, that are -- mapped to SPI2 and SPI3. SPI1 and SPI4 don't have the I2S mode. procedure Reset (This : I2S_Port); -- The I2S_2 and I2S_3 peripherals use the SPI interface hardware, that are -- mapped to SPI2 and SPI3. SPI1 and SPI4 don't have the I2S mode. type I2S_Clock_Source is (SYSCLK, PLLQ, I2S_CKIN, HSI16); procedure Select_Clock_Source (This : I2S_Port'Class; Source : I2S_Clock_Source) with Post => Read_Clock_Source (This) = Source; -- Set I2S Clock Mux source (the same source for I2S2 .. I2S3). function Read_Clock_Source (This : I2S_Port'Class) return I2S_Clock_Source; -- Return I2S Clock Mux source. function Get_Clock_Frequency (This : I2S_Port) return UInt32; -- Return I2S frequency. --------- -- RTC -- --------- RTC : aliased RTC_Device; procedure Enable_Clock (This : RTC_Device); type RTC_Clock_Source is (No_Clock, LSE, LSI, HSE) with Size => 2; procedure Select_Clock_Source (This : RTC_Device; Source : RTC_Clock_Source) with Post => Read_Clock_Source (This) = Source; -- Set RTC Clock Mux source. Once the RTC clock source has been selected, -- it cannot be changed anymore unless the RTC domain is reset, or unless -- a failure is detected on LSE (LSECSSD is set). The BDRST bit can be used -- to reset them. -- The HSE clock is divided by 32 before entering the RTC to assure it is -- < 1 MHz. function Read_Clock_Source (This : RTC_Device) return RTC_Clock_Source; -- Return RTC Clock Mux source. ----------- -- Timer -- ----------- Timer_1 : aliased Timer with Import, Volatile, Address => TIM1_Base; Timer_2 : aliased Timer with Import, Volatile, Address => TIM2_Base; Timer_3 : aliased Timer with Import, Volatile, Address => TIM3_Base; Timer_4 : aliased Timer with Import, Volatile, Address => TIM4_Base; Timer_5 : aliased Timer with Import, Volatile, Address => TIM5_Base; Timer_6 : aliased Timer with Import, Volatile, Address => TIM6_Base; Timer_7 : aliased Timer with Import, Volatile, Address => TIM7_Base; Timer_8 : aliased Timer with Import, Volatile, Address => TIM8_Base; Timer_15 : aliased Timer with Import, Volatile, Address => TIM15_Base; Timer_16 : aliased Timer with Import, Volatile, Address => TIM16_Base; Timer_17 : aliased Timer with Import, Volatile, Address => TIM17_Base; Timer_20 : aliased Timer with Import, Volatile, Address => TIM20_Base; procedure Enable_Clock (This : Timer); procedure Reset (This : Timer); function Get_Clock_Frequency (This : Timer) return UInt32; -- Return the timer input frequency in Hz. ------------- -- LPTimer -- ------------- LPTimer_1 : aliased LPTimer with Import, Volatile, Address => LPTIMER1_Base; procedure Enable_Clock (This : LPTimer); procedure Reset (This : LPTimer); type LPTimer_Clock_Source_Enum is (PCLK1, LSI, HSI, LSE) with Size => 2; type LPTimer_Clock_Source is record External : Boolean := False; Clock : LPTimer_Clock_Source_Enum := LPTimer_Clock_Source_Enum'First; end record; for LPTimer_Clock_Source use record External at 0 range 2 .. 2; Clock at 0 range 0 .. 1; end record; procedure Select_Clock_Source (This : LPTimer; Source : LPTimer_Clock_Source); -- Set clock to any internal LPTIM Clock Mux source or external through -- Input1. function Read_Clock_Source (This : LPTimer) return LPTimer_Clock_Source; -- Return LPTIM1 Clock Mux source. function Get_Clock_Frequency (This : LPTimer) return UInt32; -- Return the timer input frequency in Hz. ------------- -- HRTimer -- ------------- HRTimer_M : aliased HRTimer_Master with Import, Volatile, Address => HRTIM_Master_Base; HRTimer_A : aliased HRTimer_Channel with Import, Volatile, Address => HRTIM_TIMA_Base; HRTimer_B : aliased HRTimer_Channel with Import, Volatile, Address => HRTIM_TIMB_Base; HRTimer_C : aliased HRTimer_Channel with Import, Volatile, Address => HRTIM_TIMC_Base; HRTimer_D : aliased HRTimer_Channel with Import, Volatile, Address => HRTIM_TIMD_Base; HRTimer_E : aliased HRTimer_Channel with Import, Volatile, Address => HRTIM_TIME_Base; HRTimer_F : aliased HRTimer_Channel with Import, Volatile, Address => HRTIM_TIMF_Base; procedure Enable_Clock (This : HRTimer_Master); procedure Enable_Clock (This : HRTimer_Channel); procedure Reset (This : HRTimer_Master); procedure Reset (This : HRTimer_Channel); function Get_Clock_Frequency (This : HRTimer_Master) return UInt32; -- Returns the timer input frequency in Hz. function Get_Clock_Frequency (This : HRTimer_Channel) return UInt32; -- Returns the timer input frequency in Hz. ---------------- -- Comparator -- ---------------- Comp_1 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C1CSR'Address; Comp_2 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C2CSR'Address; Comp_3 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C3CSR'Address; Comp_4 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C4CSR'Address; Comp_5 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C5CSR'Address; Comp_6 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C6CSR'Address; Comp_7 : aliased Comparator with Import, Volatile, Address => STM32_SVD.COMP.COMP_Periph.C7CSR'Address; ----------- -- OpAmp -- ----------- Opamp_1 : aliased Operational_Amplifier with Import, Volatile, Address => STM32_SVD.OPAMP.OPAMP_Periph.OPAMP1_CSR'Address; Opamp_2 : aliased Operational_Amplifier with Import, Volatile, Address => STM32_SVD.OPAMP.OPAMP_Periph.OPAMP2_CSR'Address; Opamp_3 : aliased Operational_Amplifier with Import, Volatile, Address => STM32_SVD.OPAMP.OPAMP_Periph.OPAMP3_CSR'Address; Opamp_4 : aliased Operational_Amplifier with Import, Volatile, Address => STM32_SVD.OPAMP.OPAMP_Periph.OPAMP4_CSR'Address; Opamp_5 : aliased Operational_Amplifier with Import, Volatile, Address => STM32_SVD.OPAMP.OPAMP_Periph.OPAMP5_CSR'Address; Opamp_6 : aliased Operational_Amplifier with Import, Volatile, Address => STM32_SVD.OPAMP.OPAMP_Periph.OPAMP6_CSR'Address; ----------------------------- -- Reset and Clock Control -- ----------------------------- -- See RM0440 rev. 6 pg. 276 chapter 7.2, and pg. 279 for clock tree type RCC_System_Clocks is record SYSCLK : UInt32; -- PLLR, PLLCLK HCLK : UInt32; PCLK1 : UInt32; PCLK2 : UInt32; TIMCLK1 : UInt32; -- For TIMs 2 .. 7 TIMCLK2 : UInt32; -- For TIMs 1, 8, 20, 15 .. 17, HRTIM1 TIMCLK3 : UInt32; -- For LPTIMs 1 .. 2 PLLP : UInt32; -- PLLP PLLQ : UInt32; -- PLLQ end record; function System_Clock_Frequencies return RCC_System_Clocks; -- Returns each RCC system clock frequency in Hz. private GPIO_AF_RTC_50Hz_0 : constant GPIO_Alternate_Function := 0; GPIO_AF_MCO_0 : constant GPIO_Alternate_Function := 0; GPIO_AF_TAMPER_0 : constant GPIO_Alternate_Function := 0; GPIO_AF_SWJ_0 : constant GPIO_Alternate_Function := 0; GPIO_AF_TRACE_0 : constant GPIO_Alternate_Function := 0; GPIO_AF_TIM2_1 : constant GPIO_Alternate_Function := 1; GPIO_AF_TIM5_1 : constant GPIO_Alternate_Function := 1; GPIO_AF_TIM15_1 : constant GPIO_Alternate_Function := 1; GPIO_AF_TIM16_1 : constant GPIO_Alternate_Function := 1; GPIO_AF_TIM17_1 : constant GPIO_Alternate_Function := 1; GPIO_AF_LPTIM1_1 : constant GPIO_Alternate_Function := 1; GPIO_AF_I2C1_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_I2C3_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM1_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM2_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM3_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM4_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM5_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM8_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM15_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM20_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_COMP1_2 : constant GPIO_Alternate_Function := 2; GPIO_AF_SPI1_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_I2C3_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_I2C4_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_SAI1_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_USB_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_HRTIM1_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_TIM8_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_TIM15_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_TIM20_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_COMP3_3 : constant GPIO_Alternate_Function := 3; GPIO_AF_I2C1_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_I2C2_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_I2C3_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_I2C4_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_TIM1_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_TIM8_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_TIM16_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_TIM17_4 : constant GPIO_Alternate_Function := 4; GPIO_AF_SPI1_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_SPI2_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_SPI3_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_SPI4_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_I2S2_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_I2S3_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_I2C4_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_UART4_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_UART5_5 : constant GPIO_Alternate_Function := 5; GPIO_AF_TIM8_5 : constant GPIO_Alternate_Function := 6; GPIO_AF_INFRARED_5 : constant GPIO_Alternate_Function := 6; GPIO_AF_SPI2_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_SPI3_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_I2S2_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_I2S3_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_TIM1_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_TIM5_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_TIM8_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_TIM20_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_INFRARED_6 : constant GPIO_Alternate_Function := 6; GPIO_AF_USART1_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_USART2_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_USART3_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_FDCAN_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_COMP5_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_COMP6_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_COMP7_7 : constant GPIO_Alternate_Function := 7; GPIO_AF_I2C3_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_I2C4_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_UART4_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_UART5_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_LPUART1_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP1_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP2_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP3_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP4_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP5_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP6_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_COMP7_8 : constant GPIO_Alternate_Function := 8; GPIO_AF_FDCAN1_9 : constant GPIO_Alternate_Function := 9; GPIO_AF_FDCAN2_9 : constant GPIO_Alternate_Function := 9; GPIO_AF_TIM1_9 : constant GPIO_Alternate_Function := 9; GPIO_AF_TIM8_9 : constant GPIO_Alternate_Function := 9; GPIO_AF_TIM15_9 : constant GPIO_Alternate_Function := 9; GPIO_AF_SPI1_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_TIM1_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_TIM2_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_TIM3_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_TIM4_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_TIM7_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_TIM8_10 : constant GPIO_Alternate_Function := 10; GPIO_AF_LPTIM1_11 : constant GPIO_Alternate_Function := 11; GPIO_AF_TIM1_11 : constant GPIO_Alternate_Function := 11; GPIO_AF_TIM8_11 : constant GPIO_Alternate_Function := 11; GPIO_AF_FDCAN1_11 : constant GPIO_Alternate_Function := 11; GPIO_AF_FDCAN3_11 : constant GPIO_Alternate_Function := 11; GPIO_AF_FMC_12 : constant GPIO_Alternate_Function := 12; GPIO_AF_LPUART1_12 : constant GPIO_Alternate_Function := 12; GPIO_AF_SAI1_12 : constant GPIO_Alternate_Function := 12; GPIO_AF_HRTIM1_12 : constant GPIO_Alternate_Function := 12; GPIO_AF_TIM1_12 : constant GPIO_Alternate_Function := 12; GPIO_AF_SAI1_13 : constant GPIO_Alternate_Function := 13; GPIO_AF_HRTIM1_13 : constant GPIO_Alternate_Function := 13; GPIO_AF_OPAMP2_13 : constant GPIO_Alternate_Function := 13; GPIO_AF_UART4_14 : constant GPIO_Alternate_Function := 14; GPIO_AF_UART5_14 : constant GPIO_Alternate_Function := 14; GPIO_AF_SAI1_14 : constant GPIO_Alternate_Function := 14; GPIO_AF_TIM2_14 : constant GPIO_Alternate_Function := 14; GPIO_AF_TIM15_14 : constant GPIO_Alternate_Function := 14; GPIO_AF_UCPD1_14 : constant GPIO_Alternate_Function := 14; GPIO_AF_EVENTOUT_15 : constant GPIO_Alternate_Function := 15; end STM32.Device;
with display,Ada.Containers.Hashed_Maps ; with Ada.Strings.Hash; with Ada.text_io; use Ada.text_io; package body snake_types is function Hash_Func(Key : character) return Ada.Containers.Hash_Type is begin return Ada.Strings.Hash(Key'Image); end Hash_Func; end snake_types ;
with Extraction.Node_Edge_Types; with Extraction.Utilities; package body Extraction.Subp_Overrides is procedure Extract_Nodes (Node : LAL.Ada_Node'Class; Graph : Graph_Operations.Graph_Context) is begin if Utilities.Is_Relevant_Basic_Decl (Node) and then Node.As_Basic_Decl.P_Is_Subprogram then declare Decl : constant LAL.Basic_Decl := Node.As_Basic_Decl; Base_Decls : constant LAL.Basic_Decl_Array := Decl.P_Base_Subp_Declarations; begin -- Add all subprograms that are overriden even if external. for Base_Decl of Base_Decls loop Graph.Write_Node (Base_Decl); end loop; end; end if; end Extract_Nodes; procedure Extract_Edges (Node : LAL.Ada_Node'Class; Graph : Graph_Operations.Graph_Context) is begin if Utilities.Is_Relevant_Basic_Decl (Node) and then Node.As_Basic_Decl.P_Is_Subprogram then declare Decl : constant LAL.Basic_Decl := Node.As_Basic_Decl; Base_Decls : constant LAL.Basic_Decl_Array := Decl.P_Base_Subp_Declarations; begin if (for some Base_Decl of Base_Decls => Base_Decl = Decl) then -- Ignore implementations later in the same file. for Base_Decl of Base_Decls loop if Base_Decl /= Decl then -- Ignore Decl itself, which will be in the set, -- unless it is an implementation later in the same file. Graph.Write_Edge (Base_Decl, Decl, Node_Edge_Types.Edge_Type_Is_Overridden_By); end if; end loop; end if; end; end if; end Extract_Edges; end Extraction.Subp_Overrides;
-- This package was generated by the Ada_Drivers_Library project wizard script package ADL_Config is Max_Mount_Points : constant := 2; -- From default value Max_Mount_Name_Length : constant := 128; -- From default value Has_Ravenscar_Full_Runtime : constant String := "False"; -- From default value Board : constant String := "Native"; -- From command line Has_ZFP_Runtime : constant String := "False"; -- From default value Has_Ravenscar_SFP_Runtime : constant String := "False"; -- From default value Use_Startup_Gen : constant Boolean := False; -- From command line Max_Path_Length : constant := 1024; -- From default value Architecture : constant String := "Native"; -- From board definition end ADL_Config;
-- Copyright (c) 2021 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Streams.Stream_IO; with League.Strings; with Network.Connection_Promises; with Network.Connections; with Network.Streams; package Listeners is type Listener is limited new Network.Connection_Promises.Listener and Network.Connections.Listener with record Promise : Network.Connection_Promises.Promise; Remote : Network.Connections.Connection_Access; Output : Ada.Streams.Stream_IO.File_Type; Done : Boolean := False; end record; overriding procedure On_Resolve (Self : in out Listener; Value : Network.Connections.Connection_Access); overriding procedure On_Reject (Self : in out Listener; Value : League.Strings.Universal_String); overriding procedure Closed (Self : in out Listener; Error : League.Strings.Universal_String); overriding procedure Can_Write (Self : in out Listener); overriding procedure Can_Read (Self : in out Listener); end Listeners;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- C U D A -- -- -- -- B o d y -- -- -- -- Copyright (C) 2010-2020, 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package defines CUDA-specific datastructures and functions. with Atree; use Atree; with Debug; use Debug; with Elists; use Elists; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Rtsfind; use Rtsfind; with Sinfo; use Sinfo; with Stringt; use Stringt; with Tbuild; use Tbuild; with Uintp; use Uintp; with Sem; use Sem; with Sem_Util; use Sem_Util; with Snames; use Snames; with GNAT.HTable; package body GNAT_CUDA is -------------------------------------- -- Hash Table for CUDA_Global nodes -- -------------------------------------- type Hash_Range is range 0 .. 510; -- Size of hash table headers function Hash (F : Entity_Id) return Hash_Range; -- Hash function for hash table package CUDA_Kernels_Table is new GNAT.HTable.Simple_HTable (Header_Num => Hash_Range, Element => Elist_Id, No_Element => No_Elist, Key => Entity_Id, Hash => Hash, Equal => "="); -- The keys of this table are package entities whose bodies contain at -- least one procedure marked with aspect CUDA_Global. The values are -- Elists of the marked procedures. function Get_CUDA_Kernels (Pack_Id : Entity_Id) return Elist_Id; -- Returns an Elist of all procedures marked with pragma CUDA_Global that -- are declared within package body Pack_Body. Returns No_Elist if -- Pack_Id does not contain such procedures. procedure Set_CUDA_Kernels (Pack_Id : Entity_Id; Kernels : Elist_Id); -- Stores Kernels as the list of kernels belonging to the package entity -- Pack_Id. Pack_Id must not have a list of kernels. --------------------- -- Add_CUDA_Kernel -- --------------------- procedure Add_CUDA_Kernel (Pack_Id : Entity_Id; Kernel : Entity_Id) is Kernels : Elist_Id := Get_CUDA_Kernels (Pack_Id); begin if Kernels = No_Elist then Kernels := New_Elmt_List; Set_CUDA_Kernels (Pack_Id, Kernels); end if; Append_Elmt (Kernel, Kernels); end Add_CUDA_Kernel; ---------- -- Hash -- ---------- function Hash (F : Entity_Id) return Hash_Range is begin return Hash_Range (F mod 511); end Hash; ---------------------- -- Get_CUDA_Kernels -- ---------------------- function Get_CUDA_Kernels (Pack_Id : Entity_Id) return Elist_Id is begin return CUDA_Kernels_Table.Get (Pack_Id); end Get_CUDA_Kernels; ------------------------------------------ -- Build_And_Insert_CUDA_Initialization -- ------------------------------------------ procedure Build_And_Insert_CUDA_Initialization (N : Node_Id) is -- For the following kernel declaration: -- -- package body <Package_Name> is -- procedure <Proc_Name> (X : Integer) with CUDA_Global; -- end package; -- -- Insert the following declarations: -- -- Fat_Binary : System.Address; -- pragma Import -- (Convention => C, -- Entity => Fat_Binary, -- External_Name => "_binary_<Package_Name>_fatbin_start"); -- -- Wrapper : Fatbin_Wrapper := -- (16#466243b1#, 1, Fat_Binary'Address, System.Null_Address); -- -- Proc_Symbol_Name : Interfaces.C.Strings.Chars_Ptr := -- Interfaces.C.Strings.New_Char_Array("<Proc_Name>"); -- -- Fat_Binary_Handle : System.Address := -- CUDA.Internal.Register_Fat_Binary (Wrapper'Address); -- -- procedure Initialize_CUDA_Kernel is -- begin -- CUDA.Internal.Register_Function -- (Fat_Binary_Handle, -- <Proc_Name>'Address, -- Proc_Symbol_Name, -- Proc_Symbol_Name, -- -1, -- System.Null_Address, -- System.Null_Address, -- System.Null_Address, -- System.Null_Address, -- System.Null_Address); -- CUDA.Internal.Register_Fat_Binary_End (Fat_Binary_Handle); -- end Initialize_CUDA_Kernel; -- -- Proc_Symbol_Name is the name of the procedure marked with -- CUDA_Global. The CUDA runtime uses this in order to be able to find -- kernels in the fat binary, so it has to match the name of the -- procedure symbol compiled by GNAT_LLVM. When looking at the code -- generated by NVCC, it seems that the CUDA runtime also needs the name -- of the procedure symbol of the host. Fortuantely, the procedures are -- named the same way whether they are compiled for the host or the -- device, so we use Vector_Add_Name to specify the name of the symbol -- for both the host and the device. The meaning of the rest of the -- arguments is unknown. function Build_CUDA_Init_Proc (Init_Id : Entity_Id; CUDA_Kernels : Elist_Id; Handle_Id : Entity_Id; Pack_Decls : List_Id) return Node_Id; -- Create the declaration of Init_Id, the function that binds each -- kernel present in CUDA_Kernels with the fat binary Handle_Id and then -- tells the CUDA runtime that no new function will be bound to the fat -- binary. function Build_Fat_Binary_Declaration (Bin_Id : Entity_Id) return Node_Id; -- Create a declaration for Bin_Id, the entity that represents the fat -- binary, i.e.: -- -- Bin_Id : System.Address; function Build_Fat_Binary_Handle_Declaration (Handle_Id : Entity_Id; Wrapper_Id : Entity_Id) return Node_Id; -- Create the declaration of Handle_Id, a System.Address that will -- receive the results of passing the address of Wrapper_Id to -- CUDA.Register_Fat_Binary, i.e.: -- -- Handle_Id : System.Address := -- CUDA.Register_Fat_Binary (Wrapper_Id'Address) function Build_Fat_Binary_Wrapper_Declaration (Wrapper_Id : Entity_Id; Bin_Id : Entity_Id) return Node_Id; -- Create the declaration of the fat binary wrapper Wrapper_Id, which -- holds magic numbers and Bin_Id'Address, i.e.: -- -- Wrapper_Id : System.Address := -- (16#466243b1#, 1, Bin_Id'Address, System.Null_Address); function Build_Import_Pragma (Bin_Id : Entity_Id; Pack_Body : Node_Id) return Node_Id; -- Create a pragma that will bind the fat binary Bin_Id to its external -- symbol. N is the package body Bin_Id belongs to, i.e.: -- -- pragma Import -- (Convention => C, -- Entity => Bin_Id, -- External_Name => "_binary_<Pack_Body's name>_fatbin_start"); function Build_Kernel_Name_Declaration (Kernel : Entity_Id) return Node_Id; -- Create the declaration of a C string that contains the name of -- Kernel's symbol, i.e.: -- -- Kernel : Interfaces.C.Strings.Chars_Ptr := -- Interfaces.C.Strings.New_Char_Array("<Kernel's name>"); function Build_Register_Procedure_Call (Loc : Source_Ptr; Bin : Entity_Id; Kernel : Entity_Id; Kernel_Name : Entity_Id) return Node_Id; -- Return a call to CUDA.Internal.Register_Function that binds Kernel -- (the entity of a procedure) to the symbol described by the C string -- Kernel_Name in the fat binary Bin, using Loc as location. -------------------------- -- Build_CUDA_Init_Proc -- -------------------------- function Build_CUDA_Init_Proc (Init_Id : Entity_Id; CUDA_Kernels : Elist_Id; Handle_Id : Entity_Id; Pack_Decls : List_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Init_Id); Stmts : constant List_Id := New_List; -- List of statements that will be used by the cuda initialization -- function. New_Stmt : Node_Id; -- Temporary variable to hold the various newly-created nodes. Kernel_Elmt : Elmt_Id; Kernel_Id : Entity_Id; begin -- For each CUDA_Global function, declare a C string that holds -- its symbol's name (i.e. packagename __ functionname). -- Also create a function call to CUDA.Internal.Register_Function -- that takes the declared C string, a pointer to the function and -- the fat binary handle. Kernel_Elmt := First_Elmt (CUDA_Kernels); while Present (Kernel_Elmt) loop Kernel_Id := Node (Kernel_Elmt); New_Stmt := Build_Kernel_Name_Declaration (Kernel_Id); Append (New_Stmt, Pack_Decls); Analyze (New_Stmt); Append_To (Stmts, Build_Register_Procedure_Call (Loc, Bin => Handle_Id, Kernel => Kernel_Id, Kernel_Name => Defining_Entity (New_Stmt))); Next_Elmt (Kernel_Elmt); end loop; -- Finish the CUDA initialization function: add a call to -- register_fat_binary_end, to let the CUDA runtime know that we -- won't be registering any other symbol with the current fat binary. Append_To (Stmts, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Register_Fat_Binary_End), Loc), Parameter_Associations => New_List (New_Occurrence_Of (Handle_Id, Loc)))); -- Now that we have all the declarations and calls we need, we can -- build and and return the initialization procedure. return Make_Subprogram_Body (Loc, Specification => Make_Procedure_Specification (Loc, Init_Id), Declarations => New_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Stmts)); end Build_CUDA_Init_Proc; ---------------------------------- -- Build_Fat_Binary_Declaration -- ---------------------------------- function Build_Fat_Binary_Declaration (Bin_Id : Entity_Id) return Node_Id is begin return Make_Object_Declaration (Sloc (Bin_Id), Defining_Identifier => Bin_Id, Object_Definition => New_Occurrence_Of (RTE (RE_Address), Sloc (Bin_Id))); end Build_Fat_Binary_Declaration; ----------------------------------------- -- Build_Fat_Binary_Handle_Declaration -- ----------------------------------------- function Build_Fat_Binary_Handle_Declaration (Handle_Id : Entity_Id; Wrapper_Id : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Handle_Id); begin -- Generate: -- Handle_Id : System.Address := -- CUDA.Register_Fat_Binary (Wrapper_Id'Address); return Make_Object_Declaration (Loc, Defining_Identifier => Handle_Id, Object_Definition => New_Occurrence_Of (RTE (RE_Address), Loc), Expression => Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_Register_Fat_Binary), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Wrapper_Id, Loc), Attribute_Name => Name_Address)))); end Build_Fat_Binary_Handle_Declaration; ------------------------------------------ -- Build_Fat_Binary_Wrapper_Declaration -- ------------------------------------------ function Build_Fat_Binary_Wrapper_Declaration (Wrapper_Id : Entity_Id; Bin_Id : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Wrapper_Id); begin return Make_Object_Declaration (Loc, Defining_Identifier => Wrapper_Id, Object_Definition => New_Occurrence_Of (RTE (RE_Fatbin_Wrapper), Loc), Expression => Make_Aggregate (Loc, Expressions => New_List ( Make_Integer_Literal (Loc, UI_From_Int (16#466243b1#)), Make_Integer_Literal (Loc, UI_From_Int (1)), Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Bin_Id, Loc), Attribute_Name => Name_Address), New_Occurrence_Of (RTE (RE_Null_Address), Loc)))); end Build_Fat_Binary_Wrapper_Declaration; ------------------------- -- Build_Import_Pragma -- ------------------------- function Build_Import_Pragma (Bin_Id : Entity_Id; Pack_Body : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Bin_Id); External_Symbol : String_Id; begin Start_String; Store_String_Chars ("_binary_" & Get_Name_String (Chars (Defining_Unit_Name (Pack_Body))) & "_fatbin_start"); External_Symbol := End_String; return Make_Pragma (Loc, Pragma_Identifier => Make_Identifier (Loc, Name_Import), Pragma_Argument_Associations => New_List ( Make_Pragma_Argument_Association (Loc, Chars => Name_Convention, Expression => Make_Identifier (Loc, Name_C)), Make_Pragma_Argument_Association (Loc, Chars => Name_Entity, Expression => New_Occurrence_Of (Bin_Id, Loc)), Make_Pragma_Argument_Association (Loc, Chars => Name_External_Name, Expression => Make_String_Literal (Loc, External_Symbol)))); end Build_Import_Pragma; ------------------------------------- -- Build_Kernel_Name_Declaration -- ------------------------------------- function Build_Kernel_Name_Declaration (Kernel : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Kernel); Package_Name : constant String := Get_Name_String (Chars (Scope (Kernel))); Symbol_Name : constant String := Get_Name_String (Chars (Kernel)); Kernel_Name : String_Id; begin Start_String; Store_String_Chars (Package_Name & "__" & Symbol_Name); Kernel_Name := End_String; return Make_Object_Declaration (Loc, Defining_Identifier => Make_Temporary (Loc, 'C'), Object_Definition => New_Occurrence_Of (RTE (RE_Chars_Ptr), Loc), Expression => Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_New_Char_Array), Loc), Parameter_Associations => New_List ( Make_String_Literal (Loc, Kernel_Name)))); end Build_Kernel_Name_Declaration; ----------------------------------- -- Build_Register_Procedure_Call -- ----------------------------------- function Build_Register_Procedure_Call (Loc : Source_Ptr; Bin : Entity_Id; Kernel : Entity_Id; Kernel_Name : Entity_Id) return Node_Id is Args : constant List_Id := New_List; begin -- First argument: the handle of the fat binary. Append (New_Occurrence_Of (Bin, Loc), Args); -- Second argument: the host address of the function that is -- marked with CUDA_Global. Append_To (Args, Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Kernel, Loc), Attribute_Name => Name_Address)); -- Third argument, the name of the function on the host. Append (New_Occurrence_Of (Kernel_Name, Loc), Args); -- Fourth argument, the name of the function on the device. Append (New_Occurrence_Of (Kernel_Name, Loc), Args); -- Fith argument: -1. Meaning unknown - this has been copied from -- LLVM. Append (Make_Integer_Literal (Loc, UI_From_Int (-1)), Args); -- Args 6, 7, 8, 9, 10: Null pointers. Again, meaning unknown. for Arg_Count in 1 .. 5 loop Append_To (Args, New_Occurrence_Of (RTE (RE_Null_Address), Loc)); end loop; -- Build the call to CUDARegisterFunction, passing the argument -- list we just built. return Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Register_Function), Loc), Parameter_Associations => Args); end Build_Register_Procedure_Call; -- Local declarations Loc : constant Source_Ptr := Sloc (N); Spec_Id : constant Node_Id := Corresponding_Spec (N); -- The specification of the package we're adding a cuda init func to. Pack_Decls : constant List_Id := Declarations (N); CUDA_Node_List : constant Elist_Id := Get_CUDA_Kernels (Spec_Id); -- CUDA nodes that belong to the package. CUDA_Init_Func : Entity_Id; -- Entity of the cuda init func. Fat_Binary : Entity_Id; -- Entity of the fat binary of N. Bound to said fat binary by a pragma. Fat_Binary_Handle : Entity_Id; -- Entity of the result of passing the fat binary wrapper to. -- CUDA.Register_Fat_Binary. Fat_Binary_Wrapper : Entity_Id; -- Entity of a record that holds a bunch of magic numbers and a -- reference to Fat_Binary. New_Stmt : Node_Id; -- Node to store newly-created declarations -- Start of processing for Build_And_Insert_CUDA_Initialization begin if CUDA_Node_List = No_Elist or not Debug_Flag_Underscore_C then return; end if; Fat_Binary := Make_Temporary (Loc, 'C'); New_Stmt := Build_Fat_Binary_Declaration (Fat_Binary); Append_To (Pack_Decls, New_Stmt); Analyze (New_Stmt); New_Stmt := Build_Import_Pragma (Fat_Binary, N); Append_To (Pack_Decls, New_Stmt); Analyze (New_Stmt); Fat_Binary_Wrapper := Make_Temporary (Loc, 'C'); New_Stmt := Build_Fat_Binary_Wrapper_Declaration (Wrapper_Id => Fat_Binary_Wrapper, Bin_Id => Fat_Binary); Append_To (Pack_Decls, New_Stmt); Analyze (New_Stmt); Fat_Binary_Handle := Make_Temporary (Loc, 'C'); New_Stmt := Build_Fat_Binary_Handle_Declaration (Fat_Binary_Handle, Fat_Binary_Wrapper); Append_To (Pack_Decls, New_Stmt); Analyze (New_Stmt); CUDA_Init_Func := Make_Temporary (Loc, 'C'); New_Stmt := Build_CUDA_Init_Proc (Init_Id => CUDA_Init_Func, CUDA_Kernels => CUDA_Node_List, Handle_Id => Fat_Binary_Handle, Pack_Decls => Pack_Decls); Append_To (Pack_Decls, New_Stmt); Analyze (New_Stmt); New_Stmt := Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (CUDA_Init_Func, Loc)); Append_To (Pack_Decls, New_Stmt); Analyze (New_Stmt); end Build_And_Insert_CUDA_Initialization; -------------------- -- Set_CUDA_Nodes -- -------------------- procedure Set_CUDA_Kernels (Pack_Id : Entity_Id; Kernels : Elist_Id) is begin pragma Assert (Get_CUDA_Kernels (Pack_Id) = No_Elist); CUDA_Kernels_Table.Set (Pack_Id, Kernels); end Set_CUDA_Kernels; end GNAT_CUDA;
package FLTK.Widgets.Inputs.Float is type Float_Input is new Input with private; type Float_Input_Reference (Data : not null access Float_Input'Class) is limited null record with Implicit_Dereference => Data; package Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Float_Input; end Forge; function Get_Value (This : in Float_Input) return Standard.Float; procedure Draw (This : in out Float_Input); function Handle (This : in out Float_Input; Event : in Event_Kind) return Event_Outcome; private type Float_Input is new Input with null record; overriding procedure Finalize (This : in out Float_Input); pragma Inline (Get_Value); pragma Inline (Draw); pragma Inline (Handle); end FLTK.Widgets.Inputs.Float;
------------------------------------------------------------------------------ -- Copyright (c) 2014-2015, Natacha Porté -- -- -- -- Permission to use, copy, modify, and distribute this software for any -- -- purpose with or without fee is hereby granted, provided that the above -- -- copyright notice and this permission notice appear in all copies. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ with Natools.S_Expressions.Interpreter_Loop; with Natools.S_Expressions.Templates.Generic_Discrete_Render; with Natools.S_Expressions.Templates.Integers; with Natools.Static_Maps.S_Expressions.Templates.Dates; with Natools.Time_IO.RFC_3339; package body Natools.S_Expressions.Templates.Dates is package Commands renames Natools.Static_Maps.S_Expressions.Templates.Dates; procedure Render_Day_Of_Week is new Natools.S_Expressions.Templates.Generic_Discrete_Render (Ada.Calendar.Formatting.Day_Name, Ada.Calendar.Formatting.Day_Name'Image, Ada.Calendar.Formatting."="); procedure Append (Output : in out Ada.Streams.Root_Stream_Type'Class; Value : in Split_Time; Data : in Atom); procedure Execute (Output : in out Ada.Streams.Root_Stream_Type'Class; Value : in Split_Time; Name : in Atom; Arguments : in out Lockable.Descriptor'Class); function Two_Digit_Image (Value : Integer) return Atom is ((1 => Character'Pos ('0') + Octet (Value / 10), 2 => Character'Pos ('0') + Octet (Value mod 10))) with Pre => Value in 0 .. 99; function Four_Digit_Image (Value : Integer) return Atom is ((1 => Character'Pos ('0') + Octet (Value / 1000), 2 => Character'Pos ('0') + Octet ((Value / 100) mod 10), 3 => Character'Pos ('0') + Octet ((Value / 10) mod 10), 4 => Character'Pos ('0') + Octet (Value mod 10))) with Pre => Value in 0 .. 9999; function Parse_Time_Offset (Image : in String; Date : in Ada.Calendar.Time) return Ada.Calendar.Time_Zones.Time_Offset; procedure Render_Triplet (Output : in out Ada.Streams.Root_Stream_Type'Class; Part_1, Part_2, Part_3 : in Atom; Template : in out Lockable.Descriptor'Class); procedure Interpreter is new Interpreter_Loop (Ada.Streams.Root_Stream_Type'Class, Split_Time, Execute, Append); ------------------------------ -- Local Helper Subprograms -- ------------------------------ function Parse_Time_Offset (Image : in String; Date : in Ada.Calendar.Time) return Ada.Calendar.Time_Zones.Time_Offset is function Value (C : Character) return Ada.Calendar.Time_Zones.Time_Offset; function Value (C : Character) return Ada.Calendar.Time_Zones.Time_Offset is begin if C in '0' .. '9' then return Ada.Calendar.Time_Zones.Time_Offset (Character'Pos (C) - Character'Pos ('0')); else raise Constraint_Error with "Unknown time offset format"; end if; end Value; begin if Image = "system" then return Ada.Calendar.Time_Zones.UTC_Time_Offset (Date); end if; Abbreviation : begin return Ada.Calendar.Time_Zones.Time_Offset (Static_Maps.S_Expressions.Templates.Dates.To_Time_Offset (Image)); exception when Constraint_Error => null; end Abbreviation; Numeric : declare use type Ada.Calendar.Time_Zones.Time_Offset; First : Integer := Image'First; Length : Natural := Image'Length; V : Ada.Calendar.Time_Zones.Time_Offset; Negative : Boolean := False; begin if First in Image'Range and then Image (First) in '-' | '+' then Negative := Image (First) = '-'; First := First + 1; Length := Length - 1; end if; case Length is when 1 => V := Value (Image (First)) * 60; when 2 => V := Value (Image (First)) * 600 + Value (Image (First + 1)) * 60; when 4 => V := Value (Image (First)) * 600 + Value (Image (First + 1)) * 60 + Value (Image (First + 2)) * 10 + Value (Image (First + 3)); when 5 => if Image (First + 2) in '0' .. '9' then raise Constraint_Error with "Unknown time offset format"; end if; V := Value (Image (First)) * 600 + Value (Image (First + 1)) * 60 + Value (Image (First + 3)) * 10 + Value (Image (First + 4)); when others => raise Constraint_Error with "Unknown time offset format"; end case; if Negative then return -V; else return V; end if; end Numeric; end Parse_Time_Offset; procedure Render_Triplet (Output : in out Ada.Streams.Root_Stream_Type'Class; Part_1, Part_2, Part_3 : in Atom; Template : in out Lockable.Descriptor'Class) is begin Output.Write (Part_1); if Template.Current_Event = Events.Add_Atom then declare Separator : constant Atom := Template.Current_Atom; Event : Events.Event; begin Template.Next (Event); Output.Write (Separator); Output.Write (Part_2); if Event = Events.Add_Atom then Output.Write (Template.Current_Atom); else Output.Write (Separator); end if; end; else Output.Write (Part_2); end if; Output.Write (Part_3); end Render_Triplet; ---------------------------- -- Interpreter Components -- ---------------------------- procedure Append (Output : in out Ada.Streams.Root_Stream_Type'Class; Value : in Split_Time; Data : in Atom) is pragma Unreferenced (Value); begin Output.Write (Data); end Append; procedure Execute (Output : in out Ada.Streams.Root_Stream_Type'Class; Value : in Split_Time; Name : in Atom; Arguments : in out Lockable.Descriptor'Class) is Format : Integers.Format; begin case Commands.Main (To_String (Name)) is when Commands.Error => null; when Commands.Big_Endian_Date => Render_Triplet (Output, Four_Digit_Image (Value.Year), Two_Digit_Image (Value.Month), Two_Digit_Image (Value.Day), Arguments); when Commands.Big_Endian_Time => Render_Triplet (Output, Two_Digit_Image (Value.Hour), Two_Digit_Image (Value.Minute), Two_Digit_Image (Value.Second), Arguments); when Commands.Day => Format.Set_Image (0, Null_Atom); Integers.Render (Output, Format, Arguments, Value.Day); when Commands.Day_Of_Week => Render_Day_Of_Week (Output, Arguments, Value.Day_Of_Week); when Commands.Hour => Format.Set_Image (-1, Null_Atom); Integers.Render (Output, Format, Arguments, Value.Hour); when Commands.Little_Endian_Date => Render_Triplet (Output, Two_Digit_Image (Value.Day), Two_Digit_Image (Value.Month), Four_Digit_Image (Value.Year), Arguments); when Commands.Little_Endian_Time => Render_Triplet (Output, Two_Digit_Image (Value.Second), Two_Digit_Image (Value.Minute), Two_Digit_Image (Value.Hour), Arguments); when Commands.Minute => Format.Set_Image (-1, Null_Atom); Integers.Render (Output, Format, Arguments, Value.Minute); when Commands.Month => Format.Set_Image (0, Null_Atom); Integers.Render (Output, Format, Arguments, Value.Month); when Commands.Padded_Day => Format.Set_Image (0, Null_Atom); Format.Set_Minimum_Width (2); Format.Set_Left_Padding ((1 => Character'Pos ('0'))); Format.Set_Align (Integers.Right_Aligned); Integers.Render (Output, Format, Arguments, Value.Day); when Commands.Padded_Hour => Format.Set_Image (-1, Null_Atom); Format.Set_Minimum_Width (2); Format.Set_Left_Padding ((1 => Character'Pos ('0'))); Format.Set_Align (Integers.Right_Aligned); Integers.Render (Output, Format, Arguments, Value.Hour); when Commands.Padded_Minute => Format.Set_Image (-1, Null_Atom); Format.Set_Minimum_Width (2); Format.Set_Left_Padding ((1 => Character'Pos ('0'))); Format.Set_Align (Integers.Right_Aligned); Integers.Render (Output, Format, Arguments, Value.Minute); when Commands.Padded_Month => Format.Set_Image (0, Null_Atom); Format.Set_Minimum_Width (2); Format.Set_Left_Padding ((1 => Character'Pos ('0'))); Format.Set_Align (Integers.Right_Aligned); Integers.Render (Output, Format, Arguments, Value.Month); when Commands.Padded_Second => Format.Set_Image (-1, Null_Atom); Format.Set_Minimum_Width (2); Format.Set_Left_Padding ((1 => Character'Pos ('0'))); Format.Set_Align (Integers.Right_Aligned); Integers.Render (Output, Format, Arguments, Value.Second); when Commands.RFC_3339 => Output.Write (To_Atom (Time_IO.RFC_3339.Image (Value.Source, Value.Time_Zone))); when Commands.Second => Format.Set_Image (-1, Null_Atom); Integers.Render (Output, Format, Arguments, Value.Second); when Commands.With_Offset => if Arguments.Current_Event = Events.Add_Atom then declare use type Ada.Calendar.Time_Zones.Time_Offset; New_Offset : Ada.Calendar.Time_Zones.Time_Offset; begin begin New_Offset := Parse_Time_Offset (S_Expressions.To_String (Arguments.Current_Atom), Value.Source); exception when Constraint_Error => return; end; Arguments.Next; if New_Offset = Value.Time_Zone then Interpreter (Arguments, Output, Value); else Render (Output, Arguments, Value.Source, New_Offset); end if; end; end if; when Commands.Year => Integers.Render (Output, Arguments, Value.Year); end case; end Execute; ---------------------- -- Public Interface -- ---------------------- function Split (Value : Ada.Calendar.Time; Time_Zone : Ada.Calendar.Time_Zones.Time_Offset) return Split_Time is use type Ada.Calendar.Time_Zones.Time_Offset; Zone_Offset : constant Ada.Calendar.Time_Zones.Time_Offset := Time_Zone - Ada.Calendar.Time_Zones.UTC_Time_Offset (Value); Year : Ada.Calendar.Year_Number; Month : Ada.Calendar.Month_Number; Day : Ada.Calendar.Day_Number; Hour : Ada.Calendar.Formatting.Hour_Number; Minute : Ada.Calendar.Formatting.Minute_Number; Second : Ada.Calendar.Formatting.Second_Number; Sub_Second : Ada.Calendar.Formatting.Second_Duration; begin Ada.Calendar.Formatting.Split (Value, Year, Month, Day, Hour, Minute, Second, Sub_Second, Time_Zone); return Split_Time' (Source => Value, Time_Zone => Time_Zone, Year => Year, Month => Month, Day => Day, Day_Of_Week => Ada.Calendar.Formatting.Day_Of_Week (Ada.Calendar."+" (Value, 60 * Duration (Zone_Offset))), Hour => Hour, Minute => Minute, Second => Second, Sub_Second => Sub_Second); end Split; procedure Render (Output : in out Ada.Streams.Root_Stream_Type'Class; Template : in out Lockable.Descriptor'Class; Value : in Ada.Calendar.Time) is begin Render (Output, Template, Value, Ada.Calendar.Time_Zones.UTC_Time_Offset (Value)); end Render; procedure Render (Output : in out Ada.Streams.Root_Stream_Type'Class; Template : in out Lockable.Descriptor'Class; Value : in Ada.Calendar.Time; Time_Zone : Ada.Calendar.Time_Zones.Time_Offset) is begin Render (Output, Template, Split (Value, Time_Zone)); end Render; procedure Render (Output : in out Ada.Streams.Root_Stream_Type'Class; Template : in out Lockable.Descriptor'Class; Value : in Split_Time) is begin Interpreter (Template, Output, Value); end Render; end Natools.S_Expressions.Templates.Dates;
with box2d_c.Binding, box2d_physics.Object, c_math_c.Vector_3, c_math_c.Matrix_4x4, c_math_c.Conversion, Swig, interfaces.C, ada.unchecked_Deallocation, ada.unchecked_Conversion; package body box2d_Physics.Joint is use c_math_c.Conversion, box2d_c.Binding, Interfaces; type Any_limited_view is access all lace.Any.limited_item'Class; function to_Any_view is new ada.unchecked_Conversion (Swig.void_ptr, Any_limited_view); function to_Object_view is new ada.unchecked_Conversion (swig.void_ptr, physics.Object.view); pragma Unreferenced (to_Object_view); -- procedure set_b2d_user_Data (Self : in View) -- is -- function to_void_ptr is new ada.Unchecked_Conversion (Any_limited_view, Swig.void_ptr); -- Self_as_any : constant Any_limited_view := Any_limited_view (Self); -- begin -- b2d_Joint_user_Data_is (Self.C, to_void_ptr (Self_as_any)); -- end set_b2d_user_Data; overriding function reaction_Force (Self : in Item) return Vector_3 is begin return +b2d_Joint_reaction_Force (Self.C); end reaction_Force; overriding function reaction_Torque (Self : in Item) return Real is begin return +b2d_Joint_reaction_Torque (Self.C); end reaction_Torque; overriding procedure user_Data_is (Self : in out Item; Now : access lace.Any.limited_item'Class) is begin Self.user_Data := Now; end user_Data_is; overriding function user_Data (Self : in Item) return access lace.Any.limited_item'Class is begin return Self.user_Data; end user_Data; -------- -- DoF6 -- function new_Dof6_Joint (Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.DoF6.view is Self : constant access DoF6 := new DoF6; pragma Unreferenced (Self); c_Object_A : box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_A).C; c_Object_B : box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_B).C; c_Frame_A : aliased c_math_c.Matrix_4x4.item := +Frame_A; c_Frame_B : aliased c_math_c.Matrix_4x4.item := +Frame_B; begin return null; end new_Dof6_Joint; overriding procedure destruct (Self : in out DoF6) is begin raise Program_Error with "TBD"; end destruct; overriding function Object_A (Self : in DoF6) return physics.Object.view is c_Object_A : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_A (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_A))); end Object_A; overriding function Object_B (Self : in DoF6) return physics.Object.view is c_Object_B : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_B (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_B))); end Object_B; overriding function Frame_A (Self : in DoF6) return Matrix_4x4 is begin return +b2d_Joint_Frame_A (Self.C); end Frame_A; overriding function Frame_B (Self : in DoF6) return Matrix_4x4 is begin return +b2d_Joint_Frame_B (Self.C); end Frame_B; overriding procedure Frame_A_is (Self : in out DoF6; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_A_is (Self.C, c_Now'unchecked_Access); end Frame_A_is; overriding procedure Frame_B_is (Self : in out DoF6; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_B_is (Self.C, c_Now'unchecked_Access); end Frame_B_is; overriding function is_Limited (Self : in DoF6; DoF : Degree_of_freedom) return Boolean is use type Swig.bool; begin return b2d_Joint_is_Limited (Self.C, Degree_of_freedom'Pos (DoF)) /= 0; end is_Limited; overriding procedure Velocity_is (Self : in out DoF6; Now : in Real; DoF : in Degree_of_freedom) is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; b2d_Joint_Velocity_is (Self.C, C.int (Now), c_math_c.Real (DoF)); end Velocity_is; overriding function Extent (Self : in DoF6; DoF : Degree_of_freedom) return Real is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; return Real (b2d_Joint_Extent (Self.C, C.int (DoF))); end Extent; overriding procedure desired_Extent_is (Self : in out DoF6; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end desired_Extent_is; overriding function lower_Limit (Self : in DoF6; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end lower_Limit; overriding function upper_Limit (Self : in DoF6; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end upper_Limit; overriding procedure lower_Limit_is (Self : in out DoF6; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end lower_Limit_is; overriding procedure upper_Limit_is (Self : in out DoF6; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end upper_Limit_is; -------- -- Ball -- function new_Ball_Joint (Object_A, Object_B : in physics.Object.view; Pivot_in_A, Pivot_in_B : in Vector_3) return physics.Joint.ball.view is Self : constant access Ball := new Ball; c_Object_A : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_A).C; c_Object_B : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_B).C; c_Pivot_in_A : aliased c_math_c.Vector_3.item := +Pivot_in_A; c_Pivot_in_B : aliased c_math_c.Vector_3.item := +Pivot_in_B; begin Self.C := b2d_new_ball_Joint (c_Object_A, c_Object_B, c_Pivot_in_A'unchecked_Access, c_Pivot_in_B'unchecked_Access); return Self; end new_Ball_Joint; overriding procedure destruct (Self : in out Ball) is begin raise Error with "TODO"; end destruct; overriding function Object_A (Self : in Ball) return physics.Object.view is c_Object_A : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_A (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_A))); end Object_A; overriding function Object_B (Self : in Ball) return physics.Object.view is c_Object_B : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_B (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_B))); end Object_B; overriding function Frame_A (Self : in Ball) return Matrix_4x4 is begin return +b2d_Joint_Frame_A (Self.C); end Frame_A; overriding function Frame_B (Self : in Ball) return Matrix_4x4 is begin return +b2d_Joint_Frame_B (Self.C); end Frame_B; overriding procedure Frame_A_is (Self : in out Ball; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_A_is (Self.C, c_Now'unchecked_Access); end Frame_A_is; overriding procedure Frame_B_is (Self : in out Ball; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_B_is (Self.C, c_Now'unchecked_Access); end Frame_B_is; overriding function is_Limited (Self : in Ball; DoF : Degree_of_freedom) return Boolean is use type Swig.bool; begin return b2d_Joint_is_Limited (Self.C, Degree_of_freedom'Pos (DoF)) /= 0; end is_Limited; overriding procedure Velocity_is (Self : in out Ball; Now : in Real; DoF : in Degree_of_freedom) is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; b2d_Joint_Velocity_is (Self.C, C.int (Now), c_math_c.Real (DoF)); end Velocity_is; overriding function Extent (Self : in Ball; DoF : Degree_of_freedom) return Real is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; return Real (b2d_Joint_Extent (Self.C, C.int (DoF))); end Extent; overriding procedure desired_Extent_is (Self : in out Ball; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end desired_Extent_is; overriding function lower_Limit (Self : in Ball; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end lower_Limit; overriding function upper_Limit (Self : in Ball; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end upper_Limit; overriding procedure lower_Limit_is (Self : in out Ball; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end lower_Limit_is; overriding procedure upper_Limit_is (Self : in out Ball; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end upper_Limit_is; ---------- -- Slider -- function new_Slider_Joint (Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.slider.view is Self : constant access Slider := new Slider; c_Object_A : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_A).C; c_Object_B : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_B).C; c_Frame_A : aliased c_math_c.Matrix_4x4.item := +Frame_A; c_Frame_B : aliased c_math_c.Matrix_4x4.item := +Frame_B; begin Self.C := b2d_new_slider_Joint (c_Object_A, c_Object_B, c_Frame_A'unchecked_Access, c_Frame_B'unchecked_Access); return Self; end new_Slider_Joint; overriding procedure destruct (Self : in out Slider) is begin raise Error with "TODO"; end destruct; overriding function Object_A (Self : in Slider) return physics.Object.view is c_Object_A : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_A (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_A))); end Object_A; overriding function Object_B (Self : in Slider) return physics.Object.view is c_Object_B : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_B (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_B))); end Object_B; overriding function Frame_A (Self : in Slider) return Matrix_4x4 is begin return +b2d_Joint_Frame_A (Self.C); end Frame_A; overriding function Frame_B (Self : in Slider) return Matrix_4x4 is begin return +b2d_Joint_Frame_B (Self.C); end Frame_B; overriding procedure Frame_A_is (Self : in out Slider; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_A_is (Self.C, c_Now'unchecked_Access); end Frame_A_is; overriding procedure Frame_B_is (Self : in out Slider; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_B_is (Self.C, c_Now'unchecked_Access); end Frame_B_is; overriding function is_Limited (Self : in Slider; DoF : Degree_of_freedom) return Boolean is use type Swig.bool; begin return b2d_Joint_is_Limited (Self.C, Degree_of_freedom'Pos (DoF)) /= 0; end is_Limited; overriding procedure Velocity_is (Self : in out Slider; Now : in Real; DoF : in Degree_of_freedom) is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; b2d_Joint_Velocity_is (Self.C, C.int (Now), c_math_c.Real (DoF)); end Velocity_is; overriding function Extent (Self : in Slider; DoF : Degree_of_freedom) return Real is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; return Real (b2d_Joint_Extent (Self.C, C.int (DoF))); end Extent; overriding procedure desired_Extent_is (Self : in out Slider; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end desired_Extent_is; overriding function lower_Limit (Self : in Slider; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end lower_Limit; overriding function upper_Limit (Self : in Slider; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end upper_Limit; overriding procedure lower_Limit_is (Self : in out Slider; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end lower_Limit_is; overriding procedure upper_Limit_is (Self : in out Slider; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end upper_Limit_is; -------------- -- cone_Twist -- function new_cone_Twist_Joint (Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.cone_twist.view is Self : constant access cone_Twist := new cone_Twist; c_Object_A : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_A).C; c_Object_B : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_B).C; c_Frame_A : aliased c_math_c.Matrix_4x4.item := +Frame_A; c_Frame_B : aliased c_math_c.Matrix_4x4.item := +Frame_B; begin Self.C := b2d_new_DoF6_Joint (c_Object_A, c_Object_B, c_Frame_A'unchecked_Access, c_Frame_B'unchecked_Access); return Self; end new_cone_Twist_Joint; overriding procedure destruct (Self : in out cone_Twist) is begin raise Error with "TODO"; end destruct; overriding function Object_A (Self : in cone_Twist) return physics.Object.view is c_Object_A : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_A (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_A))); end Object_A; overriding function Object_B (Self : in cone_Twist) return physics.Object.view is c_Object_B : constant box2d_c.Pointers.Object_Pointer := b2d_Joint_Object_B (Self.C); begin return physics.Object.view (to_Any_view (b2d_Object_user_Data (c_Object_B))); end Object_B; overriding function Frame_A (Self : in cone_Twist) return Matrix_4x4 is begin return +b2d_Joint_Frame_A (Self.C); end Frame_A; overriding function Frame_B (Self : in cone_Twist) return Matrix_4x4 is begin return +b2d_Joint_Frame_B (Self.C); end Frame_B; overriding procedure Frame_A_is (Self : in out cone_Twist; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_A_is (Self.C, c_Now'unchecked_Access); end Frame_A_is; overriding procedure Frame_B_is (Self : in out cone_Twist; Now : in Matrix_4x4) is c_Now : aliased c_math_c.Matrix_4x4.item := +Now; begin b2d_Joint_Frame_B_is (Self.C, c_Now'unchecked_Access); end Frame_B_is; overriding function is_Limited (Self : in cone_Twist; DoF : Degree_of_freedom) return Boolean is use type Swig.bool; begin return b2d_Joint_is_Limited (Self.C, Degree_of_freedom'Pos (DoF)) /= 0; end is_Limited; overriding procedure Velocity_is (Self : in out cone_Twist; Now : in Real; DoF : in Degree_of_freedom) is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; b2d_Joint_Velocity_is (Self.C, C.int (Now), c_math_c.Real (DoF)); end Velocity_is; overriding function Extent (Self : in cone_Twist; DoF : Degree_of_freedom) return Real is begin if DoF < 4 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; return Real (b2d_Joint_Extent (Self.C, C.int (DoF))); end Extent; overriding procedure desired_Extent_is (Self : in out cone_Twist; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end desired_Extent_is; overriding function lower_Limit (Self : in cone_Twist; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end lower_Limit; overriding function upper_Limit (Self : in cone_Twist; DoF : in Degree_of_freedom) return Real is begin raise Error with "TODO"; return 0.0; end upper_Limit; overriding procedure lower_Limit_is (Self : in out cone_Twist; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end lower_Limit_is; overriding procedure upper_Limit_is (Self : in out cone_Twist; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end upper_Limit_is; --------- -- Hinge -- function new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer; Object_A, Object_B : in physics.Object.view; Anchor_in_A, Anchor_in_B : in Vector_3; low_Limit, high_Limit : in math.Real; collide_Conected : in Boolean) return physics.Joint.hinge.view is use type box2d_physics.Object.view, physics.Object.view; Self : constant access Hinge := new Hinge; c_Object_A : box2d_C.Pointers.Object_Pointer; c_Object_B : box2d_C.Pointers.Object_Pointer; c_Anchor_in_A : aliased c_math_c.Vector_3.item := +Anchor_in_A; c_Anchor_in_B : aliased c_math_c.Vector_3.item := +Anchor_in_B; begin if Object_A = null or Object_B = null then raise Error with "Null object detected."; end if; if box2d_physics.Object.view (Object_A) /= null then c_Object_A := box2d_physics.Object.view (Object_A).C; end if; if box2d_physics.Object.view (Object_B) /= null then c_Object_B := box2d_physics.Object.view (Object_B).C; end if; Self.C := b2d_new_hinge_Joint_with_local_anchors (in_Space, c_Object_A, c_Object_B, c_Anchor_in_A'unchecked_Access, c_Anchor_in_B'unchecked_Access, c_math_c.Real (low_Limit), c_math_c.Real (high_Limit), Boolean'Pos (collide_Conected)); return Self; end new_hinge_Joint; function new_hinge_Joint (Object_A : in physics.Object.view; Frame_A : in Matrix_4x4) return physics.Joint.hinge.view is use type box2d_physics.Object.view; Self : constant access Hinge := new Hinge; c_Object_A : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_A).C; c_Frame_A : aliased c_math_c.Matrix_4x4.item := +Frame_A; begin Self.C := b2d_new_space_hinge_Joint (c_Object_A, c_Frame_A'unchecked_Access); return Self; end new_hinge_Joint; function new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer; Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4; low_Limit, high_Limit : in math.Real; collide_Conected : in Boolean) return physics.Joint.hinge.view is use type box2d_physics.Object.view, physics.Object.view; Self : constant access Hinge := new Hinge; c_Object_A : box2d_C.Pointers.Object_Pointer; c_Object_B : box2d_C.Pointers.Object_Pointer; c_Frame_A : aliased c_math_c.Matrix_4x4.item := +Frame_A; c_Frame_B : aliased c_math_c.Matrix_4x4.item := +Frame_B; begin if Object_A = null or Object_B = null then raise Error with "Null object detected."; end if; if box2d_physics.Object.view (Object_A) /= null then c_Object_A := box2d_physics.Object.view (Object_A).C; end if; if box2d_physics.Object.view (Object_B) /= null then c_Object_B := box2d_physics.Object.view (Object_B).C; end if; Self.C := b2d_new_hinge_Joint (in_Space, c_Object_A, c_Object_B, c_Frame_A'unchecked_Access, c_Frame_B'unchecked_Access, c_math_c.Real (low_Limit), c_math_c.Real (high_Limit), Boolean'Pos (collide_Conected)); return Self; end new_hinge_Joint; overriding procedure destruct (Self : in out Hinge) is begin b2d_free_hinge_Joint (Self.C); Self.C := null; end destruct; overriding procedure Limits_are (Self : in out Hinge; Low, High : in Real; Softness : in Real := 0.9; biasFactor : in Real := 0.3; relaxationFactor : in Real := 1.0) is begin b2d_Joint_hinge_Limits_are (Self.C, c_math_c.Real (Low), c_math_c.Real (High)); end Limits_are; overriding function lower_Limit (Self : in Hinge) return Real is begin raise Error with "TODO"; return 0.0; end lower_Limit; overriding function upper_Limit (Self : in Hinge) return Real is begin raise Error with "TODO"; return 0.0; end upper_Limit; overriding function Angle (Self : in Hinge) return Real is begin raise Error with "TODO"; return 0.0; end Angle; overriding function Object_A (Self : in Hinge) return physics.Object.view is begin raise Error with "TODO"; return null; end Object_A; overriding function Object_B (Self : in Hinge) return physics.Object.view is begin raise Error with "TODO"; return null; end Object_B; overriding function Frame_A (Self : in Hinge) return Matrix_4x4 is c_Frame : aliased c_math_c.Matrix_4x4.item; begin raise Error with "TODO"; return +c_Frame; end Frame_A; overriding function Frame_B (Self : in Hinge) return Matrix_4x4 is c_Frame : aliased c_math_c.Matrix_4x4.item; begin raise Error with "TODO"; return +c_Frame; end Frame_B; overriding procedure Frame_A_is (Self : in out Hinge; Now : in Matrix_4x4) is c_Frame : aliased constant c_math_c.Matrix_4x4.item := +Now; pragma Unreferenced (c_Frame); begin raise Error with "TODO"; end Frame_A_is; overriding procedure Frame_B_is (Self : in out Hinge; Now : in Matrix_4x4) is c_Frame : aliased constant c_math_c.Matrix_4x4.item := +Now; pragma Unreferenced (c_Frame); begin raise Error with "TODO"; end Frame_B_is; overriding function is_Limited (Self : in Hinge; DoF : Degree_of_freedom) return Boolean is pragma unreferenced (Self); begin return DoF = 1; end is_Limited; overriding procedure Velocity_is (Self : in out Hinge; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; if DoF /= 1 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; end Velocity_is; overriding function Extent (Self : in Hinge; DoF : Degree_of_freedom) return Real is begin raise Error with "TODO"; if DoF /= 1 then raise Error with "Illegal degree of freedom:" & Degree_of_freedom'Image (DoF); end if; return 0.0; end Extent; overriding procedure desired_Extent_is (Self : in out Hinge; Now : in Real; DoF : in Degree_of_freedom) is begin raise Error with "TODO"; end desired_Extent_is; -------- --- Free -- procedure free (the_Joint : in out physics.Joint.view) is procedure deallocate is new ada.unchecked_Deallocation (physics.Joint.item'Class, physics.Joint.view); begin deallocate (the_Joint); end free; end box2d_Physics.Joint;
-- C41303G.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT THE NOTATION L.ALL IS ALLOWED IF L IS THE NAME OF AN -- ACCESS OBJECT DESIGNATING A RECORD, AN ARRAY, A SCALAR, OR -- ANOTHER ACCESS OBJECT. -- CHECK THAT IF A IS AN IDENTIFIER DENOTING AN ACCESS OBJECT WHICH -- IN TURN DESIGNATES AN ACCESS OBJECT, THE FORM A.ALL.ALL IS -- ACCEPTED. -- THIS OBJECTIVE IS COVERED IN SEVERAL TESTS. IN THE FOLLOWING DIAGRAM, -- THE PORTION COVERED BY THE CURRENT TEST IS MARKED BY 'X' . -- || ASSIGNMT | PROC. PARAMETERS -- || ():= :=() | IN OUT IN OUT -- ========================||=============|==================== -- ACC REC || | -- --------------||-------------|-------------------- -- 1 '.ALL' ACC ARR || | -- --------------||-------------|-------------------- -- ACC SCLR || | -- ========================||=============|==================== -- ACC ACC REC || | -- --------------||-------------|-------------------- -- 1 '.ALL' ACC ACC ARR || | -- --------------||-------------|-------------------- -- ACC ACC SCLR || XXXXXXXXX | -- ========================||=============|==================== -- ACC ACC REC || | -- --------------||-------------|-------------------- -- 2 '.ALL' ACC ACC ARR || | -- --------------||-------------|-------------------- -- ACC ACC SCLR || | -- ============================================================ -- RM 1/20/82 -- RM 1/25/82 -- SPS 12/2/82 WITH REPORT; USE REPORT; PROCEDURE C41303G IS BEGIN TEST ( "C41303G" , "CHECK THAT THE NOTATION L.ALL IS ALLOWED IF" & " L IS THE NAME OF AN ACCESS OBJECT" & " DESIGNATING ANOTHER ACCESS OBJECT" ); ------------------------------------------------------------------- --------------- ACCESS TO ACCESS TO SCALAR ---------------------- DECLARE TYPE NEWINT IS NEW INTEGER ; TYPE ACCNEWINT IS ACCESS NEWINT ; ACCNEWINT_CONST : ACCNEWINT := NEW NEWINT'( 813 ); ACCNEWINT_VAR : ACCNEWINT := ACCNEWINT_CONST ; ACCNEWINT_CONST2 : ACCNEWINT := NEW NEWINT'( 707 ); TYPE ACC_ACCNEWINT IS ACCESS ACCNEWINT ; ACC_ACCNEWINT_VAR : ACC_ACCNEWINT := NEW ACCNEWINT'( ACCNEWINT_CONST2 ); BEGIN ACCNEWINT_VAR := ACC_ACCNEWINT_VAR.ALL ; IF ACCNEWINT_VAR /= ACCNEWINT_CONST2 THEN FAILED( "ACC2 NEWINT, RIGHT SIDE OF ASSIGN.,WRONG VAL."); END IF; ACC_ACCNEWINT_VAR.ALL := ACCNEWINT_CONST ; IF ACCNEWINT_CONST /= ACC_ACCNEWINT_VAR.ALL THEN FAILED( "ACC2 NEWINT, LEFT SIDE OF ASSIGN.,WRONG VAL." ); END IF; END ; ------------------------------------------------------------------- RESULT; END C41303G;
------------------------------------------------------------------------ -- Copyright (C) 2010-2020 by Heisenbug Ltd. (github@heisenbug.eu) -- -- This work is free. You can redistribute it and/or modify it under -- the terms of the Do What The Fuck You Want To Public License, -- Version 2, as published by Sam Hocevar. See the LICENSE file for -- more details. ------------------------------------------------------------------------ pragma License (Unrestricted); ------------------------------------------------------------------------ -- Local_Message_Passing -- -- Generic package providing mailbox communication channels. -- -- All mailboxes instantiated from this package can be shared by name -- between different tasks without needing the specific package where -- the mailbox is located. -- -- The order of exporting and importing calls is not important, the -- underlying mailbox sharing mechanism takes care of suspending a -- caller until its requested mailbox becomes available. -- ------------------------------------------------------------------------ with Ada.Real_Time; with Mailbox_Sharing; generic type Message is private; package Local_Message_Passing is -- A mailbox with this name has already been exported. Already_Exported : exception renames Mailbox_Sharing.Already_Exported; -- If a mailbox can not be connected to within the given duration, -- this exception will be raised. No_Such_Mailbox : exception renames Mailbox_Sharing.No_Such_Mailbox; -- If more than the supported number of mailboxes (see package -- Mailbox_Sharing) are exported, this exception will be raised. Too_Many_Mailboxes : exception renames Mailbox_Sharing.Too_Many_Mailboxes; --------------------------------------------------------------------- -- Mailbox -- -- A package can own a mailbox by declaring an object of type -- Mailbox with an appropriate queue length (Size). -- -- Please note that a size of 0 is supported in the technical -- sense, but then the queue will always be empty and full at the -- same time, any calling task will block on both send and receive. --------------------------------------------------------------------- type Mailbox (Size : Natural) is limited private; --------------------------------------------------------------------- -- Handle -- -- To actually use the mailbox, "Open_Mailbox" must be called to -- create a handle to it. The mailbox itself has no operations at -- all, all operations on the mailbox are done through the handle. -- -- To make the mailbox available to other processes, it must be -- exported with an unique name. Any process wishing to connect to -- such a published mailbox may call "Import_Mailbox" then, which - -- upon success - makes a handle to that mailbox available to the -- calling process. -- -- Because the handle type is also private, uses like -- "Export_Mailbox (Handle.all)" are not allowed (outside of this -- package or children, that is), thus only the owning package is -- able to create such a handle directly from a mailbox declaration -- (unless its mailbox declaration would be made public). -- -- Also make it limited to disallow free copying of this handle. -- It is technically safe to pass around this handle once it has -- been properly obtained (after all, it's just a reference), but -- there is also no technical reason to do so. --------------------------------------------------------------------- type Handle is limited private; --------------------------------------------------------------------- -- Open_Mailbox -- -- "Constructor" function. -- Re-Initialises the mailbox for use and also "returns" its handle. -- If Export_Name is given, the mailbox is exported via the (local) -- sharing mechanism. --------------------------------------------------------------------- procedure Open_Mailbox (Mbx : in out Mailbox; Hnd : out Handle; Export_Name : in String := ""); --------------------------------------------------------------------- -- Import_Mailbox -- -- Imports a named mailbox for use by calling process. -- -- If the name for the mailbox does not exist and does not become -- available during the given Max_Wait timespan, No_Such_Mailbox -- will be raised. --------------------------------------------------------------------- procedure Import_Mailbox (Name : in String; Hnd : out Handle; Max_Wait : in Ada.Real_Time.Time_Span); -- -- Actual messaging functions. -- --------------------------------------------------------------------- -- Conditional_Send -- -- Puts a message into the mailbox, if it is not full yet. -- Returns True for the Success parameter if the message has been -- deposited. --------------------------------------------------------------------- procedure Conditional_Send (Mbx : in Handle; Msg : in Message; Success : out Boolean); --------------------------------------------------------------------- -- Send -- -- Puts a message into the mailbox. If the mailbox is full, the -- caller gets blocked until a slot becomes available. --------------------------------------------------------------------- procedure Send (Mbx : in Handle; Msg : in Message); --------------------------------------------------------------------- -- Timed_Send (Send_Until) -- -- Puts a message into the mailbox. Just like Send it blocks, but at -- most until the time specified. --------------------------------------------------------------------- procedure Timed_Send (Mbx : in Handle; Msg : in Message; Latest : in Ada.Real_Time.Time; Success : out Boolean); --------------------------------------------------------------------- -- Timed_Send (Send_For) -- -- Puts a message into the mailbox. Just like Send it blocks, but at -- most for the time span specified. --------------------------------------------------------------------- procedure Timed_Send (Mbx : in Handle; Msg : in Message; Max_Wait : in Ada.Real_Time.Time_Span; Success : out Boolean); --------------------------------------------------------------------- -- Conditional_Receive -- -- Retrieves a message from the mailbox. If the mailbox is empty, -- the Success parameter will be False. If it is True the message -- parameter will contain the message received. --------------------------------------------------------------------- procedure Conditional_Receive (Mbx : in Handle; Msg : out Message; Success : out Boolean); --------------------------------------------------------------------- -- Receive -- -- Retrieves a message from the mailbox. If the mailbox is empty, -- the caller gets blocked until a message becomes available. --------------------------------------------------------------------- procedure Receive (Mbx : in Handle; Msg : out Message); --------------------------------------------------------------------- -- Timed_Receive (Receive_Until) -- -- Retrieves a message from the mailbox. Just like Receive it blocks -- until a message becomes available, but at most until the time -- specified. --------------------------------------------------------------------- procedure Timed_Receive (Mbx : in Handle; Msg : out Message; Latest : in Ada.Real_Time.Time; Success : out Boolean); --------------------------------------------------------------------- -- Timed_Receive (Receive_For) -- -- Retrieves a message from the mailbox. Just like Receive it blocks -- until a message becomes available, but at most for the time span -- specified. --------------------------------------------------------------------- procedure Timed_Receive (Mbx : in Handle; Msg : out Message; Max_Wait : in Ada.Real_Time.Time_Span; Success : out Boolean); private --------------------------------------------------------------------- -- Message_Queue -- -- All messages of a mailbox are stored in a fixed size queue. --------------------------------------------------------------------- type Message_Queue is array (Positive range <>) of Message; --------------------------------------------------------------------- -- Handle -- -- The actual mailbox handle. --------------------------------------------------------------------- type Handle is access all Mailbox; --------------------------------------------------------------------- -- Mailbox -- -- A mailbox is implemented as a protected type. --------------------------------------------------------------------- protected type Mailbox (Size : Natural) is ------------------------------------------------------------------ -- Mailbox.Clear -- -- Initialisation. Clears the internal queue. ------------------------------------------------------------------ procedure Clear; ------------------------------------------------------------------ -- Mailbox.Try_Put -- -- Unblocking send. ------------------------------------------------------------------ procedure Try_Put (Msg : in Message; Success : out Boolean); ------------------------------------------------------------------ -- Mailbox.Put -- -- Blocking send. ------------------------------------------------------------------ entry Put (Msg : in Message); ------------------------------------------------------------------ -- Mailbox.Try_Get -- -- Unblocking read. ------------------------------------------------------------------ procedure Try_Get (Msg : out Message; Success : out Boolean); ------------------------------------------------------------------ -- Mailbox.Get -- -- Blocking read. ------------------------------------------------------------------ entry Get (Msg : out Message); -- Reading virtual channels shall only happen for the mailbox -- owner. This means, we can bind the Reader VC onto the mailbox -- type instead of the handle. private -- The message queue if the mailbox is used locally (same CPU). Msg_Queue : Message_Queue (1 .. Size); -- The queue is implemented like a ring buffer so that always the -- oldest message is retrieved if there is more than one. Thus we -- need to keep track of the beginning and end of the buffer. -- -- The default values here are only given for safety purposes. -- It is expected that before using a mailbox "Init_Mailbox" is -- called which re-initialises the mailbox. Num_Messages : Natural := 0; Latest : Natural := 1; Oldest : Natural := 1; end Mailbox; end Local_Message_Passing;
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h; with glib; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_app_gstappbuffer_h is -- unsupported macro: GST_TYPE_APP_BUFFER (gst_app_buffer_get_type()) -- arg-macro: function GST_APP_BUFFER (obj) -- return G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_BUFFER,GstAppBuffer); -- arg-macro: function GST_APP_BUFFER_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_BUFFER,GstAppBufferClass); -- arg-macro: function GST_IS_APP_BUFFER (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_BUFFER); -- arg-macro: function GST_IS_APP_BUFFER_CLASS (klass) -- return G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_BUFFER); -- GStreamer -- * Copyright (C) 2007 David Schleef <ds@schleef.org> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- type GstAppBuffer; --subtype GstAppBuffer is u_GstAppBuffer; -- gst/app/gstappbuffer.h:38 type GstAppBufferClass; --subtype GstAppBufferClass is u_GstAppBufferClass; -- gst/app/gstappbuffer.h:39 type GstAppBufferFinalizeFunc is access procedure (arg1 : System.Address); pragma Convention (C, GstAppBufferFinalizeFunc); -- gst/app/gstappbuffer.h:40 type GstAppBuffer is record buffer : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/app/gstappbuffer.h:44 finalize : GstAppBufferFinalizeFunc; -- gst/app/gstappbuffer.h:47 priv : System.Address; -- gst/app/gstappbuffer.h:48 end record; pragma Convention (C_Pass_By_Copy, GstAppBuffer); -- gst/app/gstappbuffer.h:42 --< private > type GstAppBufferClass is record buffer_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBufferClass; -- gst/app/gstappbuffer.h:53 end record; pragma Convention (C_Pass_By_Copy, GstAppBufferClass); -- gst/app/gstappbuffer.h:51 function gst_app_buffer_get_type return GLIB.GType; -- gst/app/gstappbuffer.h:56 pragma Import (C, gst_app_buffer_get_type, "gst_app_buffer_get_type"); function gst_app_buffer_new (data : System.Address; length : int; finalize : GstAppBufferFinalizeFunc; priv : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/app/gstappbuffer.h:58 pragma Import (C, gst_app_buffer_new, "gst_app_buffer_new"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_app_gstappbuffer_h;
package body impact.d3.motion_State.default is function to_motion_State (startTrans, centerOfMassOffset : Transform_3d := impact.d3.Transform.getIdentity) return Item is Self : Item; begin Self.m_graphicsWorldTrans := startTrans; Self.m_centerOfMassOffset := centerOfMassOffset; Self.m_startWorldTrans := startTrans; return Self; end to_motion_State; -- impact.d3.motion_State.default(const impact.d3.Transform& startTrans = impact.d3.Transform::getIdentity(),const impact.d3.Transform& centerOfMassOffset = impact.d3.Transform::getIdentity()) -- : m_graphicsWorldTrans(startTrans), -- m_centerOfMassOffset(centerOfMassOffset), -- m_startWorldTrans(startTrans), -- m_userPointer(0) -- -- { -- } overriding procedure getWorldTransform (Self : in Item; worldTrans : out Transform_3d) is use linear_Algebra_3d, impact.d3.Transform; begin WorldTrans := inverse (Self.m_centerOfMassOffset) * Self.m_graphicsWorldTrans; end getWorldTransform; -- virtual void getWorldTransform(impact.d3.Transform& centerOfMassWorldTrans ) const -- { -- centerOfMassWorldTrans = m_centerOfMassOffset.inverse() * m_graphicsWorldTrans ; -- } overriding procedure setWorldTransform (Self : in out Item; worldTrans : in Transform_3d) is use linear_Algebra_3d, impact.d3.Transform; begin Self.m_graphicsWorldTrans := WorldTrans * Self.m_centerOfMassOffset; end setWorldTransform; -- virtual void setWorldTransform(const impact.d3.Transform& centerOfMassWorldTrans) -- { -- m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ; -- } end impact.d3.motion_State.default;
----------------------------------------------------------------------- -- util-processes-tests - Test for processes -- Copyright (C) 2011, 2016, 2018, 2019, 2021 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Util.Processes.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Tests when the process is not launched procedure Test_No_Process (T : in out Test); -- Test executing a process procedure Test_Spawn (T : in out Test); -- Test output pipe redirection: read the process standard output procedure Test_Output_Pipe (T : in out Test); -- Test input pipe redirection: write the process standard input procedure Test_Input_Pipe (T : in out Test); -- Test error pipe redirection: read the process standard error procedure Test_Error_Pipe (T : in out Test); -- Test shell splitting. procedure Test_Shell_Splitting_Pipe (T : in out Test); -- Test launching several processes through pipes in several threads. procedure Test_Multi_Spawn (T : in out Test); -- Test output file redirection. procedure Test_Output_Redirect (T : in out Test); -- Test input file redirection. procedure Test_Input_Redirect (T : in out Test); -- Test changing working directory. procedure Test_Set_Working_Directory (T : in out Test); -- Test various errors. procedure Test_Errors (T : in out Test); -- Test launching and stopping a process. procedure Test_Stop (T : in out Test); -- Test various errors (pipe streams). procedure Test_Pipe_Errors (T : in out Test); -- Test launching and stopping a process (pipe streams). procedure Test_Pipe_Stop (T : in out Test); -- Test the Tools.Execute operation. procedure Test_Tools_Execute (T : in out Test); end Util.Processes.Tests;
----------------------------------------------------------------------- -- secret-tests - Unit tests for secret service library -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Secret.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; -- Test operations on the Secret_Type value. procedure Test_Value (T : in out Test); -- Test attributes operations. procedure Test_Attributes (T : in out Test); -- Test storing a secret value. procedure Test_Store (T : in out Test); end Secret.Tests;
-- Copyright 2007, 2008 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with System; package Pck is type Struct is record A : Integer; B : Integer; end record; type Arr is array (1 .. 3) of Integer; procedure Call_Me (Int : Integer; Flt : Float; Bln : Boolean; Ary : Arr; -- Non scalar Chr : Character; Sad : System.Address; Rec : Struct); -- Non scalar end Pck;
-- CC1227A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK, WHEN DERIVING FROM A FORMAL TYPE, THAT ALL THE PREDEFINED -- OPERATIONS ASSOCIATED WITH THE CLASS OF THE FORMAL TYPE ARE -- DECLARED FOR THE DERIVED TYPE. -- HISTORY: -- BCB 04/04/88 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; WITH SYSTEM; USE SYSTEM; PROCEDURE CC1227A IS GENERIC TYPE FORM IS RANGE <>; PACKAGE P IS TYPE DER_FORM IS NEW FORM; FUNCTION IDENT_DER(X : DER_FORM) RETURN DER_FORM; FUNCTION IDENT_ADR(Y : ADDRESS) RETURN ADDRESS; END P; PACKAGE BODY P IS DER_VAR : DER_FORM; DER_FORM_BASE_FIRST : DER_FORM; DER_FORM_FIRST : DER_FORM; DER_FORM_LAST : DER_FORM; DER_FORM_SIZE : DER_FORM; DER_FORM_WIDTH : DER_FORM; DER_FORM_POS : DER_FORM; DER_FORM_VAL : DER_FORM; DER_FORM_SUCC : DER_FORM; DER_FORM_PRED : DER_FORM; DER_FORM_IMAGE : STRING(1..5); DER_FORM_VALUE : DER_FORM; DER_VAR_SIZE : DER_FORM; DER_VAR_ADDRESS : ADDRESS; DER_EQUAL, DER_UNEQUAL : DER_FORM; DER_GREATER : DER_FORM; DER_MOD, DER_REM : DER_FORM; DER_ABS, DER_EXP : DER_FORM; INT : INTEGER := 5; FUNCTION IDENT_DER(X : DER_FORM) RETURN DER_FORM IS BEGIN IF EQUAL(3,3) THEN RETURN X; END IF; RETURN 0; END IDENT_DER; FUNCTION IDENT_ADR(Y : ADDRESS) RETURN ADDRESS IS X : DER_FORM; BEGIN IF EQUAL(3,3) THEN RETURN Y; END IF; RETURN X'ADDRESS; END IDENT_ADR; BEGIN TEST ("CC1227A", "CHECK, WHEN DERIVING FROM A FORMAL TYPE, " & "THAT ALL THE PREDEFINED OPERATIONS " & "ASSOCIATED WITH THE CLASS OF THE FORMAL " & "TYPE ARE DECLARED FOR THE DERIVED TYPE"); DER_VAR := IDENT_DER(1); IF DER_VAR /= 1 THEN FAILED ("IMPROPER VALUE FROM ASSIGNMENT OPERATION"); END IF; IF DER_VAR NOT IN DER_FORM THEN FAILED ("IMPROPER RESULT FROM MEMBERSHIP TEST"); END IF; DER_VAR := DER_FORM'(2); IF DER_VAR /= IDENT_DER(2) THEN FAILED ("IMPROPER RESULT FROM QUALIFICATION"); END IF; DER_VAR := DER_FORM(INT); IF DER_VAR /= IDENT_DER(5) THEN FAILED ("IMPROPER RESULT FROM EXPLICIT CONVERSION - " & "INTEGER"); END IF; DER_VAR := DER_FORM(3.0); IF DER_VAR /= IDENT_DER(3) THEN FAILED ("IMPROPER RESULT FROM EXPLICIT CONVERSION - " & "FLOAT"); END IF; DER_VAR := 1_000; IF DER_VAR /= IDENT_DER(1000) THEN FAILED ("IMPROPER RESULT FROM IMPLICIT CONVERSION"); END IF; DER_FORM_BASE_FIRST := DER_FORM'BASE'FIRST; DER_FORM_FIRST := DER_FORM'FIRST; IF DER_FORM_BASE_FIRST /= IDENT_DER(DER_FORM_FIRST) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'BASE'FIRST"); END IF; IF DER_FORM_FIRST /= IDENT_DER(DER_FORM'FIRST) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'FIRST"); END IF; DER_FORM_LAST := DER_FORM'LAST; IF DER_FORM_LAST /= IDENT_DER(DER_FORM'LAST) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'LAST"); END IF; DER_FORM_SIZE := DER_FORM(DER_FORM'SIZE); IF DER_FORM_SIZE /= IDENT_DER(DER_FORM(DER_FORM'SIZE)) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'SIZE"); END IF; DER_FORM_WIDTH := DER_FORM(DER_FORM'WIDTH); IF DER_FORM_WIDTH /= IDENT_DER(DER_FORM(DER_FORM'WIDTH)) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'WIDTH"); END IF; DER_FORM_POS := DER_FORM(DER_FORM'POS(DER_VAR)); IF DER_FORM_POS /= IDENT_DER(DER_FORM(DER_FORM'POS(DER_VAR))) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'POS(DER_VAR)"); END IF; DER_FORM_VAL := DER_FORM'VAL(DER_VAR); IF DER_FORM_VAL /= IDENT_DER(DER_FORM'VAL(DER_VAR)) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'VAL(DER_VAR)"); END IF; DER_FORM_SUCC := DER_FORM'SUCC(DER_VAR); IF DER_FORM_SUCC /= IDENT_DER(DER_FORM'SUCC(DER_VAR)) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'SUCC(DER_VAR)"); END IF; DER_FORM_PRED := DER_FORM'PRED(DER_VAR); IF DER_FORM_PRED /= IDENT_DER(DER_FORM'PRED(DER_VAR)) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'PRED(DER_VAR)"); END IF; DER_FORM_IMAGE := DER_FORM'IMAGE(DER_VAR); IF DER_FORM_IMAGE(2..5) /= "1000" THEN FAILED ("IMPROPER VALUE FOR DER_FORM'IMAGE(DER_VAR)"); END IF; DER_FORM_VALUE := DER_FORM'VALUE(DER_FORM_IMAGE); IF DER_FORM_VALUE /= IDENT_DER(1000) THEN FAILED ("IMPROPER VALUE FOR DER_FORM'VALUE" & "(DER_FORM_IMAGE)"); END IF; DER_VAR_SIZE := DER_FORM(DER_VAR'SIZE); IF DER_VAR_SIZE /= IDENT_DER(DER_FORM(DER_VAR'SIZE)) THEN FAILED ("IMPROPER VALUE FOR DER_VAR'SIZE"); END IF; DER_VAR_ADDRESS := DER_VAR'ADDRESS; IF DER_VAR_ADDRESS /= IDENT_ADR(DER_VAR'ADDRESS) THEN FAILED ("IMPROPER VALUE FOR DER_VAR'ADDRESS"); END IF; DER_EQUAL := IDENT_DER(1000); IF DER_VAR /= DER_EQUAL THEN FAILED ("IMPROPER RESULT FROM INEQUALITY OPERATOR"); END IF; DER_UNEQUAL := IDENT_DER(500); IF DER_VAR = DER_UNEQUAL THEN FAILED ("IMPROPER RESULT FROM EQUALITY OPERATOR"); END IF; IF DER_VAR < DER_UNEQUAL THEN FAILED ("IMPROPER RESULT FROM LESS THAN OPERATOR"); END IF; IF DER_VAR <= DER_UNEQUAL THEN FAILED ("IMPROPER RESULT FROM LESS THAN OR EQUAL TO " & "OPERATOR"); END IF; DER_GREATER := IDENT_DER(1500); IF DER_VAR > DER_GREATER THEN FAILED ("IMPROPER RESULT FROM GREATER THAN OPERATOR"); END IF; IF DER_VAR >= DER_GREATER THEN FAILED ("IMPROPER RESULT FROM GREATER THAN OR EQUAL " & "TO OPERATOR"); END IF; DER_VAR := DER_VAR + DER_EQUAL; IF DER_VAR /= IDENT_DER(2000) THEN FAILED ("IMPROPER RESULT FROM ADDITION OPERATOR"); END IF; DER_VAR := DER_VAR - DER_EQUAL; IF DER_VAR /= IDENT_DER(1000) THEN FAILED ("IMPROPER RESULT FROM SUBTRACTION OPERATOR"); END IF; DER_VAR := DER_VAR * IDENT_DER(2); IF DER_VAR /= IDENT_DER(2000) THEN FAILED ("IMPROPER RESULT FROM MULTIPLICATION OPERATOR"); END IF; DER_VAR := DER_VAR / IDENT_DER(2); IF DER_VAR /= IDENT_DER(1000) THEN FAILED ("IMPROPER RESULT FROM DIVISION OPERATOR"); END IF; DER_MOD := DER_GREATER MOD DER_VAR; IF DER_MOD /= IDENT_DER(500) THEN FAILED ("IMPROPER RESULT FROM MOD OPERATOR"); END IF; DER_REM := DER_GREATER REM DER_VAR; IF DER_REM /= IDENT_DER(500) THEN FAILED ("IMPROPER RESULT FROM REM OPERATOR"); END IF; DER_ABS := ABS(IDENT_DER(-1500)); IF DER_ABS /= IDENT_DER(DER_GREATER) THEN FAILED ("IMPROPER RESULT FROM ABS OPERATOR"); END IF; DER_EXP := IDENT_DER(2) ** IDENT_INT(2); IF DER_EXP /= IDENT_DER(4) THEN FAILED ("IMPROPER RESULT FROM EXPONENTIATION OPERATOR"); END IF; RESULT; END P; PACKAGE PACK IS NEW P(INTEGER); BEGIN NULL; END CC1227A;
with Tkmrpc.Servers.Ike; with Tkmrpc.Results; with Tkmrpc.Request.Ike.Ae_Reset.Convert; with Tkmrpc.Response.Ike.Ae_Reset.Convert; package body Tkmrpc.Operation_Handlers.Ike.Ae_Reset is ------------------------------------------------------------------------- procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type) is Specific_Req : Request.Ike.Ae_Reset.Request_Type; Specific_Res : Response.Ike.Ae_Reset.Response_Type; begin Specific_Res := Response.Ike.Ae_Reset.Null_Response; Specific_Req := Request.Ike.Ae_Reset.Convert.From_Request (S => Req); if Specific_Req.Data.Ae_Id'Valid then Servers.Ike.Ae_Reset (Result => Specific_Res.Header.Result, Ae_Id => Specific_Req.Data.Ae_Id); Res := Response.Ike.Ae_Reset.Convert.To_Response (S => Specific_Res); else Res.Header.Result := Results.Invalid_Parameter; end if; end Handle; end Tkmrpc.Operation_Handlers.Ike.Ae_Reset;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2016-2020, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision: 5703 $ $Date: 2017-01-20 22:17:20 +0300 (Fri, 20 Jan 2017) $ ------------------------------------------------------------------------------ package body Web.Core.Connectables.Slots_0 is --------------------- -- Create_Slot_End -- --------------------- not overriding function Create_Slot_End (Self : Slot) return not null Slot_End_Access is begin raise Program_Error with "Slot.Create_Slot_End must be overrided"; return null; end Create_Slot_End; end Web.Core.Connectables.Slots_0;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt package Definitions is pragma Pure; raven_version_major : constant String := "1"; raven_version_minor : constant String := "71"; copyright_years : constant String := "2015-2021"; raven_tool : constant String := "ravenadm"; variant_standard : constant String := "standard"; contact_nobody : constant String := "nobody"; contact_automaton : constant String := "automaton"; dlgroup_main : constant String := "main"; dlgroup_none : constant String := "none"; options_none : constant String := "none"; options_all : constant String := "all"; broken_all : constant String := "all"; boolean_yes : constant String := "yes"; homepage_none : constant String := "none"; spkg_complete : constant String := "complete"; spkg_docs : constant String := "docs"; spkg_examples : constant String := "examples"; spkg_nls : constant String := "nls"; ports_default : constant String := "floating"; default_ssl : constant String := "libressl"; default_mysql : constant String := "oracle-8.0"; default_lua : constant String := "5.3"; default_perl : constant String := "5.30"; default_pgsql : constant String := "12"; default_php : constant String := "7.4"; default_python3 : constant String := "3.8"; default_ruby : constant String := "2.7"; default_tcltk : constant String := "8.6"; default_firebird : constant String := "2.5"; default_binutils : constant String := "binutils:ravensys"; default_compiler : constant String := "gcc9"; previous_default : constant String := "gcc9"; compiler_version : constant String := "9.3.0"; previous_compiler : constant String := "9.2.0"; binutils_version : constant String := "2.35.1"; previous_binutils : constant String := "2.34"; arc_ext : constant String := ".tzst"; jobs_per_cpu : constant := 2; task_stack_limit : constant := 10_000_000; type supported_opsys is (dragonfly, freebsd, netbsd, openbsd, sunos, linux, macos); type supported_arch is (x86_64, i386, aarch64); type cpu_range is range 1 .. 64; type scanners is range cpu_range'First .. cpu_range'Last; type builders is range cpu_range'First .. cpu_range'Last * jobs_per_cpu; type count_type is (total, success, failure, ignored, skipped); -- Modify following with post-patch sed accordingly platform_type : constant supported_opsys := dragonfly; host_localbase : constant String := "/raven"; raven_var : constant String := "/var/ravenports"; host_pkg8 : constant String := host_localbase & "/sbin/ravensw"; ravenexec : constant String := host_localbase & "/libexec/ravenexec"; end Definitions;
-- This file is generated by SWIG. Please do not modify by hand. -- with xcb.xcb_request_error_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_access_error_t is -- Item -- subtype Item is xcb.xcb_request_error_t.Item; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_access_error_t.Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_access_error_t.Item, Element_Array => xcb.xcb_access_error_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_access_error_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_access_error_t.Pointer, Element_Array => xcb.xcb_access_error_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_access_error_t;
-- This file is generated by SWIG. Please do *not* modify by hand. -- with interfaces.c; with interfaces.C; package fann_c.fann_neuron is -- Item -- type Item is record first_con : aliased interfaces.c.unsigned; last_con : aliased interfaces.c.unsigned; sum : aliased fann_c.fann_type; value : aliased fann_c.fann_type; activation_steepness : aliased fann_c.fann_type; activation_function : aliased fann_c.fann_activationfunc_enum; end record; -- Items -- type Items is array (interfaces.C.Size_t range <>) of aliased fann_c.fann_neuron.Item; -- Pointer -- type Pointer is access all fann_c.fann_neuron.Item; -- Pointers -- type Pointers is array (interfaces.C.Size_t range <>) of aliased fann_c.fann_neuron.Pointer; -- Pointer_Pointer -- type Pointer_Pointer is access all fann_c.fann_neuron.Pointer; end fann_c.fann_neuron;
-- io.adb -- Plays with console IO. -- Note that Ada is case-INSENSITIVE. -- -- Simon Heath -- 19/7/2004 with Ada.Text_Io; use Ada.Text_Io; procedure Io is C : Character; S : String(1..32); begin Put_Line( "This reads information and then displays it." ); Put_Line( "Please type a character then 'enter'" ); New_Line; Get( C ); Put_Line( "You typed '" & C & "'" ); --Put_Line( "Now type a string, then 'enter'" ); --Get_Line( S, 32 ); --Put_Line( "You typed:" ); --Put_Line( S ); end Io;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- ncurses -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 2000 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000 -- Version Control -- $Revision: 1.2 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.m; use ncurses2.m; with GNAT.OS_Lib; use GNAT.OS_Lib; procedure ncurses is begin OS_Exit (main); end ncurses;
-- Auto generated file. Don't edit -- Read copyright and license at the end of this file package Encodings.Maps.CP_852 is function Decode (Char : Character) return Wide_Character; pragma Inline (Decode); procedure Encode (Text : in Wide_String; Text_Last : out Natural; Result : out Raw_String; Result_Last : out Natural; Map : in Encoding := Encodings.CP_852); procedure Decode (Text : in Raw_String; Text_Last : out Natural; Result : out Wide_String; Result_Last : out Natural; Map : in Encoding := Encodings.CP_852); end Encodings.Maps.CP_852; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the Maxim Reznik, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
-- -- The author disclaims copyright to this source code. In place of -- a legal notice, here is a blessing: -- -- May you do good and not evil. -- May you find forgiveness for yourself and forgive others. -- May you share freely, not taking more than you give. -- package Symbols is type Symbol_Type is (Space, Plus_Sign, Minus_Sign, Multiplication_Sign, Division_Sign, Black_Star, White_Star, Black_Right_Pointing_Index, White_Right_Pointing_Index, Check_Mark, Heavy_Check_Mark, Multiplication_X, Heavy_Multiplication_X, Ballot_X, Heavy_Ballot_X, Medium_Left_Parenthesis_Ornament, Medium_Right_Parenthesis_Ornament, Medium_Flattened_Left_Parenthesis_Ornament, Medium_Flattened_Right_Parenthesis_Ornament, Medium_Left_Pointing_Angle_Bracket_Ornament, Medium_Right_Pointing_Angle_Bracket_Ornament); function UTF8 (Symbol : in Symbol_Type) return String; function HTML (Symbol : in Symbol_Type) return String; end Symbols;
-------------------------------------------------------------------- --| Package : DISPLAY Version : 1.0 -------------------------------------------------------------------- --| Abstract : Provides a display object for the Mahjongg game. --| This package handles hardware dependent details of --| displaying tiles on the screeen. -------------------------------------------------------------------- --| Compiler/System : Alsys Ada --| Author : John Dalbey Date : 1/93 -------------------------------------------------------------------- --| NOTES : --| : --| Version History : -------------------------------------------------------------------- WITH TileADT; USE TileADT; PACKAGE Display IS PROCEDURE ShowTile(TheTile : Tile); -- Assumes : TheTile has a position and a value. -- Uses : TheTile. -- Results : TheTile is displayed on the screen in its appropriate place. PROCEDURE SayTile(TheTile:Tile); -- For debugging, it just dumps the tile fields to the screen. PROCEDURE ShowTilesLeft; -- Assumes: A board has been loaded -- Results: the current number of tiles remaining is displayed END Display;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A L I . U T I L -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 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- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Binderr; use Binderr; with Namet; use Namet; with Opt; use Opt; with Osint; use Osint; with System.CRC32; package body ALI.Util is ----------------------- -- Local Subprograms -- ----------------------- procedure Accumulate_Checksum (C : Character; Csum : in out Word); pragma Inline (Accumulate_Checksum); -- This routine accumulates the checksum given character C. During the -- scanning of a source file, this routine is called with every character -- in the source, excluding blanks, and all control characters (except -- that ESC is included in the checksum). Upper case letters not in string -- literals are folded by the caller. See Sinput spec for the documentation -- of the checksum algorithm. Note: checksum values are only used if we -- generate code, so it is not necessary to worry about making the right -- sequence of calls in any error situation. procedure Initialize_Checksum (Csum : out Word); -- Sets initial value of Csum before any calls to Accumulate_Checksum ------------------------- -- Accumulate_Checksum -- ------------------------- procedure Accumulate_Checksum (C : Character; Csum : in out Word) is begin System.CRC32.Update (System.CRC32.CRC32 (Csum), C); end Accumulate_Checksum; --------------------- -- Checksums_Match -- --------------------- function Checksums_Match (Checksum1, Checksum2 : Word) return Boolean is begin return Checksum1 = Checksum2 and then Checksum1 /= Checksum_Error; end Checksums_Match; ----------------------- -- Get_File_Checksum -- ----------------------- function Get_File_Checksum (Fname : Name_Id) return Word is Src : Source_Buffer_Ptr; Hi : Source_Ptr; Csum : Word; Ptr : Source_Ptr; Bad : exception; -- Raised if file not found, or file format error use ASCII; -- Make control characters visible procedure Free_Source; -- Free source file buffer procedure Free_Source is procedure free (Arg : Source_Buffer_Ptr); pragma Import (C, free, "free"); begin free (Src); end Free_Source; -- Start of processing for Get_File_Checksum begin Read_Source_File (Fname, 0, Hi, Src); -- If we cannot find the file, then return an impossible checksum, -- impossible becaues checksums have the high order bit zero, so -- that checksums do not match. if Src = null then raise Bad; end if; Initialize_Checksum (Csum); Ptr := 0; loop case Src (Ptr) is -- Spaces and formatting information are ignored in checksum when ' ' | CR | LF | VT | FF | HT => Ptr := Ptr + 1; -- EOF is ignored unless it is the last character when EOF => if Ptr = Hi then Free_Source; return Csum; else Ptr := Ptr + 1; end if; -- Non-blank characters that are included in the checksum when '#' | '&' | '*' | ':' | '(' | ',' | '.' | '=' | '>' | '<' | ')' | '/' | ';' | '|' | '!' | '+' | '_' | '0' .. '9' | 'a' .. 'z' => Accumulate_Checksum (Src (Ptr), Csum); Ptr := Ptr + 1; -- Upper case letters, fold to lower case when 'A' .. 'Z' => Accumulate_Checksum (Character'Val (Character'Pos (Src (Ptr)) + 32), Csum); Ptr := Ptr + 1; -- Left bracket, really should do wide character thing here, -- but for now, don't bother. when '[' => raise Bad; -- Minus, could be comment when '-' => if Src (Ptr + 1) = '-' then Ptr := Ptr + 2; while Src (Ptr) >= ' ' or else Src (Ptr) = HT loop Ptr := Ptr + 1; end loop; else Accumulate_Checksum ('-', Csum); Ptr := Ptr + 1; end if; -- String delimited by double quote when '"' => Accumulate_Checksum ('"', Csum); loop Ptr := Ptr + 1; exit when Src (Ptr) = '"'; if Src (Ptr) < ' ' then raise Bad; end if; Accumulate_Checksum (Src (Ptr), Csum); end loop; Accumulate_Checksum ('"', Csum); Ptr := Ptr + 1; -- String delimited by percent when '%' => Accumulate_Checksum ('%', Csum); loop Ptr := Ptr + 1; exit when Src (Ptr) = '%'; if Src (Ptr) < ' ' then raise Bad; end if; Accumulate_Checksum (Src (Ptr), Csum); end loop; Accumulate_Checksum ('%', Csum); Ptr := Ptr + 1; -- Quote, could be character constant when ''' => Accumulate_Checksum (''', Csum); if Src (Ptr + 2) = ''' then Accumulate_Checksum (Src (Ptr + 1), Csum); Accumulate_Checksum (''', Csum); Ptr := Ptr + 3; -- Otherwise assume attribute char. We should deal with wide -- character cases here, but that's hard, so forget it. else Ptr := Ptr + 1; end if; -- Upper half character, more to be done here, we should worry -- about folding Latin-1, folding other character sets, and -- dealing with the nasty case of upper half wide encoding. when Upper_Half_Character => Accumulate_Checksum (Src (Ptr), Csum); Ptr := Ptr + 1; -- Escape character, we should do the wide character thing here, -- but for now, do not bother. when ESC => raise Bad; -- Invalid control characters when NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | SO | SI | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN | EM | FS | GS | RS | US | DEL => raise Bad; -- Invalid graphic characters when '$' | '?' | '@' | '`' | '\' | '^' | '~' | ']' | '{' | '}' => raise Bad; end case; end loop; exception when Bad => Free_Source; return Checksum_Error; end Get_File_Checksum; --------------------------- -- Initialize_ALI_Source -- --------------------------- procedure Initialize_ALI_Source is begin -- When (re)initializing ALI data structures the ALI user expects to -- get a fresh set of data structures. Thus we first need to erase the -- marks put in the name table by the previous set of ALI routine calls. -- This loop is empty and harmless the first time in. for J in Source.First .. Source.Last loop Set_Name_Table_Info (Source.Table (J).Sfile, 0); Source.Table (J).Source_Found := False; end loop; Source.Init; end Initialize_ALI_Source; ------------------------- -- Initialize_Checksum -- ------------------------- procedure Initialize_Checksum (Csum : out Word) is begin System.CRC32.Initialize (System.CRC32.CRC32 (Csum)); end Initialize_Checksum; -------------- -- Read_ALI -- -------------- procedure Read_ALI (Id : ALI_Id) is Afile : File_Name_Type; Text : Text_Buffer_Ptr; Idread : ALI_Id; begin for I in ALIs.Table (Id).First_Unit .. ALIs.Table (Id).Last_Unit loop for J in Units.Table (I).First_With .. Units.Table (I).Last_With loop Afile := Withs.Table (J).Afile; -- Only process if not a generic (Afile /= No_File) and if -- file has not been processed already. if Afile /= No_File and then Get_Name_Table_Info (Afile) = 0 then Text := Read_Library_Info (Afile); if Text = null then Error_Msg_Name_1 := Afile; Error_Msg_Name_2 := Withs.Table (J).Sfile; Error_Msg ("% not found, % must be compiled"); Set_Name_Table_Info (Afile, Int (No_Unit_Id)); return; end if; Idread := Scan_ALI (F => Afile, T => Text, Ignore_ED => Force_RM_Elaboration_Order, Err => False); Free (Text); if ALIs.Table (Idread).Compile_Errors then Error_Msg_Name_1 := Withs.Table (J).Sfile; Error_Msg ("% had errors, must be fixed, and recompiled"); Set_Name_Table_Info (Afile, Int (No_Unit_Id)); elsif ALIs.Table (Idread).No_Object then Error_Msg_Name_1 := Withs.Table (J).Sfile; Error_Msg ("% must be recompiled"); Set_Name_Table_Info (Afile, Int (No_Unit_Id)); end if; -- Recurse to get new dependents Read_ALI (Idread); end if; end loop; end loop; end Read_ALI; ---------------------- -- Set_Source_Table -- ---------------------- procedure Set_Source_Table (A : ALI_Id) is F : File_Name_Type; S : Source_Id; Stamp : Time_Stamp_Type; begin Sdep_Loop : for D in ALIs.Table (A).First_Sdep .. ALIs.Table (A).Last_Sdep loop F := Sdep.Table (D).Sfile; -- If this is the first time we are seeing this source file, -- then make a new entry in the source table. if Get_Name_Table_Info (F) = 0 then Source.Increment_Last; S := Source.Last; Set_Name_Table_Info (F, Int (S)); Source.Table (S).Sfile := F; Source.Table (S).All_Timestamps_Match := True; -- Initialize checksum fields Source.Table (S).Checksum := Sdep.Table (D).Checksum; Source.Table (S).All_Checksums_Match := True; -- In check source files mode, try to get time stamp from file if Opt.Check_Source_Files then Stamp := Source_File_Stamp (F); -- If we got the stamp, then set the stamp in the source -- table entry and mark it as set from the source so that -- it does not get subsequently changed. if Stamp (Stamp'First) /= ' ' then Source.Table (S).Stamp := Stamp; Source.Table (S).Source_Found := True; -- If we could not find the file, then the stamp is set -- from the dependency table entry (to be possibly reset -- if we find a later stamp in subsequent processing) else Source.Table (S).Stamp := Sdep.Table (D).Stamp; Source.Table (S).Source_Found := False; -- In All_Sources mode, flag error of file not found if Opt.All_Sources then Error_Msg_Name_1 := F; Error_Msg ("cannot locate %"); end if; end if; -- First time for this source file, but Check_Source_Files -- is off, so simply initialize the stamp from the Sdep entry else Source.Table (S).Source_Found := False; Source.Table (S).Stamp := Sdep.Table (D).Stamp; end if; -- Here if this is not the first time for this source file, -- so that the source table entry is already constructed. else S := Source_Id (Get_Name_Table_Info (F)); -- Update checksum flag if not Checksums_Match (Sdep.Table (D).Checksum, Source.Table (S).Checksum) then Source.Table (S).All_Checksums_Match := False; end if; -- Check for time stamp mismatch if Sdep.Table (D).Stamp /= Source.Table (S).Stamp then Source.Table (S).All_Timestamps_Match := False; -- When we have a time stamp mismatch, we go look for the -- source file even if Check_Source_Files is false, since -- if we find it, then we can use it to resolve which of the -- two timestamps in the ALI files is likely to be correct. if not Check_Source_Files then Stamp := Source_File_Stamp (F); if Stamp (Stamp'First) /= ' ' then Source.Table (S).Stamp := Stamp; Source.Table (S).Source_Found := True; end if; end if; -- If the stamp in the source table entry was set from the -- source file, then we do not change it (the stamp in the -- source file is always taken as the "right" one). if Source.Table (S).Source_Found then null; -- Otherwise, we have no source file available, so we guess -- that the later of the two timestamps is the right one. -- Note that this guess only affects which error messages -- are issued later on, not correct functionality. else if Sdep.Table (D).Stamp > Source.Table (S).Stamp then Source.Table (S).Stamp := Sdep.Table (D).Stamp; end if; end if; end if; end if; -- Set the checksum value in the source table S := Source_Id (Get_Name_Table_Info (F)); Source.Table (S).Checksum := Sdep.Table (D).Checksum; end loop Sdep_Loop; end Set_Source_Table; ---------------------- -- Set_Source_Table -- ---------------------- procedure Set_Source_Table is begin for A in ALIs.First .. ALIs.Last loop Set_Source_Table (A); end loop; end Set_Source_Table; ------------------------- -- Time_Stamp_Mismatch -- ------------------------- function Time_Stamp_Mismatch (A : ALI_Id) return File_Name_Type is Src : Source_Id; -- Source file Id for the current Sdep entry begin for D in ALIs.Table (A).First_Sdep .. ALIs.Table (A).Last_Sdep loop Src := Source_Id (Get_Name_Table_Info (Sdep.Table (D).Sfile)); if Opt.Minimal_Recompilation and then Sdep.Table (D).Stamp /= Source.Table (Src).Stamp then -- If minimal recompilation is in action, replace the stamp -- of the source file in the table if checksums match. -- ??? It is probably worth updating the ALI file with a new -- field to avoid recomputing it each time. if Checksums_Match (Get_File_Checksum (Sdep.Table (D).Sfile), Source.Table (Src).Checksum) then Sdep.Table (D).Stamp := Source.Table (Src).Stamp; end if; end if; if not Source.Table (Src).Source_Found or else Sdep.Table (D).Stamp /= Source.Table (Src).Stamp then return Source.Table (Src).Sfile; end if; end loop; return No_File; end Time_Stamp_Mismatch; end ALI.Util;
-- C97301E.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT A TIMED_ENTRY_CALL DELAYS FOR AT LEAST THE SPECIFIED -- AMOUNT OF TIME IF A RENDEZVOUS IS NOT POSSIBLE. -- CASE E: THE BODY OF THE TASK CONTAINING THE CALLED ENTRY -- DOES NOT CONTAIN AN ACCEPT_STATEMENT FOR THAT ENTRY - -- (THE ENTRY BELONGS TO AN ENTRY FAMILY; SOME FAMILY MEMBERS -- ARE "ACCEPTABLE", BUT NOT THE CALLED ONE.) -- RJW 3/31/86 with Impdef; WITH REPORT; USE REPORT; WITH CALENDAR; USE CALENDAR; PROCEDURE C97301E IS OR_BRANCH_TAKEN : BOOLEAN := FALSE; BEGIN TEST ("C97301E", "CHECK THAT A TIMED_ENTRY_CALL DELAYS FOR AT " & "LEAST THE SPECIFIED AMOUNT OF TIME " & "IN THE ABSENCE OF A CORRESPONDING " & "ACCEPT_STATEMENT " ); DECLARE WAIT_TIME : DURATION := 3.0 * Impdef.One_Second; START_TIME : TIME; STOP_TIME : TIME; SUBTYPE SHORT IS INTEGER RANGE 10..20 ; KEEP_ALIVE : INTEGER := 15 ; TASK T IS ENTRY DO_IT_NOW_OR_WAIT ( SHORT ) ; END T ; TASK BODY T IS BEGIN -- NO ACCEPT_STATEMENT FOR THE ENTRY_CALL BEING TESTED. ACCEPT DO_IT_NOW_OR_WAIT ( IDENT_INT(15) ); -- THIS ALSO PREVENTS THIS SERVER -- TASK FROM TERMINATING IF -- UPON ACTIVATION -- IT GETS TO RUN -- AHEAD OF THE CALLER (WHICH -- WOULD LEAD TO A SUBSEQUENT -- TASKING_ERROR AT THE TIME -- OF THE NO-WAIT CALL). END ; BEGIN START_TIME := CLOCK; SELECT T.DO_IT_NOW_OR_WAIT (10) ; -- ACCEPT_STATEMENT HAS 15. OR -- THEREFORE THIS BRANCH MUST BE CHOSEN. DELAY WAIT_TIME; STOP_TIME := CLOCK; IF STOP_TIME >= (WAIT_TIME + START_TIME) THEN NULL; ELSE FAILED ( "INSUFFICIENT DELAY" ); END IF; OR_BRANCH_TAKEN := TRUE ; COMMENT( "OR_BRANCH TAKEN" ); END SELECT; T.DO_IT_NOW_OR_WAIT (KEEP_ALIVE) ; EXCEPTION WHEN TASKING_ERROR => FAILED ( "TASKING ERROR" ); END; -- END OF BLOCK CONTAINING THE TIMED ENTRY CALL. -- BY NOW, TASK T IS TERMINATED. IF OR_BRANCH_TAKEN THEN NULL ; ELSE FAILED( "RENDEZVOUS ATTEMPTED" ); END IF; RESULT; END C97301E ;
pragma License (Unrestricted); -- runtime unit specialized for Darwin with C.pthread; with C.signal; package System.Stack is pragma Preelaborate; procedure Get ( Thread : C.pthread.pthread_t := C.pthread.pthread_self; Top, Bottom : out Address); procedure Fake_Return_From_Signal_Handler; function Fault_Address (Info : C.signal.siginfo_t) return Address; pragma Inline (Fault_Address); end System.Stack;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 2 9 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2021, 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 29 package System.Pack_29 is pragma Preelaborate; Bits : constant := 29; type Bits_29 is mod 2 ** Bits; for Bits_29'Size use Bits; -- In all subprograms below, Rev_SSO is set True if the array has the -- non-default scalar storage order. function Get_29 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_29 with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_29 (Arr : System.Address; N : Natural; E : Bits_29; Rev_SSO : Boolean) with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. end System.Pack_29;
with ada.Strings.Hash; package body lace.Event is function Hash (the_Kind : in Kind) return ada.Containers.Hash_type is begin return ada.Strings.Hash (String (the_Kind)); end Hash; end lace.Event;
------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- Purpose: -- Helper procedures to implement up-to-down pass with Asis.Gela.Classes; package Asis.Gela.Overloads.Walk.Down is procedure Function_Call (Resolver : in out Down_Resolver; Element : in out Asis.Element); procedure Explicit_Dereference (Resolver : in out Down_Resolver; Element : in Asis.Element); procedure Selected_Component (Resolver : in out Down_Resolver; Element : in Asis.Element); procedure Attribute_Reference (Resolver : in out Down_Resolver; Element : in Asis.Element); procedure Aggregate (Resolver : in out Down_Resolver; Element : in out Asis.Element; Extension : in Boolean := False); procedure Membership (Resolver : in out Down_Resolver; Element : in out Asis.Element); procedure Qualified_Expression (Resolver : in out Down_Resolver; Element : in out Asis.Element); procedure Check_Implicit (Resolver : in out Down_Resolver; Element : in out Asis.Element; Control : in out Traverse_Control); procedure Assignment (Resolver : in out Down_Resolver; Element : in out Asis.Element); procedure Set_Expression_Type (Element : Asis.Expression; Tipe : Classes.Type_Info); procedure Set_Expression_Type (Element : Asis.Expression; Tipe : Asis.Element); end Asis.Gela.Overloads.Walk.Down; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the Maxim Reznik, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
----------------------------------------------------------------------- -- files.tests -- Unit tests for files -- Copyright (C) 2009, 2010, 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Directories; with Util.Test_Caller; package body Util.Files.Tests is use Util.Tests; package Caller is new Util.Test_Caller (Test, "Files"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Files.Read_File", Test_Read_File'Access); Caller.Add_Test (Suite, "Test Util.Files.Read_File (missing)", Test_Read_File_Missing'Access); Caller.Add_Test (Suite, "Test Util.Files.Read_File (truncate)", Test_Read_File'Access); Caller.Add_Test (Suite, "Test Util.Files.Write_File", Test_Write_File'Access); Caller.Add_Test (Suite, "Test Util.Files.Iterate_Path", Test_Iterate_Path'Access); Caller.Add_Test (Suite, "Test Util.Files.Find_File_Path", Test_Find_File_Path'Access); Caller.Add_Test (Suite, "Test Util.Files.Compose_Path", Test_Compose_Path'Access); Caller.Add_Test (Suite, "Test Util.Files.Get_Relative_Path", Test_Get_Relative_Path'Access); end Add_Tests; -- ------------------------------ -- Test reading a file into a string -- Reads this ada source file and checks we have read it correctly -- ------------------------------ procedure Test_Read_File (T : in out Test) is Result : Unbounded_String; begin Read_File (Path => "regtests/util-files-tests.adb", Into => Result); T.Assert (Index (Result, "Util.Files.Tests") > 0, "Content returned by Read_File is not correct"); T.Assert (Index (Result, "end Util.Files.Tests;") > 0, "Content returned by Read_File is not correct"); end Test_Read_File; procedure Test_Read_File_Missing (T : in out Test) is Result : Unbounded_String; pragma Unreferenced (Result); begin Read_File (Path => "regtests/files-test--util.adb", Into => Result); T.Assert (False, "No exception raised"); exception when others => null; end Test_Read_File_Missing; procedure Test_Read_File_Truncate (T : in out Test) is Result : Unbounded_String; begin Read_File (Path => "regtests/util-files-tests.adb", Into => Result, Max_Size => 50); Assert_Equals (T, Length (Result), 50, "Read_File did not truncate correctly"); T.Assert (Index (Result, "Apache License") > 0, "Content returned by Read_File is not correct"); end Test_Read_File_Truncate; -- ------------------------------ -- Check writing a file -- ------------------------------ procedure Test_Write_File (T : in out Test) is Path : constant String := Util.Tests.Get_Test_Path ("test-write.txt"); Content : constant String := "Testing Util.Files.Write_File" & ASCII.LF; Result : Unbounded_String; begin Write_File (Path => Path, Content => Content); Read_File (Path => Path, Into => Result); Assert_Equals (T, To_String (Result), Content, "Invalid content written or read"); end Test_Write_File; -- ------------------------------ -- Check Find_File_Path -- ------------------------------ procedure Test_Find_File_Path (T : in out Test) is Dir : constant String := Util.Tests.Get_Path ("regtests"); Paths : constant String := ".;" & Dir; begin declare P : constant String := Util.Files.Find_File_Path ("test.properties", Paths); begin Assert_Equals (T, Dir & "/test.properties", P, "Invalid path returned"); end; Assert_Equals (T, "blablabla.properties", Util.Files.Find_File_Path ("blablabla.properties", Paths)); end Test_Find_File_Path; -- ------------------------------ -- Check Iterate_Path -- ------------------------------ procedure Test_Iterate_Path (T : in out Test) is procedure Check_Path (Dir : in String; Done : out Boolean); Last : Unbounded_String; procedure Check_Path (Dir : in String; Done : out Boolean) is begin if Dir = "a" or Dir = "bc" or Dir = "de" then Done := False; else Done := True; end if; Last := To_Unbounded_String (Dir); end Check_Path; begin Iterate_Path ("a;bc;de;f", Check_Path'Access); Assert_Equals (T, "f", Last, "Invalid last path"); Iterate_Path ("de;bc;de;b", Check_Path'Access); Assert_Equals (T, "b", Last, "Invalid last path"); Iterate_Path ("de;bc;de;a", Check_Path'Access, Ada.Strings.Backward); Assert_Equals (T, "de", Last, "Invalid last path"); end Test_Iterate_Path; -- ------------------------------ -- Test the Compose_Path operation -- ------------------------------ procedure Test_Compose_Path (T : in out Test) is begin Assert_Equals (T, "src/os-none", Compose_Path ("src;regtests", "os-none"), "Invalid path composition"); Assert_Equals (T, "regtests/bundles", Compose_Path ("src;regtests", "bundles"), "Invalid path composition"); if Ada.Directories.Exists ("/usr/bin") then Assert_Equals (T, "/usr/bin;/usr/local/bin;/usr/bin", Compose_Path ("/usr;/usr/local;/usr", "bin"), "Invalid path composition"); end if; end Test_Compose_Path; -- ------------------------------ -- Test the Get_Relative_Path operation. -- ------------------------------ procedure Test_Get_Relative_Path (T : in out Test) is begin Assert_Equals (T, "../util", Get_Relative_Path ("/home/john/src/asf", "/home/john/src/util"), "Invalid relative path"); Assert_Equals (T, "../util", Get_Relative_Path ("/home/john/src/asf/", "/home/john/src/util"), "Invalid relative path"); Assert_Equals (T, "../util/b", Get_Relative_Path ("/home/john/src/asf", "/home/john/src/util/b"), "Invalid relative path"); Assert_Equals (T, "../as", Get_Relative_Path ("/home/john/src/asf", "/home/john/src/as"), "Invalid relative path"); Assert_Equals (T, "../../", Get_Relative_Path ("/home/john/src/asf", "/home/john"), "Invalid relative path"); Assert_Equals (T, "/usr/share/admin", Get_Relative_Path ("/home/john/src/asf", "/usr/share/admin"), "Invalid absolute path"); Assert_Equals (T, "/home/john", Get_Relative_Path ("home/john/src/asf", "/home/john"), "Invalid relative path"); Assert_Equals (T, "e", Get_Relative_Path ("/home/john/src/asf", "/home/john/src/asf/e"), "Invalid relative path"); Assert_Equals (T, ".", Get_Relative_Path ("/home/john/src/asf", "/home/john/src/asf/"), "Invalid relative path"); end Test_Get_Relative_Path; end Util.Files.Tests;
-- SPDX-FileCopyrightText: 2010-2021 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Ada.Characters.Wide_Wide_Latin_1; package body WebIDL.String_Sources is -------------- -- Get_Next -- -------------- overriding function Get_Next (Self : not null access String_Source) return WebIDL.Abstract_Sources.Code_Unit_32 is begin if Self.Cursor.Has_Element then return Result : WebIDL.Abstract_Sources.Code_Unit_32 do Result := Wide_Wide_Character'Pos (Self.Cursor.Element); Self.Cursor.Next; end return; elsif Self.Index < Self.Vector.Length then Self.Index := Self.Index + 1; Self.Line := Self.Vector (Self.Index); Self.Cursor.First (Self.Line); return Wide_Wide_Character'Pos (Ada.Characters.Wide_Wide_Latin_1.LF); elsif Self.Index = Self.Vector.Length then Self.Index := Self.Index + 1; return Wide_Wide_Character'Pos (Ada.Characters.Wide_Wide_Latin_1.LF); else return WebIDL.Abstract_Sources.End_Of_Input; end if; end Get_Next; ----------------------- -- Set_String_Vector -- ----------------------- procedure Set_String_Vector (Self : out String_Source; Value : League.String_Vectors.Universal_String_Vector) is begin Self.Vector := Value; Self.Index := 1; Self.Line := Value (Self.Index); Self.Cursor.First (Self.Line); end Set_String_Vector; end WebIDL.String_Sources;
with Interface_Pkg; procedure Main_Proc is begin Interface_Pkg.Find_Prime; end Main_Proc;
------------------------------------------------------------------------------ -- -- -- GNAT EXAMPLE -- -- -- -- Copyright (C) 2014, 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- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This file provides definitions for the GPIO ports on the STM32F4 (ARM -- Cortex M4F) microcontrollers from ST Microelectronics. pragma Restrictions (No_Elaboration_Code); package STM32F4.GPIO is type GPIO_Port is limited private; function Current_Input (Port : GPIO_Port) return Half_Word with Inline; -- Returns the value of the Port's input data register function Current_Output (Port : GPIO_Port) return Half_Word with Inline; -- Returns the value of the Port's output data register procedure Write_Output (Port : in out GPIO_Port; Data : Half_Word) with Inline; -- Sets the value of the Port's output data register to Data. All bits -- in the register are affected. type GPIO_Pin is (Pin_0, Pin_1, Pin_2, Pin_3, Pin_4, Pin_5, Pin_6, Pin_7, Pin_8, Pin_9, Pin_10, Pin_11, Pin_12, Pin_13, Pin_14, Pin_15); for GPIO_Pin use (Pin_0 => 16#0001#, Pin_1 => 16#0002#, Pin_2 => 16#0004#, Pin_3 => 16#0008#, Pin_4 => 16#0010#, Pin_5 => 16#0020#, Pin_6 => 16#0040#, Pin_7 => 16#0080#, Pin_8 => 16#0100#, Pin_9 => 16#0200#, Pin_10 => 16#0400#, Pin_11 => 16#0800#, Pin_12 => 16#1000#, Pin_13 => 16#2000#, Pin_14 => 16#4000#, Pin_15 => 16#8000#); for GPIO_Pin'Size use 16; -- for compatibility with hardware registers pragma Compile_Time_Error (not (GPIO_Pin'First = Pin_0 and GPIO_Pin'Last = Pin_15 and Pin_0'Enum_Rep = 2 ** 0 and Pin_1'Enum_Rep = 2 ** 1 and Pin_2'Enum_Rep = 2 ** 2 and Pin_3'Enum_Rep = 2 ** 3 and Pin_4'Enum_Rep = 2 ** 4 and Pin_5'Enum_Rep = 2 ** 5 and Pin_6'Enum_Rep = 2 ** 6 and Pin_7'Enum_Rep = 2 ** 7 and Pin_8'Enum_Rep = 2 ** 8 and Pin_9'Enum_Rep = 2 ** 9 and Pin_10'Enum_Rep = 2 ** 10 and Pin_11'Enum_Rep = 2 ** 11 and Pin_12'Enum_Rep = 2 ** 12 and Pin_13'Enum_Rep = 2 ** 13 and Pin_14'Enum_Rep = 2 ** 14 and Pin_15'Enum_Rep = 2 ** 15), "Invalid representation for type GPIO_Pin"); type GPIO_Pins is array (Positive range <>) of GPIO_Pin; -- Note that, in addition to aggregates, the language-defined catenation -- operator "&" is available for types GPIO_Pin and GPIO_Pins, allowing one -- to construct GPIO_Pins values conveniently All_Pins : constant GPIO_Pins := (Pin_0, Pin_1, Pin_2, Pin_3, Pin_4, Pin_5, Pin_6, Pin_7, Pin_8, Pin_9, Pin_10, Pin_11, Pin_12, Pin_13, Pin_14, Pin_15); function Is_Any_Set (Port : GPIO_Port; Pins : GPIO_Pins) return Boolean with Inline; -- Returns True if any one of the bits specified by Pins is set (not zero) -- in the Port input data register; returns False otherwise. function Is_Set (Port : GPIO_Port; Pins : GPIO_Pins) return Boolean renames Is_Any_Set; -- for the sake of readability when only one pin is specified in GPIO_Pins function Is_Set (Port : GPIO_Port; Pin : GPIO_Pin) return Boolean with Inline; function All_Set (Port : GPIO_Port; Pins : GPIO_Pins) return Boolean with Inline; -- Returns True iff all of the bits specified by Pins are set (not zero) in -- the Port input data register; returns False otherwise. procedure Set (Port : in out GPIO_Port; Pin : GPIO_Pin) with Inline, Post => Is_Set (Port, Pin); -- For the given GPIO port, sets the pins specified by Pin to -- one. Other pins are unaffected. procedure Set (Port : in out GPIO_Port; Pins : GPIO_Pins) with Inline, Post => All_Set (Port, Pins); -- For the given GPIO port, sets of all of the pins specified by Pins to -- one. Other pins are unaffected. procedure Clear (Port : in out GPIO_Port; Pin : GPIO_Pin) with Inline, Post => not Is_Set (Port, Pin); -- For the given GPIO port, sets the pin specified by Pin to -- zero. Other pins are unaffected. procedure Clear (Port : in out GPIO_Port; Pins : GPIO_Pins) with Inline, Post => not All_Set (Port, Pins); -- For the given GPIO port, sets of all of the pins specified by Pins to -- zero. Other pins are unaffected. procedure Toggle (Port : in out GPIO_Port; Pin : GPIO_Pin) with Inline, Post => (if Is_Set (Port, Pin)'Old then not Is_Set (Port, Pin) else Is_Set (Port, Pin)); -- For the given GPIO port, negates the pin specified by Pin (ones -- become zeros and vice versa). Other pins are unaffected. procedure Toggle (Port : in out GPIO_Port; Pins : GPIO_Pins) with Inline; -- For the given GPIO port, negates all of the pins specified by Pins (ones -- become zeros and vice versa). Other pins are unaffected. procedure Lock (Port : in out GPIO_Port; Pin : GPIO_Pin) with Pre => not Locked (Port, Pin), Post => Locked (Port, Pin); -- Lock configuration of the given port until the MCU is reset function Locked (Port : GPIO_Port; Pin : GPIO_Pin) return Boolean with Inline; procedure Lock (Port : in out GPIO_Port; Pins : GPIO_Pins) with Pre => (for all Pin of Pins => (not Locked (Port, Pin))), Post => (for all Pin of Pins => (Locked (Port, Pin))); -- Lock configuration of the specified pins on the given port until the MCU -- is reset type Pin_IO_Modes is (Mode_In, Mode_Out, Mode_AF, Mode_Analog); for Pin_IO_Modes use (Mode_In => 0, Mode_Out => 1, Mode_AF => 2, Mode_Analog => 3); for Pin_IO_Modes'Size use 2; type Pin_Output_Types is (Push_Pull, Open_Drain); for Pin_Output_Types use (Push_Pull => 0, Open_Drain => 1); for Pin_Output_Types'Size use 1; type Pin_Output_Speeds is (Speed_2MHz, Speed_25MHz, Speed_50MHz, Speed_100MHz); for Pin_Output_Speeds use (Speed_2MHz => 0, Speed_25MHz => 1, Speed_50MHz => 2, Speed_100MHz => 3); for Pin_Output_Speeds'Size use 2; type Internal_Pin_Resistors is (Floating, Pull_Up, Pull_Down); for Internal_Pin_Resistors use (Floating => 0, Pull_Up => 1, Pull_Down => 2); for Internal_Pin_Resistors'Size use 2; type GPIO_Port_Configuration is record Mode : Pin_IO_Modes; Output_Type : Pin_Output_Types; Speed : Pin_Output_Speeds; Resistors : Internal_Pin_Resistors; Locked : Boolean := False; end record; procedure Configure_IO (Port : in out GPIO_Port; Pin : GPIO_Pin; Config : GPIO_Port_Configuration); -- For Pin on the specified Port, configures the -- characteristics specified by Config procedure Configure_IO (Port : in out GPIO_Port; Pins : GPIO_Pins; Config : GPIO_Port_Configuration); -- For each pin of Pins on the specified Port, configures the -- characteristics specified by Config type External_Triggers is (Interrupt_Rising_Edge, Interrupt_Falling_Edge, Interrupt_Rising_Falling_Edge, Event_Rising_Edge, Event_Falling_Edge, Event_Rising_Falling_Edge); subtype Interrupt_Triggers is External_Triggers range Interrupt_Rising_Edge .. Interrupt_Rising_Falling_Edge; subtype Event_Triggers is External_Triggers range Event_Rising_Edge .. Event_Rising_Falling_Edge; procedure Configure_Trigger (Port : in out GPIO_Port; Pin : GPIO_Pin; Trigger : External_Triggers); -- For Pin on the specified Port, configures the -- characteristics specified by Trigger procedure Configure_Trigger (Port : in out GPIO_Port; Pins : GPIO_Pins; Trigger : External_Triggers); -- For each pin of Pins on the specified Port, configures the -- characteristics specified by Trigger type GPIO_Alternate_Function is private; procedure Configure_Alternate_Function (Port : in out GPIO_Port; Pin : GPIO_Pin; AF : GPIO_Alternate_Function); -- For Pin on the specified Port, sets the alternate function -- specified by AF procedure Configure_Alternate_Function (Port : in out GPIO_Port; Pins : GPIO_Pins; AF : GPIO_Alternate_Function); -- For each pin of Pins on the specified Port, sets the alternate function -- specified by AF GPIO_AF_RTC_50Hz : constant GPIO_Alternate_Function; GPIO_AF_MCO : constant GPIO_Alternate_Function; GPIO_AF_TAMPER : constant GPIO_Alternate_Function; GPIO_AF_SWJ : constant GPIO_Alternate_Function; GPIO_AF_TRACE : constant GPIO_Alternate_Function; GPIO_AF_TIM1 : constant GPIO_Alternate_Function; GPIO_AF_TIM2 : constant GPIO_Alternate_Function; GPIO_AF_TIM3 : constant GPIO_Alternate_Function; GPIO_AF_TIM4 : constant GPIO_Alternate_Function; GPIO_AF_TIM5 : constant GPIO_Alternate_Function; GPIO_AF_TIM8 : constant GPIO_Alternate_Function; GPIO_AF_TIM9 : constant GPIO_Alternate_Function; GPIO_AF_TIM10 : constant GPIO_Alternate_Function; GPIO_AF_TIM11 : constant GPIO_Alternate_Function; GPIO_AF_I2C1 : constant GPIO_Alternate_Function; GPIO_AF_I2C2 : constant GPIO_Alternate_Function; GPIO_AF_I2C3 : constant GPIO_Alternate_Function; GPIO_AF_SPI1 : constant GPIO_Alternate_Function; GPIO_AF_SPI2 : constant GPIO_Alternate_Function; GPIO_AF5_I2S3ext : constant GPIO_Alternate_Function; GPIO_AF_SPI5 : constant GPIO_Alternate_Function; GPIO_AF_SPI3 : constant GPIO_Alternate_Function; GPIO_AF_I2S2ext : constant GPIO_Alternate_Function; GPIO_AF_USART1 : constant GPIO_Alternate_Function; GPIO_AF_USART2 : constant GPIO_Alternate_Function; GPIO_AF_USART3 : constant GPIO_Alternate_Function; GPIO_AF7_I2S3ext : constant GPIO_Alternate_Function; GPIO_AF_USART4 : constant GPIO_Alternate_Function; GPIO_AF_USART5 : constant GPIO_Alternate_Function; GPIO_AF_USART6 : constant GPIO_Alternate_Function; GPIO_AF_CAN1 : constant GPIO_Alternate_Function; GPIO_AF_CAN2 : constant GPIO_Alternate_Function; GPIO_AF_TIM12 : constant GPIO_Alternate_Function; GPIO_AF_TIM13 : constant GPIO_Alternate_Function; GPIO_AF_TIM14 : constant GPIO_Alternate_Function; GPIO_AF_LTDC_2 : constant GPIO_Alternate_Function; GPIO_AF_OTG_FS : constant GPIO_Alternate_Function; GPIO_AF_OTG_HS : constant GPIO_Alternate_Function; GPIO_AF_ETH : constant GPIO_Alternate_Function; GPIO_AF_FSMC : constant GPIO_Alternate_Function; GPIO_AF_OTG_HS_FS : constant GPIO_Alternate_Function; GPIO_AF_SDIO : constant GPIO_Alternate_Function; GPIO_AF_FMC : constant GPIO_Alternate_Function; GPIO_AF_DCMI : constant GPIO_Alternate_Function; GPIO_AF_LTDC : constant GPIO_Alternate_Function; GPIO_AF_EVENTOUT : constant GPIO_Alternate_Function; private type Reserved_246X32 is array (1 .. 246) of Word with Component_Size => 32, Size => 246*32; type Bits_16x4 is array (0 .. 15) of Bits_4 with Component_Size => 4, Size => 64; type Pin_Modes_Register is array (0 .. 15) of Pin_IO_Modes; for Pin_Modes_Register'Component_Size use Pin_IO_Modes'Size; type Output_Types_Register is array (0 .. 31) of Pin_Output_Types; for Output_Types_Register'Component_Size use Pin_Output_Types'Size; type Output_Speeds_Register is array (0 .. 15) of Pin_Output_Speeds; for Output_Speeds_Register'Component_Size use Pin_Output_Speeds'Size; type Resistors_Register is array (0 .. 15) of Internal_Pin_Resistors; for Resistors_Register'Component_Size use Internal_Pin_Resistors'Size; type GPIO_Port is limited record MODER : Pin_Modes_Register; OTYPER : Output_Types_Register; OSPEEDR : Output_Speeds_Register; PUPDR : Resistors_Register; IDR : Half_Word; -- input data register Reserved_1 : Half_Word; ODR : Half_Word; -- output data register Reserved_2 : Half_Word; BSRR_Set : Half_Word; -- bit set register BSRR_Reset : Half_Word; -- bit reset register LCKR : Word; pragma Atomic (LCKR); -- configuration lock register AFR : Bits_16x4; -- alternate function registers Reserved_4 : Reserved_246x32; end record with Volatile, Size => 16#400# * 8; for GPIO_Port use record MODER at 0 range 0 .. 31; OTYPER at 4 range 0 .. 31; OSPEEDR at 8 range 0 .. 31; PUPDR at 12 range 0 .. 31; IDR at 16 range 0 .. 15; Reserved_1 at 18 range 0 .. 15; ODR at 20 range 0 .. 15; Reserved_2 at 22 range 0 .. 15; BSRR_Set at 24 range 0 .. 15; BSRR_Reset at 26 range 0 .. 15; LCKR at 28 range 0 .. 31; AFR at 32 range 0 .. 63; Reserved_4 at 40 range 0 .. 7871; end record; LCCK : constant Word := 16#0001_0000#; -- As per the Reference Manual (RM0090; Doc ID 018909 Rev 6) pg 282, -- this is the "Lock Key" used to control the locking of port/pin -- configurations. It is bit 16 in the lock register (LCKR) of any -- given port, thus the first bit of the upper 16 bits of the word. type GPIO_Alternate_Function is new Bits_4; -- We cannot use an enumeration type because there are duplicate binary -- values GPIO_AF_RTC_50Hz : constant GPIO_Alternate_Function := 0; GPIO_AF_MCO : constant GPIO_Alternate_Function := 0; GPIO_AF_TAMPER : constant GPIO_Alternate_Function := 0; GPIO_AF_SWJ : constant GPIO_Alternate_Function := 0; GPIO_AF_TRACE : constant GPIO_Alternate_Function := 0; GPIO_AF_TIM1 : constant GPIO_Alternate_Function := 1; GPIO_AF_TIM2 : constant GPIO_Alternate_Function := 1; GPIO_AF_TIM3 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM4 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM5 : constant GPIO_Alternate_Function := 2; GPIO_AF_TIM8 : constant GPIO_Alternate_Function := 3; GPIO_AF_TIM9 : constant GPIO_Alternate_Function := 3; GPIO_AF_TIM10 : constant GPIO_Alternate_Function := 3; GPIO_AF_TIM11 : constant GPIO_Alternate_Function := 3; GPIO_AF_I2C1 : constant GPIO_Alternate_Function := 4; GPIO_AF_I2C2 : constant GPIO_Alternate_Function := 4; GPIO_AF_I2C3 : constant GPIO_Alternate_Function := 4; GPIO_AF_SPI1 : constant GPIO_Alternate_Function := 5; GPIO_AF_SPI2 : constant GPIO_Alternate_Function := 5; GPIO_AF5_I2S3ext : constant GPIO_Alternate_Function := 5; GPIO_AF_SPI5 : constant GPIO_Alternate_Function := 5; GPIO_AF_SPI3 : constant GPIO_Alternate_Function := 6; GPIO_AF_I2S2ext : constant GPIO_Alternate_Function := 6; GPIO_AF_USART1 : constant GPIO_Alternate_Function := 7; GPIO_AF_USART2 : constant GPIO_Alternate_Function := 7; GPIO_AF_USART3 : constant GPIO_Alternate_Function := 7; GPIO_AF7_I2S3ext : constant GPIO_Alternate_Function := 7; GPIO_AF_USART4 : constant GPIO_Alternate_Function := 8; GPIO_AF_USART5 : constant GPIO_Alternate_Function := 8; GPIO_AF_USART6 : constant GPIO_Alternate_Function := 8; GPIO_AF_CAN1 : constant GPIO_Alternate_Function := 9; GPIO_AF_CAN2 : constant GPIO_Alternate_Function := 9; GPIO_AF_TIM12 : constant GPIO_Alternate_Function := 9; GPIO_AF_TIM13 : constant GPIO_Alternate_Function := 9; GPIO_AF_TIM14 : constant GPIO_Alternate_Function := 9; GPIO_AF_LTDC_2 : constant GPIO_Alternate_Function := 9; GPIO_AF_OTG_FS : constant GPIO_Alternate_Function := 10; GPIO_AF_OTG_HS : constant GPIO_Alternate_Function := 10; GPIO_AF_ETH : constant GPIO_Alternate_Function := 11; GPIO_AF_FSMC : constant GPIO_Alternate_Function := 12; GPIO_AF_OTG_HS_FS : constant GPIO_Alternate_Function := 12; GPIO_AF_SDIO : constant GPIO_Alternate_Function := 12; GPIO_AF_FMC : constant GPIO_Alternate_Function := 12; GPIO_AF_DCMI : constant GPIO_Alternate_Function := 13; GPIO_AF_LTDC : constant GPIO_Alternate_Function := 14; GPIO_AF_EVENTOUT : constant GPIO_Alternate_Function := 15; end STM32F4.GPIO;