repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
mirror/ncurses
Ada
3,688
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 1999-2011,2014 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: Juergen Pfeifer, 1996 -- Version Control: -- $Revision: 1.14 $ -- $Date: 2020/02/02 23:34:34 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is procedure Set_Field_Type (Fld : Field; Typ : AlphaNumeric_Field) is function Set_Fld_Type (F : Field := Fld; Arg1 : C_Int) return Eti_Error; pragma Import (C, Set_Fld_Type, "set_field_type_alnum"); begin Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width))); Wrap_Builtin (Fld, Typ); end Set_Field_Type; end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
reznikmm/matreshka
Ada
4,873
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 XML.DOM.Visitors; with ODF.DOM.Table_Data_Pilot_Group_Member_Elements; package Matreshka.ODF_Table.Data_Pilot_Group_Member_Elements is type Table_Data_Pilot_Group_Member_Element_Node is new Matreshka.ODF_Table.Abstract_Table_Element_Node and ODF.DOM.Table_Data_Pilot_Group_Member_Elements.ODF_Table_Data_Pilot_Group_Member with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Table_Data_Pilot_Group_Member_Element_Node; overriding function Get_Local_Name (Self : not null access constant Table_Data_Pilot_Group_Member_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Table_Data_Pilot_Group_Member_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Leave_Node (Self : not null access Table_Data_Pilot_Group_Member_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Visit_Node (Self : not null access Table_Data_Pilot_Group_Member_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); end Matreshka.ODF_Table.Data_Pilot_Group_Member_Elements;
AaronC98/PlaneSystem
Ada
2,940
ads
------------------------------------------------------------------------------ -- Ada Web Server -- -- -- -- Copyright (C) 2000-2015, AdaCore -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 3, 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. -- -- -- -- -- -- -- -- -- -- -- -- 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/>. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ------------------------------------------------------------------------------ with SOAP.Name_Space; with SOAP.Parameters; package SOAP.Message.Payload is type Object is new Message.Object with private; function Procedure_Name (P : Object'Class) return String; -- Retruns the Payload procedure name procedure Set_Procedure_Name (P : in out Object'Class; Name : String); -- Set the payload procedure name function Build (Procedure_Name : String; P_Set : SOAP.Parameters.List; Name_Space : SOAP.Name_Space.Object := SOAP.Name_Space.AWS) return Object; -- Retruns a Payload object initialized with the procedure name, -- parameters and name space. private type Object is new Message.Object with null record; end SOAP.Message.Payload;
godunko/adawebpack
Ada
3,445
adb
------------------------------------------------------------------------------ -- -- -- AdaWebPack -- -- -- ------------------------------------------------------------------------------ -- Copyright © 2021, Vadim Godunko -- -- All rights reserved. -- -- -- -- 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 WASM.Attributes; with WASM.Objects.Attributes; package body Web.HTML.Labels is ------------------ -- Get_HTML_For -- ------------------ function Get_HTML_For (Self : HTML_Label_Element'Class) return Web.Strings.Web_String is begin return WASM.Objects.Attributes.Get_String (Self, WASM.Attributes.HTML_For); end Get_HTML_For; ------------------ -- Set_HTML_For -- ------------------ procedure Set_HTML_For (Self : in out HTML_Label_Element'Class; To : Web.Strings.Web_String) is begin WASM.Objects.Attributes.Set_String (Self, WASM.Attributes.HTML_For, To); end Set_HTML_For; end Web.HTML.Labels;
sungyeon/drake
Ada
862
adb
with System.Address_To_Constant_Access_Conversions; with System.Startup; with System.Zero_Terminated_Strings; with C; package body System.Native_Command_Line is function Argument_Count return Natural is begin return Startup.argc - 1; end Argument_Count; function Argument (Number : Natural) return String is subtype Fixed_char_const_ptr_array is C.char_const_ptr_array (C.size_t); type char_const_ptr_array_const_ptr is access constant Fixed_char_const_ptr_array with Convention => C; package Conv is new Address_To_Constant_Access_Conversions ( Fixed_char_const_ptr_array, char_const_ptr_array_const_ptr); begin return Zero_Terminated_Strings.Value ( Conv.To_Pointer (Startup.argv) (C.size_t (Number))); end Argument; end System.Native_Command_Line;
AdaCore/Ada-IntelliJ
Ada
2,758
adb
------------------------------------------------------------------------------ -- Copyright (C) 2018, AdaCore -- -- -- -- This 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. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY 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 this software; see file -- -- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy -- -- of the license. -- ------------------------------------------------------------------------------ with System; package body Generic_Timers is use Ada; use type Ada.Real_Time.Time; protected Events is pragma Priority (System.Any_Priority'Last); procedure Handler (Event : in out Real_Time.Timing_Events.Timing_Event); end Events; ------------ -- Events -- ------------ protected body Events is ------------- -- Handler -- ------------- procedure Handler (Event : in out Real_Time.Timing_Events.Timing_Event) is begin Action; if not One_Shot then Start; -- periodic timer continues end if; end Handler; end Events; ----------- -- Start -- ----------- procedure Start is use type Ada.Real_Time.Timing_Events.Timing_Event_Handler; begin if Real_Time.Timing_Events.Current_Handler (The_Event) = null then Real_Time.Timing_Events.Set_Handler (The_Event, Ada.Real_Time.Clock + Period, Events.Handler'Access); else raise Timer_Error with Timer_Name & " started already"; end if; end Start; ---------- -- Stop -- ---------- procedure Stop is Success : Boolean := False; use type Ada.Real_Time.Timing_Events.Timing_Event_Handler; begin if Real_Time.Timing_Events.Current_Handler (The_Event) /= null then Real_Time.Timing_Events.Cancel_Handler (The_Event, Success); if not Success then raise Timer_Error with "fails to cancel " & Timer_Name; end if; end if; end Stop; ------------ -- Cancel -- ------------ procedure Cancel renames Stop; end Generic_Timers;
Lyanf/pok
Ada
136
ads
pragma No_Run_Time; with Interfaces.C; package Compute is procedure Compute; pragma Export (C, Compute, "compute"); end Compute;
reznikmm/matreshka
Ada
3,850
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- 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$ ------------------------------------------------------------------------------ package Matreshka.ODF_Attributes.Table.Number_Columns_Spanned is type Table_Number_Columns_Spanned_Node is new Matreshka.ODF_Attributes.Table.Table_Node_Base with null record; type Table_Number_Columns_Spanned_Access is access all Table_Number_Columns_Spanned_Node'Class; overriding function Get_Local_Name (Self : not null access constant Table_Number_Columns_Spanned_Node) return League.Strings.Universal_String; end Matreshka.ODF_Attributes.Table.Number_Columns_Spanned;
reznikmm/matreshka
Ada
4,259
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- 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 Matreshka.DOM_Nodes; with XML.DOM.Attributes.Internals; package body ODF.DOM.Attributes.FO.Border_Bottom.Internals is ------------ -- Create -- ------------ function Create (Node : Matreshka.ODF_Attributes.FO.Border_Bottom.FO_Border_Bottom_Access) return ODF.DOM.Attributes.FO.Border_Bottom.ODF_FO_Border_Bottom is begin return (XML.DOM.Attributes.Internals.Create (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Create; ---------- -- Wrap -- ---------- function Wrap (Node : Matreshka.ODF_Attributes.FO.Border_Bottom.FO_Border_Bottom_Access) return ODF.DOM.Attributes.FO.Border_Bottom.ODF_FO_Border_Bottom is begin return (XML.DOM.Attributes.Internals.Wrap (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Wrap; end ODF.DOM.Attributes.FO.Border_Bottom.Internals;
brock7/TianLong
Ada
4,270
ads
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- package ZLib.Streams is type Stream_Mode is (In_Stream, Out_Stream, Duplex); type Stream_Access is access all Ada.Streams.Root_Stream_Type'Class; type Stream_Type is new Ada.Streams.Root_Stream_Type with private; procedure Read (Stream : in out Stream_Type; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); procedure Write (Stream : in out Stream_Type; Item : in Ada.Streams.Stream_Element_Array); procedure Flush (Stream : in out Stream_Type; Mode : in Flush_Mode := Sync_Flush); -- Flush the written data to the back stream, -- all data placed to the compressor is flushing to the Back stream. -- Should not be used untill necessary, becouse it is decreasing -- compression. function Read_Total_In (Stream : in Stream_Type) return Count; pragma Inline (Read_Total_In); -- Return total number of bytes read from back stream so far. function Read_Total_Out (Stream : in Stream_Type) return Count; pragma Inline (Read_Total_Out); -- Return total number of bytes read so far. function Write_Total_In (Stream : in Stream_Type) return Count; pragma Inline (Write_Total_In); -- Return total number of bytes written so far. function Write_Total_Out (Stream : in Stream_Type) return Count; pragma Inline (Write_Total_Out); -- Return total number of bytes written to the back stream. procedure Create (Stream : out Stream_Type; Mode : in Stream_Mode; Back : in Stream_Access; Back_Compressed : in Boolean; Level : in Compression_Level := Default_Compression; Strategy : in Strategy_Type := Default_Strategy; Header : in Header_Type := Default; Read_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size; Write_Buffer_Size : in Ada.Streams.Stream_Element_Offset := Default_Buffer_Size); -- Create the Comression/Decompression stream. -- If mode is In_Stream then Write operation is disabled. -- If mode is Out_Stream then Read operation is disabled. -- If Back_Compressed is true then -- Data written to the Stream is compressing to the Back stream -- and data read from the Stream is decompressed data from the Back stream. -- If Back_Compressed is false then -- Data written to the Stream is decompressing to the Back stream -- and data read from the Stream is compressed data from the Back stream. -- !!! When the Need_Header is False ZLib-Ada is using undocumented -- ZLib 1.1.4 functionality to do not create/wait for ZLib headers. function Is_Open (Stream : Stream_Type) return Boolean; procedure Close (Stream : in out Stream_Type); private use Ada.Streams; type Buffer_Access is access all Stream_Element_Array; type Stream_Type is new Root_Stream_Type with record Mode : Stream_Mode; Buffer : Buffer_Access; Rest_First : Stream_Element_Offset; Rest_Last : Stream_Element_Offset; -- Buffer for Read operation. -- We need to have this buffer in the record -- becouse not all read data from back stream -- could be processed during the read operation. Buffer_Size : Stream_Element_Offset; -- Buffer size for write operation. -- We do not need to have this buffer -- in the record becouse all data could be -- processed in the write operation. Back : Stream_Access; Reader : Filter_Type; Writer : Filter_Type; end record; end ZLib.Streams;
reznikmm/matreshka
Ada
3,779
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 XML.DOM.Attributes; package ODF.DOM.Style_Text_Line_Through_Text_Attributes is pragma Preelaborate; type ODF_Style_Text_Line_Through_Text_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Text_Line_Through_Text_Attribute_Access is access all ODF_Style_Text_Line_Through_Text_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Text_Line_Through_Text_Attributes;
MonadnockSystems/Ada_Drivers_Library
Ada
2,555
ads
------------------------------------------------------------------------------ -- -- -- Copyright (C) 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. -- -- -- ------------------------------------------------------------------------------ package nRF51.Temperature is type Temp_Celsius is delta 0.25 range -2_147_483_648.0 / 4 .. 2_147_483_647.0 / 4; function Read return Temp_Celsius; end nRF51.Temperature;
reznikmm/matreshka
Ada
27,045
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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.Elements; with AMF.Internals.Element_Collections; with AMF.Internals.Helpers; with AMF.Internals.Tables.UML_Attributes; with AMF.Visitors.UML_Iterators; with AMF.Visitors.UML_Visitors; with League.Strings.Internals; with Matreshka.Internals.Strings; package body AMF.Internals.UML_Call_Operation_Actions is ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant UML_Call_Operation_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then AMF.Visitors.UML_Visitors.UML_Visitor'Class (Visitor).Enter_Call_Operation_Action (AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant UML_Call_Operation_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then AMF.Visitors.UML_Visitors.UML_Visitor'Class (Visitor).Leave_Call_Operation_Action (AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant UML_Call_Operation_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then AMF.Visitors.UML_Iterators.UML_Iterator'Class (Iterator).Visit_Call_Operation_Action (Visitor, AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access (Self), Control); end if; end Visit_Element; ------------------- -- Get_Operation -- ------------------- overriding function Get_Operation (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Operations.UML_Operation_Access is begin return AMF.UML.Operations.UML_Operation_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Operation (Self.Element))); end Get_Operation; ------------------- -- Set_Operation -- ------------------- overriding procedure Set_Operation (Self : not null access UML_Call_Operation_Action_Proxy; To : AMF.UML.Operations.UML_Operation_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Operation (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Operation; ---------------- -- Get_Target -- ---------------- overriding function Get_Target (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Input_Pins.UML_Input_Pin_Access is begin return AMF.UML.Input_Pins.UML_Input_Pin_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Target (Self.Element))); end Get_Target; ---------------- -- Set_Target -- ---------------- overriding procedure Set_Target (Self : not null access UML_Call_Operation_Action_Proxy; To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Target (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Target; ------------------------ -- Get_Is_Synchronous -- ------------------------ overriding function Get_Is_Synchronous (Self : not null access constant UML_Call_Operation_Action_Proxy) return Boolean is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Synchronous (Self.Element); end Get_Is_Synchronous; ------------------------ -- Set_Is_Synchronous -- ------------------------ overriding procedure Set_Is_Synchronous (Self : not null access UML_Call_Operation_Action_Proxy; To : Boolean) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Synchronous (Self.Element, To); end Set_Is_Synchronous; ---------------- -- Get_Result -- ---------------- overriding function Get_Result (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is begin return AMF.UML.Output_Pins.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Result (Self.Element))); end Get_Result; ------------------ -- Get_Argument -- ------------------ overriding function Get_Argument (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin is begin return AMF.UML.Input_Pins.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Argument (Self.Element))); end Get_Argument; ----------------- -- Get_On_Port -- ----------------- overriding function Get_On_Port (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Ports.UML_Port_Access is begin return AMF.UML.Ports.UML_Port_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_On_Port (Self.Element))); end Get_On_Port; ----------------- -- Set_On_Port -- ----------------- overriding procedure Set_On_Port (Self : not null access UML_Call_Operation_Action_Proxy; To : AMF.UML.Ports.UML_Port_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_On_Port (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_On_Port; ----------------- -- Get_Context -- ----------------- overriding function Get_Context (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access is begin return AMF.UML.Classifiers.UML_Classifier_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Context (Self.Element))); end Get_Context; --------------- -- Get_Input -- --------------- overriding function Get_Input (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin is begin return AMF.UML.Input_Pins.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Input (Self.Element))); end Get_Input; ------------------------------ -- Get_Is_Locally_Reentrant -- ------------------------------ overriding function Get_Is_Locally_Reentrant (Self : not null access constant UML_Call_Operation_Action_Proxy) return Boolean is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Locally_Reentrant (Self.Element); end Get_Is_Locally_Reentrant; ------------------------------ -- Set_Is_Locally_Reentrant -- ------------------------------ overriding procedure Set_Is_Locally_Reentrant (Self : not null access UML_Call_Operation_Action_Proxy; To : Boolean) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Locally_Reentrant (Self.Element, To); end Set_Is_Locally_Reentrant; ----------------------------- -- Get_Local_Postcondition -- ----------------------------- overriding function Get_Local_Postcondition (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is begin return AMF.UML.Constraints.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Postcondition (Self.Element))); end Get_Local_Postcondition; ---------------------------- -- Get_Local_Precondition -- ---------------------------- overriding function Get_Local_Precondition (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is begin return AMF.UML.Constraints.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Precondition (Self.Element))); end Get_Local_Precondition; ---------------- -- Get_Output -- ---------------- overriding function Get_Output (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is begin return AMF.UML.Output_Pins.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Output (Self.Element))); end Get_Output; ----------------- -- Get_Handler -- ----------------- overriding function Get_Handler (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler is begin return AMF.UML.Exception_Handlers.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Handler (Self.Element))); end Get_Handler; ------------------ -- Get_Activity -- ------------------ overriding function Get_Activity (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Activities.UML_Activity_Access is begin return AMF.UML.Activities.UML_Activity_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Activity (Self.Element))); end Get_Activity; ------------------ -- Set_Activity -- ------------------ overriding procedure Set_Activity (Self : not null access UML_Call_Operation_Action_Proxy; To : AMF.UML.Activities.UML_Activity_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Activity (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Activity; ------------------ -- Get_In_Group -- ------------------ overriding function Get_In_Group (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group is begin return AMF.UML.Activity_Groups.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Group (Self.Element))); end Get_In_Group; --------------------------------- -- Get_In_Interruptible_Region -- --------------------------------- overriding function Get_In_Interruptible_Region (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region is begin return AMF.UML.Interruptible_Activity_Regions.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Interruptible_Region (Self.Element))); end Get_In_Interruptible_Region; ---------------------- -- Get_In_Partition -- ---------------------- overriding function Get_In_Partition (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition is begin return AMF.UML.Activity_Partitions.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Partition (Self.Element))); end Get_In_Partition; ---------------------------- -- Get_In_Structured_Node -- ---------------------------- overriding function Get_In_Structured_Node (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access is begin return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Structured_Node (Self.Element))); end Get_In_Structured_Node; ---------------------------- -- Set_In_Structured_Node -- ---------------------------- overriding procedure Set_In_Structured_Node (Self : not null access UML_Call_Operation_Action_Proxy; To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_In_Structured_Node (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_In_Structured_Node; ------------------ -- Get_Incoming -- ------------------ overriding function Get_Incoming (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is begin return AMF.UML.Activity_Edges.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Incoming (Self.Element))); end Get_Incoming; ------------------ -- Get_Outgoing -- ------------------ overriding function Get_Outgoing (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is begin return AMF.UML.Activity_Edges.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Outgoing (Self.Element))); end Get_Outgoing; ------------------------ -- Get_Redefined_Node -- ------------------------ overriding function Get_Redefined_Node (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node is begin return AMF.UML.Activity_Nodes.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Node (Self.Element))); end Get_Redefined_Node; ----------------- -- Get_Is_Leaf -- ----------------- overriding function Get_Is_Leaf (Self : not null access constant UML_Call_Operation_Action_Proxy) return Boolean is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf (Self.Element); end Get_Is_Leaf; ----------------- -- Set_Is_Leaf -- ----------------- overriding procedure Set_Is_Leaf (Self : not null access UML_Call_Operation_Action_Proxy; To : Boolean) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf (Self.Element, To); end Set_Is_Leaf; --------------------------- -- Get_Redefined_Element -- --------------------------- overriding function Get_Redefined_Element (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is begin return AMF.UML.Redefinable_Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element (Self.Element))); end Get_Redefined_Element; ------------------------------ -- Get_Redefinition_Context -- ------------------------------ overriding function Get_Redefinition_Context (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is begin return AMF.UML.Classifiers.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context (Self.Element))); end Get_Redefinition_Context; --------------------------- -- Get_Client_Dependency -- --------------------------- overriding function Get_Client_Dependency (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is begin return AMF.UML.Dependencies.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency (Self.Element))); end Get_Client_Dependency; ------------------------- -- Get_Name_Expression -- ------------------------- overriding function Get_Name_Expression (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access is begin return AMF.UML.String_Expressions.UML_String_Expression_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression (Self.Element))); end Get_Name_Expression; ------------------------- -- Set_Name_Expression -- ------------------------- overriding procedure Set_Name_Expression (Self : not null access UML_Call_Operation_Action_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Name_Expression; ------------------- -- Get_Namespace -- ------------------- overriding function Get_Namespace (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access is begin return AMF.UML.Namespaces.UML_Namespace_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace (Self.Element))); end Get_Namespace; ------------------------ -- Get_Qualified_Name -- ------------------------ overriding function Get_Qualified_Name (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.Optional_String is begin declare use type Matreshka.Internals.Strings.Shared_String_Access; Aux : constant Matreshka.Internals.Strings.Shared_String_Access := AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element); begin if Aux = null then return (Is_Empty => True); else return (False, League.Strings.Internals.Create (Aux)); end if; end; end Get_Qualified_Name; ------------- -- Context -- ------------- overriding function Context (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Context unimplemented"); raise Program_Error with "Unimplemented procedure UML_Call_Operation_Action_Proxy.Context"; return Context (Self); end Context; ------------------------ -- Is_Consistent_With -- ------------------------ overriding function Is_Consistent_With (Self : not null access constant UML_Call_Operation_Action_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented"); raise Program_Error with "Unimplemented procedure UML_Call_Operation_Action_Proxy.Is_Consistent_With"; return Is_Consistent_With (Self, Redefinee); end Is_Consistent_With; ----------------------------------- -- Is_Redefinition_Context_Valid -- ----------------------------------- overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Call_Operation_Action_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented"); raise Program_Error with "Unimplemented procedure UML_Call_Operation_Action_Proxy.Is_Redefinition_Context_Valid"; return Is_Redefinition_Context_Valid (Self, Redefined); end Is_Redefinition_Context_Valid; ------------------------- -- All_Owning_Packages -- ------------------------- overriding function All_Owning_Packages (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented"); raise Program_Error with "Unimplemented procedure UML_Call_Operation_Action_Proxy.All_Owning_Packages"; return All_Owning_Packages (Self); end All_Owning_Packages; ----------------------------- -- Is_Distinguishable_From -- ----------------------------- overriding function Is_Distinguishable_From (Self : not null access constant UML_Call_Operation_Action_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented"); raise Program_Error with "Unimplemented procedure UML_Call_Operation_Action_Proxy.Is_Distinguishable_From"; return Is_Distinguishable_From (Self, N, Ns); end Is_Distinguishable_From; --------------- -- Namespace -- --------------- overriding function Namespace (Self : not null access constant UML_Call_Operation_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented"); raise Program_Error with "Unimplemented procedure UML_Call_Operation_Action_Proxy.Namespace"; return Namespace (Self); end Namespace; end AMF.Internals.UML_Call_Operation_Actions;
Vovanium/stm32-ada
Ada
3,027
ads
package STM32.F4.Address_Map is pragma Pure; TIM2: constant := 16#4000_0000#; TIM3: constant := 16#4000_0400#; TIM4: constant := 16#4000_0800#; TIM5: constant := 16#4000_0C00#; TIM6: constant := 16#4000_1000#; TIM7: constant := 16#4000_1400#; TIM12: constant := 16#4000_1800#; TIM13: constant := 16#4000_1C00#; TIM14: constant := 16#4000_2000#; RTC_and_BKP: constant := 16#4000_2800#; WWDG: constant := 16#4000_2C00#; IWDG: constant := 16#4000_3000#; I2S2ext: constant := 16#4000_3400#; SPI2_I2S2: constant := 16#4000_3800#; SPI3_I2S3: constant := 16#4000_3C00#; I2S3ext: constant := 16#4000_4000#; USART2: constant := 16#4000_4400#; USART3: constant := 16#4000_4800#; UART4: constant := 16#4000_4C00#; UART5: constant := 16#4000_5000#; I2C1: constant := 16#4000_5400#; I2C2: constant := 16#4000_5800#; I2C3: constant := 16#4000_5C00#; CAN1: constant := 16#4000_6400#; CAN2: constant := 16#4000_6800#; PWR: constant := 16#4000_7000#; DAC: constant := 16#4000_7400#; UART7: constant := 14#4000_7800#; UART8: constant := 14#4000_7C00#; TIM1: constant := 16#4001_0000#; TIM8: constant := 16#4001_0400#; USART1: constant := 16#4001_1000#; USART6: constant := 16#4001_1400#; ADC1_2_3: constant := 16#4001_2000#; SDIO: constant := 16#4001_2C00#; SPI1: constant := 16#4001_3000#; SPI4: constant := 16#4001_3400#; SYSCFG: constant := 16#4001_3800#; EXTI: constant := 16#4001_3C00#; TIM9: constant := 16#4001_4000#; TIM10: constant := 16#4001_4400#; TIM11: constant := 16#4001_4800#; GPIOA: constant := 16#4002_0000#; GPIOB: constant := 16#4002_0400#; GPIOC: constant := 16#4002_0800#; GPIOD: constant := 16#4002_0C00#; GPIOE: constant := 16#4002_1000#; GPIOF: constant := 16#4002_1400#; GPIOG: constant := 16#4002_1800#; GPIOH: constant := 16#4002_1C00#; GPIOI: constant := 16#4002_2000#; GPIOJ: constant := 16#4002_2400#; GPIOK: constant := 16#4002_2800#; CRC: constant := 16#4002_3000#; RCC: constant := 16#4002_3800#; Flash_IR: constant := 16#4002_3C00#; BKPSRAM: constant := 16#4002_4000#; DMA1: constant := 16#4002_6000#; DMA2: constant := 16#4002_6400#; Ethernet_MAC:constant := 16#4002_8000#; DMA2D: constant := 16#4002_B000#; USB_OTG_HS: constant := 16#4004_0000#; USB_OTG_FS: constant := 16#5000_0000#; DCMI: constant := 16#5005_0000#; CRYP: constant := 16#5006_0000#; HASH: constant := 16#5006_0400#; RNG: constant := 16#5006_0800#; FSMC_Bank1: constant := 16#6000_0000#; FSMC_Bank2: constant := 16#7000_0000#; FSMC_Bank3: constant := 16#8000_0000#; FSMC_Bank4: constant := 16#9000_0000#; FMC_FSMC: constant := 16#A000_0000#; end STM32.F4.Address_Map;
reznikmm/matreshka
Ada
4,651
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 XML.DOM.Visitors; with ODF.DOM.Draw_Rect_Elements; package Matreshka.ODF_Draw.Rect_Elements is type Draw_Rect_Element_Node is new Matreshka.ODF_Draw.Abstract_Draw_Element_Node and ODF.DOM.Draw_Rect_Elements.ODF_Draw_Rect with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Draw_Rect_Element_Node; overriding function Get_Local_Name (Self : not null access constant Draw_Rect_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Draw_Rect_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Leave_Node (Self : not null access Draw_Rect_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Visit_Node (Self : not null access Draw_Rect_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); end Matreshka.ODF_Draw.Rect_Elements;
reznikmm/matreshka
Ada
6,880
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Text.Author_Name_Elements is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Text_Author_Name_Element_Node is begin return Self : Text_Author_Name_Element_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; ---------------- -- Enter_Node -- ---------------- overriding procedure Enter_Node (Self : not null access Text_Author_Name_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Enter_Text_Author_Name (ODF.DOM.Text_Author_Name_Elements.ODF_Text_Author_Name_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Enter_Node (Visitor, Control); end if; end Enter_Node; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Author_Name_Element_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Author_Name_Element; end Get_Local_Name; ---------------- -- Leave_Node -- ---------------- overriding procedure Leave_Node (Self : not null access Text_Author_Name_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Leave_Text_Author_Name (ODF.DOM.Text_Author_Name_Elements.ODF_Text_Author_Name_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Leave_Node (Visitor, Control); end if; end Leave_Node; ---------------- -- Visit_Node -- ---------------- overriding procedure Visit_Node (Self : not null access Text_Author_Name_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then ODF.DOM.Iterators.Abstract_ODF_Iterator'Class (Iterator).Visit_Text_Author_Name (Visitor, ODF.DOM.Text_Author_Name_Elements.ODF_Text_Author_Name_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Visit_Node (Iterator, Visitor, Control); end if; end Visit_Node; begin Matreshka.DOM_Documents.Register_Element (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Author_Name_Element, Text_Author_Name_Element_Node'Tag); end Matreshka.ODF_Text.Author_Name_Elements;
charlie5/cBound
Ada
1,375
ads
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with xcb.xcb_str_t; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_str_iterator_t is -- Item -- type Item is record data : access xcb.xcb_str_t.Item; the_rem : aliased Interfaces.C.int; index : aliased Interfaces.C.int; end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_str_iterator_t.Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_str_iterator_t.Item, Element_Array => xcb.xcb_str_iterator_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_str_iterator_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_str_iterator_t.Pointer, Element_Array => xcb.xcb_str_iterator_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_str_iterator_t;
reznikmm/slimp
Ada
1,069
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with League.Strings; with League.String_Vectors; package Slim.Messages.RESP is type RESP_Message is new Message with private; not overriding function Headers (Self : RESP_Message) return League.String_Vectors.Universal_String_Vector; private subtype Byte is Ada.Streams.Stream_Element; type RESP_Message is new Message with record Value : League.Strings.Universal_String; end record; overriding function Read (Data : not null access League.Stream_Element_Vectors.Stream_Element_Vector) return RESP_Message; overriding procedure Write (Self : RESP_Message; Tag : out Message_Tag; Data : out League.Stream_Element_Vectors.Stream_Element_Vector); overriding procedure Visit (Self : not null access RESP_Message; Visiter : in out Slim.Message_Visiters.Visiter'Class); end Slim.Messages.RESP;
BrickBot/Bound-T-H8-300
Ada
3,719
ads
-- Programs.Execution.Draw (decl) -- -- Generates drawings of control-flow graphs and call-graphs. -- -- A component of the Bound-T Worst-Case Execution Time Tool. -- ------------------------------------------------------------------------------- -- Copyright (c) 1999 .. 2015 Tidorum Ltd -- All rights reserved. -- -- 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. -- -- 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. -- -- Other modules (files) of this software composition should contain their -- own copyright statements, which may have different copyright and usage -- conditions. The above conditions apply to this file. ------------------------------------------------------------------------------- -- -- $Revision: 1.6 $ -- $Date: 2015/10/24 19:36:51 $ -- -- $Log: programs-execution-draw.ads,v $ -- Revision 1.6 2015/10/24 19:36:51 niklas -- Moved to free licence. -- -- Revision 1.5 2011-08-31 04:23:34 niklas -- BT-CH-0222: Option registry. Option -dump. External help files. -- -- Revision 1.4 2007/06/06 20:05:52 niklas -- Added procedure Draw_Recursion_Graph. -- -- Revision 1.3 2005/10/09 08:10:23 niklas -- BT-CH-0013. -- -- Revision 1.2 2004/05/01 10:59:20 niklas -- First Tidorum version. -- Changed source references from SSF to Tidorum. -- Updated for changes in the parent package. -- Omitted drawing of subprograms with asserted WCET. -- Removed Program_T parameters where the target program can now be -- accessed via some Bounds_Ref. -- Added drawing of primary code address range (Code_Address_Image) under -- the option Opt.Code_Address. -- -- Revision 1.1 2003/03/11 08:30:04 holsti -- First version renamed to be a child of Programs.Execution. -- Normalized some lay-out and commenting. -- package Programs.Execution.Draw is procedure Draw_Graphs (Bounds_Set : in Bounds_Set_T); -- -- Draws diagrams of the call-graphs and control-flow graphs of -- the root subprograms in the given Bounds_Set and possibly of -- their lower-level callees, depending on the chosen options. -- -- The control-flow graphs for subprograms with an asserted time -- bound are not drawn (because they are only stubs). procedure Draw_Recursion_Graph (Program : in Program_T); -- -- Draws a diagram of the recursive call-graph of the closure -- of the root subprograms, as far as currently explored. Note -- that this is not certain to be the full call-graph because -- some subprograms may have unresolved dynamic control flow. end Programs.Execution.Draw;
reznikmm/matreshka
Ada
4,761
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- 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$ ------------------------------------------------------------------------------ package Matreshka.ODF_Elements.Office.Automatic_Styles is type Office_Automatic_Styles_Node is new Matreshka.ODF_Elements.Office.Office_Node_Base with null record; type Office_Automatic_Styles_Access is access all Office_Automatic_Styles_Node'Class; overriding procedure Enter_Element (Self : not null access Office_Automatic_Styles_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding function Get_Local_Name (Self : not null access constant Office_Automatic_Styles_Node) return League.Strings.Universal_String; overriding procedure Leave_Element (Self : not null access Office_Automatic_Styles_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access Office_Automatic_Styles_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end Matreshka.ODF_Elements.Office.Automatic_Styles;
kjseefried/GNAT-Build-Summary
Ada
10,040
adb
with Ada.Characters.Latin_1; with Ada.Command_Line; with Ada.Directories; with Ada.Exceptions; with Ada.Strings.Fixed; with Ada.Strings.Unbounded; with Ada.Text_IO; procedure GNAT_Build_Summary is Invalid_Option : exception; Unknown_Option : exception; type Option_Info is record Help : Boolean := False; Quiet : Boolean := False; end record; procedure Parse_Options (Options : out Option_Info); -- Parses command line options into Options. -- Raises Invalid_Option if an argument is malformed. -- Raises Unknown_Option if the option is not recognized. procedure Parse_Options (Options : out Option_Info) is begin -- Parse_Options Each_Argument : for Index in 1 .. Ada.Command_Line.Argument_Count loop Parse_Argument : declare Argument : constant String := Ada.Command_Line.Argument (Index); begin -- Parse_Argument if Argument'Length /= 2 or else Argument (1) /= '-' then raise Invalid_Option with Argument; else case Argument (2) is when 'h' => Options.Help := True; when 'q' => Options.Quiet := True; when others => raise Unknown_Option with Argument; end case; end if; end Parse_Argument; end loop Each_Argument; end Parse_Options; type Summary_ID is (None, Operation); -- The possible types of summary. type Summary_Command is (GNAT_Make, GCC, GNAT_List, GNAT_Compile, GNAT_Bind, GNAT_Link); -- Recognized commands. type Summary_Info (ID : Summary_ID := None) is record case ID is when None => null; when Operation => Command : Summary_Command; File : Ada.Strings.Unbounded.Unbounded_String; end case; end record; function Parse_Summary (Line : String) return Summary_Info; -- Parses Line, returning summary information. function Parse_Summary (Line : String) return Summary_Info is Result : Summary_Info (ID => Operation); Command_Start : Natural; Command_End : Natural; Source_Index : Natural; Path_Index : Natural; begin -- Parse_Summary if Line'Length = 0 then return (ID => None); -- We can't summarize, so return a result reflecting that. elsif Line (Line'First .. Line'First + 2) = "gcc" then Result.Command := GCC; else Command_Start := Ada.Strings.Fixed.Index (Line, Pattern => "gnat"); if Command_Start = 0 then return (ID => None); -- We can't summarize, so return a result reflecting that. else if Command_Start /= Line'First or (Command_Start > Line'First and then Line (Command_Start - 1) /= '/') then -- Not the beginning of the line, or the path. Command_Start := Ada.Strings.Fixed.Index (Line (Command_Start + 1 .. Line'Last), Pattern => "gnat"); if Command_Start = 0 then return (ID => None); -- We can't summarize, so return a result reflecting that. end if; end if; if Line (Command_Start + 4) = ' ' then -- Skip a space after gnat, if there is one. Command_Start := Command_Start + 5; else Command_Start := Command_Start + 4; end if; Command_End := Ada.Strings.Fixed.Index (Line (Command_Start .. Line'Last), Pattern => " "); if Command_End = 0 then return (ID => None); -- We can't summarize, so return a result reflecting that. else Command_End := Command_End - 1; end if; if Line (Command_Start .. Command_End) = "make" then Result.Command := GNAT_Make; elsif Line (Command_Start .. Command_End) = "list" then Result.Command := GNAT_List; elsif Line (Command_Start .. Command_End) = "compile" then Result.Command := GNAT_Compile; elsif Line (Command_Start .. Command_End) = "bind" then Result.Command := GNAT_Bind; elsif Line (Command_Start .. Command_End) = "link" then Result.Command := GNAT_Link; else return (ID => None); -- We can't summarize, so return a result reflecting that. end if; end if; end if; Source_Index := Ada.Strings.Fixed.Index (Line, Pattern => ".ad", Going => Ada.Strings.Backward); if Source_Index = 0 then Source_Index := Ada.Strings.Fixed.Index (Line, Pattern => ".gpr", Going => Ada.Strings.Backward); -- Try a project file. if Source_Index = 0 then Source_Index := Ada.Strings.Fixed.Index (Line, Pattern => ".ali", Going => Ada.Strings.Backward); -- Try a library file. if Source_Index = 0 then return (ID => None); -- We can't find what file the operation takes place on. end if; end if; end if; Path_Index := Ada.Strings.Fixed.Index (Line (Command_End + 1 .. Line'Last), Pattern => " /"); if Path_Index = 0 or Path_Index > Source_Index then -- Check for a relative file path. Path_Index := Ada.Strings.Fixed.Index (Line (Command_End + 1 .. Line'Last), Pattern => " "); end if; Result.File := Ada.Strings.Unbounded.To_Unbounded_String (Line (Path_Index + 1 .. Source_Index + 3) ); return Result; end Parse_Summary; procedure Usage; -- Outputs usage information to Ada.Text_IO.Current_Error. procedure Usage is use Ada.Text_IO; begin -- Usage Put_Line (File => Current_Error, Item => "GNAT Build Summary - http://github.com/jesselang/GNAT-Build-Summary"); Put_Line (File => Current_Error, Item => "Written by Jesse Lang - http://jesselang.com/"); Put_Line (File => Current_Error, Item => "Usage: gnat_build_summary [-q]"); Put_Line (File => Current_Error, Item => "Options:"); Put_Line (File => Current_Error, Item => Ada.Characters.Latin_1.HT & "-q Quiet mode. Only outputs important things."); end Usage; Options : Option_Info; Line : String (1 .. 16000); Last : Natural; Summary : Summary_Info; begin Parse_Options (Options => Options); if Options.Help then Usage; else Each_Line : loop Robust : begin exit Each_Line when Ada.Text_IO.End_Of_File (Ada.Text_IO.Current_Input); Ada.Text_IO.Get_Line (File => Ada.Text_IO.Current_Input, Item => Line, Last => Last); Summary := Parse_Summary (Line => Line (Line'First .. Last) ); case Summary.ID is when None => Ada.Text_IO.Put_Line (Item => Line (Line'First .. Last) ); when Operation => if not Options.Quiet then Ada.Text_IO.Put (Item => " [" & Summary_Command'Image (Summary.Command) & "] "); Ada.Text_IO.Set_Col (To => 20); Ada.Text_IO.Put_Line (Item => Ada.Directories.Simple_Name (Ada.Strings.Unbounded.To_String (Summary.File) ) ); end if; end case; exception -- Robust when E : others => Ada.Text_IO.Put_Line (File => Ada.Text_IO.Current_Error, Item => Ada.Exceptions.Exception_Information (E) & " on line >" & Line (Line'First .. Last) & '<'); end Robust; end loop Each_Line; end if; exception -- GNAT_Build_Summary when E : Invalid_Option => Ada.Text_IO.Put_Line (File => Ada.Text_IO.Current_Error, Item => "Invalid option: " & Ada.Exceptions.Exception_Message (E) ); Usage; Ada.Command_Line.Set_Exit_Status (Code => Ada.Command_Line.Failure); when E : Unknown_Option => Ada.Text_IO.Put_Line (File => Ada.Text_IO.Current_Error, Item => "Unknown option: " & Ada.Exceptions.Exception_Message (E) ); Usage; Ada.Command_Line.Set_Exit_Status (Code => Ada.Command_Line.Failure); when E : others => Ada.Text_IO.Put_Line (File => Ada.Text_IO.Current_Error, Item => "Fatal: " & Ada.Exceptions.Exception_Information (E) ); Ada.Command_Line.Set_Exit_Status (Code => Ada.Command_Line.Failure); end GNAT_Build_Summary; -- Copyright 2011 Solid Rock Data Solutions. All rights reserved. -- -- 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. -- -- THIS SOFTWARE IS PROVIDED BY Solid Rock Data Solutions ``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 Solid Rock Data Solutions 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 views and conclusions contained in the software and documentation are those of the -- authors and should not be interpreted as representing official policies, either expressed -- or implied, of Solid Rock Data Solutions.
reznikmm/slimp
Ada
2,421
adb
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Slim.Messages.grfe; package body Slim.Players.Displays is ----------- -- Clear -- ----------- procedure Clear (Self : in out Display) is begin Self.Buffer := (1 .. Self.Size => 0); end Clear; --------------- -- Draw_Text -- --------------- procedure Draw_Text (Self : in out Display; X, Y : Positive; Font : Slim.Fonts.Font; Text : League.Strings.Universal_String) is procedure Draw_Pixel (X, Y : Positive); procedure Draw_Pixel (X, Y : Positive) is begin Draw_Pixel (Self, X, Y); end Draw_Pixel; procedure Draw_Text is new Slim.Fonts.Draw_Text (Coordinate => Integer, Draw_Pixel => Draw_Pixel); Line : League.Strings.Universal_String := Text; begin while Fonts.Size (Font, Line).Right + X - 1 > 160 loop Line := Line.Head_To (Line.Length - 1); end loop; Draw_Text (Font, Line, X - 1, Y - 1); end Draw_Text; ---------------- -- Draw_Pixel -- ---------------- procedure Draw_Pixel (Self : in out Display; X, Y : Positive; Set : Boolean := True) is use type Ada.Streams.Stream_Element; Index : constant Ada.Streams.Stream_Element_Offset := Ada.Streams.Stream_Element_Offset ((X - 1) * 4 + (32 - Y) / 8 + 1); Mask : constant Ada.Streams.Stream_Element := 2 ** ((Y - 1) mod 8); begin if Set then Self.Buffer (Index) := Self.Buffer (Index) or Mask; else Self.Buffer (Index) := Self.Buffer (Index) and not Mask; end if; end Draw_Pixel; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out Display; Player : Players.Player) is begin Self.Socket := Player.Socket; end Initialize; ------------------ -- Send_Message -- ------------------ procedure Send_Message (Self : Display; Transition : Transition_Kind := None; Offset : Natural := 0) is Grfe : Slim.Messages.grfe.Grfe_Message; begin Grfe.Initialize (Self.Buffer, Transition, Offset); Write_Message (Self.Socket, Grfe); end Send_Message; end Slim.Players.Displays;
charlie5/cBound
Ada
3,088
ads
-- This file is generated by SWIG. Please do *not* modify by hand. -- with Interfaces.C; with Interfaces.C.Strings; with Interfaces.C; package gmp_c is -- mp_limb_t -- subtype mp_limb_t is Interfaces.C.unsigned_long; type mp_limb_t_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.mp_limb_t; -- mp_limb_signed_t -- subtype mp_limb_signed_t is Interfaces.C.long; type mp_limb_signed_t_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.mp_limb_signed_t; -- mp_bitcnt_t -- subtype mp_bitcnt_t is Interfaces.C.unsigned_long; type mp_bitcnt_t_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.mp_bitcnt_t; -- mp_size_t -- subtype mp_size_t is Interfaces.C.long; type mp_size_t_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.mp_size_t; -- mp_exp_t -- subtype mp_exp_t is Interfaces.C.long; type mp_exp_t_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.mp_exp_t; -- gmp_randalg_t -- type gmp_randalg_t is (GMP_RAND_ALG_DEFAULT); for gmp_randalg_t use (GMP_RAND_ALG_DEFAULT => 0); pragma Convention (C, gmp_randalg_t); type gmp_randalg_t_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.gmp_randalg_t; -- anonymous_enum_1 -- type anonymous_enum_1 is (GMP_ERROR_NONE, GMP_ERROR_UNSUPPORTED_ARGUMENT, GMP_ERROR_DIVISION_BY_ZERO, GMP_ERROR_SQRT_OF_NEGATIVE, GMP_ERROR_INVALID_ARGUMENT); for anonymous_enum_1 use (GMP_ERROR_NONE => 0, GMP_ERROR_UNSUPPORTED_ARGUMENT => 1, GMP_ERROR_DIVISION_BY_ZERO => 2, GMP_ERROR_SQRT_OF_NEGATIVE => 4, GMP_ERROR_INVALID_ARGUMENT => 8); pragma Convention (C, anonymous_enum_1); type anonymous_enum_1_array is array (Interfaces.C.size_t range <>) of aliased gmp_c.anonymous_enum_1; GMP_RAND_ALG_LC : aliased constant gmp_c.gmp_randalg_t := GMP_RAND_ALG_DEFAULT; a_a_GMP_HAVE_HOST_CPU_FAMILY_power : constant := 0; a_a_GMP_HAVE_HOST_CPU_FAMILY_powerpc : constant := 0; GMP_LIMB_BITS : constant := 64; GMP_NAIL_BITS : constant := 0; a_a_GNU_MP_a_a : constant := 5; a_a_GMP_LIBGMP_DLL : constant := 0; a_a_GMP_MP_SIZE_T_INT : constant := 0; a_a_GMP_INLINE_PROTOTYPES : constant := 0; bits_per_limb : aliased Interfaces.C.int; errno : aliased Interfaces.C.int; version : aliased Interfaces.C.Strings.chars_ptr; a_a_GNU_MP_VERSION : constant := 6; a_a_GNU_MP_VERSION_MINOR : constant := 1; a_a_GNU_MP_VERSION_PATCHLEVEL : constant := 0; a_a_GNU_MP_RELEASE : constant := 60100; private pragma Import (Cpp, bits_per_limb, "_ZN5gmp_c13bits_per_limbE"); pragma Import (Cpp, errno, "_ZN5gmp_c5errnoE"); pragma Import (Cpp, version, "_ZN5gmp_c7versionE"); end gmp_c;
AdaCore/libadalang
Ada
103
ads
package Foo is procedure Bar; private procedure Baz; --% node.p_fully_qualified_name end Foo;
zhmu/ananas
Ada
6,012
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ I O . D E C I M A L _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2022, 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Text_IO.Decimal_Aux; with System.Img_Decimal_32; use System.Img_Decimal_32; with System.Img_Decimal_64; use System.Img_Decimal_64; with System.Val_Decimal_32; use System.Val_Decimal_32; with System.Val_Decimal_64; use System.Val_Decimal_64; with System.WCh_Con; use System.WCh_Con; with System.WCh_WtS; use System.WCh_WtS; package body Ada.Wide_Text_IO.Decimal_IO is subtype Int32 is Interfaces.Integer_32; subtype Int64 is Interfaces.Integer_64; package Aux32 is new Ada.Wide_Text_IO.Decimal_Aux (Int32, Scan_Decimal32, Set_Image_Decimal32); package Aux64 is new Ada.Wide_Text_IO.Decimal_Aux (Int64, Scan_Decimal64, Set_Image_Decimal64); Need64 : constant Boolean := Num'Size > 32; -- Throughout this generic body, we distinguish between the case where type -- Int32 is acceptable and where type Int64 is needed. This Boolean is used -- to test for these cases and since it is a constant, only code for the -- relevant case will be included in the instance. Scale : constant Integer := Num'Scale; --------- -- Get -- --------- procedure Get (File : File_Type; Item : out Num; Width : Field := 0) is pragma Unsuppress (Range_Check); begin if Need64 then Item := Num'Fixed_Value (Aux64.Get (File, Width, Scale)); else Item := Num'Fixed_Value (Aux32.Get (File, Width, Scale)); end if; exception when Constraint_Error => raise Data_Error; end Get; procedure Get (Item : out Num; Width : Field := 0) is begin Get (Current_In, Item, Width); end Get; procedure Get (From : Wide_String; Item : out Num; Last : out Positive) is pragma Unsuppress (Range_Check); S : constant String := Wide_String_To_String (From, WCEM_Upper); -- String on which we do the actual conversion. Note that the method -- used for wide character encoding is irrelevant, since if there is -- a character outside the Standard.Character range then the call to -- Aux.Gets will raise Data_Error in any case. begin if Need64 then Item := Num'Fixed_Value (Aux64.Gets (S, Last, Scale)); else Item := Num'Fixed_Value (Aux32.Gets (S, Last, Scale)); end if; exception when Constraint_Error => raise Data_Error; end Get; --------- -- Put -- --------- procedure Put (File : File_Type; Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin if Need64 then Aux64.Put (File, Int64'Integer_Value (Item), Fore, Aft, Exp, Scale); else Aux32.Put (File, Int32'Integer_Value (Item), Fore, Aft, Exp, Scale); end if; end Put; procedure Put (Item : Num; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is begin Put (Current_Out, Item, Fore, Aft, Exp); end Put; procedure Put (To : out Wide_String; Item : Num; Aft : Field := Default_Aft; Exp : Field := Default_Exp) is S : String (To'First .. To'Last); begin if Need64 then Aux64.Puts (S, Int64'Integer_Value (Item), Aft, Exp, Scale); else Aux32.Puts (S, Int32'Integer_Value (Item), Aft, Exp, Scale); end if; for J in S'Range loop To (J) := Wide_Character'Val (Character'Pos (S (J))); end loop; end Put; end Ada.Wide_Text_IO.Decimal_IO;
aherd2985/Amass
Ada
760
ads
-- Copyright 2017 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local url = require("url") name = "Yahoo" type = "scrape" function start() setratelimit(1) end function vertical(ctx, domain) for i=1,201,10 do local ok = scrape(ctx, {['url']=buildurl(domain, i)}) if not ok then break end checkratelimit() end end function buildurl(domain, pagenum) local query = "site:" .. domain .. " -domain:www." .. domain local params = { p=query, b=pagenum, pz="10", bct="0", xargs="0", } return "https://search.yahoo.com/search?" .. url.build_query_string(params) end
chenrongchao/coinapi-sdk
Ada
6,061
adb
-- OEML _ REST API -- This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> -- -- The version of the OpenAPI document: v1 -- Contact: [email protected] -- -- NOTE: This package is auto generated by OpenAPI-Generator 5.0.1. -- https://openapi-generator.tech -- Do not edit the class manually. with Swagger.Streams; package body .Clients is -- Get balances -- Get current currency balance from all or single exchange. procedure V_1Balances_Get (Client : in out Client_Type; Exchange_Id : in Swagger.Nullable_UString; Result : out .Models.Balance_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((Swagger.Clients.APPLICATION_JSON, Swagger.Clients.APPLICTION_JSON)); URI.Add_Param ("exchange_id", Exchange_Id); URI.Set_Path ("/v1/balances"); Client.Call (Swagger.Clients.GET, URI, Reply); .Models.Deserialize (Reply, "", Result); end V_1Balances_Get; -- Cancel all orders request -- This request cancels all open orders on single specified exchange. procedure V_1Orders_Cancel_All_Post (Client : in out Client_Type; Order_Cancel_All_Request_Type : in .Models.OrderCancelAllRequest_Type; Result : out .Models.Message_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((Swagger.Clients.APPLICATION_JSON, Swagger.Clients.APPLICTION_JSON)); Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); .Models.Serialize (Req.Stream, "", Order_Cancel_All_Request_Type); URI.Set_Path ("/v1/orders/cancel/all"); Client.Call (Swagger.Clients.POST, URI, Req, Reply); .Models.Deserialize (Reply, "", Result); end V_1Orders_Cancel_All_Post; -- Cancel order request -- Request cancel for an existing order. The order can be canceled using the `client_order_id` or `exchange_order_id`. procedure V_1Orders_Cancel_Post (Client : in out Client_Type; Order_Cancel_Single_Request_Type : in .Models.OrderCancelSingleRequest_Type; Result : out .Models.OrderExecutionReport_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((Swagger.Clients.APPLICATION_JSON, Swagger.Clients.APPLICTION_JSON)); Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); .Models.Serialize (Req.Stream, "", Order_Cancel_Single_Request_Type); URI.Set_Path ("/v1/orders/cancel"); Client.Call (Swagger.Clients.POST, URI, Req, Reply); .Models.Deserialize (Reply, "", Result); end V_1Orders_Cancel_Post; -- Get open orders -- Get last execution reports for open orders across all or single exchange. procedure V_1Orders_Get (Client : in out Client_Type; Exchange_Id : in Swagger.Nullable_UString; Result : out .Models.OrderExecutionReport_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((Swagger.Clients.APPLICATION_JSON, Swagger.Clients.APPLICTION_JSON)); URI.Add_Param ("exchange_id", Exchange_Id); URI.Set_Path ("/v1/orders"); Client.Call (Swagger.Clients.GET, URI, Reply); .Models.Deserialize (Reply, "", Result); end V_1Orders_Get; -- Send new order -- This request creating new order for the specific exchange. procedure V_1Orders_Post (Client : in out Client_Type; Order_New_Single_Request_Type : in .Models.OrderNewSingleRequest_Type; Result : out .Models.OrderExecutionReport_Type) is URI : Swagger.Clients.URI_Type; Req : Swagger.Clients.Request_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((Swagger.Clients.APPLICATION_JSON, Swagger.Clients.APPLICTION_JSON)); Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON)); .Models.Serialize (Req.Stream, "", Order_New_Single_Request_Type); URI.Set_Path ("/v1/orders"); Client.Call (Swagger.Clients.POST, URI, Req, Reply); .Models.Deserialize (Reply, "", Result); end V_1Orders_Post; -- Get order execution report -- Get the last order execution report for the specified order. The requested order does not need to be active or opened. procedure V_1Orders_Status_Client_Order_Id_Get (Client : in out Client_Type; Client_Order_Id : in Swagger.UString; Result : out .Models.OrderExecutionReport_Type) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((1 => Swagger.Clients.APPLICATION_JSON)); URI.Set_Path ("/v1/orders/status/{client_order_id}"); URI.Set_Path_Param ("client_order_id", Client_Order_Id); Client.Call (Swagger.Clients.GET, URI, Reply); .Models.Deserialize (Reply, "", Result); end V_1Orders_Status_Client_Order_Id_Get; -- Get open positions -- Get current open positions across all or single exchange. procedure V_1Positions_Get (Client : in out Client_Type; Exchange_Id : in Swagger.Nullable_UString; Result : out .Models.Position_Type_Vectors.Vector) is URI : Swagger.Clients.URI_Type; Reply : Swagger.Value_Type; begin Client.Set_Accept ((Swagger.Clients.APPLICATION_JSON, Swagger.Clients.APPLICTION_JSON)); URI.Add_Param ("exchange_id", Exchange_Id); URI.Set_Path ("/v1/positions"); Client.Call (Swagger.Clients.GET, URI, Reply); .Models.Deserialize (Reply, "", Result); end V_1Positions_Get; end .Clients;
charlie5/lace
Ada
210
adb
with ada.Tags; package body lace.Response is function Name (Self : in Item) return String is begin return ada.Tags.expanded_Name (Item'Class (Self)'Tag); end Name; end lace.Response;
stcarrez/helios
Ada
2,200
ads
----------------------------------------------------------------------- -- helios-monitor-ifnet -- Linux network interface monitor -- Copyright (C) 2017 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- 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 Helios.Monitor.Ifnet is type Stat_Type is (RX_BYTES, RX_PACKETS, RX_ERRS, RX_DROP, RX_FIFO, RX_FRAME, RX_COMPRESS, RX_MULTICAST, TX_BYTES, TX_PACKETS, TX_ERRS, TX_DROP, TX_FIFO, TX_COLLS, TX_CARRIER, TX_COMPRESSED); type Stat_Definition_Array is array (Stat_Type) of Schemas.Definition_Type_Access; type Interface_Definition_Type is new Schemas.Definition_Type with record Stats : Stat_Definition_Array; end record; type Interface_Definition_Type_Access is access all Interface_Definition_Type'Class; type Agent_Type is new Helios.Monitor.Agent_Type with null record; -- Start the agent and build the definition tree. overriding procedure Start (Agent : in out Agent_Type; Config : in Util.Properties.Manager); -- Collect the values in the snapshot. overriding procedure Collect (Agent : in out Agent_Type; Values : in out Datas.Snapshot_Type); -- Make a new interface definition for the given interface name. procedure Make_Interface (Agent : in out Agent_Type; Name : in String; Interfaces : in String; Filter : in String); end Helios.Monitor.Ifnet;
reznikmm/matreshka
Ada
4,051
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 ODF.DOM.Style_List_Style_Name_Attributes; package Matreshka.ODF_Style.List_Style_Name_Attributes is type Style_List_Style_Name_Attribute_Node is new Matreshka.ODF_Style.Abstract_Style_Attribute_Node and ODF.DOM.Style_List_Style_Name_Attributes.ODF_Style_List_Style_Name_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_List_Style_Name_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Style_List_Style_Name_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Style.List_Style_Name_Attributes;
AdaCore/gpr
Ada
159
adb
with Ada.Text_IO; use Ada.Text_IO; package body Pack2 is procedure Dummy is begin Put_Line (Item => "from Pack2.Dummy"); end Dummy; end Pack2;
zhmu/ananas
Ada
459
adb
-- { dg-do compile } -- { dg-options "-O3" } package body Loop_Optimization15 is type Integer_Array_T is array (B16_T range <>) of Integer; Len : constant B16_T := 10; Src : constant Integer_Array_T (1 .. Len) := (others => 0); Dst : Integer_Array_T (1 .. Len); procedure Proc (L : B16_T) is begin for I in 1 .. B16_T'Min (L, Len) loop Dst (I) := Src (I); end loop; end; end Loop_Optimization15;
zhmu/ananas
Ada
18,350
ads
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G E N _ I L . T Y P E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2020-2022, 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. -- -- -- ------------------------------------------------------------------------------ package Gen_IL.Types is -- Enumeration of all the types that are "of interest". We have an -- enumeration literal here for every node kind, every entity kind, -- and every type that can be the type of a field. -- The following is "optional type enumeration" -- i.e. it is Type_Enum -- (declared below) plus the special null value No_Type. See the spec of -- Gen_IL.Gen for how to modify this. (Of course, in Ada we have to define -- this backwards from the above conceptual description.) -- Note that there are various subranges of this type declared below, -- which might need to be kept in sync when modifying this. -- The "Between_..." literals below are simply for making the subranges. -- When adding literals to this enumeration type, be sure to put them in -- the right place so they end up in the appropriate subranges -- (Abstract_Node, Abstract_Entity, Concrete_Node, Concrete_Entity). type Opt_Type_Enum is (No_Type, Flag, -- We use Flag for Boolean, so we don't conflict with -- Standard.Boolean. Node_Id, List_Id, Elist_Id, Name_Id, String_Id, Uint, Valid_Uint, Unat, Upos, Nonzero_Uint, Ureal, Node_Kind_Type, -- Type of result of Nkind function, i.e. Node_Kind Entity_Kind_Type, -- Type of result of Ekind function, i.e. Entity_Kind Source_Ptr, Small_Paren_Count_Type, Union_Id, Convention_Id, Component_Alignment_Kind, Mechanism_Type, Between_Special_And_Abstract_Node_Types, -- Abstract node types: Node_Kind, -- root of node type hierarchy N_Access_To_Subprogram_Definition, N_Alternative, N_Array_Type_Definition, N_Binary_Op, N_Body_Stub, N_Declaration, N_Delay_Statement, N_Direct_Name, N_Entity, N_Entity_Name, N_Formal_Subprogram_Declaration, N_Generic_Declaration, N_Generic_Instantiation, N_Generic_Renaming_Declaration, N_Has_Bounds, N_Has_Chars, N_Has_Condition, N_Has_Entity, N_Has_Etype, N_Is_Case_Choice, N_Is_Decl, N_Is_Exception_Choice, N_Is_Index, N_Is_Range, N_Multiplying_Operator, N_Later_Decl_Item, N_Membership_Test, N_Numeric_Or_String_Literal, N_Op, N_Op_Boolean, N_Op_Compare, N_Op_Shift, N_Proper_Body, N_Push_xxx_Label, N_Pop_xxx_Label, N_Push_Pop_xxx_Label, N_Raise_xxx_Error, N_Renaming_Declaration, N_Representation_Clause, N_Short_Circuit, N_SCIL_Node, N_Statement_Other_Than_Procedure_Call, N_Subprogram_Call, N_Subprogram_Instantiation, N_Subexpr, N_Subprogram_Specification, N_Unary_Op, N_Unit_Body, -- End of abstract node types. Between_Abstract_Node_And_Abstract_Entity_Types, -- Abstract entity types: Entity_Kind, -- root of entity type hierarchy Access_Kind, Access_Subprogram_Kind, Access_Protected_Kind, Aggregate_Kind, Allocatable_Kind, Anonymous_Access_Kind, Array_Kind, Assignable_Kind, Class_Wide_Kind, Composite_Kind, Concurrent_Kind, Concurrent_Body_Kind, Constant_Or_Variable_Kind, Decimal_Fixed_Point_Kind, Digits_Kind, Discrete_Kind, Discrete_Or_Fixed_Point_Kind, Elementary_Kind, Enumeration_Kind, Entry_Kind, Evaluable_Kind, Exception_Or_Object_Kind, Fixed_Point_Kind, Float_Kind, Formal_Kind, Formal_Object_Kind, Generic_Subprogram_Kind, Generic_Unit_Kind, Global_Name_Kind, Incomplete_Kind, Incomplete_Or_Private_Kind, Integer_Kind, Modular_Integer_Kind, Named_Access_Kind, Named_Kind, Numeric_Kind, Object_Kind, Ordinary_Fixed_Point_Kind, Overloadable_Kind, Private_Kind, Protected_Kind, Real_Kind, Record_Kind, Record_Field_Kind, Scalar_Kind, Signed_Integer_Kind, Subprogram_Type_Or_Kind, Subprogram_Kind, Task_Kind, Type_Kind, Void_Or_Type_Kind, -- End of abstract entity types. Between_Abstract_Entity_And_Concrete_Node_Types, -- Concrete node types: N_Unused_At_Start, N_At_Clause, N_Component_Clause, N_Enumeration_Representation_Clause, N_Mod_Clause, N_Record_Representation_Clause, N_Attribute_Definition_Clause, N_Empty, N_Pragma_Argument_Association, N_Error, N_Defining_Character_Literal, N_Defining_Identifier, N_Defining_Operator_Symbol, N_Expanded_Name, N_Identifier, N_Operator_Symbol, N_Character_Literal, N_Op_Add, N_Op_Concat, N_Op_Expon, N_Op_Subtract, N_Op_Divide, N_Op_Mod, N_Op_Multiply, N_Op_Rem, N_Op_And, N_Op_Eq, N_Op_Ge, N_Op_Gt, N_Op_Le, N_Op_Lt, N_Op_Ne, N_Op_Or, N_Op_Xor, N_Op_Rotate_Left, N_Op_Rotate_Right, N_Op_Shift_Left, N_Op_Shift_Right, N_Op_Shift_Right_Arithmetic, N_Op_Abs, N_Op_Minus, N_Op_Not, N_Op_Plus, N_Attribute_Reference, N_In, N_Not_In, N_And_Then, N_Or_Else, N_Function_Call, N_Procedure_Call_Statement, N_Raise_Constraint_Error, N_Raise_Program_Error, N_Raise_Storage_Error, N_Integer_Literal, N_Real_Literal, N_String_Literal, N_Explicit_Dereference, N_Expression_With_Actions, N_If_Expression, N_Indexed_Component, N_Null, N_Qualified_Expression, N_Quantified_Expression, N_Aggregate, N_Allocator, N_Case_Expression, N_Delta_Aggregate, N_Extension_Aggregate, N_Raise_Expression, N_Range, N_Reference, N_Selected_Component, N_Slice, N_Target_Name, N_Type_Conversion, N_Unchecked_Expression, N_Unchecked_Type_Conversion, N_Subtype_Indication, N_Component_Declaration, N_Entry_Declaration, N_Expression_Function, N_Formal_Object_Declaration, N_Formal_Type_Declaration, N_Full_Type_Declaration, N_Incomplete_Type_Declaration, N_Iterator_Specification, N_Loop_Parameter_Specification, N_Object_Declaration, N_Protected_Type_Declaration, N_Private_Extension_Declaration, N_Private_Type_Declaration, N_Subtype_Declaration, N_Function_Specification, N_Procedure_Specification, N_Access_Function_Definition, N_Access_Procedure_Definition, N_Task_Type_Declaration, N_Package_Body_Stub, N_Protected_Body_Stub, N_Subprogram_Body_Stub, N_Task_Body_Stub, N_Function_Instantiation, N_Procedure_Instantiation, N_Package_Instantiation, N_Package_Body, N_Subprogram_Body, N_Protected_Body, N_Task_Body, N_Implicit_Label_Declaration, N_Package_Declaration, N_Single_Task_Declaration, N_Subprogram_Declaration, N_Use_Package_Clause, N_Generic_Package_Declaration, N_Generic_Subprogram_Declaration, N_Constrained_Array_Definition, N_Unconstrained_Array_Definition, N_Exception_Renaming_Declaration, N_Object_Renaming_Declaration, N_Package_Renaming_Declaration, N_Subprogram_Renaming_Declaration, N_Generic_Function_Renaming_Declaration, N_Generic_Package_Renaming_Declaration, N_Generic_Procedure_Renaming_Declaration, N_Abort_Statement, N_Accept_Statement, N_Assignment_Statement, N_Asynchronous_Select, N_Block_Statement, N_Case_Statement, N_Code_Statement, N_Compound_Statement, N_Conditional_Entry_Call, N_Delay_Relative_Statement, N_Delay_Until_Statement, N_Entry_Call_Statement, N_Free_Statement, N_Goto_Statement, N_Goto_When_Statement, N_Loop_Statement, N_Null_Statement, N_Raise_Statement, N_Raise_When_Statement, N_Requeue_Statement, N_Simple_Return_Statement, N_Extended_Return_Statement, N_Return_When_Statement, N_Selective_Accept, N_Timed_Entry_Call, N_Exit_Statement, N_If_Statement, N_Accept_Alternative, N_Delay_Alternative, N_Elsif_Part, N_Entry_Body_Formal_Part, N_Iteration_Scheme, N_Terminate_Alternative, N_Formal_Abstract_Subprogram_Declaration, N_Formal_Concrete_Subprogram_Declaration, N_Push_Constraint_Error_Label, N_Push_Program_Error_Label, N_Push_Storage_Error_Label, N_Pop_Constraint_Error_Label, N_Pop_Program_Error_Label, N_Pop_Storage_Error_Label, N_SCIL_Dispatch_Table_Tag_Init, N_SCIL_Dispatching_Call, N_SCIL_Membership_Test, N_Abortable_Part, N_Abstract_Subprogram_Declaration, N_Access_Definition, N_Access_To_Object_Definition, N_Aspect_Specification, N_Call_Marker, N_Case_Expression_Alternative, N_Case_Statement_Alternative, N_Compilation_Unit, N_Compilation_Unit_Aux, N_Component_Association, N_Component_Definition, N_Component_List, N_Contract, N_Derived_Type_Definition, N_Decimal_Fixed_Point_Definition, N_Defining_Program_Unit_Name, N_Delta_Constraint, N_Designator, N_Digits_Constraint, N_Discriminant_Association, N_Discriminant_Specification, N_Enumeration_Type_Definition, N_Entry_Body, N_Entry_Call_Alternative, N_Entry_Index_Specification, N_Exception_Declaration, N_Exception_Handler, N_Floating_Point_Definition, N_Formal_Decimal_Fixed_Point_Definition, N_Formal_Derived_Type_Definition, N_Formal_Discrete_Type_Definition, N_Formal_Floating_Point_Definition, N_Formal_Modular_Type_Definition, N_Formal_Ordinary_Fixed_Point_Definition, N_Formal_Package_Declaration, N_Formal_Private_Type_Definition, N_Formal_Incomplete_Type_Definition, N_Formal_Signed_Integer_Type_Definition, N_Freeze_Entity, N_Freeze_Generic_Entity, N_Generic_Association, N_Handled_Sequence_Of_Statements, N_Index_Or_Discriminant_Constraint, N_Iterated_Component_Association, N_Iterated_Element_Association, N_Itype_Reference, N_Label, N_Modular_Type_Definition, N_Number_Declaration, N_Ordinary_Fixed_Point_Definition, N_Others_Choice, N_Package_Specification, N_Parameter_Association, N_Parameter_Specification, N_Pragma, N_Protected_Definition, N_Range_Constraint, N_Real_Range_Specification, N_Record_Definition, N_Signed_Integer_Type_Definition, N_Single_Protected_Declaration, N_Subunit, N_Task_Definition, N_Triggering_Alternative, N_Use_Type_Clause, N_Validate_Unchecked_Conversion, N_Variable_Reference_Marker, N_Variant, N_Variant_Part, N_With_Clause, N_Unused_At_End, -- End of concrete node types. Between_Concrete_Node_And_Concrete_Entity_Types, -- Concrete entity types: E_Void, E_Component, E_Constant, E_Discriminant, E_Loop_Parameter, E_Variable, E_Out_Parameter, E_In_Out_Parameter, E_In_Parameter, E_Generic_In_Out_Parameter, E_Generic_In_Parameter, E_Named_Integer, E_Named_Real, E_Enumeration_Type, E_Enumeration_Subtype, E_Signed_Integer_Type, E_Signed_Integer_Subtype, E_Modular_Integer_Type, E_Modular_Integer_Subtype, E_Ordinary_Fixed_Point_Type, E_Ordinary_Fixed_Point_Subtype, E_Decimal_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype, E_Floating_Point_Type, E_Floating_Point_Subtype, E_Access_Type, E_Access_Subtype, E_Access_Attribute_Type, E_Allocator_Type, E_General_Access_Type, E_Access_Subprogram_Type, E_Access_Protected_Subprogram_Type, E_Anonymous_Access_Protected_Subprogram_Type, E_Anonymous_Access_Subprogram_Type, E_Anonymous_Access_Type, E_Array_Type, E_Array_Subtype, E_String_Literal_Subtype, E_Class_Wide_Type, E_Class_Wide_Subtype, E_Record_Type, E_Record_Subtype, E_Record_Type_With_Private, E_Record_Subtype_With_Private, E_Private_Type, E_Private_Subtype, E_Limited_Private_Type, E_Limited_Private_Subtype, E_Incomplete_Type, E_Incomplete_Subtype, E_Task_Type, E_Task_Subtype, E_Protected_Type, E_Protected_Subtype, E_Exception_Type, E_Subprogram_Type, E_Enumeration_Literal, E_Function, E_Operator, E_Procedure, E_Abstract_State, E_Entry, E_Entry_Family, E_Block, E_Entry_Index_Parameter, E_Exception, E_Generic_Function, E_Generic_Procedure, E_Generic_Package, E_Label, E_Loop, E_Return_Statement, E_Package, E_Package_Body, E_Protected_Body, E_Task_Body, E_Subprogram_Body -- End of concrete entity types. ); -- Type_Enum subtype Type_Enum is Opt_Type_Enum range Opt_Type_Enum'Succ (No_Type) .. Opt_Type_Enum'Last; -- Enumeration of types -- Opt_Type_Enum without the special null value -- No_Type. subtype Node_Or_Entity_Type is Type_Enum range Type_Enum'Succ (Between_Special_And_Abstract_Node_Types) .. Type_Enum'Last; subtype Abstract_Type is Type_Enum range Type_Enum'Succ (Between_Special_And_Abstract_Node_Types) .. Type_Enum'Pred (Between_Abstract_Entity_And_Concrete_Node_Types); subtype Abstract_Node is Abstract_Type range Type_Enum'Succ (Between_Special_And_Abstract_Node_Types) .. Type_Enum'Pred (Between_Abstract_Node_And_Abstract_Entity_Types); subtype Abstract_Entity is Abstract_Type range Type_Enum'Succ (Between_Abstract_Node_And_Abstract_Entity_Types) .. Type_Enum'Pred (Between_Abstract_Entity_And_Concrete_Node_Types); subtype Concrete_Type is Type_Enum range Type_Enum'Succ (Between_Abstract_Entity_And_Concrete_Node_Types) .. Type_Enum'Last; subtype Concrete_Node is Concrete_Type range Type_Enum'Succ (Between_Abstract_Entity_And_Concrete_Node_Types) .. Type_Enum'Pred (Between_Concrete_Node_And_Concrete_Entity_Types); subtype Concrete_Entity is Concrete_Type range Type_Enum'Succ (Between_Concrete_Node_And_Concrete_Entity_Types) .. Type_Enum'Last; subtype Root_Type is Abstract_Type with Predicate => Root_Type in Node_Kind | Entity_Kind; subtype Node_Type is Node_Or_Entity_Type with Predicate => Node_Type in Abstract_Node | Concrete_Node; subtype Entity_Type is Node_Or_Entity_Type with Predicate => Entity_Type in Abstract_Entity | Concrete_Entity; subtype Special_Type is Type_Enum range Flag .. Type_Enum'Pred (Between_Special_And_Abstract_Node_Types); subtype Traversed_Field_Type is Type_Enum with Predicate => Traversed_Field_Type in Node_Id | List_Id | Node_Type; -- These are the types of fields traversed by Traverse_Func subtype Entity_Node is Node_Type with Predicate => Entity_Node in N_Defining_Character_Literal | N_Defining_Identifier | N_Defining_Operator_Symbol; subtype Opt_Abstract_Type is Opt_Type_Enum with Predicate => Opt_Abstract_Type in No_Type | Abstract_Type; subtype Type_Boundaries is Type_Enum with Predicate => Type_Boundaries in Between_Abstract_Node_And_Abstract_Entity_Types | Between_Abstract_Entity_And_Concrete_Node_Types | Between_Concrete_Node_And_Concrete_Entity_Types; -- These are not used, other than to separate the various subranges. subtype Uint_Subtype is Type_Enum with Predicate => Uint_Subtype in Valid_Uint | Unat | Upos | Nonzero_Uint; -- These are the subtypes of Uint that have predicates restricting their -- values. end Gen_IL.Types;
sungyeon/drake
Ada
12,196
adb
with Ada.Exceptions.Finally; with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; with System; package body Ada.Containers.Limited_Hashed_Maps is use type Hash_Tables.Table_Access; -- diff function Upcast is new Unchecked_Conversion (Cursor, Hash_Tables.Node_Access); function Downcast is new Unchecked_Conversion (Hash_Tables.Node_Access, Cursor); -- diff (Upcast) -- -- diff (Downcast) -- procedure Free is new Unchecked_Deallocation (Key_Type, Key_Access); procedure Free is new Unchecked_Deallocation (Element_Type, Element_Access); procedure Free is new Unchecked_Deallocation (Node, Cursor); type Context_Type is limited record Left : not null access Key_Type; end record; pragma Suppress_Initialization (Context_Type); function Equivalent_Key ( Position : not null Hash_Tables.Node_Access; Params : System.Address) return Boolean; function Equivalent_Key ( Position : not null Hash_Tables.Node_Access; Params : System.Address) return Boolean is Context : Context_Type; for Context'Address use Params; begin return Equivalent_Keys ( Context.Left.all, Downcast (Position).Key.all); end Equivalent_Key; -- diff (Allocate_Element) -- -- -- -- -- -- -- -- -- diff (Allocate_Node) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff (Copy_Node) -- -- -- -- -- -- -- -- -- -- -- -- procedure Free_Node (Object : in out Hash_Tables.Node_Access); procedure Free_Node (Object : in out Hash_Tables.Node_Access) is X : Cursor := Downcast (Object); begin Free (X.Key); Free (X.Element); Free (X); Object := null; end Free_Node; -- diff (Allocate_Data) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff (Copy_Data) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff (Free) procedure Free_Data (Data : in out Map); procedure Free_Data (Data : in out Map) is -- diff begin Hash_Tables.Free (Data.Table, Data.Length, Free => Free_Node'Access); -- diff -- diff end Free_Data; procedure Reallocate (Container : in out Map; Capacity : Count_Type); -- diff -- diff -- diff procedure Reallocate (Container : in out Map; Capacity : Count_Type) is -- diff -- diff -- diff begin Hash_Tables.Rebuild (Container.Table, Capacity); -- diff -- diff -- diff -- diff -- diff -- diff -- diff -- diff -- diff -- diff -- diff end Reallocate; -- diff (Unique) -- -- -- -- -- -- -- -- -- function Find (Container : Map; Hash : Hash_Type; Key : Key_Type) return Cursor; function Find (Container : Map; Hash : Hash_Type; Key : Key_Type) return Cursor is begin if Is_Empty (Container) then return null; else -- diff declare Context : aliased Context_Type := (Left => Key'Unrestricted_Access); begin return Downcast (Hash_Tables.Find ( Container.Table, Hash, Context'Address, Equivalent => Equivalent_Key'Access)); end; end if; end Find; -- implementation function Empty_Map return Map is begin return (Finalization.Limited_Controlled with Table => null, Length => 0); end Empty_Map; function Has_Element (Position : Cursor) return Boolean is begin return Position /= null; end Has_Element; -- diff ("=") -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- function Capacity (Container : Map) return Count_Type is -- diff begin -- diff -- diff -- diff return Hash_Tables.Capacity (Container.Table); -- diff end Capacity; procedure Reserve_Capacity ( Container : in out Map; Capacity : Count_Type) is New_Capacity : constant Count_Type := Count_Type'Max (Capacity, Length (Container)); begin Reallocate (Container, New_Capacity); end Reserve_Capacity; function Length (Container : Map) return Count_Type is -- diff begin -- diff -- diff -- diff return Container.Length; -- diff end Length; function Is_Empty (Container : Map) return Boolean is -- diff begin return Container.Length = 0; end Is_Empty; procedure Clear (Container : in out Map) is begin Free_Data (Container); end Clear; function Key (Position : Cursor) return Key_Reference_Type is begin return (Element => Position.Key.all'Access); end Key; -- diff (Element) -- -- -- -- diff (Replace_Element) -- -- -- -- -- -- -- -- procedure Query_Element ( Position : Cursor; Process : not null access procedure ( Key : Key_Type; Element : Element_Type)) is begin Process (Position.Key.all, Position.Element.all); end Query_Element; procedure Update_Element ( Container : in out Map'Class; Position : Cursor; Process : not null access procedure ( Key : Key_Type; Element : in out Element_Type)) is begin Process ( Position.Key.all, Reference (Map (Container), Position).Element.all); end Update_Element; function Constant_Reference (Container : aliased Map; Position : Cursor) return Constant_Reference_Type is pragma Unreferenced (Container); begin return (Element => Position.Element.all'Access); end Constant_Reference; function Reference (Container : aliased in out Map; Position : Cursor) return Reference_Type is pragma Unreferenced (Container); begin return (Element => Position.Element.all'Access); end Reference; function Constant_Reference (Container : aliased Map; Key : Key_Type) return Constant_Reference_Type is begin return Constant_Reference (Container, Find (Container, Key)); end Constant_Reference; function Reference (Container : aliased in out Map; Key : Key_Type) return Reference_Type is begin return Reference (Container, Find (Container, Key)); end Reference; -- diff (Assign) -- -- -- -- -- -- -- diff (Copy) -- -- -- -- -- -- -- -- -- -- -- procedure Move (Target : in out Map; Source : in out Map) is begin Clear (Target); Target.Table := Source.Table; Target.Length := Source.Length; Source.Table := null; Source.Length := 0; end Move; procedure Insert ( Container : in out Map'Class; New_Key : not null access function return Key_Type; New_Item : not null access function return Element_Type; Position : out Cursor; Inserted : out Boolean) is type Pair is record Key : Key_Access; Node : Cursor; end record; pragma Suppress_Initialization (Pair); procedure Finally (X : in out Pair); procedure Finally (X : in out Pair) is begin Free (X.Key); Free (X.Node); end Finally; package Holder is new Exceptions.Finally.Scoped_Holder (Pair, Finally); New_Pair : aliased Pair := (new Key_Type'(New_Key.all), null); New_Hash : Hash_Type; begin Holder.Assign (New_Pair); New_Hash := Hash (New_Pair.Key.all); Position := Find (Map (Container), New_Hash, New_Pair.Key.all); Inserted := Position = null; if Inserted then New_Pair.Node := new Node; New_Pair.Node.Key := New_Pair.Key; New_Pair.Node.Element := new Element_Type'(New_Item.all); Holder.Clear; Position := New_Pair.Node; Hash_Tables.Insert ( Container.Table, Container.Length, New_Hash, Upcast (Position)); -- diff end if; end Insert; -- diff (Insert) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Insert ( Container : in out Map'Class; Key : not null access function return Key_Type; New_Item : not null access function return Element_Type) is Position : Cursor; Inserted : Boolean; begin Insert (Container, Key, New_Item, Position, Inserted); if not Inserted then raise Constraint_Error; end if; end Insert; -- diff (Include) -- -- -- -- -- -- -- -- -- -- -- -- -- diff (Replace) -- -- -- -- -- -- procedure Exclude (Container : in out Map; Key : Key_Type) is Position : Cursor := Find (Container, Key); begin if Position /= null then Delete (Container, Position); end if; end Exclude; procedure Delete (Container : in out Map; Key : Key_Type) is Position : Cursor := Find (Container, Key); begin Delete (Container, Position); end Delete; procedure Delete (Container : in out Map; Position : in out Cursor) is Position_2 : Hash_Tables.Node_Access := Upcast (Position); begin -- diff -- diff -- diff -- diff Hash_Tables.Remove (Container.Table, Container.Length, Position_2); -- diff Free_Node (Position_2); Position := null; end Delete; function First (Container : Map) return Cursor is begin return Downcast (Hash_Tables.First (Container.Table)); -- diff -- diff -- diff -- diff -- diff -- diff end First; function Next (Position : Cursor) return Cursor is begin return Downcast (Position.Super.Next); end Next; procedure Next (Position : in out Cursor) is begin Position := Downcast (Position.Super.Next); end Next; function Find (Container : Map; Key : Key_Type) return Cursor is begin return Find (Container, Hash (Key), Key); end Find; -- diff (Element) -- -- -- -- -- -- function Contains (Container : Map; Key : Key_Type) return Boolean is begin return Find (Container, Key) /= null; end Contains; function Equivalent_Keys (Left, Right : Cursor) return Boolean is begin return Equivalent_Keys (Left.Key.all, Right.Key.all); end Equivalent_Keys; function Equivalent_Keys (Left : Cursor; Right : Key_Type) return Boolean is begin return Equivalent_Keys (Left.Key.all, Right); end Equivalent_Keys; function Equivalent_Keys (Left : Key_Type; Right : Cursor) return Boolean is begin return Equivalent_Keys (Left, Right.Key.all); end Equivalent_Keys; procedure Iterate ( Container : Map'Class; Process : not null access procedure (Position : Cursor)) is type P1 is access procedure (Position : Cursor); type P2 is access procedure (Position : Hash_Tables.Node_Access); function Cast is new Unchecked_Conversion (P1, P2); begin -- diff -- diff Hash_Tables.Iterate ( Container.Table, Cast (Process)); -- diff end Iterate; function Iterate (Container : Map'Class) return Map_Iterator_Interfaces.Forward_Iterator'Class is begin return Map_Iterator'(First => First (Map (Container))); end Iterate; -- diff (Adjust) -- -- -- overriding function First (Object : Map_Iterator) return Cursor is begin return Object.First; end First; overriding function Next (Object : Map_Iterator; Position : Cursor) return Cursor is pragma Unreferenced (Object); begin return Next (Position); end Next; package body Equivalent is function "=" (Left, Right : Map) return Boolean is function Equivalent (Left, Right : not null Hash_Tables.Node_Access) return Boolean; function Equivalent (Left, Right : not null Hash_Tables.Node_Access) return Boolean is begin return Equivalent_Keys ( Downcast (Left).Key.all, Downcast (Right).Key.all) and then Downcast (Left).Element.all = Downcast (Right).Element.all; end Equivalent; begin return Hash_Tables.Equivalent ( Left.Table, Left.Length, Right.Table, Right.Length, Equivalent => Equivalent'Access); end "="; end Equivalent; end Ada.Containers.Limited_Hashed_Maps;
kjseefried/The-Dice-Roller
Ada
950
adb
------------------------------------------------------------------------------- -- Dice.CLI (body) -- -- The methods necessary for checking parameters passed to DiceRoller when -- the program was started. -- -- Author: Thomas LÝcke -- Copyleft 2010. You may freely do with this source as you wish. ------------------------------------------------------------------------------- with Ada.Command_Line; use Ada.Command_Line; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Directories; use Ada.Directories; package body Dice.CLI is procedure Check_Passed_Parameters is begin for i in 1 .. Argument_Count loop if To_Lower (Argument (i)) = "-h" then raise Help_Needed; end if; if not Exists (Name => Argument (Number => i)) then raise File_Error with Argument (Number => i); end if; end loop; end Check_Passed_Parameters; end Dice.CLI;
reznikmm/matreshka
Ada
4,899
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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.Use_Cases.Collections is pragma Preelaborate; package UML_Use_Case_Collections is new AMF.Generic_Collections (UML_Use_Case, UML_Use_Case_Access); type Set_Of_UML_Use_Case is new UML_Use_Case_Collections.Set with null record; Empty_Set_Of_UML_Use_Case : constant Set_Of_UML_Use_Case; type Ordered_Set_Of_UML_Use_Case is new UML_Use_Case_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Use_Case : constant Ordered_Set_Of_UML_Use_Case; type Bag_Of_UML_Use_Case is new UML_Use_Case_Collections.Bag with null record; Empty_Bag_Of_UML_Use_Case : constant Bag_Of_UML_Use_Case; type Sequence_Of_UML_Use_Case is new UML_Use_Case_Collections.Sequence with null record; Empty_Sequence_Of_UML_Use_Case : constant Sequence_Of_UML_Use_Case; private Empty_Set_Of_UML_Use_Case : constant Set_Of_UML_Use_Case := (UML_Use_Case_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Use_Case : constant Ordered_Set_Of_UML_Use_Case := (UML_Use_Case_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Use_Case : constant Bag_Of_UML_Use_Case := (UML_Use_Case_Collections.Bag with null record); Empty_Sequence_Of_UML_Use_Case : constant Sequence_Of_UML_Use_Case := (UML_Use_Case_Collections.Sequence with null record); end AMF.UML.Use_Cases.Collections;
reznikmm/matreshka
Ada
4,923
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- 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 Ada.Containers.Hashed_Maps; with Ada.Strings.Hash; with Ada.Tags.Generic_Dispatching_Constructor; package body Web_Services.SOAP.Payloads.Encoders.Registry is function Hash (Item : Ada.Tags.Tag) return Ada.Containers.Hash_Type; function Create is new Ada.Tags.Generic_Dispatching_Constructor (Web_Services.SOAP.Payloads.Encoders.SOAP_Payload_Encoder, Boolean, Web_Services.SOAP.Payloads.Encoders.Create); package Tag_Tag_Maps is new Ada.Containers.Hashed_Maps (Ada.Tags.Tag, Ada.Tags.Tag, Hash, Ada.Tags."=", Ada.Tags."="); Registry : Tag_Tag_Maps.Map; ---------- -- Hash -- ---------- function Hash (Item : Ada.Tags.Tag) return Ada.Containers.Hash_Type is begin return Ada.Strings.Hash (Ada.Tags.External_Tag (Item)); end Hash; -------------- -- Register -- -------------- procedure Register (Message_Tag : Ada.Tags.Tag; Encoder_Tag : Ada.Tags.Tag) is begin Registry.Insert (Message_Tag, Encoder_Tag); end Register; ------------- -- Resolve -- ------------- function Resolve (Message_Tag : Ada.Tags.Tag) return not null Web_Services.SOAP.Payloads.Encoders.SOAP_Payload_Encoder_Access is Aux : aliased Boolean := False; begin return new Web_Services.SOAP.Payloads.Encoders.SOAP_Payload_Encoder'Class' (Create (Registry.Element (Message_Tag), Aux'Access)); end Resolve; end Web_Services.SOAP.Payloads.Encoders.Registry;
optikos/oasis
Ada
1,600
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Constraints; with Program.Lexical_Elements; with Program.Elements.Discriminant_Associations; package Program.Elements.Discriminant_Constraints is pragma Pure (Program.Elements.Discriminant_Constraints); type Discriminant_Constraint is limited interface and Program.Elements.Constraints.Constraint; type Discriminant_Constraint_Access is access all Discriminant_Constraint'Class with Storage_Size => 0; not overriding function Discriminants (Self : Discriminant_Constraint) return not null Program.Elements.Discriminant_Associations .Discriminant_Association_Vector_Access is abstract; type Discriminant_Constraint_Text is limited interface; type Discriminant_Constraint_Text_Access is access all Discriminant_Constraint_Text'Class with Storage_Size => 0; not overriding function To_Discriminant_Constraint_Text (Self : aliased in out Discriminant_Constraint) return Discriminant_Constraint_Text_Access is abstract; not overriding function Left_Bracket_Token (Self : Discriminant_Constraint_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Right_Bracket_Token (Self : Discriminant_Constraint_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Discriminant_Constraints;
merced317/scirun4plus
Ada
3,715
adb
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2004 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- -- $Id: buffer_demo.adb,v 1.1 2008/12/19 14:44:49 dkf Exp $ -- This demo program provided by Dr Steve Sangwine <[email protected]> -- -- Demonstration of a problem with Zlib-Ada (already fixed) when a buffer -- of exactly the correct size is used for decompressed data, and the last -- few bytes passed in to Zlib are checksum bytes. -- This program compresses a string of text, and then decompresses the -- compressed text into a buffer of the same size as the original text. with Ada.Streams; use Ada.Streams; with Ada.Text_IO; with ZLib; use ZLib; procedure Buffer_Demo is EOL : Character renames ASCII.LF; Text : constant String := "Four score and seven years ago our fathers brought forth," & EOL & "upon this continent, a new nation, conceived in liberty," & EOL & "and dedicated to the proposition that `all men are created equal'."; Source : Stream_Element_Array (1 .. Text'Length); for Source'Address use Text'Address; begin Ada.Text_IO.Put (Text); Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line ("Uncompressed size : " & Positive'Image (Text'Length) & " bytes"); declare Compressed_Data : Stream_Element_Array (1 .. Text'Length); L : Stream_Element_Offset; begin Compress : declare Compressor : Filter_Type; I : Stream_Element_Offset; begin Deflate_Init (Compressor); -- Compress the whole of T at once. Translate (Compressor, Source, I, Compressed_Data, L, Finish); pragma Assert (I = Source'Last); Close (Compressor); Ada.Text_IO.Put_Line ("Compressed size : " & Stream_Element_Offset'Image (L) & " bytes"); end Compress; -- Now we decompress the data, passing short blocks of data to Zlib -- (because this demonstrates the problem - the last block passed will -- contain checksum information and there will be no output, only a -- check inside Zlib that the checksum is correct). Decompress : declare Decompressor : Filter_Type; Uncompressed_Data : Stream_Element_Array (1 .. Text'Length); Block_Size : constant := 4; -- This makes sure that the last block contains -- only Adler checksum data. P : Stream_Element_Offset := Compressed_Data'First - 1; O : Stream_Element_Offset; begin Inflate_Init (Decompressor); loop Translate (Decompressor, Compressed_Data (P + 1 .. Stream_Element_Offset'Min (P + Block_Size, L)), P, Uncompressed_Data (Total_Out (Decompressor) + 1 .. Uncompressed_Data'Last), O, No_Flush); Ada.Text_IO.Put_Line ("Total in : " & Count'Image (Total_In (Decompressor)) & ", out : " & Count'Image (Total_Out (Decompressor))); exit when P = L; end loop; Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line ("Decompressed text matches original text : " & Boolean'Image (Uncompressed_Data = Source)); end Decompress; end; end Buffer_Demo;
persan/a-cups
Ada
341
adb
with Cups.Cups; procedure Pinprint.Main is -- Main, but no special name is needed. begin Cups.Cups.PrintString ("Hello", True); -- Cups.PrintString ("Hi there!", True); -- Cups.PrintString ("How are you?", True); -- Cups.PrintString ("I am fine thank you!", True); -- Cups.PrintString ("Bye!", True); end Pinprint.Main;
reznikmm/matreshka
Ada
3,963
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 ODF.DOM.Table_Mode_Attributes; package Matreshka.ODF_Table.Mode_Attributes is type Table_Mode_Attribute_Node is new Matreshka.ODF_Table.Abstract_Table_Attribute_Node and ODF.DOM.Table_Mode_Attributes.ODF_Table_Mode_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Table_Mode_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Table_Mode_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Table.Mode_Attributes;
niechaojun/Amass
Ada
2,558
ads
-- Copyright 2017 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "Censys" type = "cert" function start() setratelimit(3) end function vertical(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.key == nil or c.key == "" or c.secret == nil or c.secret == "") then scrape(ctx, {url=scrapeurl(domain)}) return end apiquery(ctx, cfg, domain) end function apiquery(ctx, cfg, domain) local p = 1 while(true) do local resp local reqstr = domain .. "page: " .. p -- Check if the response data is in the graph database if (cfg.ttl ~= nil and cfg.ttl > 0) then resp = obtain_response(reqstr, cfg.ttl) end if (resp == nil or resp == "") then local body, err = json.encode({ query="parsed.names: " .. domain, page=p, fields={"parsed.names"}, }) if (err ~= nil and err ~= "") then return end resp, err = request({ method="POST", data=body, url=apiurl(), headers={['Content-Type']="application/json"}, id=cfg["credentials"].key, pass=cfg["credentials"].secret, }) if (err ~= nil and err ~= "") then return end if (cfg.ttl ~= nil and cfg.ttl > 0) then cache_response(reqstr, resp) end end local d = json.decode(resp) if (d == nil or d.status ~= "ok" or #(d.results) == 0) then return end for i, r in pairs(d.results) do for j, v in pairs(r["parsed.names"]) do sendnames(ctx, v) end end if d["metadata"].page >= d["metadata"].pages then return end checkratelimit() active(ctx) p = p + 1 end end function apiurl() return "https://www.censys.io/api/v1/search/certificates" end function scrapeurl(domain) return "https://www.censys.io/domain/" .. domain .. "/table" end function sendnames(ctx, content) local names = find(content, subdomainre) if names == nil then return end for i, v in pairs(names) do newname(ctx, v) end end
reznikmm/matreshka
Ada
3,739
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 XML.DOM.Attributes; package ODF.DOM.Table_Protection_Key_Attributes is pragma Preelaborate; type ODF_Table_Protection_Key_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Table_Protection_Key_Attribute_Access is access all ODF_Table_Protection_Key_Attribute'Class with Storage_Size => 0; end ODF.DOM.Table_Protection_Key_Attributes;
optikos/ada-lsp
Ada
7,734
adb
-- Copyright (c) 2017 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Streams.Stream_IO; with Ada.Containers.Hashed_Maps; with League.JSON.Arrays; with League.JSON.Documents; with League.JSON.Objects; with League.JSON.Values; with League.Stream_Element_Vectors; with League.String_Vectors; with League.Strings.Hash; package body Ada_Wellknown is function "+" (Text : Wide_Wide_String) return League.Strings.Universal_String renames League.Strings.To_Universal_String; function Read_File (Name : String) return League.Stream_Element_Vectors.Stream_Element_Vector; package MarkedString_Maps is new Ada.Containers.Hashed_Maps (Key_Type => League.Strings.Universal_String, Element_Type => LSP.Messages.MarkedString_Vectors.Vector, Hash => League.Strings.Hash, Equivalent_Keys => League.Strings."=", "=" => LSP.Messages.MarkedString_Vectors."="); package SignatureInformation_Maps is new Ada.Containers.Hashed_Maps (Key_Type => League.Strings.Universal_String, Element_Type => LSP.Messages.SignatureInformation, Hash => League.Strings.Hash, Equivalent_Keys => League.Strings."=", "=" => LSP.Messages."="); MarkedString_Map : MarkedString_Maps.Map; Signatures : SignatureInformation_Maps.Map; Attr : LSP.Messages.CompletionItem_Vectors.Vector; --------------------- -- Attribute_Hover -- --------------------- function Attribute_Hover (Name : LSP.Types.LSP_String) return LSP.Messages.MarkedString_Vectors.Vector is Cursor : constant MarkedString_Maps.Cursor := MarkedString_Map.Find (Name.To_Lowercase); begin if MarkedString_Maps.Has_Element (Cursor) then return MarkedString_Maps.Element (Cursor); else return LSP.Messages.MarkedString_Vectors.Empty_Vector; end if; end Attribute_Hover; ---------------- -- Attributes -- ---------------- function Attributes return LSP.Messages.CompletionItem_Vectors.Vector is begin return Attr; end Attributes; ---------------- -- Initialize -- ---------------- procedure Initialize is JSON : constant League.JSON.Documents.JSON_Document := League.JSON.Documents.From_JSON (Read_File ("tests/wellknown.json")); Attr_List : constant League.JSON.Arrays.JSON_Array := JSON.To_JSON_Object.Value (+"Attributes").To_Array; Hover : constant League.JSON.Objects.JSON_Object := JSON.To_JSON_Object.Value (+"Hover").To_Object; Hover_Keys : constant League.String_Vectors.Universal_String_Vector := Hover.Keys; Sign : constant League.JSON.Objects.JSON_Object := JSON.To_JSON_Object.Value (+"Signatures").To_Object; Sign_Keys : constant League.String_Vectors.Universal_String_Vector := Sign.Keys; begin for J in 1 .. Attr_List.Length loop declare function "-" (Name : Wide_Wide_String) return LSP.Types.LSP_String; function "-" (Name : Wide_Wide_String) return LSP.Types.LSP_String is begin return Attr_List (J).To_Object.Value (+Name).To_String; end "-"; Item : LSP.Messages.CompletionItem; begin Item.label := -"label"; Item.detail := (True, -"detail"); Item.documentation := (True, -"documentation"); Item.sortText := (True, -"sortText"); Item.filterText := (True, -"filterText"); Item.insertText := (True, -"insertText"); if Item.insertText.Value.Index ('$') > 0 then Item.insertTextFormat := (True, LSP.Messages.Snippet); end if; Attr.Append (Item); end; end loop; for J in 1 .. Hover_Keys.Length loop declare Key : constant League.Strings.Universal_String := Hover_Keys (J); List : constant League.JSON.Arrays.JSON_Array := Hover.Value (Key).To_Array; Next : LSP.Messages.MarkedString_Vectors.Vector; begin for K in 1 .. List.Length loop declare Value : constant League.JSON.Values.JSON_Value := List (K); Item : LSP.Messages.MarkedString; Object : League.JSON.Objects.JSON_Object; begin if Value.Is_String then Item := (Is_String => True, Value => Value.To_String); else Object := Value.To_Object; Item := (Is_String => False, language => Object.Value (+"language").To_String, value => Object.Value (+"value").To_String); end if; Next.Append (Item); end; end loop; MarkedString_Map.Insert (Key, Next); end; end loop; for J in 1 .. Sign_Keys.Length loop declare Key : constant League.Strings.Universal_String := Sign_Keys (J); Object : constant League.JSON.Objects.JSON_Object := Sign.Value (Key).To_Object; Result : LSP.Messages.SignatureInformation; Params : League.JSON.Arrays.JSON_Array; begin Result.label := Object.Value (+"label").To_String; Result.documentation := (True, Object.Value (+"documentation").To_String); Params := Object.Value (+"params").To_Array; for K in 1 .. Params.Length loop declare Value : constant League.JSON.Objects.JSON_Object := Params (K).To_Object; Item : LSP.Messages.ParameterInformation; begin Item.label := Value.Value (+"label").To_String; Item.documentation := (True, Value.Value (+"documentation").To_String); Result.parameters.Append (Item); end; end loop; Signatures.Insert (Key, Result); end; end loop; end Initialize; ----------------------- -- Pragma_Signatures -- ----------------------- function Pragma_Signatures (Name : LSP.Types.LSP_String) return LSP.Messages.SignatureInformation_Vectors.Vector is Cursor : constant SignatureInformation_Maps.Cursor := Signatures.Find (Name.To_Lowercase); begin if SignatureInformation_Maps.Has_Element (Cursor) then return LSP.Messages.SignatureInformation_Vectors.To_Vector (SignatureInformation_Maps.Element (Cursor), 1); else return LSP.Messages.SignatureInformation_Vectors.Empty_Vector; end if; end Pragma_Signatures; --------------- -- Read_File -- --------------- function Read_File (Name : String) return League.Stream_Element_Vectors.Stream_Element_Vector is Input : Ada.Streams.Stream_IO.File_Type; Buffer : Ada.Streams.Stream_Element_Array (1 .. 1024); Last : Ada.Streams.Stream_Element_Offset; Result : League.Stream_Element_Vectors.Stream_Element_Vector; begin Ada.Streams.Stream_IO.Open (Input, Ada.Streams.Stream_IO.In_File, Name); while not Ada.Streams.Stream_IO.End_Of_File (Input) loop Ada.Streams.Stream_IO.Read (Input, Buffer, Last); Result.Append (Buffer (1 .. Last)); end loop; return Result; end Read_File; end Ada_Wellknown;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
3,907
ads
-- This spec has been automatically generated from STM32F0xx.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with System; package STM32_SVD.PWR is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR_LPDS_Field is STM32_SVD.Bit; subtype CR_PDDS_Field is STM32_SVD.Bit; subtype CR_CWUF_Field is STM32_SVD.Bit; subtype CR_CSBF_Field is STM32_SVD.Bit; subtype CR_PVDE_Field is STM32_SVD.Bit; subtype CR_PLS_Field is STM32_SVD.UInt3; subtype CR_DBP_Field is STM32_SVD.Bit; subtype CR_FPDS_Field is STM32_SVD.Bit; -- power control register type CR_Register is record -- Low-power deep sleep LPDS : CR_LPDS_Field := 16#0#; -- Power down deepsleep PDDS : CR_PDDS_Field := 16#0#; -- Clear wakeup flag CWUF : CR_CWUF_Field := 16#0#; -- Clear standby flag CSBF : CR_CSBF_Field := 16#0#; -- Power voltage detector enable PVDE : CR_PVDE_Field := 16#0#; -- PVD level selection PLS : CR_PLS_Field := 16#0#; -- Disable backup domain write protection DBP : CR_DBP_Field := 16#0#; -- Flash power down in Stop mode FPDS : CR_FPDS_Field := 16#0#; -- unspecified Reserved_10_31 : STM32_SVD.UInt22 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record LPDS at 0 range 0 .. 0; PDDS at 0 range 1 .. 1; CWUF at 0 range 2 .. 2; CSBF at 0 range 3 .. 3; PVDE at 0 range 4 .. 4; PLS at 0 range 5 .. 7; DBP at 0 range 8 .. 8; FPDS at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; subtype CSR_WUF_Field is STM32_SVD.Bit; subtype CSR_SBF_Field is STM32_SVD.Bit; subtype CSR_PVDO_Field is STM32_SVD.Bit; subtype CSR_BRR_Field is STM32_SVD.Bit; subtype CSR_EWUP_Field is STM32_SVD.Bit; subtype CSR_BRE_Field is STM32_SVD.Bit; -- power control/status register type CSR_Register is record -- Read-only. Wakeup flag WUF : CSR_WUF_Field := 16#0#; -- Read-only. Standby flag SBF : CSR_SBF_Field := 16#0#; -- Read-only. PVD output PVDO : CSR_PVDO_Field := 16#0#; -- Read-only. Backup regulator ready BRR : CSR_BRR_Field := 16#0#; -- unspecified Reserved_4_7 : STM32_SVD.UInt4 := 16#0#; -- Enable WKUP pin EWUP : CSR_EWUP_Field := 16#0#; -- Backup regulator enable BRE : CSR_BRE_Field := 16#0#; -- unspecified Reserved_10_31 : STM32_SVD.UInt22 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CSR_Register use record WUF at 0 range 0 .. 0; SBF at 0 range 1 .. 1; PVDO at 0 range 2 .. 2; BRR at 0 range 3 .. 3; Reserved_4_7 at 0 range 4 .. 7; EWUP at 0 range 8 .. 8; BRE at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Power control type PWR_Peripheral is record -- power control register CR : aliased CR_Register; -- power control/status register CSR : aliased CSR_Register; end record with Volatile; for PWR_Peripheral use record CR at 16#0# range 0 .. 31; CSR at 16#4# range 0 .. 31; end record; -- Power control PWR_Periph : aliased PWR_Peripheral with Import, Address => System'To_Address (16#40007000#); end STM32_SVD.PWR;
reznikmm/matreshka
Ada
35,907
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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_Classifiers; with AMF.String_Collections; with AMF.UML.Associations; with AMF.UML.Classifier_Template_Parameters; with AMF.UML.Classifiers.Collections; with AMF.UML.Collaboration_Uses.Collections; with AMF.UML.Constraints.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Element_Imports.Collections; with AMF.UML.Elements.Collections; with AMF.UML.Features.Collections; with AMF.UML.Generalization_Sets.Collections; with AMF.UML.Generalizations.Collections; with AMF.UML.Named_Elements.Collections; with AMF.UML.Namespaces; with AMF.UML.Package_Imports.Collections; with AMF.UML.Packageable_Elements.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Parameterable_Elements.Collections; with AMF.UML.Properties.Collections; with AMF.UML.Redefinable_Elements.Collections; with AMF.UML.Redefinable_Template_Signatures; with AMF.UML.String_Expressions; with AMF.UML.Substitutions.Collections; with AMF.UML.Template_Bindings.Collections; with AMF.UML.Template_Parameters; with AMF.UML.Template_Signatures; with AMF.UML.Types.Collections; with AMF.UML.Use_Cases.Collections; with AMF.Visitors; package AMF.Internals.UML_Associations is type UML_Association_Proxy is limited new AMF.Internals.UML_Classifiers.UML_Classifier_Proxy and AMF.UML.Associations.UML_Association with null record; overriding function Get_End_Type (Self : not null access constant UML_Association_Proxy) return AMF.UML.Types.Collections.Ordered_Set_Of_UML_Type; -- Getter of Association::endType. -- -- References the classifiers that are used as types of the ends of the -- association. overriding function Get_Is_Derived (Self : not null access constant UML_Association_Proxy) return Boolean; -- Getter of Association::isDerived. -- -- Specifies whether the association is derived from other model elements -- such as other associations or constraints. overriding procedure Set_Is_Derived (Self : not null access UML_Association_Proxy; To : Boolean); -- Setter of Association::isDerived. -- -- Specifies whether the association is derived from other model elements -- such as other associations or constraints. overriding function Get_Member_End (Self : not null access constant UML_Association_Proxy) return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property; -- Getter of Association::memberEnd. -- -- Each end represents participation of instances of the classifier -- connected to the end in links of the association. overriding function Get_Navigable_Owned_End (Self : not null access constant UML_Association_Proxy) return AMF.UML.Properties.Collections.Set_Of_UML_Property; -- Getter of Association::navigableOwnedEnd. -- -- The navigable ends that are owned by the association itself. overriding function Get_Owned_End (Self : not null access constant UML_Association_Proxy) return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property; -- Getter of Association::ownedEnd. -- -- The ends that are owned by the association itself. overriding function Get_Related_Element (Self : not null access constant UML_Association_Proxy) return AMF.UML.Elements.Collections.Set_Of_UML_Element; -- Getter of Relationship::relatedElement. -- -- Specifies the elements related by the Relationship. overriding function Get_Attribute (Self : not null access constant UML_Association_Proxy) return AMF.UML.Properties.Collections.Set_Of_UML_Property; -- Getter of Classifier::attribute. -- -- Refers to all of the Properties that are direct (i.e. not inherited or -- imported) attributes of the classifier. overriding function Get_Collaboration_Use (Self : not null access constant UML_Association_Proxy) return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use; -- Getter of Classifier::collaborationUse. -- -- References the collaboration uses owned by the classifier. overriding function Get_Feature (Self : not null access constant UML_Association_Proxy) return AMF.UML.Features.Collections.Set_Of_UML_Feature; -- Getter of Classifier::feature. -- -- Specifies each feature defined in the classifier. -- Note that there may be members of the Classifier that are of the type -- Feature but are not included in this association, e.g. inherited -- features. overriding function Get_General (Self : not null access constant UML_Association_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of Classifier::general. -- -- Specifies the general Classifiers for this Classifier. -- References the general classifier in the Generalization relationship. overriding function Get_Generalization (Self : not null access constant UML_Association_Proxy) return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization; -- Getter of Classifier::generalization. -- -- Specifies the Generalization relationships for this Classifier. These -- Generalizations navigaten to more general classifiers in the -- generalization hierarchy. overriding function Get_Inherited_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Getter of Classifier::inheritedMember. -- -- Specifies all elements inherited by this classifier from the general -- classifiers. overriding function Get_Is_Abstract (Self : not null access constant UML_Association_Proxy) return Boolean; -- Getter of Classifier::isAbstract. -- -- If true, the Classifier does not provide a complete declaration and can -- typically not be instantiated. An abstract classifier is intended to be -- used by other classifiers e.g. as the target of general -- metarelationships or generalization relationships. overriding function Get_Is_Final_Specialization (Self : not null access constant UML_Association_Proxy) return Boolean; -- Getter of Classifier::isFinalSpecialization. -- -- If true, the Classifier cannot be specialized by generalization. Note -- that this property is preserved through package merge operations; that -- is, the capability to specialize a Classifier (i.e., -- isFinalSpecialization =false) must be preserved in the resulting -- Classifier of a package merge operation where a Classifier with -- isFinalSpecialization =false is merged with a matching Classifier with -- isFinalSpecialization =true: the resulting Classifier will have -- isFinalSpecialization =false. overriding procedure Set_Is_Final_Specialization (Self : not null access UML_Association_Proxy; To : Boolean); -- Setter of Classifier::isFinalSpecialization. -- -- If true, the Classifier cannot be specialized by generalization. Note -- that this property is preserved through package merge operations; that -- is, the capability to specialize a Classifier (i.e., -- isFinalSpecialization =false) must be preserved in the resulting -- Classifier of a package merge operation where a Classifier with -- isFinalSpecialization =false is merged with a matching Classifier with -- isFinalSpecialization =true: the resulting Classifier will have -- isFinalSpecialization =false. overriding function Get_Owned_Template_Signature (Self : not null access constant UML_Association_Proxy) return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access; -- Getter of Classifier::ownedTemplateSignature. -- -- The optional template signature specifying the formal template -- parameters. overriding procedure Set_Owned_Template_Signature (Self : not null access UML_Association_Proxy; To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access); -- Setter of Classifier::ownedTemplateSignature. -- -- The optional template signature specifying the formal template -- parameters. overriding function Get_Owned_Use_Case (Self : not null access constant UML_Association_Proxy) return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case; -- Getter of Classifier::ownedUseCase. -- -- References the use cases owned by this classifier. overriding function Get_Powertype_Extent (Self : not null access constant UML_Association_Proxy) return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set; -- Getter of Classifier::powertypeExtent. -- -- Designates the GeneralizationSet of which the associated Classifier is -- a power type. overriding function Get_Redefined_Classifier (Self : not null access constant UML_Association_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of Classifier::redefinedClassifier. -- -- References the Classifiers that are redefined by this Classifier. overriding function Get_Representation (Self : not null access constant UML_Association_Proxy) return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access; -- Getter of Classifier::representation. -- -- References a collaboration use which indicates the collaboration that -- represents this classifier. overriding procedure Set_Representation (Self : not null access UML_Association_Proxy; To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access); -- Setter of Classifier::representation. -- -- References a collaboration use which indicates the collaboration that -- represents this classifier. overriding function Get_Substitution (Self : not null access constant UML_Association_Proxy) return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution; -- Getter of Classifier::substitution. -- -- References the substitutions that are owned by this Classifier. overriding function Get_Template_Parameter (Self : not null access constant UML_Association_Proxy) return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access; -- Getter of Classifier::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding procedure Set_Template_Parameter (Self : not null access UML_Association_Proxy; To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access); -- Setter of Classifier::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding function Get_Use_Case (Self : not null access constant UML_Association_Proxy) return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case; -- Getter of Classifier::useCase. -- -- The set of use cases for which this Classifier is the subject. overriding function Get_Element_Import (Self : not null access constant UML_Association_Proxy) return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import; -- Getter of Namespace::elementImport. -- -- References the ElementImports owned by the Namespace. overriding function Get_Imported_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element; -- Getter of Namespace::importedMember. -- -- References the PackageableElements that are members of this Namespace -- as a result of either PackageImports or ElementImports. overriding function Get_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Getter of Namespace::member. -- -- A collection of NamedElements identifiable within the Namespace, either -- by being owned or by being introduced by importing or inheritance. overriding function Get_Owned_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Getter of Namespace::ownedMember. -- -- A collection of NamedElements owned by the Namespace. overriding function Get_Owned_Rule (Self : not null access constant UML_Association_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Namespace::ownedRule. -- -- Specifies a set of Constraints owned by this Namespace. overriding function Get_Package_Import (Self : not null access constant UML_Association_Proxy) return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import; -- Getter of Namespace::packageImport. -- -- References the PackageImports owned by the Namespace. overriding function Get_Client_Dependency (Self : not null access constant UML_Association_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Association_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Association_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Association_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Association_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Get_Package (Self : not null access constant UML_Association_Proxy) return AMF.UML.Packages.UML_Package_Access; -- Getter of Type::package. -- -- Specifies the owning package of this classifier, if any. overriding procedure Set_Package (Self : not null access UML_Association_Proxy; To : AMF.UML.Packages.UML_Package_Access); -- Setter of Type::package. -- -- Specifies the owning package of this classifier, if any. overriding function Get_Owning_Template_Parameter (Self : not null access constant UML_Association_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding procedure Set_Owning_Template_Parameter (Self : not null access UML_Association_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::owningTemplateParameter. -- -- The formal template parameter that owns this element. overriding function Get_Template_Parameter (Self : not null access constant UML_Association_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; -- Getter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding procedure Set_Template_Parameter (Self : not null access UML_Association_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); -- Setter of ParameterableElement::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. overriding function Get_Owned_Template_Signature (Self : not null access constant UML_Association_Proxy) return AMF.UML.Template_Signatures.UML_Template_Signature_Access; -- Getter of TemplateableElement::ownedTemplateSignature. -- -- The optional template signature specifying the formal template -- parameters. overriding procedure Set_Owned_Template_Signature (Self : not null access UML_Association_Proxy; To : AMF.UML.Template_Signatures.UML_Template_Signature_Access); -- Setter of TemplateableElement::ownedTemplateSignature. -- -- The optional template signature specifying the formal template -- parameters. overriding function Get_Template_Binding (Self : not null access constant UML_Association_Proxy) return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding; -- Getter of TemplateableElement::templateBinding. -- -- The optional bindings from this element to templates. overriding function Get_Is_Leaf (Self : not null access constant UML_Association_Proxy) return Boolean; -- Getter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding procedure Set_Is_Leaf (Self : not null access UML_Association_Proxy; To : Boolean); -- Setter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding function Get_Redefined_Element (Self : not null access constant UML_Association_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element; -- Getter of RedefinableElement::redefinedElement. -- -- The redefinable element that is being redefined by this element. overriding function Get_Redefinition_Context (Self : not null access constant UML_Association_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of RedefinableElement::redefinitionContext. -- -- References the contexts that this element may be redefined from. overriding function End_Type (Self : not null access constant UML_Association_Proxy) return AMF.UML.Types.Collections.Ordered_Set_Of_UML_Type; -- Operation Association::endType. -- -- endType is derived from the types of the member ends. overriding function All_Features (Self : not null access constant UML_Association_Proxy) return AMF.UML.Features.Collections.Set_Of_UML_Feature; -- Operation Classifier::allFeatures. -- -- The query allFeatures() gives all of the features in the namespace of -- the classifier. In general, through mechanisms such as inheritance, -- this will be a larger set than feature. overriding function Conforms_To (Self : not null access constant UML_Association_Proxy; Other : AMF.UML.Classifiers.UML_Classifier_Access) return Boolean; -- Operation Classifier::conformsTo. -- -- The query conformsTo() gives true for a classifier that defines a type -- that conforms to another. This is used, for example, in the -- specification of signature conformance for operations. overriding function General (Self : not null access constant UML_Association_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Operation Classifier::general. -- -- The general classifiers are the classifiers referenced by the -- generalization relationships. overriding function Has_Visibility_Of (Self : not null access constant UML_Association_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access) return Boolean; -- Operation Classifier::hasVisibilityOf. -- -- The query hasVisibilityOf() determines whether a named element is -- visible in the classifier. By default all are visible. It is only -- called when the argument is something owned by a parent. overriding function Inherit (Self : not null access constant UML_Association_Proxy; Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Operation Classifier::inherit. -- -- The query inherit() defines how to inherit a set of elements. Here the -- operation is defined to inherit them all. It is intended to be -- redefined in circumstances where inheritance is affected by -- redefinition. -- The inherit operation is overridden to exclude redefined properties. overriding function Inheritable_Members (Self : not null access constant UML_Association_Proxy; C : AMF.UML.Classifiers.UML_Classifier_Access) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Operation Classifier::inheritableMembers. -- -- The query inheritableMembers() gives all of the members of a classifier -- that may be inherited in one of its descendants, subject to whatever -- visibility restrictions apply. overriding function Inherited_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Operation Classifier::inheritedMember. -- -- The inheritedMember association is derived by inheriting the -- inheritable members of the parents. -- The inheritedMember association is derived by inheriting the -- inheritable members of the parents. overriding function Is_Template (Self : not null access constant UML_Association_Proxy) return Boolean; -- Operation Classifier::isTemplate. -- -- The query isTemplate() returns whether this templateable element is -- actually a template. overriding function May_Specialize_Type (Self : not null access constant UML_Association_Proxy; C : AMF.UML.Classifiers.UML_Classifier_Access) return Boolean; -- Operation Classifier::maySpecializeType. -- -- The query maySpecializeType() determines whether this classifier may -- have a generalization relationship to classifiers of the specified -- type. By default a classifier may specialize classifiers of the same or -- a more general type. It is intended to be redefined by classifiers that -- have different specialization constraints. overriding function Exclude_Collisions (Self : not null access constant UML_Association_Proxy; Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element; -- Operation Namespace::excludeCollisions. -- -- The query excludeCollisions() excludes from a set of -- PackageableElements any that would not be distinguishable from each -- other in this namespace. overriding function Get_Names_Of_Member (Self : not null access constant UML_Association_Proxy; Element : AMF.UML.Named_Elements.UML_Named_Element_Access) return AMF.String_Collections.Set_Of_String; -- Operation Namespace::getNamesOfMember. -- -- The query getNamesOfMember() takes importing into account. It gives -- back the set of names that an element would have in an importing -- namespace, either because it is owned, or if not owned then imported -- individually, or if not individually then from a package. -- The query getNamesOfMember() gives a set of all of the names that a -- member would have in a Namespace. In general a member can have multiple -- names in a Namespace if it is imported more than once with different -- aliases. The query takes account of importing. It gives back the set of -- names that an element would have in an importing namespace, either -- because it is owned, or if not owned then imported individually, or if -- not individually then from a package. overriding function Import_Members (Self : not null access constant UML_Association_Proxy; Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element; -- Operation Namespace::importMembers. -- -- The query importMembers() defines which of a set of PackageableElements -- are actually imported into the namespace. This excludes hidden ones, -- i.e., those which have names that conflict with names of owned members, -- and also excludes elements which would have the same name when imported. overriding function Imported_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element; -- Operation Namespace::importedMember. -- -- The importedMember property is derived from the ElementImports and the -- PackageImports. References the PackageableElements that are members of -- this Namespace as a result of either PackageImports or ElementImports. overriding function Members_Are_Distinguishable (Self : not null access constant UML_Association_Proxy) return Boolean; -- Operation Namespace::membersAreDistinguishable. -- -- The Boolean query membersAreDistinguishable() determines whether all of -- the namespace's members are distinguishable within it. overriding function Owned_Member (Self : not null access constant UML_Association_Proxy) return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element; -- Operation Namespace::ownedMember. -- -- Missing derivation for Namespace::/ownedMember : NamedElement overriding function All_Owning_Packages (Self : not null access constant UML_Association_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Association_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Association_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding function Conforms_To (Self : not null access constant UML_Association_Proxy; Other : AMF.UML.Types.UML_Type_Access) return Boolean; -- Operation Type::conformsTo. -- -- The query conformsTo() gives true for a type that conforms to another. -- By default, two types do not conform to each other. This query is -- intended to be redefined for specific conformance situations. overriding function Is_Compatible_With (Self : not null access constant UML_Association_Proxy; P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) return Boolean; -- Operation ParameterableElement::isCompatibleWith. -- -- The query isCompatibleWith() determines if this parameterable element -- is compatible with the specified parameterable element. By default -- parameterable element P is compatible with parameterable element Q if -- the kind of P is the same or a subtype as the kind of Q. Subclasses -- should override this operation to specify different compatibility -- constraints. overriding function Is_Template_Parameter (Self : not null access constant UML_Association_Proxy) return Boolean; -- Operation ParameterableElement::isTemplateParameter. -- -- The query isTemplateParameter() determines if this parameterable -- element is exposed as a formal template parameter. overriding function Parameterable_Elements (Self : not null access constant UML_Association_Proxy) return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element; -- Operation TemplateableElement::parameterableElements. -- -- The query parameterableElements() returns the set of elements that may -- be used as the parametered elements for a template parameter of this -- templateable element. By default, this set includes all the owned -- elements. Subclasses may override this operation if they choose to -- restrict the set of parameterable elements. overriding function Is_Consistent_With (Self : not null access constant UML_Association_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two RedefinableElements -- in a context in which redefinition is possible, whether redefinition -- would be logically consistent. By default, this is false; this -- operation must be overridden for subclasses of RedefinableElement to -- define the consistency conditions. overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Association_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isRedefinitionContextValid. -- -- The query isRedefinitionContextValid() specifies whether the -- redefinition contexts of this RedefinableElement are properly related -- to the redefinition contexts of the specified RedefinableElement to -- allow this element to redefine the other. By default at least one of -- the redefinition contexts of this element must be a specialization of -- at least one of the redefinition contexts of the specified element. overriding procedure Enter_Element (Self : not null access constant UML_Association_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Association_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Association_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Associations;
usainzg/EHU
Ada
2,396
adb
WITH Ada.Text_Io; USE Ada.Text_Io; procedure Ver_Substring_aa is -- salida: 11 booleanos(SE) -- post: corresponden a cada uno de los casos de pruebas dise�ados. -- pre: { True } function Substring_aa( S : String) return Boolean is -- EJERCICIO 3- ESPECIFICA E IMPLEMENTA recursivamente el subprograma -- Substring_aa que decide si el string S contiene el substring 'aa'. BEGIN -- Completar if S'Size < 16 then return False; end if; if S(S'First .. S'First + 1) = "aa" then return True; end if; return Substring_aa(S(S'First + 1 .. S'Last)); end Substring_aa; -- post: { True <=> Substring(S) } begin Put_Line("-------------------------------------"); Put("La palabra vacia no contiene el string 'aa': "); Put(Boolean'Image(Substring_aa(""))); New_Line; New_Line; New_Line; Put_Line("-------------------------------------"); Put_Line("Palabras de 1 caracter"); Put("-- La palabra de 1 caracter 'a' no contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("a"))); New_Line; Put("-- La palabra de 1 caracter 'b' no contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("b"))); New_Line; New_Line; New_Line; Put_Line("-------------------------------------"); Put_Line("Palabras de varios caracteres"); Put("-- 'aaaa' contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("aaaa"))); New_Line; Put("-- 'bbbb' no contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("bbbb"))); New_Line; Put("-- 'abab' no contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("abab"))); New_Line; Put("-- 'baba' no contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("baba"))); New_Line; Put("-- 'abba' no contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("abba"))); New_Line; Put("-- 'aabb' contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("aabb"))); New_Line; Put("-- 'baab' contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("baab"))); New_Line; Put("-- 'bbaa' contiene el substring 'aa': "); Put(Boolean'Image(Substring_aa("bbaa"))); New_Line; Put_Line("-------------------------------------"); end Ver_Substring_aa;
reznikmm/matreshka
Ada
4,210
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- 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$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_02FA is pragma Preelaborate; Group_02FA : aliased constant Core_Second_Stage := (16#00# .. 16#1D# => -- 02FA00 .. 02FA1D (Other_Letter, Wide, Other, Other, O_Letter, Ideographic, (Ideographic | Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False)), others => (Unassigned, Wide, Other, Other, Other, Ideographic, (others => False))); end Matreshka.Internals.Unicode.Ucd.Core_02FA;
reznikmm/matreshka
Ada
3,719
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 XML.DOM.Attributes; package ODF.DOM.Dr3d_Close_Front_Attributes is pragma Preelaborate; type ODF_Dr3d_Close_Front_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Dr3d_Close_Front_Attribute_Access is access all ODF_Dr3d_Close_Front_Attribute'Class with Storage_Size => 0; end ODF.DOM.Dr3d_Close_Front_Attributes;
sungyeon/drake
Ada
3,856
adb
with Ada.Exceptions.Finally; with Ada.Text_IO.Formatting; with System.Runtime_Context; package body Ada.Text_IO.Enumeration_IO is procedure Put_To_Field ( To : out String; Last : out Natural; Item : Enum; Set : Type_Set); procedure Put_To_Field ( To : out String; Last : out Natural; Item : Enum; Set : Type_Set) is Image : String := Enum'Image (Item); begin if Image (Image'First) /= ''' then case Set is when Upper_Case => null; when Lower_Case => for I in Image'Range loop if Image (I) in 'A' .. 'Z' then Image (I) := Character'Val ( Character'Pos (Image (I)) + 16#20#); end if; end loop; end case; end if; Last := To'First + Image'Length - 1; To (To'First .. Last) := Image; end Put_To_Field; procedure Get_From_Field ( From : String; Item : out Enum); procedure Get_From_Field ( From : String; Item : out Enum) is procedure Finally ( TLS : in out System.Runtime_Context.Task_Local_Storage); procedure Finally ( TLS : in out System.Runtime_Context.Task_Local_Storage) is begin TLS.No_Discrete_Value_Failure_Propagation := False; end Finally; package Holder is new Exceptions.Finally.Scoped_Holder ( System.Runtime_Context.Task_Local_Storage, Finally); TLS : constant not null System.Runtime_Context.Task_Local_Storage_Access := System.Runtime_Context.Get_Task_Local_Storage; B : Enum'Base; begin Holder.Assign (TLS.all); TLS.No_Discrete_Value_Failure_Propagation := True; TLS.Discrete_Value_Failure := False; -- dispatching B := Enum'Base'Value (From); -- checking if TLS.Discrete_Value_Failure or else B not in Enum then raise Data_Error; end if; Item := B; end Get_From_Field; -- implementation procedure Get ( File : File_Type; Item : out Enum) is S : constant String := Formatting.Get_Enum_Literal (File); -- checking the predicate begin Get_From_Field (S, Item); end Get; procedure Get ( Item : out Enum) is begin Get (Current_Input.all, Item); end Get; procedure Get ( File : not null File_Access; Item : out Enum) is begin Get (File.all, Item); end Get; procedure Put ( File : File_Type; Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is S : String (1 .. Enum'Width); Last : Natural; begin Put_To_Field (S, Last, Item, Set); Formatting.Head (File, S (1 .. Last), Width); -- checking the predicate end Put; procedure Put ( Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is begin Put (Current_Output.all, Item, Width, Set); end Put; procedure Put ( File : not null File_Access; Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is begin Put (File.all, Item, Width, Set); end Put; procedure Get ( From : String; Item : out Enum; Last : out Positive) is First : Positive; begin Formatting.Get_Head (From, First, Last); Get_From_Field (From (First .. Last), Item); end Get; procedure Put ( To : out String; Item : Enum; Set : Type_Set := Default_Setting) is S : String (1 .. Enum'Width); Last : Natural; begin Put_To_Field (S, Last, Item, Set); Formatting.Head (To, S (1 .. Last)); end Put; end Ada.Text_IO.Enumeration_IO;
stcarrez/ada-css
Ada
14,457
adb
pragma Style_Checks (Off); with Interfaces; with Ada.Text_IO; with CSS.Analysis.Parser.Parser_Goto; with CSS.Analysis.Parser.Parser_Tokens; with CSS.Analysis.Parser.Parser_Shift_Reduce; with CSS.Analysis.Parser.Lexer_IO; with CSS.Analysis.Parser.Lexer; with CSS.Analysis.Parser.Lexer_Dfa; package body CSS.Analysis.Parser.Parser is use Ada; use CSS.Analysis.Parser.Lexer; use CSS.Analysis.Parser.Lexer_Dfa; use type Interfaces.Unsigned_64; procedure yyparse; procedure yyerror (Message : in String := "syntax error"); procedure yyerror (Message : in String := "syntax error") is pragma Unreferenced (Message); begin error_count := error_count + 1; end yyerror; function Parse (Content : in String) return Integer is begin Error_Count := 0; CSS.Analysis.Parser.Lexer_Dfa.yylineno := 1; CSS.Analysis.Parser.Lexer_Dfa.yylinecol := 1; CSS.Analysis.Parser.Lexer_IO.Open_Input (Content); yyparse; CSS.Analysis.Parser.Lexer_IO.Close_Input; return Error_Count; exception when others => CSS.Analysis.Parser.Lexer_IO.Close_Input; raise; end Parse; procedure YYParse is -- Rename User Defined Packages to Internal Names. package yy_goto_tables renames CSS.Analysis.Parser.Parser_Goto; package yy_shift_reduce_tables renames CSS.Analysis.Parser.Parser_Shift_Reduce; package yy_tokens renames CSS.Analysis.Parser.Parser_Tokens; use yy_tokens, yy_goto_tables, yy_shift_reduce_tables; procedure yyclearin; procedure handle_error; subtype goto_row is yy_goto_tables.Row; subtype reduce_row is yy_shift_reduce_tables.Row; package yy is -- the size of the value and state stacks -- Affects error 'Stack size exceeded on state_stack' stack_size : constant Natural := 256; -- subtype rule is Natural; subtype parse_state is Natural; -- subtype nonterminal is Integer; -- encryption constants default : constant := -1; first_shift_entry : constant := 0; accept_code : constant := -3001; error_code : constant := -3000; -- stack data used by the parser tos : Natural := 0; value_stack : array (0 .. stack_size) of yy_tokens.YYSType; state_stack : array (0 .. stack_size) of parse_state; -- current input symbol and action the parser is on action : Integer; rule_id : Rule; input_symbol : yy_tokens.Token := ERROR; -- error recovery flag error_flag : Natural := 0; -- indicates 3 - (number of valid shifts after an error occurs) look_ahead : Boolean := True; index : reduce_row; -- Is Debugging option on or off debug : constant Boolean := False; end yy; procedure shift_debug (state_id : yy.parse_state; lexeme : yy_tokens.Token); procedure reduce_debug (rule_id : Rule; state_id : yy.parse_state); function goto_state (state : yy.parse_state; sym : Nonterminal) return yy.parse_state; function parse_action (state : yy.parse_state; t : yy_tokens.Token) return Integer; pragma Inline (goto_state, parse_action); function goto_state (state : yy.parse_state; sym : Nonterminal) return yy.parse_state is index : goto_row; begin index := Goto_Offset (state); while Goto_Matrix (index).Nonterm /= sym loop index := index + 1; end loop; return Integer (Goto_Matrix (index).Newstate); end goto_state; function parse_action (state : yy.parse_state; t : yy_tokens.Token) return Integer is index : reduce_row; tok_pos : Integer; default : constant Integer := -1; begin tok_pos := yy_tokens.Token'Pos (t); index := Shift_Reduce_Offset (state); while Integer (Shift_Reduce_Matrix (index).T) /= tok_pos and then Integer (Shift_Reduce_Matrix (index).T) /= default loop index := index + 1; end loop; return Integer (Shift_Reduce_Matrix (index).Act); end parse_action; -- error recovery stuff procedure handle_error is temp_action : Integer; begin if yy.error_flag = 3 then -- no shift yet, clobber input. if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Error Recovery Clobbers " & yy_tokens.Token'Image (yy.input_symbol)); end if; if yy.input_symbol = yy_tokens.END_OF_INPUT then -- don't discard, if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Can't discard END_OF_INPUT, quiting..."); end if; raise yy_tokens.Syntax_Error; end if; yy.look_ahead := True; -- get next token return; -- and try again... end if; if yy.error_flag = 0 then -- brand new error yyerror ("Syntax Error"); end if; yy.error_flag := 3; -- find state on stack where error is a valid shift -- if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Looking for state with error as valid shift"); end if; loop if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Examining State " & yy.parse_state'Image (yy.state_stack (yy.tos))); end if; temp_action := parse_action (yy.state_stack (yy.tos), ERROR); if temp_action >= yy.first_shift_entry then if yy.tos = yy.stack_size then Text_IO.Put_Line (" -- Ayacc.YYParse: Stack size exceeded on state_stack"); raise yy_tokens.Syntax_Error; end if; yy.tos := yy.tos + 1; yy.state_stack (yy.tos) := temp_action; exit; end if; if yy.tos /= 0 then yy.tos := yy.tos - 1; end if; if yy.tos = 0 then if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Error recovery popped entire stack, aborting..."); end if; raise yy_tokens.Syntax_Error; end if; end loop; if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Shifted error token in state " & yy.parse_state'Image (yy.state_stack (yy.tos))); end if; end handle_error; -- print debugging information for a shift operation procedure shift_debug (state_id : yy.parse_state; lexeme : yy_tokens.Token) is begin Text_IO.Put_Line (" -- Ayacc.YYParse: Shift " & yy.parse_state'Image (state_id) & " on input symbol " & yy_tokens.Token'Image (lexeme)); end shift_debug; -- print debugging information for a reduce operation procedure reduce_debug (rule_id : Rule; state_id : yy.parse_state) is begin Text_IO.Put_Line (" -- Ayacc.YYParse: Reduce by rule " & Rule'Image (rule_id) & " goto state " & yy.parse_state'Image (state_id)); end reduce_debug; -- called to clear input symbol that caused an error. procedure yyclearin is begin -- yy.input_symbol := YYLex; yy.look_ahead := True; end yyclearin; begin -- initialize by pushing state 0 and getting the first input symbol yy.state_stack (yy.tos) := 0; loop yy.index := Shift_Reduce_Offset (yy.state_stack (yy.tos)); if Integer (Shift_Reduce_Matrix (yy.index).T) = yy.default then yy.action := Integer (Shift_Reduce_Matrix (yy.index).Act); else if yy.look_ahead then yy.look_ahead := False; yy.input_symbol := YYLex; end if; yy.action := parse_action (yy.state_stack (yy.tos), yy.input_symbol); end if; if yy.action >= yy.first_shift_entry then -- SHIFT if yy.debug then shift_debug (yy.action, yy.input_symbol); end if; -- Enter new state if yy.tos = yy.stack_size then Text_IO.Put_Line (" Stack size exceeded on state_stack"); raise yy_tokens.Syntax_Error; end if; yy.tos := yy.tos + 1; yy.state_stack (yy.tos) := yy.action; yy.value_stack (yy.tos) := YYLVal; if yy.error_flag > 0 then -- indicate a valid shift yy.error_flag := yy.error_flag - 1; end if; -- Advance lookahead yy.look_ahead := True; elsif yy.action = yy.error_code then -- ERROR handle_error; elsif yy.action = yy.accept_code then if yy.debug then Text_IO.Put_Line (" -- Ayacc.YYParse: Accepting Grammar..."); end if; exit; else -- Reduce Action -- Convert action into a rule yy.rule_id := Rule (-1 * yy.action); -- Execute User Action -- user_action(yy.rule_id); case yy.rule_id is pragma Style_Checks (Off); when 4 => -- #line 38 Error (yylval.Line, yylval.Column, "Syntax error"); yyclearin; when 9 => -- #line 55 Create_Property (yy.value_stack (yy.tos-4), yy.value_stack (yy.tos)); when 10 => -- #line 58 Create_Property (yy.value_stack (yy.tos-4), yy.value_stack (yy.tos)); when 11 => -- #line 61 Error (yy.value_stack (yy.tos-1).Line, yy.value_stack (yy.tos-1).Column, "Error in property definition"); when 12 => -- #line 66 Create_Names (yy.value_stack (yy.tos-2), yy.value_stack (yy.tos)); YYVal := yy.value_stack (yy.tos-2); when 13 => -- #line 69 Create_Names (yy.value_stack (yy.tos-2), yy.value_stack (yy.tos)); YYVal := yy.value_stack (yy.tos-2); when 14 => -- #line 72 YYVal := yy.value_stack (yy.tos); YYVal.Names.Append (Ada.Strings.Unbounded.To_String (yy.value_stack (yy.tos).Token)); when 15 => -- #line 75 YYVal := yy.value_stack (yy.tos); YYVal.Names.Append (Ada.Strings.Unbounded.To_String (yy.value_stack (yy.tos).Token)); when 17 => -- #line 84 Append_Group (YYVal, yy.value_stack (yy.tos-4), yy.value_stack (yy.tos), Rules.GROUP_DBAR); when 19 => -- #line 91 Append_Group (YYVal, yy.value_stack (yy.tos-4), yy.value_stack (yy.tos), Rules.GROUP_DBAR); when 21 => -- #line 98 Append_Group (YYVal, yy.value_stack (yy.tos-4), yy.value_stack (yy.tos), Rules.GROUP_AND); when 23 => -- #line 105 Append_Group (YYVal, yy.value_stack (yy.tos-4), yy.value_stack (yy.tos), Rules.GROUP_ONLY_ONE); when 25 => -- #line 112 Append_Group (YYVal, yy.value_stack (yy.tos-3), yy.value_stack (yy.tos-1), Rules.GROUP_SEQ); when 26 => -- #line 115 Append_Group (YYVal, yy.value_stack (yy.tos-5), yy.value_stack (yy.tos-1), Rules.GROUP_SEQ); when 27 => -- #line 118 YYVal := yy.value_stack (yy.tos-1); when 28 => -- #line 123 yy.value_stack (yy.tos-1).Rule.Set_Repeat (1, Natural'Last); YYVal := yy.value_stack (yy.tos-1); when 29 => -- #line 126 yy.value_stack (yy.tos-2).Rule.Set_Repeat (0, 1); YYVal := yy.value_stack (yy.tos-2); when 30 => -- #line 129 yy.value_stack (yy.tos-2).Rule.Set_Repeat (0, Natural'Last); YYVal := yy.value_stack (yy.tos-2); when 31 => -- #line 132 yy.value_stack (yy.tos-2).Rule.Set_Repeat (yy.value_stack (yy.tos).Min_Repeat, yy.value_stack (yy.tos).Max_Repeat, True); YYVal := yy.value_stack (yy.tos-2); when 32 => -- #line 135 yy.value_stack (yy.tos-1).Rule.Set_Repeat (yy.value_stack (yy.tos).Min_Repeat, yy.value_stack (yy.tos).Max_Repeat); YYVal := yy.value_stack (yy.tos-1); when 35 => -- #line 146 Create_Function (YYVal, yy.value_stack (yy.tos-5), yy.value_stack (yy.tos-2)); when 36 => -- #line 149 Create_Identifier (YYVal, yy.value_stack (yy.tos)); when 37 => -- #line 152 Create_Type_Or_Reference (YYVal, yy.value_stack (yy.tos)); when 38 => -- #line 155 Create_Identifier (YYVal, yy.value_stack (yy.tos)); when 39 => -- #line 158 Create_Identifier (YYVal, yy.value_stack (yy.tos)); when 40 => -- #line 161 Create_Identifier (YYVal, yy.value_stack (yy.tos)); when 41 => -- #line 166 Append_Group (YYVal, yy.value_stack (yy.tos-2), yy.value_stack (yy.tos), Rules.GROUP_PARAMS); when 43 => -- #line 173 YYVal := yy.value_stack (yy.tos-2); when 44 => -- #line 176 YYVal := yy.value_stack (yy.tos-1); when 46 => -- #line 183 YYVal := yy.value_stack (yy.tos-2); when 47 => -- #line 186 YYVal := yy.value_stack (yy.tos-1); when 48 => -- #line 191 YYVal.Min_Repeat := Get_Value (yy.value_stack (yy.tos-3)); YYVal.Max_Repeat := Get_Value (yy.value_stack (yy.tos-1)); when 49 => -- #line 194 YYVal.Min_Repeat := Get_Value (yy.value_stack (yy.tos-2)); YYVal.Max_Repeat := Natural'Last; when 50 => -- #line 197 YYVal.Min_Repeat := Get_Value (yy.value_stack (yy.tos-1)); YYVal.Max_Repeat := YYVal.Min_Repeat; when 51 => -- #line 200 YYVal.Min_Repeat := 1; YYVal.Max_Repeat := 1; pragma Style_Checks (On); when others => null; end case; -- Pop RHS states and goto next state yy.tos := yy.tos - Rule_Length (yy.rule_id) + 1; if yy.tos > yy.stack_size then Text_IO.Put_Line (" Stack size exceeded on state_stack"); raise yy_tokens.Syntax_Error; end if; yy.state_stack (yy.tos) := goto_state (yy.state_stack (yy.tos - 1), Get_LHS_Rule (yy.rule_id)); yy.value_stack (yy.tos) := YYVal; if yy.debug then reduce_debug (yy.rule_id, goto_state (yy.state_stack (yy.tos - 1), Get_LHS_Rule (yy.rule_id))); end if; end if; end loop; end YYParse; end CSS.Analysis.Parser.Parser;
AdaCore/training_material
Ada
42
ads
O4 : A := (for I of O3 when I /= 0 => I);
reznikmm/matreshka
Ada
6,687
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2018, Vadim Godunko <[email protected]> -- -- 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 Ada.Streams; with Ada.Unchecked_Conversion; with League.Base_Codecs; with League.Strings.Hash; with League.Stream_Element_Vectors; package body Spikedog.HTTP_Sessions is type Session_Identifier_Buffer is new Ada.Streams.Stream_Element_Array (1 .. 32); ------------ -- Decode -- ------------ procedure Decode (Image : League.Strings.Universal_String; Identifier : out Session_Identifier; Success : out Boolean) is use type Ada.Streams.Stream_Element_Offset; function To_Session_Identifier is new Ada.Unchecked_Conversion (Session_Identifier_Buffer, Session_Identifier); Aux : League.Stream_Element_Vectors.Stream_Element_Vector; begin -- Декодирование строки в бинарный массив. League.Base_Codecs.From_Base_64_URL (Image, Aux, Success); if not Success then return; end if; -- Проверка длины декодированных данных. if Aux.Length /= 32 then Success := False; return; end if; -- Преобразование во внутреннее представление идентификатора. Identifier := To_Session_Identifier (Session_Identifier_Buffer (Aux.To_Stream_Element_Array)); end Decode; ------------ -- Encode -- ------------ function Encode (Value : Session_Identifier) return League.Strings.Universal_String is function To_Session_Identifier_Buffer is new Ada.Unchecked_Conversion (Session_Identifier, Session_Identifier_Buffer); begin return League.Base_Codecs.To_Base_64_URL (League.Stream_Element_Vectors.To_Stream_Element_Vector (Ada.Streams.Stream_Element_Array (To_Session_Identifier_Buffer (Value)))); end Encode; ----------------------- -- Get_Creation_Time -- ----------------------- overriding function Get_Creation_Time (Self : Spikedog_HTTP_Session) return League.Calendars.Date_Time is begin if Self.Valid then return Self.Creation_Time; else raise Program_Error; end if; end Get_Creation_Time; ------------ -- Get_Id -- ------------ overriding function Get_Id (Self : Spikedog_HTTP_Session) return League.Strings.Universal_String is begin return Encode (Self.Identifier); end Get_Id; ---------------------------- -- Get_Last_Accessed_Time -- ---------------------------- overriding function Get_Last_Accessed_Time (Self : Spikedog_HTTP_Session) return League.Calendars.Date_Time is begin if Self.Valid then return Self.Last_Accessed_Time; else raise Program_Error; end if; end Get_Last_Accessed_Time; ---------- -- Hash -- ---------- function Hash (Value : Session_Identifier) return Ada.Containers.Hash_Type is begin return League.Strings.Hash (Encode (Value)); end Hash; ------------ -- Is_New -- ------------ overriding function Is_New (Self : Spikedog_HTTP_Session) return Boolean is begin if Self.Valid then return Self.Is_New; else raise Program_Error; end if; end Is_New; end Spikedog.HTTP_Sessions;
zhmu/ananas
Ada
214
adb
-- { dg-do run } -- { dg-options "-O2" } with Opt74_Pkg; use Opt74_Pkg; procedure Opt74 is Index, Found : Integer; begin Proc (Found, Index); if Found = 1 then raise Program_Error; end if; end;
kimtg/euler-ada
Ada
367
adb
with Ada.Text_IO; with Ada.Calendar.Formatting; use Ada.Calendar.Formatting; procedure Euler19 is Count : Natural := 0; begin for Year in 1901 .. 2000 loop for Month in 1 .. 12 loop if Day_Of_Week(Time_Of(Year, Month, 1)) = Sunday then Count := Count + 1; end if; end loop; end loop; Ada.Text_IO.Put_Line(Integer'Image(Count)); end;
zhmu/ananas
Ada
7,957
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M _ S C I L -- -- -- -- B o d y -- -- -- -- Copyright (C) 2009-2022, 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. -- -- -- ------------------------------------------------------------------------------ with Einfo; use Einfo; with Einfo.Entities; use Einfo.Entities; with Einfo.Utils; use Einfo.Utils; with Nlists; use Nlists; with Rtsfind; use Rtsfind; with Sem_Aux; use Sem_Aux; with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; with Stand; use Stand; with SCIL_LL; use SCIL_LL; package body Sem_SCIL is --------------------- -- Check_SCIL_Node -- --------------------- function Check_SCIL_Node (N : Node_Id) return Traverse_Result is SCIL_Node : constant Node_Id := Get_SCIL_Node (N); Ctrl_Tag : Node_Id; Ctrl_Typ : Entity_Id; begin -- For nodes that do not have SCIL node continue traversing the tree if No (SCIL_Node) then return OK; end if; case Nkind (SCIL_Node) is when N_SCIL_Dispatch_Table_Tag_Init => pragma Assert (Nkind (N) = N_Object_Declaration); null; when N_SCIL_Dispatching_Call => Ctrl_Tag := SCIL_Controlling_Tag (SCIL_Node); -- Parent of SCIL dispatching call nodes MUST be a subprogram call if Nkind (N) not in N_Subprogram_Call then raise Program_Error; -- In simple cases the controlling tag is the tag of the -- controlling argument (i.e. Obj.Tag). elsif Nkind (Ctrl_Tag) = N_Selected_Component then Ctrl_Typ := Etype (Ctrl_Tag); -- Interface types are unsupported if Is_Interface (Ctrl_Typ) or else Is_RTE (Ctrl_Typ, RE_Interface_Tag) then null; else pragma Assert (Is_RTE (Ctrl_Typ, RE_Tag)); null; end if; -- When the controlling tag of a dispatching call is an identifier -- the SCIL_Controlling_Tag attribute references the corresponding -- object or parameter declaration. Interface types are still -- unsupported. elsif Nkind (Ctrl_Tag) in N_Object_Declaration | N_Parameter_Specification then Ctrl_Typ := Etype (Defining_Identifier (Ctrl_Tag)); -- Interface types are unsupported. if Is_Interface (Ctrl_Typ) or else Is_RTE (Ctrl_Typ, RE_Interface_Tag) or else (Is_Access_Type (Ctrl_Typ) and then Is_Interface (Available_View (Base_Type (Designated_Type (Ctrl_Typ))))) then null; else pragma Assert (Is_RTE (Ctrl_Typ, RE_Tag) or else (Is_Access_Type (Ctrl_Typ) and then Is_RTE (Available_View (Base_Type (Designated_Type (Ctrl_Typ))), RE_Tag))); null; end if; -- Interface types are unsupported elsif Is_Interface (Etype (Ctrl_Tag)) then null; else pragma Assert (False); raise Program_Error; end if; return Skip; when N_SCIL_Membership_Test => -- Check contents of the boolean expression associated with the -- membership test. pragma Assert (Nkind (N) in N_Identifier | N_And_Then | N_Or_Else | N_Expression_With_Actions | N_Function_Call and then Etype (N) = Standard_Boolean); -- Check the entity identifier of the associated tagged type (that -- is, in testing for membership in T'Class, the entity id of the -- specific type T). -- Note: When the SCIL node is generated the private and full-view -- of the tagged types may have been swapped and hence the node -- referenced by attribute SCIL_Entity may be the private view. -- Therefore, in order to uniformly locate the full-view we use -- attribute Underlying_Type. pragma Assert (Is_Tagged_Type (Underlying_Type (SCIL_Entity (SCIL_Node)))); -- Interface types are unsupported pragma Assert (not Is_Interface (Underlying_Type (SCIL_Entity (SCIL_Node)))); -- Check the decoration of the expression that denotes the tag -- value being tested Ctrl_Tag := SCIL_Tag_Value (SCIL_Node); case Nkind (Ctrl_Tag) is -- For class-wide membership tests the SCIL tag value is the -- tag of the tested object (i.e. Obj.Tag). when N_Selected_Component => pragma Assert (Is_RTE (Etype (Ctrl_Tag), RE_Tag)); null; when others => pragma Assert (False); null; end case; return Skip; when others => pragma Assert (False); raise Program_Error; end case; return Skip; end Check_SCIL_Node; ------------------------- -- First_Non_SCIL_Node -- ------------------------- function First_Non_SCIL_Node (L : List_Id) return Node_Id is N : Node_Id; begin N := First (L); while Nkind (N) in N_SCIL_Node loop Next (N); end loop; return N; end First_Non_SCIL_Node; ------------------------ -- Next_Non_SCIL_Node -- ------------------------ function Next_Non_SCIL_Node (N : Node_Id) return Node_Id is Aux_N : Node_Id; begin Aux_N := Next (N); while Nkind (Aux_N) in N_SCIL_Node loop Next (Aux_N); end loop; return Aux_N; end Next_Non_SCIL_Node; end Sem_SCIL;
zhmu/ananas
Ada
7,770
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M -- -- -- -- S p e c -- -- (VxWorks Version ARM) -- -- -- -- Copyright (C) 1992-2022, 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. -- -- -- ------------------------------------------------------------------------------ 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 := 1.0 / 60.0; -- Storage-related Declarations type Address is private; pragma Preelaborable_Initialization (Address); Null_Address : constant Address; Storage_Unit : constant := 8; Word_Size : constant := 32; Memory_Size : constant := 2 ** 32; -- 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 := Low_Order_First; pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning -- Priority-related Declarations (RM D.1) -- Ada priorities are mapped to VxWorks priorities using the following -- transformation: 255 - Ada Priority -- Ada priorities are used as follows: -- 256 is reserved for the VxWorks kernel -- 248 - 255 correspond to hardware interrupt levels 0 .. 7 -- 247 is a catchall default "interrupt" priority for signals, -- allowing higher priority than normal tasks, but lower than -- hardware priority levels. Protected Object ceilings can -- override these values. -- 246 is used by the Interrupt_Manager task Max_Priority : constant Positive := 245; Max_Interrupt_Priority : constant Positive := 255; subtype Any_Priority is Integer range 0 .. 255; subtype Priority is Any_Priority range 0 .. 245; subtype Interrupt_Priority is Any_Priority range 246 .. 255; Default_Priority : constant Priority := 122; 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. Backend_Divide_Checks : constant Boolean := False; Backend_Overflow_Checks : constant Boolean := True; Command_Line_Args : constant Boolean := False; Configurable_Run_Time : constant Boolean := False; Denorm : constant Boolean := True; Duration_32_Bits : constant Boolean := False; Exit_Status_Supported : constant Boolean := True; Machine_Overflows : constant Boolean := False; Machine_Rounds : constant Boolean := True; Preallocated_Stacks : constant Boolean := False; 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 := False; Suppress_Standard_Library : constant Boolean := False; Use_Ada_Main_Program_Name : constant Boolean := True; Frontend_Exceptions : constant Boolean := False; ZCX_By_Default : constant Boolean := True; Executable_Extension : constant String := ".out"; end System;
jhumphry/LALG
Ada
2,913
ads
-- LALG -- An Ada 2012 binding to BLAS and other linear algebra routines -- Unit tests for Level 2 BLAS routines -- Copyright (c) 2015-2021, James Humphry - see LICENSE file for details -- SPDX-License-Identifier: ISC with AUnit; use AUnit; with AUnit.Test_Cases; use AUnit.Test_Cases; with LALG, LALG.Real_BLAS; private with Ada.Strings.Unbounded; generic with package BLAS_Base is new LALG(<>); with package BLAS is new BLAS_Base.Real_BLAS; Real_Type_Name : String := "<Unknown>"; Epsilon : BLAS_Base.Real := BLAS_Base."*"(2.0, BLAS_Base.Real'Model_Epsilon); Soft_Epsilon : BLAS_Base.Real := BLAS_Base."*"(1000.0, BLAS_Base.Real'Model_Epsilon); package BLAS_Real_Level2 is pragma Unreferenced(Epsilon); pragma Unreferenced(Soft_Epsilon); use BLAS_Base, BLAS; type Level2_Test is new Test_Cases.Test_Case with null record; procedure Register_Tests (T: in out Level2_Test); function Name (T : Level2_Test) return Test_String is (Format("Test real Level 2 BLAS routines for " & Real_Type_Name)); procedure Set_Up (T : in out Level2_Test); procedure Check_Gemv (T : in out Test_Cases.Test_Case'Class); procedure Check_Symv (T : in out Test_Cases.Test_Case'Class); procedure Check_Spmv (T : in out Test_Cases.Test_Case'Class); procedure Check_Trmv (T : in out Test_Cases.Test_Case'Class); procedure Check_Tpmv (T : in out Test_Cases.Test_Case'Class); procedure Check_Trsv (T : in out Test_Cases.Test_Case'Class); procedure Check_Tpsv (T : in out Test_Cases.Test_Case'Class); procedure Check_Ger (T : in out Test_Cases.Test_Case'Class); procedure Check_Syr_Syr2 (T : in out Test_Cases.Test_Case'Class); procedure Check_Spr_Spr2 (T : in out Test_Cases.Test_Case'Class); private -- RM 3.10.2(32) means we cannot hide this away inside the body of the -- generic unit - the use of unbounded strings and the Test_Details type -- is just to make things less irritating. use Ada.Strings.Unbounded; function "+"(Source : in String) return Unbounded_String renames To_Unbounded_String; type Test_Details is record T : Test_Routine; D : Unbounded_String; end record; Test_Details_List: array (Positive range <>) of Test_Details := ( (Check_Gemv'Access, +"Check real gemv routine."), (Check_Symv'Access, +"Check real symv routine."), (Check_Spmv'Access, +"Check real spmv routine."), (Check_Trmv'Access, +"Check real trmv routine."), (Check_Tpmv'Access, +"Check real tpmv routine."), (Check_Trsv'Access, +"Check real trsv routine."), (Check_Tpsv'Access, +"Check real tpsv routine."), (Check_Ger'Access, +"Check real ger routine."), (Check_Syr_Syr2'Access, +"Check real syr and syr2 routines."), (Check_Spr_Spr2'Access, +"Check real spr and spr2 routines.") ); end BLAS_Real_Level2;
albinjal/ada_basic
Ada
1,155
adb
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Upg4 is type Ints is array(1..10) of Integer; type Arrs is array(1..20) of Ints; procedure Extract(Data: out Arrs) is File : File_Type; begin Open(File, In_File, "NUMMER.TXT"); for X in Data'Range loop for I in Ints'Range loop Get(File, Data(X)(I)); end loop; end loop; Close(File); end; procedure Sort(Arr: in out Ints) is procedure Swap(A,B: in out Integer) is C: Integer := A; begin A := B; B := C; end; begin for J in 2..Arr'Last loop for I in reverse J..Arr'Last loop if Arr(I) < Arr(I-1) then Swap(Arr(I), Arr(I-1)); end if; end loop; end loop; end; procedure Put(Data: in Arrs) is begin for X in Data'Range loop for I in reverse Ints'Range loop Put(Data(X)(I), 2); Put(' '); end loop; New_Line; end loop; end; Data: Arrs; begin Extract(Data); for I in Data'Range loop Sort(Data(I)); end loop; Put(Data); end;
charlie5/aIDE
Ada
710
ads
with Asis; -- AdaM.Source; package AdaM.Assist.Query.find_Entities.Actuals_for_traversing is type Traversal_State is record -- parent_Stack : AdaM.Source.Entities; ignore_Starter : asis.Element := asis.Nil_Element; end record; Initial_Traversal_State : constant Traversal_State := (others => <>); procedure Pre_Op (Element : Asis.Element; Control : in out Asis.Traverse_Control; State : in out Traversal_State); procedure Post_Op (Element : Asis.Element; Control : in out Asis.Traverse_Control; State : in out Traversal_State); end AdaM.Assist.Query.find_Entities.Actuals_for_traversing;
HackInvent/Ada_Drivers_Library
Ada
9,095
ads
-- This spec has been automatically generated from STM32H7x3.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with System; package STM32_SVD.COMP1 is pragma Preelaborate; --------------- -- Registers -- --------------- -- Comparator status register type COMP1_SR_Register is record -- Read-only. COMP channel 1 output status bit C1VAL : Boolean; -- Read-only. COMP channel 2 output status bit C2VAL : Boolean; -- unspecified Reserved_2_15 : STM32_SVD.UInt14; -- Read-only. COMP channel 1 Interrupt Flag C1IF : Boolean; -- Read-only. COMP channel 2 Interrupt Flag C2IF : Boolean; -- unspecified Reserved_18_31 : STM32_SVD.UInt14; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for COMP1_SR_Register use record C1VAL at 0 range 0 .. 0; C2VAL at 0 range 1 .. 1; Reserved_2_15 at 0 range 2 .. 15; C1IF at 0 range 16 .. 16; C2IF at 0 range 17 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; -- Comparator interrupt clear flag register type COMP1_ICFR_Register is record -- unspecified Reserved_0_15 : STM32_SVD.UInt16 := 16#0#; -- Write-only. Clear COMP channel 1 Interrupt Flag CC1IF : Boolean := False; -- Write-only. Clear COMP channel 2 Interrupt Flag CC2IF : Boolean := False; -- unspecified Reserved_18_31 : STM32_SVD.UInt14 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for COMP1_ICFR_Register use record Reserved_0_15 at 0 range 0 .. 15; CC1IF at 0 range 16 .. 16; CC2IF at 0 range 17 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; subtype COMP1_OR_AFOP_Field is STM32_SVD.UInt11; subtype COMP1_OR_OR_Field is STM32_SVD.UInt21; -- Comparator option register type COMP1_OR_Register is record -- Selection of source for alternate function of output ports AFOP : COMP1_OR_AFOP_Field := 16#0#; -- Option Register OR_k : COMP1_OR_OR_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for COMP1_OR_Register use record AFOP at 0 range 0 .. 10; OR_k at 0 range 11 .. 31; end record; subtype COMP1_CFGR1_HYST_Field is STM32_SVD.UInt2; subtype COMP1_CFGR1_PWRMODE_Field is STM32_SVD.UInt2; subtype COMP1_CFGR1_INMSEL_Field is STM32_SVD.UInt3; subtype COMP1_CFGR1_BLANKING_Field is STM32_SVD.UInt4; -- Comparator configuration register 1 type COMP1_CFGR1_Register is record -- COMP channel 1 enable bit EN : Boolean := False; -- Scaler bridge enable BRGEN : Boolean := False; -- Voltage scaler enable bit SCALEN : Boolean := False; -- COMP channel 1 polarity selection bit POLARITY : Boolean := False; -- unspecified Reserved_4_5 : STM32_SVD.UInt2 := 16#0#; -- COMP channel 1 interrupt enable ITEN : Boolean := False; -- unspecified Reserved_7_7 : STM32_SVD.Bit := 16#0#; -- COMP channel 1 hysteresis selection bits HYST : COMP1_CFGR1_HYST_Field := 16#0#; -- unspecified Reserved_10_11 : STM32_SVD.UInt2 := 16#0#; -- Power Mode of the COMP channel 1 PWRMODE : COMP1_CFGR1_PWRMODE_Field := 16#0#; -- unspecified Reserved_14_15 : STM32_SVD.UInt2 := 16#0#; -- COMP channel 1 inverting input selection field INMSEL : COMP1_CFGR1_INMSEL_Field := 16#0#; -- unspecified Reserved_19_19 : STM32_SVD.Bit := 16#0#; -- COMP channel 1 non-inverting input selection bit INPSEL : Boolean := False; -- unspecified Reserved_21_23 : STM32_SVD.UInt3 := 16#0#; -- COMP channel 1 blanking source selection bits BLANKING : COMP1_CFGR1_BLANKING_Field := 16#0#; -- unspecified Reserved_28_30 : STM32_SVD.UInt3 := 16#0#; -- Lock bit LOCK : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for COMP1_CFGR1_Register use record EN at 0 range 0 .. 0; BRGEN at 0 range 1 .. 1; SCALEN at 0 range 2 .. 2; POLARITY at 0 range 3 .. 3; Reserved_4_5 at 0 range 4 .. 5; ITEN at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; HYST at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; PWRMODE at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INMSEL at 0 range 16 .. 18; Reserved_19_19 at 0 range 19 .. 19; INPSEL at 0 range 20 .. 20; Reserved_21_23 at 0 range 21 .. 23; BLANKING at 0 range 24 .. 27; Reserved_28_30 at 0 range 28 .. 30; LOCK at 0 range 31 .. 31; end record; subtype COMP1_CFGR2_HYST_Field is STM32_SVD.UInt2; subtype COMP1_CFGR2_PWRMODE_Field is STM32_SVD.UInt2; subtype COMP1_CFGR2_INMSEL_Field is STM32_SVD.UInt3; subtype COMP1_CFGR2_BLANKING_Field is STM32_SVD.UInt4; -- Comparator configuration register 2 type COMP1_CFGR2_Register is record -- COMP channel 1 enable bit EN : Boolean := False; -- Scaler bridge enable BRGEN : Boolean := False; -- Voltage scaler enable bit SCALEN : Boolean := False; -- COMP channel 1 polarity selection bit POLARITY : Boolean := False; -- Window comparator mode selection bit WINMODE : Boolean := False; -- unspecified Reserved_5_5 : STM32_SVD.Bit := 16#0#; -- COMP channel 1 interrupt enable ITEN : Boolean := False; -- unspecified Reserved_7_7 : STM32_SVD.Bit := 16#0#; -- COMP channel 1 hysteresis selection bits HYST : COMP1_CFGR2_HYST_Field := 16#0#; -- unspecified Reserved_10_11 : STM32_SVD.UInt2 := 16#0#; -- Power Mode of the COMP channel 1 PWRMODE : COMP1_CFGR2_PWRMODE_Field := 16#0#; -- unspecified Reserved_14_15 : STM32_SVD.UInt2 := 16#0#; -- COMP channel 1 inverting input selection field INMSEL : COMP1_CFGR2_INMSEL_Field := 16#0#; -- unspecified Reserved_19_19 : STM32_SVD.Bit := 16#0#; -- COMP channel 1 non-inverting input selection bit INPSEL : Boolean := False; -- unspecified Reserved_21_23 : STM32_SVD.UInt3 := 16#0#; -- COMP channel 1 blanking source selection bits BLANKING : COMP1_CFGR2_BLANKING_Field := 16#0#; -- unspecified Reserved_28_30 : STM32_SVD.UInt3 := 16#0#; -- Lock bit LOCK : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for COMP1_CFGR2_Register use record EN at 0 range 0 .. 0; BRGEN at 0 range 1 .. 1; SCALEN at 0 range 2 .. 2; POLARITY at 0 range 3 .. 3; WINMODE at 0 range 4 .. 4; Reserved_5_5 at 0 range 5 .. 5; ITEN at 0 range 6 .. 6; Reserved_7_7 at 0 range 7 .. 7; HYST at 0 range 8 .. 9; Reserved_10_11 at 0 range 10 .. 11; PWRMODE at 0 range 12 .. 13; Reserved_14_15 at 0 range 14 .. 15; INMSEL at 0 range 16 .. 18; Reserved_19_19 at 0 range 19 .. 19; INPSEL at 0 range 20 .. 20; Reserved_21_23 at 0 range 21 .. 23; BLANKING at 0 range 24 .. 27; Reserved_28_30 at 0 range 28 .. 30; LOCK at 0 range 31 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- COMP1 type COMP1_Peripheral is record -- Comparator status register COMP1_SR : aliased COMP1_SR_Register; -- Comparator interrupt clear flag register COMP1_ICFR : aliased COMP1_ICFR_Register; -- Comparator option register COMP1_OR : aliased COMP1_OR_Register; -- Comparator configuration register 1 COMP1_CFGR1 : aliased COMP1_CFGR1_Register; -- Comparator configuration register 2 COMP1_CFGR2 : aliased COMP1_CFGR2_Register; end record with Volatile; for COMP1_Peripheral use record COMP1_SR at 16#0# range 0 .. 31; COMP1_ICFR at 16#4# range 0 .. 31; COMP1_OR at 16#8# range 0 .. 31; COMP1_CFGR1 at 16#C# range 0 .. 31; COMP1_CFGR2 at 16#10# range 0 .. 31; end record; -- COMP1 COMP1_Periph : aliased COMP1_Peripheral with Import, Address => COMP1_Base; end STM32_SVD.COMP1;
reznikmm/matreshka
Ada
4,001
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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. ------------------------------------------------------------------------------ -- WriteLinkAction is an abstract class for link actions that create and -- destroy links. ------------------------------------------------------------------------------ with AMF.UML.Link_Actions; package AMF.UML.Write_Link_Actions is pragma Preelaborate; type UML_Write_Link_Action is limited interface and AMF.UML.Link_Actions.UML_Link_Action; type UML_Write_Link_Action_Access is access all UML_Write_Link_Action'Class; for UML_Write_Link_Action_Access'Storage_Size use 0; end AMF.UML.Write_Link_Actions;
godunko/adawebpack
Ada
16,516
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Web API Definition -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2020, Vadim Godunko <[email protected]> -- -- 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: 5518 $ $Date: 2015-12-20 14:25:24 +0300 (Sun, 20 Dec 2015) $ ------------------------------------------------------------------------------ -- This package provides binding to interface Document. ------------------------------------------------------------------------------ with Web.DOM.Elements; with Web.DOM.Nodes; with Web.DOM.Non_Element_Parent_Nodes; with Web.DOM.Texts; with Web.Strings; package Web.DOM.Documents is pragma Preelaborate; type Document is new Web.DOM.Nodes.Node and Web.DOM.Non_Element_Parent_Nodes.Non_Element_Parent_Node with null record; -- interface Document : Node { -- [SameObject] readonly attribute DOMImplementation implementation; -- readonly attribute DOMString URL; -- readonly attribute DOMString documentURI; -- readonly attribute DOMString origin; -- readonly attribute DOMString compatMode; -- readonly attribute DOMString characterSet; -- readonly attribute DOMString contentType; -- -- readonly attribute DocumentType? doctype; -- readonly attribute Element? documentElement; -- HTMLCollection getElementsByTagName(DOMString localName); -- HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); -- HTMLCollection getElementsByClassName(DOMString classNames); -- -- [NewObject] Element createElement(DOMString localName); -- [NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName); -- [NewObject] DocumentFragment createDocumentFragment(); -- [NewObject] Comment createComment(DOMString data); -- [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); -- -- [NewObject] Node importNode(Node node, optional boolean deep = false); -- Node adoptNode(Node node); -- -- [NewObject] Event createEvent(DOMString interface); -- -- [NewObject] Range createRange(); -- -- // NodeFilter.SHOW_ALL = 0xFFFFFFFF -- [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); -- [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); -- }; --with WebAPI.DOM.Comments; --with WebAPI.DOM.Document_Fragments; --with WebAPI.DOM.Document_Types; --with WebAPI.DOM.Elements; --with WebAPI.DOM.HTML_Collections; --with WebAPI.DOM.Nodes; --with WebAPI.DOM.Non_Element_Parent_Nodes; --with WebAPI.DOM.Parent_Nodes; --with WebAPI.DOM.Processing_Instructions; -- --package WebAPI.DOM.Documents is -- -- pragma Preelaborate; -- -- type Document is limited interface -- and WebAPI.DOM.Nodes.Node -- and WebAPI.DOM.Non_Element_Parent_Nodes.Non_Element_Parent_Node -- and WebAPI.DOM.Parent_Nodes.Parent_Node; -- -- type Document_Access is access all Document'Class -- with Storage_Size => 0; -- -- -- XXX Not binded yet: -- -- [SameObject] readonly attribute DOMImplementation implementation; -- -- not overriding function Get_URL -- (Self : not null access constant Document) -- return WebAPI.DOM_String is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "URL"; -- -- Returns document's URL. -- -- not overriding function Get_Document_URI -- (Self : not null access constant Document) -- return WebAPI.DOM_String is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "documentURI"; -- -- Returns document's URL. -- -- not overriding function Get_Compat_Mode -- (Self : not null access constant Document) -- return WebAPI.DOM_String is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "compatMode"; -- -- Returns the string "CSS1Compat" if document is in no-quirks mode or -- -- limited-quirks mode, and "BackCompat", if document is in quirks mode. -- -- not overriding function Get_Character_Set -- (Self : not null access constant Document) -- return WebAPI.DOM_String is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "characterSet"; -- -- Returns document's encoding. -- -- not overriding function Get_Content_Type -- (Self : not null access constant Document) -- return WebAPI.DOM_String is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "contentType"; -- -- Returns document's content type. -- -- not overriding function Get_Doctype -- (Self : not null access constant Document) -- return WebAPI.DOM.Document_Types.Document_Type_Access is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "doctype"; -- -- Returns the doctype or null if there is none. -- -- not overriding function Get_Document_Element -- (Self : not null access constant Document) -- return WebAPI.DOM.Elements.Element_Access is abstract -- with Import => True, -- Convention => JavaScript_Property_Getter, -- Link_Name => "documentElement"; -- -- Returns the document element. -- -- not overriding function Get_Elements_By_Tag_Name -- (Self : not null access constant Document; -- Local_Name : WebAPI.DOM_String) -- return WebAPI.DOM.HTML_Collections.HTML_Collection is abstract -- with Import => True, -- Convention => JavaScript_Function, -- Link_Name => "getElementsByTagName"; -- -- If localName is "*" returns a HTMLCollection of all descendant elements. -- -- -- -- Otherwise, returns a HTMLCollection of all descendant elements whose -- -- local name is localName. (Matches case-insensitively against elements in -- -- the HTML namespace within an HTML document.) -- -- not overriding function Get_Elements_By_Tag_Name_NS -- (Self : not null access constant Document; -- Namespace_URI : WebAPI.DOM_String; -- Local_Name : WebAPI.DOM_String) -- return WebAPI.DOM.HTML_Collections.HTML_Collection is abstract -- with Import => True, -- Convention => JavaScript_Function, -- Link_Name => "getElementsByTagNameNS"; -- -- If namespace and localName are "*" returns a HTMLCollection of all -- -- descendant elements. -- -- -- -- If only namespace is "*" returns a HTMLCollection of all descendant -- -- elements whose local name is localName. -- -- -- -- If only localName is "*" returns a HTMLCollection of all descendant -- -- elements whose namespace is namespace. -- -- -- -- Otherwise, returns a HTMLCollection of all descendant elements whose -- -- namespace is namespace and local name is localName. -- -- not overriding function Get_Elements_By_Class_Name -- (Self : not null access constant Document; -- Class_Names : WebAPI.DOM_String) -- return WebAPI.DOM.HTML_Collections.HTML_Collection is abstract -- with Import => True, -- Convention => JavaScript_Function, -- Link_Name => "getElementsByClassName"; -- -- Returns a HTMLCollection of the elements in the object on which the -- -- method was invoked (a document or an element) that have all the classes -- -- given by classes. -- -- -- -- The classes argument is interpreted as a space-separated list of -- -- classes. -- -- not overriding function Create_Element -- (Self : not null access Document; -- Local_Name : WebAPI.DOM_String) -- return not null WebAPI.DOM.Elements.Element_Access is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "createElement"; -- -- Returns an element in the HTML namespace with localName as local name. -- -- (In an HTML document localName is lowercased.) -- -- -- -- If localName does not match the Name production an -- -- "InvalidCharacterError" exception will be thrown. -- -- not overriding function Create_Element_NS -- (Self : not null access Document; -- Namespace_URI : WebAPI.DOM_String; -- Qialified_Name : WebAPI.DOM_String) -- return not null WebAPI.DOM.Elements.Element_Access is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "createElementNS"; -- -- Returns an element with namespace namespace. Its namespace prefix will -- -- be everything before ":" (U+003E) in qualifiedName or null. Its local -- -- name will be everything after ":" (U+003E) in qualifiedName or -- -- qualifiedName. -- -- -- -- If localName does not match the Name production an -- -- "InvalidCharacterError" exception will be thrown. -- -- -- -- If one of the following conditions is true a "NamespaceError" exception -- -- will be thrown: -- -- -- -- - localName does not match the QName production. -- -- - Namespace prefix is not null and namespace is the empty string. -- -- - Namespace prefix is "xml" and namespace is not the XML namespace. -- -- - qualifiedName or namespace prefix is "xmlns" and namespace is not the -- -- XMLNS namespace. -- -- - namespace is the XMLNS namespace and neither qualifiedName nor -- -- namespace prefix is "xmlns". -- -- not overriding function Create_Document_Fragment -- (Self : not null access Document) -- return not null WebAPI.DOM.Document_Fragments.Document_Fragment_Access -- is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "createDocumentFragment"; -- -- Returns a DocumentFragment node. function Create_Text_Node (Self : in out Document'Class; Data : Web.Strings.Web_String) return Web.DOM.Texts.Text; -- Returns a Text node whose data is data. -- not overriding function Create_Comment -- (Self : not null access Document; -- Data : WebAPI.DOM_String) -- return WebAPI.DOM.Comments.Comment_Access is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "createComment"; -- -- Returns a Comment node whose data is data. -- -- not overriding function Create_Processing_Instruction -- (Self : not null access Document; -- Target : WebAPI.DOM_String; -- Data : WebAPI.DOM_String) -- return WebAPI.DOM.Processing_Instructions.Processing_Instruction_Access -- is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "createProcessingInstruction"; -- -- Returns a ProcessingInstruction node whose target is target and data is -- -- data. -- -- -- -- If target does not match the Name production an "InvalidCharacterError" -- -- exception will be thrown. -- -- -- -- If data contains "?>" an "InvalidCharacterError" exception will be -- -- thrown. -- -- not overriding function Import_Node -- (Self : not null access Document; -- Node : not null access WebAPI.DOM.Nodes.Node'Class; -- Deep : Boolean := False) -- return WebAPI.DOM.Nodes.Node_Access is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "importNode"; -- -- Returns a copy of node. If deep is true, the copy also includes the -- -- node's descendants. -- -- -- -- If node is a document throws a "NotSupportedError" exception. -- -- not overriding function Adopt_Node -- (Self : not null access Document; -- Node : not null access WebAPI.DOM.Nodes.Node'Class) -- return WebAPI.DOM.Nodes.Node_Access is abstract -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "adoptNode"; -- procedure Adopt_Node -- (Self : not null access Document'Class; -- Node : not null access WebAPI.DOM.Nodes.Node'Class) -- with Import => True, -- Convention => JavaScript_Method, -- Link_Name => "adoptNode"; -- -- Moves node from another document and returns it. -- -- -- -- If node is a document throws a "NotSupportedError" exception. -- -- -- XXX Not binded yet: -- -- [NewObject] Event createEvent(DOMString interface); -- -- -- XXX Not binded yet: -- -- [NewObject] Range createRange(); -- -- -- XXX Not binded yet: -- -- // NodeFilter.SHOW_ALL = 0xFFFFFFFF -- -- [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); -- -- [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); overriding function Get_Element_By_Id (Self : Document; Element_Id : Web.Strings.Web_String) return Web.DOM.Elements.Element; end Web.DOM.Documents;
zhmu/ananas
Ada
1,112
ads
-- { dg-do compile } with System; package Discr5 is X, Y : Boolean; type R (D : Boolean := False) is tagged limited record F : Integer; case D is when True => F1, F2 : Integer; when False => null; end case; end record; for R use record F1 at 100 range 0..31; end record; subtype Rt is R(True); subtype Rf is R(False); type R1 (D1 : Boolean) is new R (X) with record FF : Float; case D1 is when True => F3, F4 : Float; when False => null; end case; end record; for R1 use record F4 at 200 range 0..31; end record; subtype R1t is R1 (True); subtype R1f is R1 (False); type R2 (D2 : Boolean) is new R1 (Y) with record FFF: System.Address; case D2 is when True => F5, F6: System.Address; when False => null; end case; end record; for R2 use record F6 at 300 range 0..63; end record; subtype R2t is R2 (True); subtype R2f is R2 (False); end Discr5;
zhmu/ananas
Ada
1,007
adb
-- { dg-do run } with Init9; use Init9; with Ada.Numerics; use Ada.Numerics; with Text_IO; use Text_IO; with Dump; procedure Q9 is A1 : R1 := My_R1; B1 : R1 := My_R1; A2 : R2 := My_R2; B2 : R2 := My_R2; begin Put ("A1 :"); Dump (A1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A1 : 18 2d 44 54 fb 21 09 40.*\n" } Put ("B1 :"); Dump (B1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "B1 : 18 2d 44 54 fb 21 09 40.*\n" } Put ("A2 :"); Dump (A2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A2 : 40 09 21 fb 54 44 2d 18.*\n" } Put ("B2 :"); Dump (B2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "B2 : 40 09 21 fb 54 44 2d 18.*\n" } if A1.F /= B1.F then raise Program_Error; end if; if A1.F /= Pi then raise Program_Error; end if; if A2.F /= B2.F then raise Program_Error; end if; if A2.F /= Pi then raise Program_Error; end if; end;
persan/A-gst
Ada
23,354
ads
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; with glib.Values; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstminiobject_h; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h; with System; with glib; -- with GStreamer.GST_Low_Level.glib_2_0_glib_gquark_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gststructure_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h is GST_BUFFER_TRACE_NAME : aliased constant String := "GstBuffer" & ASCII.NUL; -- gst/gstbuffer.h:42 -- unsupported macro: GST_TYPE_BUFFER (gst_buffer_get_type()) -- arg-macro: function GST_IS_BUFFER (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BUFFER); -- arg-macro: function GST_IS_BUFFER_CLASS (klass) -- return G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BUFFER); -- arg-macro: function GST_BUFFER_GET_CLASS (obj) -- return G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BUFFER, GstBufferClass); -- arg-macro: function GST_BUFFER (obj) -- return G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BUFFER, GstBuffer); -- arg-macro: function GST_BUFFER_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BUFFER, GstBufferClass); -- arg-macro: function GST_BUFFER_CAST (obj) -- return (GstBuffer *)(obj); -- arg-macro: procedure GST_BUFFER_FLAGS (buf) -- GST_MINI_OBJECT_FLAGS(buf) -- arg-macro: procedure GST_BUFFER_FLAG_IS_SET (buf, flag) -- GST_MINI_OBJECT_FLAG_IS_SET (buf, flag) -- arg-macro: procedure GST_BUFFER_FLAG_SET (buf, flag) -- GST_MINI_OBJECT_FLAG_SET (buf, flag) -- arg-macro: procedure GST_BUFFER_FLAG_UNSET (buf, flag) -- GST_MINI_OBJECT_FLAG_UNSET (buf, flag) -- arg-macro: function GST_BUFFER_DATA (buf) -- return GST_BUFFER_CAST(buf).data; -- arg-macro: function GST_BUFFER_SIZE (buf) -- return GST_BUFFER_CAST(buf).size; -- arg-macro: function GST_BUFFER_TIMESTAMP (buf) -- return GST_BUFFER_CAST(buf).timestamp; -- arg-macro: function GST_BUFFER_DURATION (buf) -- return GST_BUFFER_CAST(buf).duration; -- arg-macro: function GST_BUFFER_CAPS (buf) -- return GST_BUFFER_CAST(buf).caps; -- arg-macro: function GST_BUFFER_OFFSET (buf) -- return GST_BUFFER_CAST(buf).offset; -- arg-macro: function GST_BUFFER_OFFSET_END (buf) -- return GST_BUFFER_CAST(buf).offset_end; -- arg-macro: function GST_BUFFER_MALLOCDATA (buf) -- return GST_BUFFER_CAST(buf).malloc_data; -- arg-macro: function GST_BUFFER_FREE_FUNC (buf) -- return GST_BUFFER_CAST(buf).free_func; -- unsupported macro: GST_BUFFER_OFFSET_NONE ((guint64)-1) -- arg-macro: function GST_BUFFER_DURATION_IS_VALID (buffer) -- return GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DURATION (buffer)); -- arg-macro: function GST_BUFFER_TIMESTAMP_IS_VALID (buffer) -- return GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)); -- arg-macro: function GST_BUFFER_OFFSET_IS_VALID (buffer) -- return GST_BUFFER_OFFSET (buffer) /= GST_BUFFER_OFFSET_NONE; -- arg-macro: function GST_BUFFER_OFFSET_END_IS_VALID (buffer) -- return GST_BUFFER_OFFSET_END (buffer) /= GST_BUFFER_OFFSET_NONE; -- arg-macro: function GST_BUFFER_IS_DISCONT (buffer) -- return GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_DISCONT); -- arg-macro: procedure gst_buffer_set_data (buf, data, size) -- G_STMT_START { GST_BUFFER_DATA (buf) := data; GST_BUFFER_SIZE (buf) := size; } G_STMT_END -- unsupported macro: GST_BUFFER_COPY_ALL ((GstBufferCopyFlags) (GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS | GST_BUFFER_COPY_CAPS | GST_BUFFER_COPY_QDATA)) -- arg-macro: procedure gst_buffer_is_writable (buf) -- gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (buf)) -- arg-macro: procedure gst_buffer_make_writable (buf) -- GST_BUFFER_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (buf))) -- arg-macro: procedure gst_value_set_buffer (v, b) -- gst_value_set_mini_object(v, GST_MINI_OBJECT_CAST(b)) -- arg-macro: procedure gst_value_take_buffer (v, b) -- gst_value_take_mini_object(v, GST_MINI_OBJECT_CAST(b)) -- arg-macro: procedure gst_value_get_buffer (v) -- GST_BUFFER_CAST (gst_value_get_mini_object(v)) -- GStreamer -- * Copyright (C) 1999,2000 Erik Walthinsen <[email protected]> -- * 2000 Wim Taymans <[email protected]> -- * -- * gstbuffer.h: Header for GstBuffer object -- * -- * 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 GstBuffer; type u_GstBuffer_u_gst_reserved_array is array (0 .. 0) of System.Address; --subtype GstBuffer is u_GstBuffer; -- gst/gstbuffer.h:33 type GstBufferClass; --subtype GstBufferClass is u_GstBufferClass; -- gst/gstbuffer.h:34 -- skipped empty struct u_GstBufferPrivate -- skipped empty struct GstBufferPrivate --* -- * GST_BUFFER_TRACE_NAME: -- * -- * The name used for tracing memory allocations. -- --* -- * GST_BUFFER_FLAGS: -- * @buf: a #GstBuffer. -- * -- * A flags word containing #GstBufferFlag flags set on this buffer. -- --* -- * GST_BUFFER_FLAG_IS_SET: -- * @buf: a #GstBuffer. -- * @flag: the #GstBufferFlag to check. -- * -- * Gives the status of a specific flag on a buffer. -- --* -- * GST_BUFFER_FLAG_SET: -- * @buf: a #GstBuffer. -- * @flag: the #GstBufferFlag to set. -- * -- * Sets a buffer flag on a buffer. -- --* -- * GST_BUFFER_FLAG_UNSET: -- * @buf: a #GstBuffer. -- * @flag: the #GstBufferFlag to clear. -- * -- * Clears a buffer flag. -- --* -- * GST_BUFFER_DATA: -- * @buf: a #GstBuffer. -- * -- * A pointer to the data element of this buffer. -- --* -- * GST_BUFFER_SIZE: -- * @buf: a #GstBuffer. -- * -- * The size in bytes of the data in this buffer. -- --* -- * GST_BUFFER_TIMESTAMP: -- * @buf: a #GstBuffer.: -- * -- * The timestamp in nanoseconds (as a #GstClockTime) of the data in the buffer. -- * Value will be %GST_CLOCK_TIME_NONE if the timestamp is unknown. -- * -- --* -- * GST_BUFFER_DURATION: -- * @buf: a #GstBuffer. -- * -- * The duration in nanoseconds (as a #GstClockTime) of the data in the buffer. -- * Value will be %GST_CLOCK_TIME_NONE if the duration is unknown. -- --* -- * GST_BUFFER_CAPS: -- * @buf: a #GstBuffer. -- * -- * The caps for this buffer. -- --* -- * GST_BUFFER_OFFSET: -- * @buf: a #GstBuffer. -- * -- * The offset in the source file of the beginning of this buffer. -- --* -- * GST_BUFFER_OFFSET_END: -- * @buf: a #GstBuffer. -- * -- * The offset in the source file of the end of this buffer. -- --* -- * GST_BUFFER_MALLOCDATA: -- * @buf: a #GstBuffer. -- * -- * A pointer to any data allocated for this buffer using g_malloc(). If this is -- * non-NULL, this memory will be freed at the end of the buffer's lifecycle -- * (i.e. when its refcount becomes zero). -- --* -- * GST_BUFFER_FREE_FUNC: -- * @buf: a #GstBuffer. -- * -- * A pointer to a function that will be called on the buffer's malloc_data when -- * this buffer is finalized. Defaults to g_free(). -- * -- * Note that the free function only affects the buffer's malloc_data; if the -- * buffer's malloc_data is %NULL, the function will not be called. -- * -- * Since: 0.10.22 -- --* -- * GST_BUFFER_OFFSET_NONE: -- * -- * Constant for no-offset return results. -- --* -- * GST_BUFFER_DURATION_IS_VALID: -- * @buffer: a #GstBuffer -- * -- * Tests if the duration is known. -- --* -- * GST_BUFFER_TIMESTAMP_IS_VALID: -- * @buffer: a #GstBuffer -- * -- * Tests if the timestamp is known. -- --* -- * GST_BUFFER_OFFSET_IS_VALID: -- * @buffer: a #GstBuffer -- * -- * Tests if the start offset is known. -- --* -- * GST_BUFFER_OFFSET_END_IS_VALID: -- * @buffer: a #GstBuffer -- * -- * Tests if the end offset is known. -- --* -- * GST_BUFFER_IS_DISCONT: -- * @buffer: a #GstBuffer -- * -- * Tests if the buffer marks a discontinuity in the stream. -- * -- * Since: 0.10.9 -- --* -- * GstBufferFlag: -- * @GST_BUFFER_FLAG_READONLY: the buffer is read-only. This means the data of -- * the buffer should not be modified. The metadata might still be modified. -- * @GST_BUFFER_FLAG_PREROLL: the buffer is part of a preroll and should not be -- * displayed. -- * @GST_BUFFER_FLAG_DISCONT: the buffer marks a discontinuity in the stream. -- * This typically occurs after a seek or a dropped buffer from a live or -- * network source. -- * @GST_BUFFER_FLAG_IN_CAPS: the buffer has been added as a field in a #GstCaps. -- * @GST_BUFFER_FLAG_GAP: the buffer has been created to fill a gap in the -- * stream and contains media neutral data (elements can switch to optimized code -- * path that ignores the buffer content). -- * @GST_BUFFER_FLAG_DELTA_UNIT: this unit cannot be decoded independently. -- * @GST_BUFFER_FLAG_MEDIA1: a flag whose use is specific to the caps of the buffer. Since: 0.10.23. -- * @GST_BUFFER_FLAG_MEDIA2: a flag whose use is specific to the caps of the buffer. Since: 0.10.23. -- * @GST_BUFFER_FLAG_MEDIA3: a flag whose use is specific to the caps of the buffer. Since: 0.10.23. -- * @GST_BUFFER_FLAG_MEDIA4: a flag whose use is specific to the caps of the buffer. Since: 0.10.33. -- * @GST_BUFFER_FLAG_LAST: additional flags can be added starting from this flag. -- * -- * A set of buffer flags used to describe properties of a #GstBuffer. -- subtype GstBufferFlag is unsigned; GST_BUFFER_FLAG_READONLY : constant GstBufferFlag := 1; GST_BUFFER_FLAG_MEDIA4 : constant GstBufferFlag := 2; GST_BUFFER_FLAG_PREROLL : constant GstBufferFlag := 16; GST_BUFFER_FLAG_DISCONT : constant GstBufferFlag := 32; GST_BUFFER_FLAG_IN_CAPS : constant GstBufferFlag := 64; GST_BUFFER_FLAG_GAP : constant GstBufferFlag := 128; GST_BUFFER_FLAG_DELTA_UNIT : constant GstBufferFlag := 256; GST_BUFFER_FLAG_MEDIA1 : constant GstBufferFlag := 512; GST_BUFFER_FLAG_MEDIA2 : constant GstBufferFlag := 1024; GST_BUFFER_FLAG_MEDIA3 : constant GstBufferFlag := 2048; GST_BUFFER_FLAG_LAST : constant GstBufferFlag := 4096; -- gst/gstbuffer.h:238 --* -- * GstBuffer: -- * @mini_object: the parent structure -- * @data: pointer to the buffer data -- * @size: size of buffer data -- * @timestamp: timestamp of the buffer, can be #GST_CLOCK_TIME_NONE when the -- * timestamp is not known or relevant. -- * @duration: duration in time of the buffer data, can be #GST_CLOCK_TIME_NONE -- * when the duration is not known or relevant. -- * @caps: the #GstCaps describing the data format in this buffer -- * @offset: a media specific offset for the buffer data. -- * For video frames, this is the frame number of this buffer. -- * For audio samples, this is the offset of the first sample in this buffer. -- * For file data or compressed data this is the byte offset of the first -- * byte in this buffer. -- * @offset_end: the last offset contained in this buffer. It has the same -- * format as @offset. -- * @malloc_data: a pointer to the allocated memory associated with this buffer. -- * When the buffer is freed, this data will freed with @free_func. -- * @free_func: a custom function that will be called with @malloc_data, defaults -- * to g_free(). Since 0.10.22. -- * @parent: the parent buffer if this is a subbuffer. Since 0.10.26. -- * -- * The structure of a #GstBuffer. Use the associated macros to access the public -- * variables. -- type GstBuffer is record mini_object : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstminiobject_h.GstMiniObject; -- gst/gstbuffer.h:267 data : access GLIB.guint8; -- gst/gstbuffer.h:271 size : aliased GLIB.guint; -- gst/gstbuffer.h:272 timestamp : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/gstbuffer.h:275 duration : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/gstbuffer.h:276 caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/gstbuffer.h:279 offset : aliased GLIB.guint64; -- gst/gstbuffer.h:282 offset_end : aliased GLIB.guint64; -- gst/gstbuffer.h:283 malloc_data : access GLIB.guint8; -- gst/gstbuffer.h:285 free_func : GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GFreeFunc; -- gst/gstbuffer.h:288 parent : access GstBuffer; -- gst/gstbuffer.h:289 priv : System.Address; -- gst/gstbuffer.h:292 u_gst_reserved : u_GstBuffer_u_gst_reserved_array; -- gst/gstbuffer.h:293 end record; pragma Convention (C_Pass_By_Copy, GstBuffer); -- gst/gstbuffer.h:266 --< public > -- with COW -- pointer to data and its size -- timestamp -- the media type of this buffer -- media specific offset -- ABI Added --< private > type GstBufferClass is record mini_object_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstminiobject_h.GstMiniObjectClass; -- gst/gstbuffer.h:297 end record; pragma Convention (C_Pass_By_Copy, GstBufferClass); -- gst/gstbuffer.h:296 function gst_buffer_get_type return GLIB.GType; -- gst/gstbuffer.h:300 pragma Import (C, gst_buffer_get_type, "gst_buffer_get_type"); -- allocation function gst_buffer_new return access GstBuffer; -- gst/gstbuffer.h:303 pragma Import (C, gst_buffer_new, "gst_buffer_new"); function gst_buffer_new_and_alloc (size : GLIB.guint) return access GstBuffer; -- gst/gstbuffer.h:304 pragma Import (C, gst_buffer_new_and_alloc, "gst_buffer_new_and_alloc"); function gst_buffer_try_new_and_alloc (size : GLIB.guint) return access GstBuffer; -- gst/gstbuffer.h:305 pragma Import (C, gst_buffer_try_new_and_alloc, "gst_buffer_try_new_and_alloc"); --* -- * gst_buffer_set_data: -- * @buf: a #GstBuffer -- * @data: The data (a #guint8 *) to set on the buffer. -- * @size: The size (in bytes, as a #guint) of the data being set. -- * -- * A convenience function to set the data and size on a buffer. -- * This will replace any existing data pointer set on this buffer, but will -- * not change GST_BUFFER_MALLOCDATA(), if any. Callers should ensure that -- * GST_BUFFER_MALLOCDATA() is non-NULL, or should free that and set it to NULL. -- * -- * No checks are done on the data or size arguments passed. -- -- refcounting --* -- * gst_buffer_ref: -- * @buf: a #GstBuffer. -- * -- * Increases the refcount of the given buffer by one. -- * -- * Note that the refcount affects the writeability -- * of @buf and its metadata, see gst_buffer_is_writable() and -- * gst_buffer_is_metadata_writable(). It is -- * important to note that keeping additional references to -- * GstBuffer instances can potentially increase the number -- * of memcpy operations in a pipeline. -- * -- * Returns: (transfer full): @buf -- function gst_buffer_ref (buf : access GstBuffer) return access GstBuffer; -- gst/gstbuffer.h:347 pragma Import (C, gst_buffer_ref, "gst_buffer_ref"); --* -- * gst_buffer_unref: -- * @buf: (transfer full): a #GstBuffer. -- * -- * Decreases the refcount of the buffer. If the refcount reaches 0, the buffer -- * will be freed. If GST_BUFFER_MALLOCDATA() is non-NULL, this pointer will -- * also be freed at this time. -- procedure gst_buffer_unref (buf : access GstBuffer); -- gst/gstbuffer.h:365 pragma Import (C, gst_buffer_unref, "gst_buffer_unref"); -- copy buffer --* -- * gst_buffer_copy: -- * @buf: a #GstBuffer. -- * -- * Create a copy of the given buffer. This will also make a newly allocated -- * copy of the data the source buffer contains. -- * -- * Returns: (transfer full): a new copy of @buf. -- function gst_buffer_copy (buf : access constant GstBuffer) return access GstBuffer; -- gst/gstbuffer.h:385 pragma Import (C, gst_buffer_copy, "gst_buffer_copy"); --* -- * GstBufferCopyFlags: -- * @GST_BUFFER_COPY_FLAGS: flag indicating that buffer flags should be copied -- * @GST_BUFFER_COPY_TIMESTAMPS: flag indicating that buffer timestamp, duration, -- * offset and offset_end should be copied -- * @GST_BUFFER_COPY_CAPS: flag indicating that buffer caps should be copied -- * @GST_BUFFER_COPY_QDATA: flag indicating that buffer qdata should be copied -- * (Since 0.10.36) -- * -- * A set of flags that can be provided to the gst_buffer_copy_metadata() -- * function to specify which metadata fields should be copied. -- * -- * Since: 0.10.13 -- subtype GstBufferCopyFlags is unsigned; GST_BUFFER_COPY_FLAGS : constant GstBufferCopyFlags := 1; GST_BUFFER_COPY_TIMESTAMPS : constant GstBufferCopyFlags := 2; GST_BUFFER_COPY_CAPS : constant GstBufferCopyFlags := 4; GST_BUFFER_COPY_QDATA : constant GstBufferCopyFlags := 8; -- gst/gstbuffer.h:410 --* -- * GST_BUFFER_COPY_ALL: -- * -- * Combination of all possible fields that can be copied with -- * gst_buffer_copy_metadata(). -- * -- * Since: 0.10.13 -- -- copies metadata into newly allocated buffer procedure gst_buffer_copy_metadata (dest : access GstBuffer; src : access constant GstBuffer; flags : GstBufferCopyFlags); -- gst/gstbuffer.h:423 pragma Import (C, gst_buffer_copy_metadata, "gst_buffer_copy_metadata"); --* -- * gst_buffer_is_writable: -- * @buf: a #GstBuffer -- * -- * Tests if you can safely write data into a buffer's data array or validly -- * modify the caps and timestamp metadata. Metadata in a GstBuffer is always -- * writable, but it is only safe to change it when there is only one owner -- * of the buffer - ie, the refcount is 1. -- --* -- * gst_buffer_make_writable: -- * @buf: (transfer full): a #GstBuffer -- * -- * Makes a writable buffer from the given buffer. If the source buffer is -- * already writable, this will simply return the same buffer. A copy will -- * otherwise be made using gst_buffer_copy(). -- * -- * Returns: (transfer full): a writable buffer which may or may not be the -- * same as @buf -- -- Ensure that the metadata of the buffer is writable, even if the buffer data -- * isn't function gst_buffer_is_metadata_writable (buf : access GstBuffer) return GLIB.gboolean; -- gst/gstbuffer.h:451 pragma Import (C, gst_buffer_is_metadata_writable, "gst_buffer_is_metadata_writable"); function gst_buffer_make_metadata_writable (buf : access GstBuffer) return access GstBuffer; -- gst/gstbuffer.h:452 pragma Import (C, gst_buffer_make_metadata_writable, "gst_buffer_make_metadata_writable"); -- per-buffer user data procedure gst_buffer_set_qdata (buffer : access GstBuffer; quark : Glib.GQuark; data : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gststructure_h.GstStructure); -- gst/gstbuffer.h:456 pragma Import (C, gst_buffer_set_qdata, "gst_buffer_set_qdata"); function gst_buffer_get_qdata (buffer : access GstBuffer; quark : Glib.GQuark) return access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gststructure_h.GstStructure; -- gst/gstbuffer.h:460 pragma Import (C, gst_buffer_get_qdata, "gst_buffer_get_qdata"); --* -- * gst_buffer_replace: -- * @obuf: (inout) (transfer full): pointer to a pointer to a #GstBuffer to be -- * replaced. -- * @nbuf: (transfer none) (allow-none): pointer to a #GstBuffer that will -- * replace the buffer pointed to by @obuf. -- * -- * Modifies a pointer to a #GstBuffer to point to a different #GstBuffer. The -- * modification is done atomically (so this is useful for ensuring thread safety -- * in some cases), and the reference counts are updated appropriately (the old -- * buffer is unreffed, the new is reffed). -- * -- * Either @nbuf or the #GstBuffer pointed to by @obuf may be NULL. -- procedure gst_buffer_replace (obuf : System.Address; nbuf : access GstBuffer); -- gst/gstbuffer.h:484 pragma Import (C, gst_buffer_replace, "gst_buffer_replace"); function gst_buffer_get_caps (buffer : access GstBuffer) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/gstbuffer.h:489 pragma Import (C, gst_buffer_get_caps, "gst_buffer_get_caps"); procedure gst_buffer_set_caps (buffer : access GstBuffer; caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps); -- gst/gstbuffer.h:490 pragma Import (C, gst_buffer_set_caps, "gst_buffer_set_caps"); -- creating a subbuffer function gst_buffer_create_sub (parent : access GstBuffer; offset : GLIB.guint; size : GLIB.guint) return access GstBuffer; -- gst/gstbuffer.h:493 pragma Import (C, gst_buffer_create_sub, "gst_buffer_create_sub"); -- span, two buffers, intelligently function gst_buffer_is_span_fast (buf1 : access GstBuffer; buf2 : access GstBuffer) return GLIB.gboolean; -- gst/gstbuffer.h:496 pragma Import (C, gst_buffer_is_span_fast, "gst_buffer_is_span_fast"); function gst_buffer_span (buf1 : access GstBuffer; offset : GLIB.guint32; buf2 : access GstBuffer; len : GLIB.guint32) return access GstBuffer; -- gst/gstbuffer.h:497 pragma Import (C, gst_buffer_span, "gst_buffer_span"); --* -- * gst_value_set_buffer: -- * @v: a #GValue to receive the data -- * @b: (transfer none): a #GstBuffer to assign to the GstValue -- * -- * Sets @b as the value of @v. Caller retains reference to buffer. -- --* -- * gst_value_take_buffer: -- * @v: a #GValue to receive the data -- * @b: (transfer full): a #GstBuffer to assign to the GstValue -- * -- * Sets @b as the value of @v. Caller gives away reference to buffer. -- --* -- * gst_value_get_buffer: -- * @v: a #GValue to query -- * -- * Receives a #GstBuffer as the value of @v. Does not return a reference to -- * the buffer, so the pointer is only valid for as long as the caller owns -- * a reference to @v. -- * -- * Returns: (transfer none): buffer -- end GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h;
AdamSzerszen/Concurrency_v.2.0
Ada
157
ads
package Units is type TramNumber is new Integer range -1 .. 100; type SteeringNumber is new Integer range -1 .. 100; procedure Dummy; end Units;
reznikmm/matreshka
Ada
5,163
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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.Read_Self_Actions.Collections is pragma Preelaborate; package UML_Read_Self_Action_Collections is new AMF.Generic_Collections (UML_Read_Self_Action, UML_Read_Self_Action_Access); type Set_Of_UML_Read_Self_Action is new UML_Read_Self_Action_Collections.Set with null record; Empty_Set_Of_UML_Read_Self_Action : constant Set_Of_UML_Read_Self_Action; type Ordered_Set_Of_UML_Read_Self_Action is new UML_Read_Self_Action_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Read_Self_Action : constant Ordered_Set_Of_UML_Read_Self_Action; type Bag_Of_UML_Read_Self_Action is new UML_Read_Self_Action_Collections.Bag with null record; Empty_Bag_Of_UML_Read_Self_Action : constant Bag_Of_UML_Read_Self_Action; type Sequence_Of_UML_Read_Self_Action is new UML_Read_Self_Action_Collections.Sequence with null record; Empty_Sequence_Of_UML_Read_Self_Action : constant Sequence_Of_UML_Read_Self_Action; private Empty_Set_Of_UML_Read_Self_Action : constant Set_Of_UML_Read_Self_Action := (UML_Read_Self_Action_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Read_Self_Action : constant Ordered_Set_Of_UML_Read_Self_Action := (UML_Read_Self_Action_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Read_Self_Action : constant Bag_Of_UML_Read_Self_Action := (UML_Read_Self_Action_Collections.Bag with null record); Empty_Sequence_Of_UML_Read_Self_Action : constant Sequence_Of_UML_Read_Self_Action := (UML_Read_Self_Action_Collections.Sequence with null record); end AMF.UML.Read_Self_Actions.Collections;
reznikmm/matreshka
Ada
11,821
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- 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$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_0019 is pragma Preelaborate; Group_0019 : aliased constant Core_Second_Stage := (16#00# .. 16#1E# => -- 1900 .. 191E (Other_Letter, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False)), 16#1F# => -- 191F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#20# .. 16#22# => -- 1920 .. 1922 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#23# .. 16#26# => -- 1923 .. 1926 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#27# .. 16#28# => -- 1927 .. 1928 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#29# .. 16#2B# => -- 1929 .. 192B (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#2C# .. 16#2F# => -- 192C .. 192F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#30# .. 16#31# => -- 1930 .. 1931 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#32# => -- 1932 (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#33# .. 16#38# => -- 1933 .. 1938 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Combining_Mark, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#39# .. 16#3B# => -- 1939 .. 193B (Nonspacing_Mark, Neutral, Extend, Extend, Extend, Combining_Mark, (Diacritic | Case_Ignorable | Grapheme_Extend | ID_Continue | XID_Continue => True, others => False)), 16#3C# .. 16#3F# => -- 193C .. 193F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#40# => -- 1940 (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), 16#41# .. 16#43# => -- 1941 .. 1943 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#44# .. 16#45# => -- 1944 .. 1945 (Other_Punctuation, Neutral, Other, Other, S_Term, Exclamation, (STerm | Terminal_Punctuation | Grapheme_Base => True, others => False)), 16#46# .. 16#4F# => -- 1946 .. 194F (Decimal_Number, Neutral, Other, Numeric, Numeric, Numeric, (Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#6E# .. 16#6F# => -- 196E .. 196F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#75# .. 16#7F# => -- 1975 .. 197F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#AC# .. 16#AF# => -- 19AC .. 19AF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#B0# .. 16#B4# => -- 19B0 .. 19B4 (Spacing_Mark, Neutral, Other, Extend, Extend, Complex_Context, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#B5# .. 16#B7# => -- 19B5 .. 19B7 (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Complex_Context, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#B8# .. 16#B9# => -- 19B8 .. 19B9 (Spacing_Mark, Neutral, Other, Extend, Extend, Complex_Context, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#BA# => -- 19BA (Spacing_Mark, Neutral, Spacing_Mark, Extend, Extend, Complex_Context, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#BB# .. 16#C0# => -- 19BB .. 19C0 (Spacing_Mark, Neutral, Other, Extend, Extend, Complex_Context, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#C8# .. 16#C9# => -- 19C8 .. 19C9 (Spacing_Mark, Neutral, Other, Extend, Extend, Complex_Context, (Other_Alphabetic | Alphabetic | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#CA# .. 16#CF# => -- 19CA .. 19CF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#D0# .. 16#D9# => -- 19D0 .. 19D9 (Decimal_Number, Neutral, Other, Numeric, Numeric, Numeric, (Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#DA# => -- 19DA (Other_Number, Neutral, Other, Other, Other, Complex_Context, (Other_ID_Continue | Grapheme_Base | ID_Continue | XID_Continue => True, others => False)), 16#DB# .. 16#DD# => -- 19DB .. 19DD (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#DE# .. 16#DF# => -- 19DE .. 19DF (Other_Symbol, Neutral, Other, Other, Other, Complex_Context, (Grapheme_Base => True, others => False)), 16#E0# .. 16#FF# => -- 19E0 .. 19FF (Other_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base => True, others => False)), others => (Other_Letter, Neutral, Other, Other, O_Letter, Complex_Context, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_0019;
reznikmm/matreshka
Ada
4,786
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Testsuite Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- 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$ ------------------------------------------------------------------------------ package body Test_157_Handlers is ------------------ -- Error_String -- ------------------ overriding function Error_String (Self : Handler) return League.Strings.Universal_String is begin -- This subprogram must never be called because Start_Prefix_Mapping is -- called first and it raise exception. raise Program_Error; return League.Strings.Empty_Universal_String; end Error_String; ------------------- -- Start_Element -- ------------------- overriding procedure Start_Element (Self : in out Handler; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean) is begin -- This subprogram must never be called because Start_Prefix_Mapping is -- called first and it raise exception. raise Program_Error; end Start_Element; -------------------------- -- Start_Prefix_Mapping -- -------------------------- overriding procedure Start_Prefix_Mapping (Self : in out Handler; Prefix : League.Strings.Universal_String; Namespace_URI : League.Strings.Universal_String; Success : in out Boolean) is begin raise Expected_Error; end Start_Prefix_Mapping; end Test_157_Handlers;
tum-ei-rcs/StratoX
Ada
925
adb
package body simulation is procedure init is begin if not CSV_here.Open then Put_Line ("Simulation: Error opening file"); Simulation.Finished := True; return; else Put_Line ("Simulation: Replay from file"); have_data := True; CSV_here.Parse_Header; end if; end init; procedure update is begin if CSV_here.End_Of_File then Finished := True; Put_Line ("Simulation: EOF"); return; end if; if not CSV_here.Parse_Row then Simulation.Finished := True; Put_Line ("Simulation: Row error"); else CSV_here.Dump_Columns; declare t : float := CSV_here.Get_Column("time"); begin Put_Line ("t=" & t'Img); end; end if; end; procedure close is begin CSV_here.Close; end close; end simulation;
charlie5/lace
Ada
2,456
adb
with openGL.Visual, openGL.Palette, openGL.Font, openGL.Model.Text.lit_colored, openGL.Demo; procedure launch_render_Text -- -- Render updated text. -- is use openGL, openGL.Palette, openGL.Math, openGL.linear_Algebra_3d; the_font_Id : constant openGL.Font.font_Id := (to_Asset ("assets/opengl/font/LiberationMono-Regular.ttf"), 24); begin Demo.print_Usage ("Use space ' ' to cycle the text."); openGL.Demo.define ("openGL 'Render Text' Demo"); -- Setup the camera. -- Demo.Camera.Position_is ([3.0, 0.0, 10.0], y_Rotation_from (to_Radians (0.0))); Demo.Renderer.add_Font (the_font_Id); declare -- The model. -- the_Text_Model : constant Model.Text.lit_colored.view := Model.Text.lit_colored.new_Text (Text => "Howdy", Font => the_font_Id, Color => (Red, Opaque), Centered => False); -- The sprites. -- use openGL.Visual.Forge; the_Sprites : constant openGL.Visual.views := [1 => new_Visual (the_Text_Model.all'Access)]; Current : constant Integer := the_Sprites'First; begin -- Main loop. -- while not Demo.Done loop Demo.Dolly.evolve; Demo.Done := Demo.Dolly.quit_Requested; declare Command : Character; Avail : Boolean; begin Demo.Dolly.get_last_Character (Command, Avail); if Avail then case Command is when ' ' => if the_Text_Model.Text = "Howdy" then the_Text_Model.Text_is ("Doody"); else the_Text_Model.Text_is ("Howdy"); end if; when others => null; end case; end if; end; -- Render all sprites. -- Demo.Camera.render ([1 => the_Sprites (Current)]); while not Demo.Camera.cull_Completed loop delay Duration'Small; end loop; Demo.Renderer.render; Demo.FPS_Counter.increment; -- Frames per second display. end loop; end; Demo.destroy; end launch_render_Text;
godunko/adawebui
Ada
11,652
adb
with Ada.Numerics.Generic_Elementary_Functions; -- with System.IO; with Web.HTML.Canvases; with Web.Strings; with Web.UI.Events.Mouse.Click; with Web.UI.GL_Widgets; with Web.Window; with OpenGL; with Cube_Programs; package body Cube_Demo is use type OpenGL.GLfloat; function "+" (Item : Wide_Wide_String) return Web.Strings.Web_String renames Web.Strings.To_Web_String; package GLfloat_Elementary_Functions is new Ada.Numerics.Generic_Elementary_Functions (OpenGL.GLfloat); procedure Initialize_Demo; type My_GL_Widget is new Web.UI.GL_Widgets.Abstract_GL_Widget with record Vertex_Buffer : Cube_Programs.Vertex_Data_Buffers.OpenGL_Buffer (OpenGL.Vertex); Index_Buffer : Cube_Programs.Index_Data_Buffers.OpenGL_Buffer (OpenGL.Index); Program : Cube_Programs.Cube_Program; end record; type My_GL_Widget_Access is access all My_GL_Widget'Class; overriding procedure Initialize_GL (Self : in out My_GL_Widget); overriding procedure Paint_GL (Self : in out My_GL_Widget); overriding procedure Resize_GL (Self : in out My_GL_Widget; Width : Integer; Height : Integer); overriding procedure Context_Lost (Self : in out My_GL_Widget); -- overriding procedure Click_Event -- (Self : in out My_GL_Widget; -- Event : in out Web.UI.Events.Mouse.Click.Click_Event'Class); procedure Initialize (Self : in out My_GL_Widget'Class); Points : constant Cube_Programs.Vertex_Data_Array := ((Vertex_Position => (-1.0, -1.0, -1.0), Vertex_Color => (5.0, 3.0, 7.0)), (Vertex_Position => ( 1.0, -1.0, -1.0), Vertex_Color => (5.0, 3.0, 7.0)), (Vertex_Position => ( 1.0, 1.0, -1.0), Vertex_Color => (5.0, 3.0, 7.0)), (Vertex_Position => (-1.0, 1.0, -1.0), Vertex_Color => (5.0, 3.0, 7.0)), (Vertex_Position => (-1.0, -1.0, 1.0), Vertex_Color => (1.0, 1.0, 3.0)), (Vertex_Position => ( 1.0, -1.0, 1.0), Vertex_Color => (1.0, 1.0, 3.0)), (Vertex_Position => ( 1.0, 1.0, 1.0), Vertex_Color => (1.0, 1.0, 3.0)), (Vertex_Position => (-1.0, 1.0, 1.0), Vertex_Color => (1.0, 1.0, 3.0)), (Vertex_Position => (-1.0, -1.0, -1.0), Vertex_Color => (0.0, 0.0, 1.0)), (Vertex_Position => (-1.0, 1.0, -1.0), Vertex_Color => (0.0, 0.0, 1.0)), (Vertex_Position => (-1.0, 1.0, 1.0), Vertex_Color => (0.0, 0.0, 1.0)), (Vertex_Position => (-1.0, -1.0, 1.0), Vertex_Color => (0.0, 0.0, 1.0)), (Vertex_Position => ( 1.0, -1.0, -1.0), Vertex_Color => (1.0, 0.0, 0.0)), (Vertex_Position => ( 1.0, 1.0, -1.0), Vertex_Color => (1.0, 0.0, 0.0)), (Vertex_Position => ( 1.0, 1.0, 1.0), Vertex_Color => (1.0, 0.0, 0.0)), (Vertex_Position => ( 1.0, -1.0, 1.0), Vertex_Color => (1.0, 0.0, 0.0)), (Vertex_Position => (-1.0, -1.0, -1.0), Vertex_Color => (1.0, 1.0, 0.0)), (Vertex_Position => (-1.0, -1.0, 1.0), Vertex_Color => (1.0, 1.0, 0.0)), (Vertex_Position => ( 1.0, -1.0, 1.0), Vertex_Color => (1.0, 1.0, 0.0)), (Vertex_Position => ( 1.0, -1.0, -1.0), Vertex_Color => (1.0, 1.0, 0.0)), (Vertex_Position => (-1.0, 1.0, -1.0), Vertex_Color => (0.0, 1.0, 0.0)), (Vertex_Position => (-1.0, 1.0, 1.0), Vertex_Color => (0.0, 1.0, 0.0)), (Vertex_Position => ( 1.0, 1.0, 1.0), Vertex_Color => (0.0, 1.0, 0.0)), (Vertex_Position => ( 1.0, 1.0, -1.0), Vertex_Color => (0.0, 1.0, 0.0))); Indicies : constant Cube_Programs.Index_Data_Array := ( 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, 8, 9, 10, 8, 10, 11, 12, 13, 14, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 22, 20, 22, 23); function Projection (Angle : OpenGL.GLfloat; Aspect : OpenGL.GLfloat; Z_Min : OpenGL.GLfloat; Z_Max : OpenGL.GLfloat) return OpenGL.GLfloat_Matrix_4x4; ---------------- -- Projection -- ---------------- function Projection (Angle : OpenGL.GLfloat; Aspect : OpenGL.GLfloat; Z_Min : OpenGL.GLfloat; Z_Max : OpenGL.GLfloat) return OpenGL.GLfloat_Matrix_4x4 is Ang : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Tan ((Angle * 0.5) * Ada.Numerics.PI / 180.0); begin return ((0.5 / Ang, 0.0, 0.0, 0.0), (0.0, 0.5 * Aspect / Ang, 0.0, 0.0), (0.0, 0.0, -(Z_Max + Z_Min) / (Z_Max - Z_Min), (-2.0 * Z_Max * Z_Min) / (Z_Max - Z_Min)), (0.0, 0.0, -1.0, 0.0)); end Projection; procedure Rotate_X (M : in out OpenGL.GLfloat_Matrix_4x4; Angle : OpenGL.GLfloat); procedure Rotate_Y (M : in out OpenGL.GLfloat_Matrix_4x4; Angle : OpenGL.GLfloat); procedure Rotate_Z (M : in out OpenGL.GLfloat_Matrix_4x4; Angle : OpenGL.GLfloat); -------------- -- Rotate_X -- -------------- procedure Rotate_X (M : in out OpenGL.GLfloat_Matrix_4x4; Angle : OpenGL.GLfloat) is -- 0 4 8 12 -- 1 5 9 13 -- 2 6 10 14 -- 3 7 11 15 C : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Cos (Angle); S : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Sin (Angle); M21 : constant OpenGL.GLfloat := M (2, 1); M22 : constant OpenGL.GLfloat := M (2, 2); M23 : constant OpenGL.GLfloat := M (2, 3); -- var mv1 = m[1], mv5 = m[5], mv9 = m[9]; begin M (2, 1) := C * M (2, 1) - S * M (3, 1); -- m[1] = m[1]*c-m[2]*s; M (2, 2) := C * M (2, 2) - S * M (3, 2); -- m[5] = m[5]*c-m[6]*s; M (2, 3) := C * M (2, 3) - S * M (3, 3); -- m[9] = m[9]*c-m[10]*s; M (3, 1) := C * M (3, 1) + S * M21; -- m[2] = m[2]*c+mv1*s; M (3, 2) := C * M (3, 2) + S * M22; -- m[6] = m[6]*c+mv5*s; M (3, 3) := C * M (3, 3) + S * M23; -- m[10] = m[10]*c+mv9*s; end Rotate_X; -------------- -- Rotate_Y -- -------------- procedure Rotate_Y (M : in out OpenGL.GLfloat_Matrix_4x4; Angle : OpenGL.GLfloat) is -- 0 4 8 12 -- 1 5 9 13 -- 2 6 10 14 -- 3 7 11 15 C : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Cos (Angle); S : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Sin (Angle); M11 : constant OpenGL.GLfloat := M (1, 1); M12 : constant OpenGL.GLfloat := M (1, 2); M13 : constant OpenGL.GLfloat := M (1, 3); -- var mv0 = m[0], mv4 = m[4], mv8 = m[8]; begin M (1, 1) := C * M (1, 1) + S * M (3, 1); -- m[0] = c*m[0]+s*m[2]; M (1, 2) := C * M (1, 2) + S * M (3, 2); -- m[4] = c*m[4]+s*m[6]; M (1, 3) := C * M (1, 3) + S * M (3, 3); -- m[8] = c*m[8]+s*m[10]; M (3, 1) := C * M (3, 1) - S * M11; -- m[2] = c*m[2]-s*mv0; M (3, 2) := C * M (3, 2) - S * M12; -- m[6] = c*m[6]-s*mv4; M (3, 3) := C * M (3, 3) - S * M13; -- m[10] = c*m[10]-s*mv8; end Rotate_Y; -------------- -- Rotate_Z -- -------------- procedure Rotate_Z (M : in out OpenGL.GLfloat_Matrix_4x4; Angle : OpenGL.GLfloat) is -- 0 4 8 12 -- 1 5 9 13 -- 2 6 10 14 -- 3 7 11 15 C : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Cos (Angle); S : constant OpenGL.GLfloat := GLfloat_Elementary_Functions.Sin (Angle); M11 : constant OpenGL.GLfloat := M (1, 1); M12 : constant OpenGL.GLfloat := M (1, 2); M13 : constant OpenGL.GLfloat := M (1, 3); -- var mv0 = m[0], mv4 = m[4], mv8 = m[8]; begin M (1, 1) := C * M (1, 1) - S * M (2, 1); -- m[0] = c*m[0]-s*m[1]; M (1, 2) := C * M (1, 2) - S * M (2, 2); -- m[4] = c*m[4]-s*m[5]; M (1, 3) := C * M (1, 3) - S * M (2, 3); -- m[8] = c*m[8]-s*m[9]; M (2, 1) := C * M (2, 1) + S * M11; -- m[1]=c*m[1]+s*mv0; M (2, 2) := C * M (2, 2) + S * M12; -- m[5]=c*m[5]+s*mv4; M (2, 3) := C * M (2, 3) + S * M13; -- m[9]=c*m[9]+s*mv8; end Rotate_Z; Projection_Matrix : OpenGL.GLfloat_Matrix_4x4; Model_View_Matrix : constant OpenGL.GLfloat_Matrix_4x4 := ((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, -6.0), (0.0, 0.0, 0.0, 1.0)); Model_Move_Matrix : OpenGL.GLfloat_Matrix_4x4 := ((1.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0)); W : My_GL_Widget_Access; -- T : OpenGL.GLfloat := 0.0; -- ----------------- -- -- Click_Event -- -- ----------------- -- -- overriding procedure Click_Event -- (Self : in out My_GL_Widget; -- Event : in out Web.UI.Events.Mouse.Click.Click_Event'Class) -- is -- begin -- System.IO.Put_Line ("Clicked!"); -- end Click_Event; ------------------ -- Context_Lost -- ------------------ overriding procedure Context_Lost (Self : in out My_GL_Widget) is begin raise Program_Error; end Context_Lost; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out My_GL_Widget'Class) is Canvas : Web.HTML.Canvases.HTML_Canvas_Element := Web.Window.Document.Get_Element_By_Id (+"cube_gl_canvas").As_HTML_Canvas; begin Web.UI.GL_Widgets.Constructors.Initialize (Self, Canvas); end Initialize; --------------------- -- Initialize_Demo -- --------------------- procedure Initialize_Demo is begin W := new My_GL_Widget; Initialize (W.all); end Initialize_Demo; ------------------- -- Initialize_GL -- ------------------- overriding procedure Initialize_GL (Self : in out My_GL_Widget) is begin Self.Vertex_Buffer.Create; Self.Vertex_Buffer.Bind; Self.Vertex_Buffer.Allocate (Points); Self.Index_Buffer.Create; Self.Index_Buffer.Bind; Self.Index_Buffer.Allocate (Indicies); Self.Program.Initialize; end Initialize_GL; -------------- -- Paint_GL -- -------------- overriding procedure Paint_GL (Self : in out My_GL_Widget) is use type OpenGL.GLbitfield; DT : OpenGL.GLfloat := 1.0 / 60.0 * 1_000.0; begin Rotate_Z (Model_Move_Matrix, DT * 0.005); Rotate_Y (Model_Move_Matrix, DT * 0.002); Rotate_X (Model_Move_Matrix, DT * 0.003); Self.Program.Bind; Self.Program.Set_Projection_Matrix (Projection_Matrix); Self.Program.Set_Model_View_Matrix (Model_View_Matrix); Self.Program.Set_Model_Move_Matrix (Model_Move_Matrix); Self.Program.Set_Vertex_Data_Buffer (Self.Vertex_Buffer); Self.Functions.Enable (OpenGL.GL_DEPTH_TEST); Self.Functions.Depth_Func (OpenGL.GL_LEQUAL); Self.Functions.Clear_Color (0.5, 0.5, 0.5, 0.9); Self.Functions.Clear_Depth (1.0); Self.Functions.Clear (OpenGL.GL_COLOR_BUFFER_BIT + OpenGL.GL_DEPTH_BUFFER_BIT); Self.Vertex_Buffer.Bind; Self.Index_Buffer.Bind; Self.Functions.Draw_Elements (OpenGL.GL_TRIANGLES, Indicies'Length, OpenGL.GL_UNSIGNED_SHORT, 0); Self.Update; end Paint_GL; --------------- -- Resize_GL -- --------------- overriding procedure Resize_GL (Self : in out My_GL_Widget; Width : Integer; Height : Integer) is begin Projection_Matrix := Projection (40.0, OpenGL.GLfloat (Width) / OpenGL.GLfloat (Height), 1.0, 100.0); end Resize_GL; begin Initialize_Demo; end Cube_Demo;
reznikmm/matreshka
Ada
5,526
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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.UMLDI.UML_Compartmentable_Shapes.Collections is pragma Preelaborate; package UMLDI_UML_Compartmentable_Shape_Collections is new AMF.Generic_Collections (UMLDI_UML_Compartmentable_Shape, UMLDI_UML_Compartmentable_Shape_Access); type Set_Of_UMLDI_UML_Compartmentable_Shape is new UMLDI_UML_Compartmentable_Shape_Collections.Set with null record; Empty_Set_Of_UMLDI_UML_Compartmentable_Shape : constant Set_Of_UMLDI_UML_Compartmentable_Shape; type Ordered_Set_Of_UMLDI_UML_Compartmentable_Shape is new UMLDI_UML_Compartmentable_Shape_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UMLDI_UML_Compartmentable_Shape : constant Ordered_Set_Of_UMLDI_UML_Compartmentable_Shape; type Bag_Of_UMLDI_UML_Compartmentable_Shape is new UMLDI_UML_Compartmentable_Shape_Collections.Bag with null record; Empty_Bag_Of_UMLDI_UML_Compartmentable_Shape : constant Bag_Of_UMLDI_UML_Compartmentable_Shape; type Sequence_Of_UMLDI_UML_Compartmentable_Shape is new UMLDI_UML_Compartmentable_Shape_Collections.Sequence with null record; Empty_Sequence_Of_UMLDI_UML_Compartmentable_Shape : constant Sequence_Of_UMLDI_UML_Compartmentable_Shape; private Empty_Set_Of_UMLDI_UML_Compartmentable_Shape : constant Set_Of_UMLDI_UML_Compartmentable_Shape := (UMLDI_UML_Compartmentable_Shape_Collections.Set with null record); Empty_Ordered_Set_Of_UMLDI_UML_Compartmentable_Shape : constant Ordered_Set_Of_UMLDI_UML_Compartmentable_Shape := (UMLDI_UML_Compartmentable_Shape_Collections.Ordered_Set with null record); Empty_Bag_Of_UMLDI_UML_Compartmentable_Shape : constant Bag_Of_UMLDI_UML_Compartmentable_Shape := (UMLDI_UML_Compartmentable_Shape_Collections.Bag with null record); Empty_Sequence_Of_UMLDI_UML_Compartmentable_Shape : constant Sequence_Of_UMLDI_UML_Compartmentable_Shape := (UMLDI_UML_Compartmentable_Shape_Collections.Sequence with null record); end AMF.UMLDI.UML_Compartmentable_Shapes.Collections;
reznikmm/matreshka
Ada
4,568
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Xlink.Href_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Xlink_Href_Attribute_Node is begin return Self : Xlink_Href_Attribute_Node do Matreshka.ODF_Xlink.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Xlink_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Xlink_Href_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Href_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Xlink_URI, Matreshka.ODF_String_Constants.Href_Attribute, Xlink_Href_Attribute_Node'Tag); end Matreshka.ODF_Xlink.Href_Attributes;
zhmu/ananas
Ada
382
adb
-- { dg-do run } procedure self_aggregate_with_zeros is type Sensor is record Value : Natural; A, B, C, D, E, F, G, H, I, J, K, L, M : Natural; end record; Pressure : Sensor; begin Pressure.Value := 256; Pressure := (Pressure.Value, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if Pressure.Value /= 256 then raise Program_Error; end if; end;
AdaCore/gpr
Ada
2,339
adb
-- Copyright (C) 2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with Ada.Text_IO; use Ada.Text_IO; with GPR2.Context; with GPR2.Path_Name; with GPR2.Project.Tree; procedure test is Imported_Begin : constant String := "project imported is for Source_Dirs use ("""; Imported_End : constant String := """); end imported;"; Extended_Begin : constant String := "project extended is for Source_Dirs use ("""; Extended_End : constant String := """); end extended;"; Extending_Begin : constant String := "with ""imported""; project extending extends ""extended"" is for Source_Dirs use ("""; Extending_End : constant String := """); end extending;"; Imported : constant GPR2.Path_Name.Object := GPR2.Path_Name.Create_File ("imported.gpr"); Extended : constant GPR2.Path_Name.Object := GPR2.Path_Name.Create_File ("extended.gpr"); Extending : constant GPR2.Path_Name.Object := GPR2.Path_Name.Create_File ("extending.gpr"); procedure Write (Path : GPR2.Path_Name.Object; Before : String; Middle : String; After : String) is File : File_Type; begin Create (File => File, Name => Path.Value); Put_Line (File, Before & Middle & After); Close (File); end Write; Tree : GPR2.Project.Tree.Object; procedure Print_Source_Dirs (Header : String) is begin Put_Line (Header); Put_Line (String (Tree.Root_Project.Source_Directories.First_Element.Simple_Name)); Put_Line (String (Tree.Root_Project.Imports.First_Element.Source_Directories.First_Element.Simple_Name)); Put_Line (String (Tree.Root_Project.Extended_Root.Source_Directories.First_Element.Simple_Name)); end Print_Source_Dirs; begin Write (Imported, Imported_Begin, "imported_1", Imported_End); Write (Extended, Extended_Begin, "extended_1", Extended_End); Write (Extending, Extending_Begin, "extending_1", Extending_End); Tree.Load_Autoconf (Extending, GPR2.Context.Empty); Print_Source_Dirs ("Expecting source dirs ended by 1"); Write (Imported, Imported_Begin, "imported_2", Imported_End); Write (Extended, Extended_Begin, "extended_2", Extended_End); Write (Extending, Extending_Begin, "extending_2", Extending_End); Tree.Load_Autoconf (Extending, GPR2.Context.Empty); Print_Source_Dirs ("Expecting source dirs ended by 2"); end test;
jhumphry/PRNG_Zoo
Ada
1,340
ads
-- -- PRNG Zoo -- Copyright (c) 2014 - 2015, James Humphry -- -- Permission to use, copy, modify, and/or 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 AUnit; use AUnit; with AUnit.Test_Cases; use AUnit.Test_Cases; package PRNGTests_Suite.Stats is type Stats_Test is new Test_Cases.Test_Case with null record; procedure Register_Tests (T: in out Stats_Test); function Name (T : Stats_Test) return Test_String; procedure Set_Up (T : in out Stats_Test); procedure Check_Z_Score (T : in out Test_Cases.Test_Case'Class); procedure Check_Chi2 (T : in out Test_Cases.Test_Case'Class); procedure Check_Erf (T : in out Test_Cases.Test_Case'Class); end PRNGTests_Suite.Stats;
zhmu/ananas
Ada
1,224
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S H O R T _ I N T E G E R _ W I D E _ T E X T _ I O -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Text_IO; package Ada.Short_Integer_Wide_Text_IO is new Ada.Wide_Text_IO.Integer_IO (Short_Integer);
zhmu/ananas
Ada
633
adb
-- { dg-do run } -- { dg-options "-gnatws" } with Misaligned_Param_Pkg; procedure Misaligned_Param is procedure Channel_Eth (Status : out Integer; Kind : out Integer); pragma Import (External, Channel_Eth); pragma Import_Valued_Procedure (Channel_Eth, "channel_eth", (Integer, Integer), (VALUE, REFERENCE)); type Channel is record B : Boolean; Kind : Integer; end record; pragma Pack (Channel); MyChan : Channel; Status : Integer; begin MyChan.Kind := 0; Channel_Eth (Status => Status, Kind => MyChan.Kind); if Mychan.Kind = 0 then raise Program_Error; end if; end;
pchapin/augusta
Ada
219
adb
-- A silly program to just exercise some computations. -- procedure Hello is X : Integer; Y : Integer := 5; begin X := X + X*Y - 42; Y := X/3 + 1; X := Y/(3 + 1); Y := X - 2#1111_1111#; X := Y * 1E2; end;
gitter-badger/libAnne
Ada
40
ads
package Colors with Pure is end Colors;
reznikmm/matreshka
Ada
3,739
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- 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 XML.DOM.Attributes; package ODF.DOM.Chart_Interval_Major_Attributes is pragma Preelaborate; type ODF_Chart_Interval_Major_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Chart_Interval_Major_Attribute_Access is access all ODF_Chart_Interval_Major_Attribute'Class with Storage_Size => 0; end ODF.DOM.Chart_Interval_Major_Attributes;
mitchelhaan/ncurses
Ada
3,595
ads
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Text_IO.Aux -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 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: Juergen Pfeifer <[email protected]> 1996 -- Version Control: -- $Revision: 1.8 $ -- Binding Version 00.93 ------------------------------------------------------------------------------ private package Terminal_Interface.Curses.Text_IO.Aux is -- pragma Preelaborate (Aux); -- This routine is called from the Text_IO output routines for numeric -- and enumeration types. -- procedure Put_Buf (Win : in Window; -- The output window Buf : in String; -- The buffer containing the text Width : in Field; -- The width of the output field Signal : in Boolean := True; -- If true, we raise Layout_Error Ljust : in Boolean := False); -- The Buf is left justified end Terminal_Interface.Curses.Text_IO.Aux;
guillaume-lin/tsc
Ada
3,860
ads
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Menus.Menu_User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 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: Juergen Pfeifer, 1996 -- Version Control: -- $Revision: 1.14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access User; package Terminal_Interface.Curses.Menus.Menu_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data); -- |===================================================================== -- | Man page menu_userptr.3x -- |===================================================================== -- | procedure Set_User_Data (Men : in Menu; Data : in User_Access); -- AKA: set_menu_userptr pragma Inline (Set_User_Data); -- | procedure Get_User_Data (Men : in Menu; Data : out User_Access); -- AKA: menu_userptr -- | function Get_User_Data (Men : in Menu) return User_Access; -- AKA: menu_userptr -- Same as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Menus.Menu_User_Data;
reznikmm/matreshka
Ada
3,618
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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.Elements.Generic_Hash; function AMF.CMOF.Package_Merges.Hash is new AMF.Elements.Generic_Hash (CMOF_Package_Merge, CMOF_Package_Merge_Access);
AdaCore/Ada_Drivers_Library
Ada
2,674
ads
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-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 HAL; with ADL_Config; package Filesystem is Max_Path_Length : constant := ADL_Config.Max_Path_Length; -- Maximum size of a path name length subtype Block_Number is HAL.UInt64; -- To account GUID partitions, and large disks, we need a 64-bit -- representation end Filesystem;
reznikmm/matreshka
Ada
18,583
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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_Named_Elements; with AMF.String_Collections; with AMF.UML.Activities; with AMF.UML.Activity_Edges.Collections; with AMF.UML.Activity_Groups.Collections; with AMF.UML.Activity_Nodes.Collections; with AMF.UML.Activity_Partitions.Collections; with AMF.UML.Classifiers.Collections; with AMF.UML.Constraints.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Exception_Handlers.Collections; with AMF.UML.Input_Pins.Collections; with AMF.UML.Interruptible_Activity_Regions.Collections; with AMF.UML.Named_Elements; with AMF.UML.Namespaces; with AMF.UML.Opaque_Actions; with AMF.UML.Output_Pins.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Redefinable_Elements.Collections; with AMF.UML.String_Expressions; with AMF.UML.Structured_Activity_Nodes; with AMF.Visitors; package AMF.Internals.UML_Opaque_Actions is type UML_Opaque_Action_Proxy is limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy and AMF.UML.Opaque_Actions.UML_Opaque_Action with null record; overriding function Get_Body (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.String_Collections.Sequence_Of_String; -- Getter of OpaqueAction::body. -- -- Specifies the action in one or more languages. overriding function Get_Input_Value (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Input_Pins.Collections.Set_Of_UML_Input_Pin; -- Getter of OpaqueAction::inputValue. -- -- Provides input to the action. overriding function Get_Language (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.String_Collections.Ordered_Set_Of_String; -- Getter of OpaqueAction::language. -- -- Languages the body strings use, in the same order as the body strings overriding function Get_Output_Value (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Output_Pins.Collections.Set_Of_UML_Output_Pin; -- Getter of OpaqueAction::outputValue. -- -- Takes output from the action. overriding function Get_Context (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Getter of Action::context. -- -- The classifier that owns the behavior of which this action is a part. overriding function Get_Input (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin; -- Getter of Action::input. -- -- The ordered set of input pins connected to the Action. These are among -- the total set of inputs. overriding function Get_Is_Locally_Reentrant (Self : not null access constant UML_Opaque_Action_Proxy) return Boolean; -- Getter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding procedure Set_Is_Locally_Reentrant (Self : not null access UML_Opaque_Action_Proxy; To : Boolean); -- Setter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding function Get_Local_Postcondition (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPostcondition. -- -- Constraint that must be satisfied when executed is completed. overriding function Get_Local_Precondition (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPrecondition. -- -- Constraint that must be satisfied when execution is started. overriding function Get_Output (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin; -- Getter of Action::output. -- -- The ordered set of output pins connected to the Action. The action -- places its results onto pins in this set. overriding function Get_Handler (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler; -- Getter of ExecutableNode::handler. -- -- A set of exception handlers that are examined if an uncaught exception -- propagates to the outer level of the executable node. overriding function Get_Activity (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Activities.UML_Activity_Access; -- Getter of ActivityNode::activity. -- -- Activity containing the node. overriding procedure Set_Activity (Self : not null access UML_Opaque_Action_Proxy; To : AMF.UML.Activities.UML_Activity_Access); -- Setter of ActivityNode::activity. -- -- Activity containing the node. overriding function Get_In_Group (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group; -- Getter of ActivityNode::inGroup. -- -- Groups containing the node. overriding function Get_In_Interruptible_Region (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region; -- Getter of ActivityNode::inInterruptibleRegion. -- -- Interruptible regions containing the node. overriding function Get_In_Partition (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition; -- Getter of ActivityNode::inPartition. -- -- Partitions containing the node. overriding function Get_In_Structured_Node (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access; -- Getter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding procedure Set_In_Structured_Node (Self : not null access UML_Opaque_Action_Proxy; To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access); -- Setter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding function Get_Incoming (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::incoming. -- -- Edges that have the node as target. overriding function Get_Outgoing (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::outgoing. -- -- Edges that have the node as source. overriding function Get_Redefined_Node (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node; -- Getter of ActivityNode::redefinedNode. -- -- Inherited nodes replaced by this node in a specialization of the -- activity. overriding function Get_Is_Leaf (Self : not null access constant UML_Opaque_Action_Proxy) return Boolean; -- Getter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding procedure Set_Is_Leaf (Self : not null access UML_Opaque_Action_Proxy; To : Boolean); -- Setter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding function Get_Redefined_Element (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element; -- Getter of RedefinableElement::redefinedElement. -- -- The redefinable element that is being redefined by this element. overriding function Get_Redefinition_Context (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of RedefinableElement::redefinitionContext. -- -- References the contexts that this element may be redefined from. overriding function Get_Client_Dependency (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Opaque_Action_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Context (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Operation Action::context. -- -- Missing derivation for Action::/context : Classifier overriding function Is_Consistent_With (Self : not null access constant UML_Opaque_Action_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two RedefinableElements -- in a context in which redefinition is possible, whether redefinition -- would be logically consistent. By default, this is false; this -- operation must be overridden for subclasses of RedefinableElement to -- define the consistency conditions. overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Opaque_Action_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isRedefinitionContextValid. -- -- The query isRedefinitionContextValid() specifies whether the -- redefinition contexts of this RedefinableElement are properly related -- to the redefinition contexts of the specified RedefinableElement to -- allow this element to redefine the other. By default at least one of -- the redefinition contexts of this element must be a specialization of -- at least one of the redefinition contexts of the specified element. overriding function All_Owning_Packages (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Opaque_Action_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Opaque_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding procedure Enter_Element (Self : not null access constant UML_Opaque_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Opaque_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Opaque_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Opaque_Actions;
optikos/oasis
Ada
1,590
ads
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Formal_Type_Definitions; with Program.Lexical_Elements; package Program.Elements.Formal_Ordinary_Fixed_Point_Definitions is pragma Pure (Program.Elements.Formal_Ordinary_Fixed_Point_Definitions); type Formal_Ordinary_Fixed_Point_Definition is limited interface and Program.Elements.Formal_Type_Definitions.Formal_Type_Definition; type Formal_Ordinary_Fixed_Point_Definition_Access is access all Formal_Ordinary_Fixed_Point_Definition'Class with Storage_Size => 0; type Formal_Ordinary_Fixed_Point_Definition_Text is limited interface; type Formal_Ordinary_Fixed_Point_Definition_Text_Access is access all Formal_Ordinary_Fixed_Point_Definition_Text'Class with Storage_Size => 0; not overriding function To_Formal_Ordinary_Fixed_Point_Definition_Text (Self : aliased in out Formal_Ordinary_Fixed_Point_Definition) return Formal_Ordinary_Fixed_Point_Definition_Text_Access is abstract; not overriding function Delta_Token (Self : Formal_Ordinary_Fixed_Point_Definition_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Box_Token (Self : Formal_Ordinary_Fixed_Point_Definition_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Formal_Ordinary_Fixed_Point_Definitions;
reznikmm/matreshka
Ada
4,497
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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 value pin is an input pin that provides a value by evaluating a value -- specification. ------------------------------------------------------------------------------ with AMF.UML.Input_Pins; limited with AMF.UML.Value_Specifications; package AMF.UML.Value_Pins is pragma Preelaborate; type UML_Value_Pin is limited interface and AMF.UML.Input_Pins.UML_Input_Pin; type UML_Value_Pin_Access is access all UML_Value_Pin'Class; for UML_Value_Pin_Access'Storage_Size use 0; not overriding function Get_Value (Self : not null access constant UML_Value_Pin) return AMF.UML.Value_Specifications.UML_Value_Specification_Access is abstract; -- Getter of ValuePin::value. -- -- Value that the pin will provide. not overriding procedure Set_Value (Self : not null access UML_Value_Pin; To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is abstract; -- Setter of ValuePin::value. -- -- Value that the pin will provide. end AMF.UML.Value_Pins;
tum-ei-rcs/StratoX
Ada
1,513
ads
-- Project: StratoX -- System: Stratosphere Balloon Flight Controller -- Author: Martin Becker ([email protected]) with FAT_Filesystem.Directories.Files; with Interfaces; use Interfaces; -- @summary top-level package for reading/writing logfiles to SD card package SDLog with SPARK_Mode, Abstract_State => State, Initializes => State is subtype SDLog_Data is FAT_Filesystem.Directories.Files.File_Data; procedure Init with Post => Is_Open = False; -- initialize the SD log procedure Close with Post => Is_Open = False; -- closes the SD log procedure Start_Logfile (dirname : String; filename : String; ret : out Boolean); -- @summary create new logfile procedure Write_Log (Data : SDLog_Data; n_written : out Integer) with Pre => Is_Open; -- @summary write bytes to logfile procedure Write_Log (S : String; n_written : out Integer) with Pre => Is_Open; -- convenience function for Write_Log (File_Data) procedure Flush_Log; -- @summary force writing logfile to disk. -- Not recommended when time is critical! function Logsize return Unsigned_32; -- return log size in bytes function Is_Open return Boolean; -- return true if logfile is opened function To_File_Data (S : String) return SDLog_Data; private log_open : Boolean := False with Part_Of => State; SD_Initialized : Boolean := False with Part_Of => State; Error_State : Boolean := False with Part_Of => State; end SDLog;
AdaCore/langkit
Ada
591
adb
with Ada.Exceptions; use Ada.Exceptions; with Ada.Text_IO; use Ada.Text_IO; with Langkit_Support.Adalog.Main_Support; use Langkit_Support.Adalog.Main_Support; -- Test that an atomic boolean rel solves correctly procedure Main is use T_Solver; use Refs; use Solver_Ifc; X : constant Refs.Logic_Var := Create ("X"); function Is_Even (V : Integer) return Boolean is (V mod 2 = 0); R : constant Relation := (Predicate (X, Predicate(Is_Even'Access, "Is_Even"))); begin Solve_All (R); exception when E : others => Put_Line (Exception_Message (E)); end Main;
reznikmm/matreshka
Ada
20,149
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- 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_Named_Elements; with AMF.UML.Activities; with AMF.UML.Activity_Edges.Collections; with AMF.UML.Activity_Groups.Collections; with AMF.UML.Activity_Nodes.Collections; with AMF.UML.Activity_Partitions.Collections; with AMF.UML.Classifiers.Collections; with AMF.UML.Clear_Structural_Feature_Actions; with AMF.UML.Constraints.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Exception_Handlers.Collections; with AMF.UML.Input_Pins.Collections; with AMF.UML.Interruptible_Activity_Regions.Collections; with AMF.UML.Named_Elements; with AMF.UML.Namespaces; with AMF.UML.Output_Pins.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Redefinable_Elements.Collections; with AMF.UML.String_Expressions; with AMF.UML.Structural_Features; with AMF.UML.Structured_Activity_Nodes; with AMF.Visitors; package AMF.Internals.UML_Clear_Structural_Feature_Actions is type UML_Clear_Structural_Feature_Action_Proxy is limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy and AMF.UML.Clear_Structural_Feature_Actions.UML_Clear_Structural_Feature_Action with null record; overriding function Get_Result (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Output_Pins.UML_Output_Pin_Access; -- Getter of ClearStructuralFeatureAction::result. -- -- Gives the output pin on which the result is put. overriding procedure Set_Result (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : AMF.UML.Output_Pins.UML_Output_Pin_Access); -- Setter of ClearStructuralFeatureAction::result. -- -- Gives the output pin on which the result is put. overriding function Get_Object (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Input_Pins.UML_Input_Pin_Access; -- Getter of StructuralFeatureAction::object. -- -- Gives the input pin from which the object whose structural feature is -- to be read or written is obtained. overriding procedure Set_Object (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : AMF.UML.Input_Pins.UML_Input_Pin_Access); -- Setter of StructuralFeatureAction::object. -- -- Gives the input pin from which the object whose structural feature is -- to be read or written is obtained. overriding function Get_Structural_Feature (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Structural_Features.UML_Structural_Feature_Access; -- Getter of StructuralFeatureAction::structuralFeature. -- -- Structural feature to be read. overriding procedure Set_Structural_Feature (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : AMF.UML.Structural_Features.UML_Structural_Feature_Access); -- Setter of StructuralFeatureAction::structuralFeature. -- -- Structural feature to be read. overriding function Get_Context (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Getter of Action::context. -- -- The classifier that owns the behavior of which this action is a part. overriding function Get_Input (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin; -- Getter of Action::input. -- -- The ordered set of input pins connected to the Action. These are among -- the total set of inputs. overriding function Get_Is_Locally_Reentrant (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return Boolean; -- Getter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding procedure Set_Is_Locally_Reentrant (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : Boolean); -- Setter of Action::isLocallyReentrant. -- -- If true, the action can begin a new, concurrent execution, even if -- there is already another execution of the action ongoing. If false, the -- action cannot begin a new execution until any previous execution has -- completed. overriding function Get_Local_Postcondition (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPostcondition. -- -- Constraint that must be satisfied when executed is completed. overriding function Get_Local_Precondition (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint; -- Getter of Action::localPrecondition. -- -- Constraint that must be satisfied when execution is started. overriding function Get_Output (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin; -- Getter of Action::output. -- -- The ordered set of output pins connected to the Action. The action -- places its results onto pins in this set. overriding function Get_Handler (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler; -- Getter of ExecutableNode::handler. -- -- A set of exception handlers that are examined if an uncaught exception -- propagates to the outer level of the executable node. overriding function Get_Activity (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Activities.UML_Activity_Access; -- Getter of ActivityNode::activity. -- -- Activity containing the node. overriding procedure Set_Activity (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : AMF.UML.Activities.UML_Activity_Access); -- Setter of ActivityNode::activity. -- -- Activity containing the node. overriding function Get_In_Group (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group; -- Getter of ActivityNode::inGroup. -- -- Groups containing the node. overriding function Get_In_Interruptible_Region (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region; -- Getter of ActivityNode::inInterruptibleRegion. -- -- Interruptible regions containing the node. overriding function Get_In_Partition (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition; -- Getter of ActivityNode::inPartition. -- -- Partitions containing the node. overriding function Get_In_Structured_Node (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access; -- Getter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding procedure Set_In_Structured_Node (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access); -- Setter of ActivityNode::inStructuredNode. -- -- Structured activity node containing the node. overriding function Get_Incoming (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::incoming. -- -- Edges that have the node as target. overriding function Get_Outgoing (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge; -- Getter of ActivityNode::outgoing. -- -- Edges that have the node as source. overriding function Get_Redefined_Node (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node; -- Getter of ActivityNode::redefinedNode. -- -- Inherited nodes replaced by this node in a specialization of the -- activity. overriding function Get_Is_Leaf (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return Boolean; -- Getter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding procedure Set_Is_Leaf (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : Boolean); -- Setter of RedefinableElement::isLeaf. -- -- Indicates whether it is possible to further redefine a -- RedefinableElement. If the value is true, then it is not possible to -- further redefine the RedefinableElement. Note that this property is -- preserved through package merge operations; that is, the capability to -- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in -- the resulting RedefinableElement of a package merge operation where a -- RedefinableElement with isLeaf=false is merged with a matching -- RedefinableElement with isLeaf=true: the resulting RedefinableElement -- will have isLeaf=false. Default value is false. overriding function Get_Redefined_Element (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element; -- Getter of RedefinableElement::redefinedElement. -- -- The redefinable element that is being redefined by this element. overriding function Get_Redefinition_Context (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier; -- Getter of RedefinableElement::redefinitionContext. -- -- References the contexts that this element may be redefined from. overriding function Get_Client_Dependency (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; -- Getter of NamedElement::clientDependency. -- -- Indicates the dependencies that reference the client. overriding function Get_Name_Expression (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.String_Expressions.UML_String_Expression_Access; -- Getter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding procedure Set_Name_Expression (Self : not null access UML_Clear_Structural_Feature_Action_Proxy; To : AMF.UML.String_Expressions.UML_String_Expression_Access); -- Setter of NamedElement::nameExpression. -- -- The string expression used to define the name of this named element. overriding function Get_Namespace (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Getter of NamedElement::namespace. -- -- Specifies the namespace that owns the NamedElement. overriding function Get_Qualified_Name (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.Optional_String; -- Getter of NamedElement::qualifiedName. -- -- A name which allows the NamedElement to be identified within a -- hierarchy of nested Namespaces. It is constructed from the names of the -- containing namespaces starting at the root of the hierarchy and ending -- with the name of the NamedElement itself. overriding function Context (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Classifiers.UML_Classifier_Access; -- Operation Action::context. -- -- Missing derivation for Action::/context : Classifier overriding function Is_Consistent_With (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two RedefinableElements -- in a context in which redefinition is possible, whether redefinition -- would be logically consistent. By default, this is false; this -- operation must be overridden for subclasses of RedefinableElement to -- define the consistency conditions. overriding function Is_Redefinition_Context_Valid (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy; Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean; -- Operation RedefinableElement::isRedefinitionContextValid. -- -- The query isRedefinitionContextValid() specifies whether the -- redefinition contexts of this RedefinableElement are properly related -- to the redefinition contexts of the specified RedefinableElement to -- allow this element to redefine the other. By default at least one of -- the redefinition contexts of this element must be a specialization of -- at least one of the redefinition contexts of the specified element. overriding function All_Owning_Packages (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Packages.Collections.Set_Of_UML_Package; -- Operation NamedElement::allOwningPackages. -- -- The query allOwningPackages() returns all the directly or indirectly -- owning packages. overriding function Is_Distinguishable_From (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy; N : AMF.UML.Named_Elements.UML_Named_Element_Access; Ns : AMF.UML.Namespaces.UML_Namespace_Access) return Boolean; -- Operation NamedElement::isDistinguishableFrom. -- -- The query isDistinguishableFrom() determines whether two NamedElements -- may logically co-exist within a Namespace. By default, two named -- elements are distinguishable if (a) they have unrelated types or (b) -- they have related types but different names. overriding function Namespace (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy) return AMF.UML.Namespaces.UML_Namespace_Access; -- Operation NamedElement::namespace. -- -- Missing derivation for NamedElement::/namespace : Namespace overriding procedure Enter_Element (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Leave_Element (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of visitor interface. overriding procedure Visit_Element (Self : not null access constant UML_Clear_Structural_Feature_Action_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control); -- Dispatch call to corresponding subprogram of iterator interface. end AMF.Internals.UML_Clear_Structural_Feature_Actions;
AdaCore/gpr
Ada
2,881
adb
-- -- Copyright (C) 2019-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with Ada.Strings.Fixed; with Ada.Text_IO; with GPR2.Context; with GPR2.Message; with GPR2.Path_Name; with GPR2.Project.View; with GPR2.Project.Tree; with GPR2.Project.Attribute.Set; procedure Main is use Ada; use GPR2; use GPR2.Project; use GPR2.Message; procedure Display (Prj : Project.View.Object); function Filter_Path (Line : String) return String; -- Remove the tmp directory where test is processing Prj : Project.Tree.Object; Ctx : Context.Object; ------------- -- Display -- ------------- procedure Display (Prj : Project.View.Object) is use GPR2.Project.Attribute.Set; begin Text_IO.Put (String (Prj.Name) & " "); Text_IO.Set_Col (10); Text_IO.Put_Line (Prj.Kind'Img); Text_IO.Put_Line ("Library_Name : " & String (Prj.Library_Name)); Text_IO.Put_Line ("Library_Directory : " & String (Prj.Library_Directory.Name)); Text_IO.Put_Line (" : " & Filter_Path (Prj.Library_Directory.Value)); Text_IO.Put_Line ("Library Filename : " & String (Prj.Library_Filename.Name)); Text_IO.Put_Line (" : " & Filter_Path (Prj.Library_Filename.Value)); Text_IO.Put_Line ("Library Version Filename : " & String (Prj.Library_Version_Filename.Name)); Text_IO.Put_Line (" : " & Filter_Path (Prj.Library_Version_Filename.Value)); Text_IO.Put_Line ("Library Major Version Filename : " & String (Prj.Library_Major_Version_Filename.Name)); Text_IO.Put_Line (" : " & Filter_Path (Prj.Library_Major_Version_Filename.Value)); Text_IO.Put_Line ("Library_Standalone : " & Prj.Library_Standalone'Img); end Display; ----------------- -- Filter_Path -- ----------------- function Filter_Path (Line : String) return String is D : constant String := Prj.Root_Project.Path_Name.Dir_Name; I : constant Positive := Strings.Fixed.Index (Line, D); begin return Line (Line'First .. I - 1) & "/" & Line (I + D'Length .. Line'Last); end Filter_Path; begin Project.Tree.Load (Prj, Create ("demo.gpr"), Ctx); Display (Prj.Root_Project); Ctx.Insert ("VERSION", "1.4"); Prj.Set_Context (Ctx); Display (Prj.Root_Project); Project.Tree.Load (Prj, Create ("demo.gpr"), Ctx, Subdirs => "release"); Display (Prj.Root_Project); Ctx.Replace ("VERSION", "A.B"); Prj.Set_Context (Ctx); Display (Prj.Root_Project); exception when Project_Error => for M of Prj.Log_Messages.all loop if M.Level /= Information then Text_IO.Put_Line (M.Format); end if; end loop; end Main;
zhmu/ananas
Ada
61,403
ads
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A S P E C T S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2010-2022, 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 the aspects that are recognized by GNAT in aspect -- specifications. It also contains the subprograms for storing/retrieving -- aspect specifications from the tree. The semantic processing for aspect -- specifications is found in Sem_Ch13.Analyze_Aspect_Specifications. ------------------------ -- Adding New Aspects -- ------------------------ -- In general, each aspect should have a corresponding pragma or attribute, so -- that the newly developed functionality is available for old Ada versions. -- When both are defined, it is convenient to first transform the aspect into -- an equivalent pragma or attribute in Sem_Ch13.Analyze_Aspect_Specifications -- and then analyze that. -- To add a new aspect, you need to do the following -- 1. Create a name in snames.ads-tmpl -- 2. Create a value in type Aspect_Id in this unit -- 3. Add a value for the aspect in the global arrays defined in this unit -- 4. Add code for the aspect in Sem_Ch13.Analyze_Aspect_Specifications. -- This may involve adding some nodes to the tree to perform additional -- treatments later. -- 5. If the semantic analysis of expressions/names in the aspect should not -- occur at the point the aspect is defined, add code in the appropriate -- semantic analysis procedure for the aspect. For example, this is the -- case for aspects Pre and Post on subprograms, which are preanalyzed -- at the end of the declaration list to which the subprogram belongs, -- and fully analyzed (possibly with expansion) during the semantic -- analysis of subprogram bodies. with Namet; use Namet; with Snames; use Snames; with Types; use Types; package Aspects is -- Type defining recognized aspects type Aspect_Id is (No_Aspect, -- Dummy entry for no aspect Aspect_Abstract_State, -- GNAT Aspect_Address, Aspect_Aggregate, Aspect_Alignment, Aspect_Annotate, -- GNAT Aspect_Async_Readers, -- GNAT Aspect_Async_Writers, -- GNAT Aspect_Attach_Handler, Aspect_Bit_Order, Aspect_Component_Size, Aspect_Constant_After_Elaboration, -- GNAT Aspect_Constant_Indexing, Aspect_Contract_Cases, -- GNAT Aspect_Convention, Aspect_CPU, Aspect_Default_Component_Value, Aspect_Default_Initial_Condition, -- GNAT Aspect_Default_Iterator, Aspect_Default_Storage_Pool, Aspect_Default_Value, Aspect_Depends, -- GNAT Aspect_Designated_Storage_Model, -- GNAT Aspect_Dimension, -- GNAT Aspect_Dimension_System, -- GNAT Aspect_Dispatching_Domain, Aspect_Dynamic_Predicate, Aspect_Effective_Reads, -- GNAT Aspect_Effective_Writes, -- GNAT Aspect_Extensions_Visible, -- GNAT Aspect_External_Name, Aspect_External_Tag, Aspect_Ghost, -- GNAT Aspect_Global, -- GNAT Aspect_GNAT_Annotate, -- GNAT Aspect_Implicit_Dereference, Aspect_Initial_Condition, -- GNAT Aspect_Initializes, -- GNAT Aspect_Input, Aspect_Integer_Literal, Aspect_Interrupt_Priority, Aspect_Invariant, -- GNAT Aspect_Iterator_Element, Aspect_Iterable, -- GNAT Aspect_Link_Name, Aspect_Linker_Section, -- GNAT Aspect_Machine_Radix, Aspect_Max_Entry_Queue_Depth, -- GNAT Aspect_Max_Entry_Queue_Length, Aspect_Max_Queue_Length, -- GNAT Aspect_No_Caching, -- GNAT Aspect_No_Controlled_Parts, Aspect_No_Task_Parts, -- GNAT Aspect_Object_Size, -- GNAT Aspect_Obsolescent, -- GNAT Aspect_Output, Aspect_Part_Of, -- GNAT Aspect_Post, Aspect_Postcondition, Aspect_Pre, Aspect_Precondition, Aspect_Predicate, -- GNAT Aspect_Predicate_Failure, Aspect_Priority, Aspect_Put_Image, Aspect_Read, Aspect_Real_Literal, Aspect_Refined_Depends, -- GNAT Aspect_Refined_Global, -- GNAT Aspect_Refined_Post, -- GNAT Aspect_Refined_State, -- GNAT Aspect_Relative_Deadline, Aspect_Relaxed_Initialization, -- GNAT Aspect_Scalar_Storage_Order, -- GNAT Aspect_Secondary_Stack_Size, -- GNAT Aspect_Simple_Storage_Pool, -- GNAT Aspect_Size, Aspect_Small, Aspect_SPARK_Mode, -- GNAT Aspect_Stable_Properties, Aspect_Static_Predicate, Aspect_Storage_Model_Type, -- GNAT Aspect_Storage_Pool, Aspect_Storage_Size, Aspect_Stream_Size, Aspect_String_Literal, Aspect_Subprogram_Variant, -- GNAT Aspect_Suppress, Aspect_Synchronization, Aspect_Test_Case, -- GNAT Aspect_Type_Invariant, Aspect_Unimplemented, -- GNAT Aspect_Unsuppress, Aspect_Value_Size, -- GNAT Aspect_Variable_Indexing, Aspect_Volatile_Function, -- GNAT Aspect_Warnings, -- GNAT Aspect_Write, -- The following aspects correspond to library unit pragmas Aspect_All_Calls_Remote, Aspect_Elaborate_Body, Aspect_No_Elaboration_Code_All, -- GNAT Aspect_Preelaborate, Aspect_Pure, Aspect_Remote_Call_Interface, Aspect_Remote_Types, Aspect_Shared_Passive, -- Remaining aspects have a static boolean value that turns the aspect -- on or off. They all correspond to pragmas, but are only converted to -- the pragmas where the value is True. A value of False normally means -- that the aspect is ignored, except in the case of derived types where -- the aspect value is inherited from the parent, in which case, we do -- not allow False if we inherit a True value from the parent. Aspect_Asynchronous, Aspect_Atomic, Aspect_Atomic_Components, Aspect_Disable_Controlled, -- GNAT Aspect_Discard_Names, Aspect_CUDA_Device, -- GNAT Aspect_CUDA_Global, -- GNAT Aspect_Exclusive_Functions, Aspect_Export, Aspect_Favor_Top_Level, -- GNAT Aspect_Full_Access_Only, Aspect_Independent, Aspect_Independent_Components, Aspect_Import, Aspect_Inline, Aspect_Inline_Always, -- GNAT Aspect_Interrupt_Handler, Aspect_Lock_Free, -- GNAT Aspect_No_Inline, -- GNAT Aspect_No_Return, Aspect_No_Tagged_Streams, -- GNAT Aspect_Pack, Aspect_Persistent_BSS, -- GNAT Aspect_Preelaborable_Initialization, Aspect_Pure_Function, -- GNAT Aspect_Remote_Access_Type, -- GNAT Aspect_Shared, -- GNAT (equivalent to Atomic) Aspect_Simple_Storage_Pool_Type, -- GNAT Aspect_Static, Aspect_Suppress_Debug_Info, -- GNAT Aspect_Suppress_Initialization, -- GNAT Aspect_Thread_Local_Storage, -- GNAT Aspect_Unchecked_Union, Aspect_Universal_Aliasing, -- GNAT Aspect_Unmodified, -- GNAT Aspect_Unreferenced, -- GNAT Aspect_Unreferenced_Objects, -- GNAT Aspect_Volatile, Aspect_Volatile_Components, Aspect_Volatile_Full_Access, -- GNAT Aspect_Yield); subtype Aspect_Id_Exclude_No_Aspect is Aspect_Id range Aspect_Id'Succ (No_Aspect) .. Aspect_Id'Last; -- Aspect_Id's excluding No_Aspect subtype Nonoverridable_Aspect_Id is Aspect_Id with Static_Predicate => Nonoverridable_Aspect_Id in Aspect_Default_Iterator | Aspect_Iterator_Element | Aspect_Implicit_Dereference | Aspect_Constant_Indexing | Aspect_Variable_Indexing | Aspect_Aggregate | Aspect_Max_Entry_Queue_Length | Aspect_No_Controlled_Parts -- ??? No_Controlled_Parts not yet in Aspect_Id enumeration ; -- see RM 13.1.1(18.7) -- The following array indicates aspects that accept 'Class Class_Aspect_OK : constant array (Aspect_Id) of Boolean := (Aspect_Input => True, Aspect_Invariant => True, Aspect_Output => True, Aspect_Pre => True, Aspect_Predicate => True, Aspect_Post => True, Aspect_Read => True, Aspect_Write => True, Aspect_Stable_Properties => True, Aspect_Type_Invariant => True, others => False); -- The following array identifies all implementation defined aspects Implementation_Defined_Aspect : constant array (Aspect_Id) of Boolean := (Aspect_Abstract_State => True, Aspect_Annotate => True, Aspect_Async_Readers => True, Aspect_Async_Writers => True, Aspect_Constant_After_Elaboration => True, Aspect_Contract_Cases => True, Aspect_Depends => True, Aspect_Dimension => True, Aspect_Dimension_System => True, Aspect_Effective_Reads => True, Aspect_Effective_Writes => True, Aspect_Extensions_Visible => True, Aspect_Favor_Top_Level => True, Aspect_Ghost => True, Aspect_Global => True, Aspect_GNAT_Annotate => True, Aspect_Inline_Always => True, Aspect_Invariant => True, Aspect_Lock_Free => True, Aspect_Max_Entry_Queue_Depth => True, Aspect_Max_Entry_Queue_Length => True, Aspect_Max_Queue_Length => True, Aspect_Object_Size => True, Aspect_Persistent_BSS => True, Aspect_Predicate => True, Aspect_Pure_Function => True, Aspect_Relaxed_Initialization => True, Aspect_Remote_Access_Type => True, Aspect_Scalar_Storage_Order => True, Aspect_Secondary_Stack_Size => True, Aspect_Shared => True, Aspect_Simple_Storage_Pool => True, Aspect_Simple_Storage_Pool_Type => True, Aspect_Suppress_Debug_Info => True, Aspect_Suppress_Initialization => True, Aspect_Thread_Local_Storage => True, Aspect_Test_Case => True, Aspect_Universal_Aliasing => True, Aspect_Unmodified => True, Aspect_Unreferenced => True, Aspect_Unreferenced_Objects => True, Aspect_Value_Size => True, Aspect_Volatile_Function => True, Aspect_Warnings => True, others => False); -- The following array indicates aspects that specify operational -- characteristics, and thus are view-specific. Representation -- aspects break privacy, as they are needed during expansion and -- code generation. -- List is currently incomplete ??? Operational_Aspect : constant array (Aspect_Id) of Boolean := (Aspect_Constant_Indexing => True, Aspect_Default_Iterator => True, Aspect_Iterator_Element => True, Aspect_Iterable => True, Aspect_Variable_Indexing => True, Aspect_Aggregate => True, others => False); -- The following array indicates aspects for which multiple occurrences of -- the same aspect attached to the same declaration are allowed. No_Duplicates_Allowed : constant array (Aspect_Id) of Boolean := (Aspect_Annotate => False, Aspect_GNAT_Annotate => False, Aspect_Test_Case => False, others => True); -- The following subtype defines aspects corresponding to library unit -- pragmas, these can only validly appear as aspects for library units, -- and result in a corresponding pragma being inserted immediately after -- the occurrence of the aspect. subtype Library_Unit_Aspects is Aspect_Id range Aspect_All_Calls_Remote .. Aspect_Shared_Passive; -- The following subtype defines aspects accepting an optional static -- boolean parameter indicating if the aspect should be active or -- cancelling. If the parameter is missing the effective value is True, -- enabling the aspect. If the parameter is present it must be a static -- expression of type Standard.Boolean. If the value is True, then the -- aspect is enabled. If it is False, the aspect is disabled. subtype Boolean_Aspects is Aspect_Id range Aspect_Asynchronous .. Aspect_Id'Last; subtype Pre_Post_Aspects is Aspect_Id range Aspect_Post .. Aspect_Precondition; -- The following type is used for indicating allowed expression forms type Aspect_Expression is (Expression, -- Required expression Name, -- Required name Optional_Expression, -- Optional boolean expression Optional_Name); -- Optional name -- The following array indicates what argument type is required Aspect_Argument : constant array (Aspect_Id) of Aspect_Expression := (No_Aspect => Optional_Expression, Aspect_Abstract_State => Expression, Aspect_Address => Expression, Aspect_Aggregate => Expression, Aspect_Alignment => Expression, Aspect_Annotate => Expression, Aspect_Async_Readers => Optional_Expression, Aspect_Async_Writers => Optional_Expression, Aspect_Attach_Handler => Expression, Aspect_Bit_Order => Expression, Aspect_Component_Size => Expression, Aspect_Constant_After_Elaboration => Optional_Expression, Aspect_Constant_Indexing => Name, Aspect_Contract_Cases => Expression, Aspect_Convention => Name, Aspect_CPU => Expression, Aspect_Default_Component_Value => Expression, Aspect_Default_Initial_Condition => Optional_Expression, Aspect_Default_Iterator => Name, Aspect_Default_Storage_Pool => Expression, Aspect_Default_Value => Expression, Aspect_Depends => Expression, Aspect_Designated_Storage_Model => Name, Aspect_Dimension => Expression, Aspect_Dimension_System => Expression, Aspect_Dispatching_Domain => Expression, Aspect_Dynamic_Predicate => Expression, Aspect_Effective_Reads => Optional_Expression, Aspect_Effective_Writes => Optional_Expression, Aspect_Extensions_Visible => Optional_Expression, Aspect_External_Name => Expression, Aspect_External_Tag => Expression, Aspect_Ghost => Optional_Expression, Aspect_Global => Expression, Aspect_GNAT_Annotate => Expression, Aspect_Implicit_Dereference => Name, Aspect_Initial_Condition => Expression, Aspect_Initializes => Expression, Aspect_Input => Name, Aspect_Integer_Literal => Name, Aspect_Interrupt_Priority => Expression, Aspect_Invariant => Expression, Aspect_Iterable => Expression, Aspect_Iterator_Element => Name, Aspect_Link_Name => Expression, Aspect_Linker_Section => Expression, Aspect_Machine_Radix => Expression, Aspect_Max_Entry_Queue_Depth => Expression, Aspect_Max_Entry_Queue_Length => Expression, Aspect_Max_Queue_Length => Expression, Aspect_No_Caching => Optional_Expression, Aspect_No_Controlled_Parts => Optional_Expression, Aspect_No_Task_Parts => Optional_Expression, Aspect_Object_Size => Expression, Aspect_Obsolescent => Optional_Expression, Aspect_Output => Name, Aspect_Part_Of => Expression, Aspect_Post => Expression, Aspect_Postcondition => Expression, Aspect_Pre => Expression, Aspect_Precondition => Expression, Aspect_Predicate => Expression, Aspect_Predicate_Failure => Expression, Aspect_Priority => Expression, Aspect_Put_Image => Name, Aspect_Read => Name, Aspect_Real_Literal => Name, Aspect_Refined_Depends => Expression, Aspect_Refined_Global => Expression, Aspect_Refined_Post => Expression, Aspect_Refined_State => Expression, Aspect_Relative_Deadline => Expression, Aspect_Relaxed_Initialization => Optional_Expression, Aspect_Scalar_Storage_Order => Expression, Aspect_Secondary_Stack_Size => Expression, Aspect_Simple_Storage_Pool => Name, Aspect_Size => Expression, Aspect_Small => Expression, Aspect_SPARK_Mode => Optional_Name, Aspect_Stable_Properties => Expression, Aspect_Static_Predicate => Expression, Aspect_Storage_Model_Type => Expression, Aspect_Storage_Pool => Name, Aspect_Storage_Size => Expression, Aspect_Stream_Size => Expression, Aspect_String_Literal => Name, Aspect_Subprogram_Variant => Expression, Aspect_Suppress => Name, Aspect_Synchronization => Name, Aspect_Test_Case => Expression, Aspect_Type_Invariant => Expression, Aspect_Unimplemented => Optional_Expression, Aspect_Unsuppress => Name, Aspect_Value_Size => Expression, Aspect_Variable_Indexing => Name, Aspect_Volatile_Function => Optional_Expression, Aspect_Warnings => Name, Aspect_Write => Name, Boolean_Aspects => Optional_Expression, Library_Unit_Aspects => Optional_Expression); -- The following array indicates what aspects are representation aspects Is_Representation_Aspect : constant array (Aspect_Id) of Boolean := (No_Aspect => False, Aspect_Abstract_State => False, Aspect_Address => True, Aspect_Aggregate => False, Aspect_Alignment => True, Aspect_Annotate => False, Aspect_Async_Readers => False, Aspect_Async_Writers => False, Aspect_Attach_Handler => False, Aspect_Bit_Order => True, Aspect_Component_Size => True, Aspect_Constant_After_Elaboration => False, Aspect_Constant_Indexing => False, Aspect_Contract_Cases => False, Aspect_Convention => True, Aspect_CPU => False, Aspect_CUDA_Device => False, Aspect_CUDA_Global => False, Aspect_Default_Component_Value => True, Aspect_Default_Initial_Condition => False, Aspect_Default_Iterator => False, Aspect_Default_Storage_Pool => True, Aspect_Default_Value => True, Aspect_Depends => False, Aspect_Designated_Storage_Model => True, Aspect_Dimension => False, Aspect_Dimension_System => False, Aspect_Dispatching_Domain => False, Aspect_Dynamic_Predicate => False, Aspect_Effective_Reads => False, Aspect_Effective_Writes => False, Aspect_Exclusive_Functions => False, Aspect_Extensions_Visible => False, Aspect_External_Name => False, Aspect_External_Tag => False, Aspect_Ghost => False, Aspect_Global => False, Aspect_GNAT_Annotate => False, Aspect_Implicit_Dereference => False, Aspect_Initial_Condition => False, Aspect_Initializes => False, Aspect_Input => False, Aspect_Integer_Literal => False, Aspect_Interrupt_Priority => False, Aspect_Invariant => False, Aspect_Iterable => False, Aspect_Iterator_Element => False, Aspect_Link_Name => True, Aspect_Linker_Section => True, Aspect_Machine_Radix => True, Aspect_Max_Entry_Queue_Depth => False, Aspect_Max_Entry_Queue_Length => False, Aspect_Max_Queue_Length => False, Aspect_No_Caching => False, Aspect_No_Controlled_Parts => False, Aspect_No_Task_Parts => False, Aspect_Object_Size => True, Aspect_Obsolescent => False, Aspect_Output => False, Aspect_Part_Of => False, Aspect_Post => False, Aspect_Postcondition => False, Aspect_Pre => False, Aspect_Precondition => False, Aspect_Predicate => False, Aspect_Predicate_Failure => False, Aspect_Priority => False, Aspect_Put_Image => False, Aspect_Read => False, Aspect_Real_Literal => False, Aspect_Refined_Depends => False, Aspect_Refined_Global => False, Aspect_Refined_Post => False, Aspect_Refined_State => False, Aspect_Relative_Deadline => False, Aspect_Relaxed_Initialization => False, Aspect_Scalar_Storage_Order => True, Aspect_Secondary_Stack_Size => True, Aspect_Simple_Storage_Pool => True, Aspect_Size => True, Aspect_Small => True, Aspect_SPARK_Mode => False, Aspect_Stable_Properties => False, Aspect_Static_Predicate => False, Aspect_Storage_Model_Type => False, Aspect_Storage_Pool => True, Aspect_Storage_Size => True, Aspect_Stream_Size => True, Aspect_String_Literal => False, Aspect_Subprogram_Variant => False, Aspect_Suppress => False, Aspect_Synchronization => False, Aspect_Test_Case => False, Aspect_Type_Invariant => False, Aspect_Unimplemented => False, Aspect_Unsuppress => False, Aspect_Value_Size => True, Aspect_Variable_Indexing => False, Aspect_Volatile_Function => False, Aspect_Warnings => False, Aspect_Write => False, Library_Unit_Aspects => False, Aspect_Asynchronous => True, Aspect_Atomic => True, Aspect_Atomic_Components => True, Aspect_Disable_Controlled => False, Aspect_Discard_Names => True, Aspect_Export => True, Aspect_Favor_Top_Level => False, Aspect_Full_Access_Only => True, Aspect_Independent => True, Aspect_Independent_Components => True, Aspect_Import => True, Aspect_Inline => False, Aspect_Inline_Always => False, Aspect_Interrupt_Handler => False, Aspect_Lock_Free => False, Aspect_No_Inline => False, Aspect_No_Return => False, Aspect_No_Tagged_Streams => False, Aspect_Pack => True, Aspect_Persistent_BSS => True, Aspect_Preelaborable_Initialization => False, Aspect_Pure_Function => False, Aspect_Remote_Access_Type => False, Aspect_Shared => True, Aspect_Simple_Storage_Pool_Type => True, Aspect_Static => False, Aspect_Suppress_Debug_Info => False, Aspect_Suppress_Initialization => False, Aspect_Thread_Local_Storage => True, Aspect_Unchecked_Union => True, Aspect_Universal_Aliasing => False, Aspect_Unmodified => False, Aspect_Unreferenced => False, Aspect_Unreferenced_Objects => False, Aspect_Volatile => True, Aspect_Volatile_Components => True, Aspect_Volatile_Full_Access => True, Aspect_Yield => False); ----------------------------------------- -- Table Linking Names and Aspect_Id's -- ----------------------------------------- -- Table linking aspect names and id's Aspect_Names : constant array (Aspect_Id) of Name_Id := (No_Aspect => No_Name, Aspect_Abstract_State => Name_Abstract_State, Aspect_Address => Name_Address, Aspect_Aggregate => Name_Aggregate, Aspect_Alignment => Name_Alignment, Aspect_All_Calls_Remote => Name_All_Calls_Remote, Aspect_Annotate => Name_Annotate, Aspect_Async_Readers => Name_Async_Readers, Aspect_Async_Writers => Name_Async_Writers, Aspect_Asynchronous => Name_Asynchronous, Aspect_Atomic => Name_Atomic, Aspect_Atomic_Components => Name_Atomic_Components, Aspect_Attach_Handler => Name_Attach_Handler, Aspect_Bit_Order => Name_Bit_Order, Aspect_Component_Size => Name_Component_Size, Aspect_Constant_After_Elaboration => Name_Constant_After_Elaboration, Aspect_Constant_Indexing => Name_Constant_Indexing, Aspect_Contract_Cases => Name_Contract_Cases, Aspect_Convention => Name_Convention, Aspect_CPU => Name_CPU, Aspect_CUDA_Device => Name_CUDA_Device, Aspect_CUDA_Global => Name_CUDA_Global, Aspect_Default_Component_Value => Name_Default_Component_Value, Aspect_Default_Initial_Condition => Name_Default_Initial_Condition, Aspect_Default_Iterator => Name_Default_Iterator, Aspect_Default_Storage_Pool => Name_Default_Storage_Pool, Aspect_Default_Value => Name_Default_Value, Aspect_Depends => Name_Depends, Aspect_Designated_Storage_Model => Name_Designated_Storage_Model, Aspect_Dimension => Name_Dimension, Aspect_Dimension_System => Name_Dimension_System, Aspect_Disable_Controlled => Name_Disable_Controlled, Aspect_Discard_Names => Name_Discard_Names, Aspect_Dispatching_Domain => Name_Dispatching_Domain, Aspect_Dynamic_Predicate => Name_Dynamic_Predicate, Aspect_Effective_Reads => Name_Effective_Reads, Aspect_Effective_Writes => Name_Effective_Writes, Aspect_Elaborate_Body => Name_Elaborate_Body, Aspect_Exclusive_Functions => Name_Exclusive_Functions, Aspect_Export => Name_Export, Aspect_Extensions_Visible => Name_Extensions_Visible, Aspect_External_Name => Name_External_Name, Aspect_External_Tag => Name_External_Tag, Aspect_Favor_Top_Level => Name_Favor_Top_Level, Aspect_Full_Access_Only => Name_Full_Access_Only, Aspect_Ghost => Name_Ghost, Aspect_Global => Name_Global, Aspect_GNAT_Annotate => Name_GNAT_Annotate, Aspect_Implicit_Dereference => Name_Implicit_Dereference, Aspect_Import => Name_Import, Aspect_Independent => Name_Independent, Aspect_Independent_Components => Name_Independent_Components, Aspect_Inline => Name_Inline, Aspect_Inline_Always => Name_Inline_Always, Aspect_Initial_Condition => Name_Initial_Condition, Aspect_Initializes => Name_Initializes, Aspect_Input => Name_Input, Aspect_Integer_Literal => Name_Integer_Literal, Aspect_Interrupt_Handler => Name_Interrupt_Handler, Aspect_Interrupt_Priority => Name_Interrupt_Priority, Aspect_Invariant => Name_Invariant, Aspect_Iterator_Element => Name_Iterator_Element, Aspect_Iterable => Name_Iterable, Aspect_Link_Name => Name_Link_Name, Aspect_Linker_Section => Name_Linker_Section, Aspect_Lock_Free => Name_Lock_Free, Aspect_Machine_Radix => Name_Machine_Radix, Aspect_Max_Entry_Queue_Depth => Name_Max_Entry_Queue_Depth, Aspect_Max_Entry_Queue_Length => Name_Max_Entry_Queue_Length, Aspect_Max_Queue_Length => Name_Max_Queue_Length, Aspect_No_Caching => Name_No_Caching, Aspect_No_Controlled_Parts => Name_No_Controlled_Parts, Aspect_No_Task_Parts => Name_No_Task_Parts, Aspect_No_Elaboration_Code_All => Name_No_Elaboration_Code_All, Aspect_No_Inline => Name_No_Inline, Aspect_No_Return => Name_No_Return, Aspect_No_Tagged_Streams => Name_No_Tagged_Streams, Aspect_Object_Size => Name_Object_Size, Aspect_Obsolescent => Name_Obsolescent, Aspect_Output => Name_Output, Aspect_Pack => Name_Pack, Aspect_Part_Of => Name_Part_Of, Aspect_Persistent_BSS => Name_Persistent_BSS, Aspect_Post => Name_Post, Aspect_Postcondition => Name_Postcondition, Aspect_Pre => Name_Pre, Aspect_Precondition => Name_Precondition, Aspect_Predicate => Name_Predicate, Aspect_Predicate_Failure => Name_Predicate_Failure, Aspect_Preelaborable_Initialization => Name_Preelaborable_Initialization, Aspect_Preelaborate => Name_Preelaborate, Aspect_Priority => Name_Priority, Aspect_Pure => Name_Pure, Aspect_Pure_Function => Name_Pure_Function, Aspect_Put_Image => Name_Put_Image, Aspect_Read => Name_Read, Aspect_Real_Literal => Name_Real_Literal, Aspect_Refined_Depends => Name_Refined_Depends, Aspect_Refined_Global => Name_Refined_Global, Aspect_Refined_Post => Name_Refined_Post, Aspect_Refined_State => Name_Refined_State, Aspect_Relative_Deadline => Name_Relative_Deadline, Aspect_Relaxed_Initialization => Name_Relaxed_Initialization, Aspect_Remote_Access_Type => Name_Remote_Access_Type, Aspect_Remote_Call_Interface => Name_Remote_Call_Interface, Aspect_Remote_Types => Name_Remote_Types, Aspect_Scalar_Storage_Order => Name_Scalar_Storage_Order, Aspect_Secondary_Stack_Size => Name_Secondary_Stack_Size, Aspect_Shared => Name_Shared, Aspect_Shared_Passive => Name_Shared_Passive, Aspect_Simple_Storage_Pool => Name_Simple_Storage_Pool, Aspect_Simple_Storage_Pool_Type => Name_Simple_Storage_Pool_Type, Aspect_Size => Name_Size, Aspect_Small => Name_Small, Aspect_SPARK_Mode => Name_SPARK_Mode, Aspect_Stable_Properties => Name_Stable_Properties, Aspect_Static => Name_Static, Aspect_Static_Predicate => Name_Static_Predicate, Aspect_Storage_Model_Type => Name_Storage_Model_Type, Aspect_Storage_Pool => Name_Storage_Pool, Aspect_Storage_Size => Name_Storage_Size, Aspect_Stream_Size => Name_Stream_Size, Aspect_String_Literal => Name_String_Literal, Aspect_Subprogram_Variant => Name_Subprogram_Variant, Aspect_Suppress => Name_Suppress, Aspect_Suppress_Debug_Info => Name_Suppress_Debug_Info, Aspect_Suppress_Initialization => Name_Suppress_Initialization, Aspect_Thread_Local_Storage => Name_Thread_Local_Storage, Aspect_Synchronization => Name_Synchronization, Aspect_Test_Case => Name_Test_Case, Aspect_Type_Invariant => Name_Type_Invariant, Aspect_Unchecked_Union => Name_Unchecked_Union, Aspect_Unimplemented => Name_Unimplemented, Aspect_Universal_Aliasing => Name_Universal_Aliasing, Aspect_Unmodified => Name_Unmodified, Aspect_Unreferenced => Name_Unreferenced, Aspect_Unreferenced_Objects => Name_Unreferenced_Objects, Aspect_Unsuppress => Name_Unsuppress, Aspect_Value_Size => Name_Value_Size, Aspect_Variable_Indexing => Name_Variable_Indexing, Aspect_Volatile => Name_Volatile, Aspect_Volatile_Components => Name_Volatile_Components, Aspect_Volatile_Full_Access => Name_Volatile_Full_Access, Aspect_Volatile_Function => Name_Volatile_Function, Aspect_Warnings => Name_Warnings, Aspect_Write => Name_Write, Aspect_Yield => Name_Yield); function Get_Aspect_Id (Name : Name_Id) return Aspect_Id; pragma Inline (Get_Aspect_Id); -- Given a name Nam, returns the corresponding aspect id value. If the name -- does not match any aspect, then No_Aspect is returned as the result. function Get_Aspect_Id (Aspect : Node_Id) return Aspect_Id; pragma Inline (Get_Aspect_Id); -- Given an aspect specification, return the corresponding aspect_id value. -- If the name does not match any aspect, return No_Aspect. function Is_Aspect_Id (Aspect : Name_Id) return Boolean; pragma Inline (Is_Aspect_Id); -- Return True if a corresponding aspect id exists function Is_Aspect_Id (Aspect : Node_Id) return Boolean; pragma Inline (Is_Aspect_Id); -- Return True if a corresponding aspect id exists ------------------------------------ -- Delaying Evaluation of Aspects -- ------------------------------------ -- The RM requires that all language defined aspects taking an expression -- delay evaluation of the expression till the freeze point of the entity -- to which the aspect applies. This allows forward references, and is of -- use for example in connection with preconditions and postconditions -- where the requirement of making all references in contracts to local -- functions be backwards references would be onerous. -- For consistency, even attributes like Size are delayed, so we can do: -- type A is range 1 .. 10 -- with Size => Not_Defined_Yet; -- .. -- Not_Defined_Yet : constant := 64; -- Resulting in A having a size of 64, which gets set when A is frozen. -- Furthermore, we can have a situation like -- type A is range 1 .. 10 -- with Size => Not_Defined_Yet; -- .. -- type B is new A; -- .. -- Not_Defined_Yet : constant := 64; -- where the Size of A is considered to have been previously specified at -- the point of derivation, even though the actual value of the size is -- not known yet, and in this example B inherits the size value of 64. -- Our normal implementation model (prior to Ada 2012) was simply to copy -- inheritable attributes at the point of derivation. Then any subsequent -- representation items apply either to the parent type, not affecting the -- derived type, or to the derived type, not affecting the parent type. -- To deal with the delayed aspect case, we use two flags. The first is -- set on the parent type if it has delayed representation aspects. This -- flag Has_Delayed_Rep_Aspects indicates that if we derive from this type -- we have to worry about making sure we inherit any delayed aspects. The -- second flag is set on a derived type: May_Have_Inherited_Rep_Aspects -- is set if the parent type has Has_Delayed_Rep_Aspects set. -- When we freeze a derived type, if the May_Have_Inherited_Rep_Aspects -- flag is set, then we call Freeze.Inherit_Delayed_Rep_Aspects when -- the derived type is frozen, which deals with the necessary copying of -- information from the parent type, which must be frozen at that point -- (since freezing the derived type first freezes the parent type). -- SPARK 2014 aspects do not follow the general delay mechanism as they -- act as annotations and cannot modify the attributes of their related -- constructs. To handle forward references in such aspects, the compiler -- delays the analysis of their respective pragmas by collecting them in -- N_Contract nodes. The pragmas are then analyzed at the end of the -- declarative region containing the related construct. For details, -- see routines Analyze_xxx_In_Decl_Part. -- The following shows which aspects are delayed. There are three cases: type Delay_Type is (Always_Delay, -- This aspect is not a representation aspect that can be inherited and -- is always delayed, as required by the language definition. Never_Delay, -- There are two cases. There are language defined aspects like -- Convention where the "expression" is simply an uninterpreted -- identifier, and there is no issue of evaluating it and thus no -- issue of delaying the evaluation. The second case is implementation -- defined aspects where we have decided that we don't want to allow -- delays (and for our own aspects we can do what we like). Rep_Aspect); -- These are the cases of representation aspects that are in general -- delayed, and where there is a potential issue of derived types that -- inherit delayed representation values. -- Note: even if this table indicates that an aspect is delayed, we never -- delay Boolean aspects that have a missing expression (taken as True), -- or expressions for delayed rep items that consist of an integer literal -- (most cases of Size etc. in practice), since in these cases we know we -- can get the value of the expression without delay. Note that we still -- need to delay Boolean aspects that are specifically set to True: -- type R is array (0 .. 31) of Boolean -- with Pack => True; -- True : constant Boolean := False; -- This is nonsense, but we need to make it work and result in R not -- being packed, and if we have something like: -- type R is array (0 .. 31) of Boolean -- with Pack => True; -- RR : R; -- True : constant Boolean := False; -- This is illegal because the visibility of True changes after the freeze -- point, which is not allowed, and we need the delay mechanism to properly -- diagnose this error. Aspect_Delay : constant array (Aspect_Id) of Delay_Type := (No_Aspect => Always_Delay, Aspect_Address => Always_Delay, Aspect_Aggregate => Always_Delay, Aspect_All_Calls_Remote => Always_Delay, Aspect_Asynchronous => Always_Delay, Aspect_Attach_Handler => Always_Delay, Aspect_Constant_Indexing => Always_Delay, Aspect_CPU => Always_Delay, Aspect_CUDA_Device => Always_Delay, Aspect_CUDA_Global => Always_Delay, Aspect_Default_Iterator => Always_Delay, Aspect_Default_Storage_Pool => Always_Delay, Aspect_Default_Value => Always_Delay, Aspect_Default_Component_Value => Always_Delay, Aspect_Designated_Storage_Model => Always_Delay, Aspect_Discard_Names => Always_Delay, Aspect_Dispatching_Domain => Always_Delay, Aspect_Dynamic_Predicate => Always_Delay, Aspect_Elaborate_Body => Always_Delay, Aspect_Exclusive_Functions => Always_Delay, Aspect_External_Name => Always_Delay, Aspect_External_Tag => Always_Delay, Aspect_Favor_Top_Level => Always_Delay, Aspect_Implicit_Dereference => Always_Delay, Aspect_Independent => Always_Delay, Aspect_Independent_Components => Always_Delay, Aspect_Inline => Always_Delay, Aspect_Inline_Always => Always_Delay, Aspect_Input => Always_Delay, Aspect_Integer_Literal => Always_Delay, Aspect_Interrupt_Handler => Always_Delay, Aspect_Interrupt_Priority => Always_Delay, Aspect_Invariant => Always_Delay, Aspect_Iterable => Always_Delay, Aspect_Iterator_Element => Always_Delay, Aspect_Link_Name => Always_Delay, Aspect_Linker_Section => Always_Delay, Aspect_Lock_Free => Always_Delay, Aspect_No_Inline => Always_Delay, Aspect_No_Return => Always_Delay, Aspect_Output => Always_Delay, Aspect_Persistent_BSS => Always_Delay, Aspect_Post => Always_Delay, Aspect_Postcondition => Always_Delay, Aspect_Pre => Always_Delay, Aspect_Precondition => Always_Delay, Aspect_Predicate => Always_Delay, Aspect_Predicate_Failure => Always_Delay, Aspect_Preelaborable_Initialization => Always_Delay, Aspect_Preelaborate => Always_Delay, Aspect_Priority => Always_Delay, Aspect_Pure => Always_Delay, Aspect_Pure_Function => Always_Delay, Aspect_Put_Image => Always_Delay, Aspect_Read => Always_Delay, Aspect_Real_Literal => Always_Delay, Aspect_Relative_Deadline => Always_Delay, Aspect_Remote_Access_Type => Always_Delay, Aspect_Remote_Call_Interface => Always_Delay, Aspect_Remote_Types => Always_Delay, Aspect_Secondary_Stack_Size => Always_Delay, Aspect_Shared => Always_Delay, Aspect_Shared_Passive => Always_Delay, Aspect_Simple_Storage_Pool => Always_Delay, Aspect_Simple_Storage_Pool_Type => Always_Delay, Aspect_Static_Predicate => Always_Delay, Aspect_Storage_Model_Type => Always_Delay, Aspect_Storage_Pool => Always_Delay, Aspect_Stream_Size => Always_Delay, Aspect_String_Literal => Always_Delay, Aspect_Suppress => Always_Delay, Aspect_Suppress_Debug_Info => Always_Delay, Aspect_Suppress_Initialization => Always_Delay, Aspect_Thread_Local_Storage => Always_Delay, Aspect_Type_Invariant => Always_Delay, Aspect_Unchecked_Union => Always_Delay, Aspect_Universal_Aliasing => Always_Delay, Aspect_Unmodified => Always_Delay, Aspect_Unreferenced => Always_Delay, Aspect_Unreferenced_Objects => Always_Delay, Aspect_Unsuppress => Always_Delay, Aspect_Variable_Indexing => Always_Delay, Aspect_Write => Always_Delay, Aspect_Abstract_State => Never_Delay, Aspect_Annotate => Never_Delay, Aspect_Async_Readers => Never_Delay, Aspect_Async_Writers => Never_Delay, Aspect_Constant_After_Elaboration => Never_Delay, Aspect_Contract_Cases => Never_Delay, Aspect_Convention => Never_Delay, Aspect_Default_Initial_Condition => Never_Delay, Aspect_Depends => Never_Delay, Aspect_Dimension => Never_Delay, Aspect_Dimension_System => Never_Delay, Aspect_Disable_Controlled => Never_Delay, Aspect_Effective_Reads => Never_Delay, Aspect_Effective_Writes => Never_Delay, Aspect_Export => Never_Delay, Aspect_Extensions_Visible => Never_Delay, Aspect_Ghost => Never_Delay, Aspect_Global => Never_Delay, Aspect_GNAT_Annotate => Never_Delay, Aspect_Import => Never_Delay, Aspect_Initial_Condition => Never_Delay, Aspect_Initializes => Never_Delay, Aspect_Max_Entry_Queue_Depth => Never_Delay, Aspect_Max_Entry_Queue_Length => Never_Delay, Aspect_Max_Queue_Length => Never_Delay, Aspect_No_Caching => Never_Delay, Aspect_No_Controlled_Parts => Never_Delay, Aspect_No_Task_Parts => Never_Delay, Aspect_No_Elaboration_Code_All => Never_Delay, Aspect_No_Tagged_Streams => Never_Delay, Aspect_Obsolescent => Never_Delay, Aspect_Part_Of => Never_Delay, Aspect_Refined_Depends => Never_Delay, Aspect_Refined_Global => Never_Delay, Aspect_Refined_Post => Never_Delay, Aspect_Refined_State => Never_Delay, Aspect_Relaxed_Initialization => Never_Delay, Aspect_SPARK_Mode => Never_Delay, Aspect_Stable_Properties => Always_Delay, Aspect_Static => Never_Delay, Aspect_Subprogram_Variant => Never_Delay, Aspect_Synchronization => Never_Delay, Aspect_Test_Case => Never_Delay, Aspect_Unimplemented => Never_Delay, Aspect_Volatile_Function => Never_Delay, Aspect_Warnings => Never_Delay, Aspect_Yield => Never_Delay, Aspect_Alignment => Rep_Aspect, Aspect_Atomic => Rep_Aspect, Aspect_Atomic_Components => Rep_Aspect, Aspect_Bit_Order => Rep_Aspect, Aspect_Component_Size => Rep_Aspect, Aspect_Full_Access_Only => Rep_Aspect, Aspect_Machine_Radix => Rep_Aspect, Aspect_Object_Size => Rep_Aspect, Aspect_Pack => Rep_Aspect, Aspect_Scalar_Storage_Order => Rep_Aspect, Aspect_Size => Rep_Aspect, Aspect_Small => Rep_Aspect, Aspect_Storage_Size => Rep_Aspect, Aspect_Value_Size => Rep_Aspect, Aspect_Volatile => Rep_Aspect, Aspect_Volatile_Components => Rep_Aspect, Aspect_Volatile_Full_Access => Rep_Aspect); ------------------------------------------------ -- Handling of Aspect Specifications on Stubs -- ------------------------------------------------ -- Aspects that appear on the following stub nodes -- N_Package_Body_Stub -- N_Protected_Body_Stub -- N_Subprogram_Body_Stub -- N_Task_Body_Stub -- are treated as if they apply to the corresponding proper body. Their -- analysis is postponed until the analysis of the proper body takes place -- (see Analyze_Proper_Body). The delay is required because the analysis -- may generate extra code which would be harder to relocate to the body. -- If the proper body is present, the aspect specifications are relocated -- to the corresponding body node: -- N_Package_Body -- N_Protected_Body -- N_Subprogram_Body -- N_Task_Body -- The subsequent analysis takes care of the aspect-to-pragma conversions -- and verification of pragma legality. In the case where the proper body -- is not available, the aspect specifications are analyzed on the spot -- (see Analyze_Proper_Body) to catch potential errors. -- The following table lists all aspects that can apply to a subprogram -- body [stub]. For instance, the following example is legal: -- package P with SPARK_Mode ...; -- package body P with SPARK_Mode is ...; -- The table should be synchronized with Pragma_On_Body_Or_Stub_OK in unit -- Sem_Prag. Aspect_On_Body_Or_Stub_OK : constant array (Aspect_Id) of Boolean := (Aspect_Refined_Depends => True, Aspect_Refined_Global => True, Aspect_Refined_Post => True, Aspect_SPARK_Mode => True, Aspect_Warnings => True, others => False); ------------------------------------------------------------------- -- Handling of Aspects Specifications on Single Concurrent Types -- ------------------------------------------------------------------- -- Certain aspects that appear on the following nodes -- N_Single_Protected_Declaration -- N_Single_Task_Declaration -- are treated as if they apply to the anonymous object produced by the -- analysis of a single concurrent type. The following table lists all -- aspects that should apply to the anonymous object. The table should -- be synchronized with Pragma_On_Anonymous_Object_OK in unit Sem_Prag. Aspect_On_Anonymous_Object_OK : constant array (Aspect_Id) of Boolean := (Aspect_Depends => True, Aspect_Global => True, Aspect_Part_Of => True, others => False); --------------------------------------------------- -- Handling of Aspect Specifications in the Tree -- --------------------------------------------------- -- Several kinds of declaration node permit aspect specifications in Ada -- 2012 mode. If there was room in all the corresponding declaration nodes, -- we could just have a field Aspect_Specifications pointing to a list of -- nodes for the aspects (N_Aspect_Specification nodes). But there isn't -- room, so we adopt a different approach. -- The following subprograms provide access to a specialized interface -- implemented internally with a hash table in the body, that provides -- access to aspect specifications. function Aspect_Specifications (N : Node_Id) return List_Id; -- Given a node N, returns the list of N_Aspect_Specification nodes that -- are attached to this declaration node. If the node is in the class of -- declaration nodes that permit aspect specifications, as defined by the -- predicate above, and if their Has_Aspects flag is set to True, then this -- will always be a non-empty list. If this flag is set to False, then -- No_List is returned. Normally, the only nodes that have Has_Aspects set -- True are the nodes for which Permits_Aspect_Specifications would return -- True (i.e. the declaration nodes defined in the RM as permitting the -- presence of Aspect_Specifications). However, it is possible for the -- flag Has_Aspects to be set on other nodes as a result of Rewrite and -- Replace calls, and this function may be used to retrieve the aspect -- specifications for the original rewritten node in such cases. function Aspects_On_Body_Or_Stub_OK (N : Node_Id) return Boolean; -- N denotes a body [stub] with aspects. Determine whether all aspects of N -- are allowed to appear on a body [stub]. procedure Exchange_Aspects (N1 : Node_Id; N2 : Node_Id); -- Exchange the aspect specifications of two nodes. If either node lacks an -- aspect specification list, the routine has no effect. It is assumed that -- both nodes can support aspects. function Find_Aspect (Id : Entity_Id; A : Aspect_Id; Class_Present : Boolean := False) return Node_Id; -- Find the aspect specification of aspect A (or A'Class if Class_Present) -- associated with entity I. -- Return Empty if Id does not have the requested aspect. function Find_Value_Of_Aspect (Id : Entity_Id; A : Aspect_Id; Class_Present : Boolean := False) return Node_Id; -- Find the value of aspect A (or A'Class, if Class_Present) associated -- with entity Id. Return Empty if Id does not have the requested aspect. function Has_Aspect (Id : Entity_Id; A : Aspect_Id; Class_Present : Boolean := False) return Boolean; -- Determine whether entity Id has aspect A (or A'Class, if Class_Present) procedure Move_Aspects (From : Node_Id; To : Node_Id); -- Relocate the aspect specifications of node From to node To. On entry it -- is assumed that To does not have aspect specifications. If From has no -- aspects, the routine has no effect. procedure Move_Or_Merge_Aspects (From : Node_Id; To : Node_Id); -- Relocate the aspect specifications of node From to node To. If To has -- aspects, the aspects of From are appended to the aspects of To. If From -- has no aspects, the routine has no effect. Special behavior: -- * When node From denotes a subprogram body stub without a previous -- declaration, the only aspects relocated to node To are those found -- in table Aspect_On_Body_Or_Stub_OK. -- * When node From denotes a single synchronized type declaration, the -- only aspects relocated to node To are those found in table -- Aspect_On_Anonymous_Object_OK. function Permits_Aspect_Specifications (N : Node_Id) return Boolean; -- Returns True if the node N is a declaration node that permits aspect -- specifications in the grammar. It is possible for other nodes to have -- aspect specifications as a result of Rewrite or Replace calls. procedure Remove_Aspects (N : Node_Id); -- Delete the aspect specifications associated with node N. If the node has -- no aspects, the routine has no effect. function Same_Aspect (A1 : Aspect_Id; A2 : Aspect_Id) return Boolean; -- Returns True if A1 and A2 are (essentially) the same aspect. This is not -- a simple equality test because e.g. Post and Postcondition are the same. -- This is used for detecting duplicate aspects. procedure Set_Aspect_Specifications (N : Node_Id; L : List_Id); -- The node N must be in the class of declaration nodes that permit aspect -- specifications and the Has_Aspects flag must be False on entry. L must -- be a non-empty list of N_Aspect_Specification nodes. This procedure sets -- the Has_Aspects flag to True, and makes an entry that can be retrieved -- by a subsequent Aspect_Specifications call. It is an error to call this -- procedure with a node that does not permit aspect specifications, or a -- node that has its Has_Aspects flag set True on entry, or with L being an -- empty list or No_List. end Aspects;
faicaltoubali/ENSEEIHT
Ada
9,037
adb
with Ada.Text_IO ; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with arbre_genealogique; procedure test_arbre_genealogique is package arbre_genea_100 is new arbre_genealogique ( Registre_Taille => 100 ); use arbre_genea_100; Arbre : T_Abr_Genea ; Liste : T_Ensemble_Identifiant ; type T_Tableau is array (1..13) of Integer ; Tableau1 : T_Tableau; Registre : T_Registre_Genea; i : Integer ; -- Construire un arbre genealogique, l'arbre à construire est le suivant -- -- 1 -- 3 2 -- 7 5 4 -- 12 11 10 8 -- -- Afficher l'arbre binaire après construction procedure Construire_Arbre_Genealogique ( Arbre : out T_Abr_Genea ) is begin Put("---------------------------------------------------");New_Line; Put ("=> Début du Test Constuire_Arbre_Genealogique"); New_Line; Creer_Minimal ( Arbre , 1 , Registre , To_Unbounded_String("Toubali"),To_Unbounded_String("Faical") , 7 , JUILLET , 1999 , To_Unbounded_String("Rabat") ); Pragma Assert ( not Vide_Genealogique ( Arbre ) ); Pragma Assert ( Taille_Genealogique ( Arbre ) = 1 ); Ajouter_Pere ( Arbre , 1 , 2 , Registre , To_Unbounded_String("Aassou") , To_Unbounded_String("Ayoub") , 20 , Janvier , 2000, To_Unbounded_String("Nador") ); Ajouter_Mere ( Arbre , 1 , 3 , Registre , To_Unbounded_String("Palace") , To_Unbounded_String("William") , 1 , Juillet , 1985 , To_Unbounded_String("Grande Bretagne ") ); Ajouter_Pere ( Arbre , 2 , 4 , Registre,To_Unbounded_String(" Francois"), To_Unbounded_String("Labeure") , 1 , Mars , 1995 , To_Unbounded_String("Toulouse") ); Ajouter_Mere ( Arbre , 2 , 5 , Registre, To_Unbounded_String("Jackie "), To_Unbounded_String("Monier "), 26 , Octobre , 1985 ,To_Unbounded_String(" Frankfurt")); Ajouter_Pere ( Arbre , 4 , 8 , Registre , To_Unbounded_String("Mami") ,To_Unbounded_String(" Kirshoff" ), 16 , Novembre , 1984 , To_Unbounded_String("Algerie") ); Ajouter_Pere ( Arbre , 5 , 10 , Registre , To_Unbounded_String("Muchos") , To_Unbounded_String("Colue") , 30 , Avril , 1994 , To_Unbounded_String("Senegal") ); Ajouter_Mere ( Arbre , 5 , 11 , Registre ,To_Unbounded_String(" Marie") ,To_Unbounded_String(" LeBlanc") , 14 , Juin , 1994 ,To_Unbounded_String( "Paris") ); Ajouter_Mere ( Arbre , 3 , 7 , Registre , To_Unbounded_String("Stephan" ),To_Unbounded_String(" Bolois" ), 2 , Janvier , 1865 , To_Unbounded_String("Allemagne " )); Ajouter_Pere ( Arbre , 7 ,12 , Registre , To_Unbounded_String("Nora") , To_Unbounded_String("Kirma" ), 6 , Juin , 2002 ,To_Unbounded_String(" South Africa") ); Pragma Assert ( Taille_Genealogique ( Arbre ) = 10 ); Afficher_Arbre_Noeud (Arbre, Avoir_Cle_Arbre_Genea(Arbre),1);New_Line; Put("=> Succès : Fin du test Constuire_Arbre_Genealogique ");New_Line; put("---------------------------------------------------"); New_Line; end Construire_Arbre_Genealogique; -- Creer une procedure qui teste toutes les procédures et fonction qui opèrent sur les parents des individus : -- 1- Savoir si un individu a uniquement un seul parent -- 2- Savoir si un individu a deux parents -- 3- Savoir si un individu n'a aucun parent procedure Parents_Test is begin Put ("=> Debut du test Parents_Test");New_Line;New_Line; Liste := Un_Seul_Parent ( Arbre ); Put_Line ("Les individus qui ont un seul parent sont : "); i := 1 ; while Liste /= Null loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Avoir_Suivant ( Liste ); i := i+1; end loop; Pragma Assert ( Tableau1(1) = 7 ); Pragma Assert ( Tableau1(2) = 3 ); Pragma Assert ( Tableau1(3) = 4 ); New_Line; put("Un_Seul_Parent est vérifié");New_Line; New_Line; i := 1 ; Liste := Deux_Parent ( Arbre ); Put_Line ( "Les individus qui ont deux parents sont : "); while Liste /= Null loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Avoir_Suivant ( Liste ); i := i+1; end loop; Pragma Assert ( Tableau1(1) = 5 ); Pragma Assert ( Tableau1(2) = 2 ); Pragma Assert ( Tableau1(3) = 1 ); New_Line; Put ("Deux_Parent est vérifié ");New_Line; New_Line; Liste := Aucun_Parent ( Arbre ); i := 1 ; Put ("Les individus qui n'ont aucun parent sont :");New_Line; while Liste /= Null and i<=13 loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Avoir_Suivant ( Liste ); i := i+1; end loop; Pragma Assert ( Tableau1(1) = 12 ); Pragma Assert ( Tableau1(2) = 11 ); Pragma Assert ( Tableau1(3) = 10 ); Pragma Assert ( Tableau1(4) = 8 ); New_Line; Put("Aucun Parent est vérifié ");New_line; New_Line; Put_Line ("=> Succès : Fin du test Parents_Test "); put("---------------------------------------------------");New_Line; end Parents_Test ; --Creer une procedure qui teste toutes les procédures et fonctions qui opèrent sur les ancetres des individus. procedure Ancetres_Test is begin Put("---------------------------------------------------");New_Line; Put ( "=> Debut du test de Ancetres_Test"); Tableau1(1) := Nombre_Ancetre ( Arbre, 1 ) ; Tableau1(2) := Nombre_Ancetre ( Arbre, 2 ) ; Tableau1(3) := Nombre_Ancetre ( Arbre, 3 ) ; Tableau1(4) := Nombre_Ancetre ( Arbre, 5 ) ; Tableau1(5) := Nombre_Ancetre ( Arbre, 7 ) ; Tableau1(6) := Nombre_Ancetre ( Arbre, 12 ); Pragma Assert ( Tableau1(1) = 10); Pragma Assert ( Tableau1(2) = 6); Pragma Assert ( Tableau1(3) = 3); Pragma Assert ( Tableau1(4) = 3); Pragma Assert ( Tableau1(5) = 2); Pragma Assert ( Tableau1(6) = 1); --Pragma Assert ( Tableau1 = ( 10,6,3,3,2,1)); Put ("Fin test Nombre_Ancetre : Succès");New_Line; Put ("Debut test Ancetres_Plusieurs_Generation");New_Line; Liste := Null ; i := 1; Liste := Ancetres_Plusieurs_Generation( Arbre , 1 , 1 ) ; while Liste /= Null loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Liste.All.Suivant; i := i+1; end loop; New_Line ; Pragma Assert ( Tableau1(1) = 1); Pragma Assert ( Tableau1(2) = 2); Pragma Assert ( Tableau1(3) = 3); --Pragma Assert ( Tableau1 = ( 1, 2 , 3 )); Liste := Null ; i := 1; Liste := Ancetres_Plusieurs_Generation( Arbre , 1 , 2 ) ; while Liste /= Null loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Liste.All.Suivant; i := i+1; end loop; New_Line; Pragma Assert ( Tableau1(1) = 1); Pragma Assert ( Tableau1(2) = 2); Pragma Assert ( Tableau1(3) = 4); Pragma Assert ( Tableau1(4) = 5); Pragma Assert ( Tableau1(5) = 3); Pragma Assert ( Tableau1(6) = 7 ); --Pragma Assert ( Tableau1 = (1 ,2 , 4 ,5 ,3 ,7 )); Put ("Fin test Ancetres_Plusieurs_Generation ");New_Line; Put ("Debut test Ancetres_Generation");New_Line; i:= 1 ; Liste := Null ; Liste := Ancetres_Generation ( Arbre , 1 , 3 ); while Liste /= Null loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Liste.All.Suivant; i := i+1; end loop; Pragma Assert ( Tableau1(1) = 8 ); Pragma Assert ( Tableau1(2) = 10); Pragma Assert ( Tableau1(3) = 11); Pragma Assert ( Tableau1(4) = 12 ) ; -- Tableau1 = ( 8 , 10 ,11 ,12 ); i:= 1 ; New_Line; Liste := Null ; Liste := Ancetres_Generation ( Arbre , 1 ,2 ); while Liste /= Null loop Tableau1(i) := Avoir_Identifiant ( Liste ) ; Put ( Avoir_Identifiant ( Liste )); Liste := Liste.All.Suivant; i := i+1; end loop; New_Line; Pragma Assert ( Tableau1(1) = 4 ); Pragma Assert ( Tableau1(2) = 5); Pragma Assert ( Tableau1(3) = 7); -- Tableau1 = ( 4, 5,7 ) Put ("Fin test Ancetres_Generation");New_Line; Put ("Debut test Verifier_Ancetres");New_Line; i := Verifier_Ancetres ( Arbre ,2 ,3); -- i = 0 Put ( i) ;New_Line; Pragma Assert ( i = 0 ); -- pragma assert ( i = 0 ) Vraie mais ne marche pas i := Verifier_Ancetres ( Arbre ,1 , 3); -- i = 1 Put (i);New_Line; Pragma Assert ( i = 1 ); i:= Verifier_Ancetres ( Arbre,7 ,5 ); --i = 0 Put (i ) ;New_Line; Pragma Assert ( i = 0 ); Put ("Fin test Verifier_Ancetres");New_Line; Put_Line ("=> Succès : Fin du test de Ancetres_Test"); end Ancetres_Test; begin Construire_Arbre_Genealogique (Arbre); Parents_Test; Ancetres_Test; end test_arbre_genealogique;
reznikmm/matreshka
Ada
5,515
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- 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. ------------------------------------------------------------------------------ -- Image is a graphical element that defines a shape that paints an image -- with a given URL within given bounds. ------------------------------------------------------------------------------ limited with AMF.DC; with AMF.DG.Graphical_Elements; with League.Strings; package AMF.DG.Images is pragma Preelaborate; type DG_Image is limited interface and AMF.DG.Graphical_Elements.DG_Graphical_Element; type DG_Image_Access is access all DG_Image'Class; for DG_Image_Access'Storage_Size use 0; not overriding function Get_Source (Self : not null access constant DG_Image) return League.Strings.Universal_String is abstract; -- Getter of Image::source. -- -- the URL of a referenced image file. not overriding procedure Set_Source (Self : not null access DG_Image; To : League.Strings.Universal_String) is abstract; -- Setter of Image::source. -- -- the URL of a referenced image file. not overriding function Get_Bounds (Self : not null access constant DG_Image) return AMF.DC.DC_Bounds is abstract; -- Getter of Image::bounds. -- -- the bounds within which the image is rendered. not overriding procedure Set_Bounds (Self : not null access DG_Image; To : AMF.DC.DC_Bounds) is abstract; -- Setter of Image::bounds. -- -- the bounds within which the image is rendered. not overriding function Get_Is_Aspect_Ratio_Preserved (Self : not null access constant DG_Image) return Boolean is abstract; -- Getter of Image::isAspectRatioPreserved. -- -- wether to preserve the aspect ratio of the image upon scaling, i.e. the -- same scale factor for width and height. not overriding procedure Set_Is_Aspect_Ratio_Preserved (Self : not null access DG_Image; To : Boolean) is abstract; -- Setter of Image::isAspectRatioPreserved. -- -- wether to preserve the aspect ratio of the image upon scaling, i.e. the -- same scale factor for width and height. end AMF.DG.Images;
faelys/natools
Ada
3,560
ads
------------------------------------------------------------------------------ -- Copyright (c) 2013, 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. -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Natools.Indefinite_Holders is an implementation of a subset of Ada 2012 -- -- Containers.Indefinite_Holders, compatible with Ada 2005. -- -- -- -- WARNING: tampering checks are not implemented yet. -- ------------------------------------------------------------------------------ private with Ada.Finalization; private with Ada.Unchecked_Deallocation; generic type Element_Type (<>) is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Natools.Indefinite_Holders is pragma Preelaborate (Indefinite_Holders); -- pragma Remote_Types (Indefinite_Holders); is not supported yet. type Holder is tagged private; pragma Preelaborable_Initialization (Holder); Empty_Holder : constant Holder; function "=" (Left, Right : Holder) return Boolean; function To_Holder (New_Item : Element_Type) return Holder; function Is_Empty (Container : Holder) return Boolean; procedure Clear (Container : in out Holder); function Element (Container : Holder) return Element_Type; procedure Replace_Element (Container : in out Holder; New_Item : in Element_Type); procedure Query_Element (Container : in Holder; Process : not null access procedure (Element : in Element_Type)); procedure Update_Element (Container : in out Holder; Process : not null access procedure (Element : in out Element_Type)); function Reference (Container : Holder) return access Element_Type; procedure Assign (Target : in out Holder; Source : in Holder); function Copy (Source : Holder) return Holder; procedure Move (Target : in out Holder; Source : in out Holder); private type Element_Access is access Element_Type; procedure Free is new Ada.Unchecked_Deallocation (Element_Type, Element_Access); type Holder is new Ada.Finalization.Controlled with record Ref : Element_Access := null; end record; overriding procedure Adjust (Object : in out Holder); overriding procedure Finalize (Object : in out Holder); Empty_Holder : constant Holder := (Ada.Finalization.Controlled with null); end Natools.Indefinite_Holders;
sparre/Command-Line-Parser-Generator
Ada
150
ads
package Subtype_Chains_1 is subtype One is Integer with Dynamic_Predicate => One /= 2; procedure Something_To_Call; end Subtype_Chains_1;
reznikmm/matreshka
Ada
4,364
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <[email protected]> -- -- 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$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_00A0 is pragma Preelaborate; Group_00A0 : aliased constant Core_Second_Stage := (16#15# => -- A015 (Modifier_Letter, Wide, Other, A_Letter, O_Letter, Nonstarter, (Extender | Alphabetic | Case_Ignorable | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False)), others => (Other_Letter, Wide, Other, A_Letter, O_Letter, Ideographic, (Alphabetic | Grapheme_Base | ID_Continue | ID_Start | XID_Continue | XID_Start => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_00A0;