CombinedText
stringlengths
4
3.42M
package Tcl.Commands.Test_Data.Tests.Argv_Pointer is end Tcl.Commands.Test_Data.Tests.Argv_Pointer;
----------------------------------------------------------------------- -- awa-users-beans -- ASF Beans for user module -- Copyright (C) 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Beans.Basic; with Util.Beans.Objects; with Util.Beans.Methods; with Ada.Strings.Unbounded; with AWA.Users.Services; with AWA.Users.Modules; with AWA.Users.Principals; package AWA.Users.Beans is use Ada.Strings.Unbounded; type Authenticate_Bean is new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record Module : AWA.Users.Modules.User_Module_Access := null; Manager : AWA.Users.Services.User_Service_Access := null; Email : Unbounded_String; Password : Unbounded_String; First_Name : Unbounded_String; Last_Name : Unbounded_String; Access_Key : Unbounded_String; end record; -- Attributes exposed by the <b>Authenticate_Bean</b> through Get_Value. EMAIL_ATTR : constant String := "email"; PASSWORD_ATTR : constant String := "password"; FIRST_NAME_ATTR : constant String := "firstName"; LAST_NAME_ATTR : constant String := "lastName"; KEY_ATTR : constant String := "key"; type Authenticate_Bean_Access is access all Authenticate_Bean'Class; -- Get the value identified by the name. overriding function Get_Value (From : in Authenticate_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the value identified by the name. overriding procedure Set_Value (From : in out Authenticate_Bean; Name : in String; Value : in Util.Beans.Objects.Object); -- This bean provides some methods that can be used in a Method_Expression overriding function Get_Method_Bindings (From : in Authenticate_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; procedure Set_Session_Principal (Data : in Authenticate_Bean; Principal : in AWA.Users.Principals.Principal_Access); procedure Set_Authenticate_Cookie (Data : in out Authenticate_Bean; Principal : in AWA.Users.Principals.Principal_Access); -- Action to register a user procedure Register_User (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); -- Action to verify the user after the registration procedure Verify_User (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); -- Action to trigger the lost password email process. procedure Lost_Password (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); -- Action to validate the reset password key and set a new password. procedure Reset_Password (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); -- Action to authenticate a user (password authentication). procedure Authenticate_User (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); -- Logout the user and closes the session. procedure Logout_User (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); procedure Load_User (Data : in out Authenticate_Bean; Outcome : in out Unbounded_String); -- Create an authenticate bean. function Create_Authenticate_Bean (Module : in AWA.Users.Modules.User_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access; -- ------------------------------ -- Current user -- ------------------------------ -- The <b>Current_User_Bean</b> provides information about the current user. -- It relies on the <b>AWA.Services.Contexts</b> to identify the current user -- and return information about him/her. type Current_User_Bean is new Util.Beans.Basic.Readonly_Bean with null record; type Current_User_Bean_Access is access all Current_User_Bean'Class; -- Attributes exposed by <b>Current_User_Bean</b> IS_LOGGED_ATTR : constant String := "isLogged"; USER_EMAIL_ATTR : constant String := "email"; USER_NAME_ATTR : constant String := "name"; USER_ID_ATTR : constant String := "id"; -- Get the value identified by the name. The following names are recognized: -- o isLogged Boolean True if a user is logged -- o name String The user name -- o email String The user email address -- o id Long The user identifier overriding function Get_Value (From : in Current_User_Bean; Name : in String) return Util.Beans.Objects.Object; -- Create the current user bean. function Create_Current_User_Bean (Module : in AWA.Users.Modules.User_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access; end AWA.Users.Beans;
with Ada.Finalization; with Interfaces; with kv.avm.references; use kv.avm.references; with kv.avm.Instructions; with kv.avm.Registers; with kv.avm.Memories; with kv.avm.Actor_References; with kv.avm.Actor_References.Sets; with kv.avm.Tuples; package kv.avm.Frames is Program_Counter_Error : exception; Invalid_Source_Error : exception; Operand_Mismatch_Error : exception; Fixed_Target_Error : exception; type Frame_Type is tagged private; type Frame_Access is access all Frame_Type; procedure Initialize (Self : in out Frame_Type; Instance : in kv.avm.Actor_References.Actor_Reference_Type; Name : in kv.avm.Registers.String_Type; Invoker : in kv.avm.Actor_References.Actor_Reference_Type; Future : in Interfaces.Unsigned_32; Code : in kv.avm.Instructions.Code_Access; Memory : in kv.avm.Memories.Memory_Type; Next : in Frame_Access := null); function Program_Counter (Self : in Frame_Type) return Interfaces.Unsigned_32; procedure Set_Program_Counter (Self : in out Frame_Type; Pc : in Interfaces.Unsigned_32); procedure Increment_Program_Counter (Self : in out Frame_Type); function Is_Done(Self : Frame_Type) return Boolean; function Get_Running (Self : in Frame_Type) return Boolean; procedure Set_Running (Self : in out Frame_Type; Running : in Boolean); procedure Set_Blocked (Self : in out Frame_Type; Blocked : in Boolean); function Fetch_Instruction (Self : in Frame_Type) return kv.avm.Instructions.Instruction_Type; procedure Fetch_And_Increment -- Fetch an instruction and increment the program counter by one (Self : in out Frame_Type; Instruction : out kv.avm.Instructions.Instruction_Type); procedure Vet_Operands (Self : in out Frame_Type; Target : in Reference_Type; Source : in Reference_Type); procedure Vet_Operands (Self : in out Frame_Type; Target : in Reference_Type; Source_1 : in Reference_Type; Source_2 : in Reference_Type); function Get (Self : in Frame_Type; Ref : in Reference_Type) return kv.avm.Registers.Register_Type; procedure Set (Self : in out Frame_Type; Ref : in Reference_Type; Value : in kv.avm.Registers.Register_Type); function Get_Invoker(Self : Frame_Type) return kv.avm.Actor_References.Actor_Reference_Type; function Get_Instance(Self : Frame_Type) return kv.avm.Actor_References.Actor_Reference_Type; function Is_Self_Replying(Self : Frame_Type) return Boolean; function Get_Name(Self : Frame_Type) return String; procedure Set_Invoker -- Test routine (Self : in out Frame_Type; Invoker : in kv.avm.Actor_References.Actor_Reference_Type); procedure Set_Future -- Test routine (Self : in out Frame_Type; Future : in Interfaces.Unsigned_32); function Fold (Self : in Frame_Type; Ref : in Reference_Type) return kv.avm.Tuples.Tuple_Type; procedure Process_Gosub_Response (Self : in out Frame_Type; Answer : in kv.avm.Tuples.Tuple_Type); procedure Set_Reply_Information (Self : in out Frame_Type; Reply_To : in Reference_Type; Future : in Interfaces.Unsigned_32); function Get_Invoker_Future(self : Frame_Type) return Interfaces.Unsigned_32; procedure Process_Gosub (Self : in out Frame_Type; Tail_Call : in Boolean; Supercall : in Boolean; Message_Name : in kv.avm.Registers.String_Type; Data : in kv.avm.Tuples.Tuple_Type; Future : in Interfaces.Unsigned_32); procedure Resolve_Future (Self : in out Frame_Type; Answer : in kv.avm.Tuples.Tuple_Type; Future : in Interfaces.Unsigned_32); function Reachable(Self : Frame_Type) return kv.avm.Actor_References.Sets.Set; function Get_Next(Self : Frame_Type) return Frame_Access; procedure Halt_Actor (Self : in out Frame_Type); function Image(Self : Frame_Type) return String; function Debug_Info(Self : Frame_Type) return String; procedure Prepare_For_Deletion(Self : in out Frame_Type); private type Frame_Type is tagged record Instance : kv.avm.Actor_References.Actor_Reference_Type; Invoker : kv.avm.Actor_References.Actor_Reference_Type; Future : Interfaces.Unsigned_32; -- Future of the Invoker Future_R : Reference_Type; Name : kv.avm.Registers.String_Type; Code : kv.avm.Instructions.Code_Access; Memory : kv.avm.Memories.Memory_Type; Pc : Interfaces.Unsigned_32; RunningF : Boolean; Blocked : Boolean; Depth : Positive; Next : Frame_Access; end record; end kv.avm.Frames;
------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $: with Asis.Gela.Base_Lists; use Asis.Gela.Base_Lists; package body Asis.Gela.Iterator is procedure Real_Walk_Element (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information; Read_Only : in Boolean); procedure Walk_List (List : access Primary_Base_List_Node'Class; Control : in out Traverse_Control; State : in out State_Information; Read_Only : in Boolean); ------------------ -- Walk_Element -- ------------------ procedure Walk_Element (Element : in Asis.Element; Control : in out Traverse_Control; State : in out State_Information) is Store : Asis.Element := Element; begin Check_Nil_Element (Element, "Walk_Element"); Real_Walk_Element (Store, Control, State, True); pragma Assert (Is_Equal (Store, Element)); end Walk_Element; ------------------ -- Walk_Element -- ------------------ procedure Walk_Element (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information; Read_Only : in Boolean) is begin Check_Nil_Element (Element, "Walk_Element"); Real_Walk_Element (Element, Control, State, Read_Only); end Walk_Element; --------------------------- -- Walk_Element_And_Free -- --------------------------- procedure Walk_Element_And_Free (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information) is -- Store : Asis.Element := Element; begin Check_Nil_Element (Element, "Walk_Element_And_Free"); Real_Walk_Element (Element, Control, State, False); -- if not Is_Equal (Store, Element) then -- Free (Store); -- end if; end Walk_Element_And_Free; --------------- -- Walk_List -- --------------- procedure Walk_List (List : access Primary_Base_List_Node'Class; Control : in out Traverse_Control; State : in out State_Information; Read_Only : in Boolean) is Element : Asis.Element; Store : Asis.Element; begin pragma Assert (Control = Continue); for I in 1 .. Length (List.all) loop Element := Get_Item (List, I); Store := Element; Real_Walk_Element (Element, Control, State, Read_Only); if not Read_Only and then not Is_Equal (Store, Element) then if Assigned (Element) then Add_After (List.all, Store, Element); end if; Remove (List.all, Store); -- Free (Store); end if; exit when Control /= Continue; end loop; end Walk_List; ----------------------- -- Real_Walk_Element -- ----------------------- procedure Real_Walk_Element (Element : in out Asis.Element; Control : in out Traverse_Control; State : in out State_Information; Read_Only : in Boolean) is begin if not Assigned (Element) or Control /= Continue then return; end if; Pre_Operation (Element, Control, State); pragma Assert (Assigned (Element) or Control = Abandon_Children); if Control = Continue then declare Children : constant Traverse_List := Asis.Children (Element); Store : Asis.Element; begin for I in Children'Range loop if Children (I).Is_List and then Assigned (Children (I).List) then Walk_List (Primary_Base_List (Children (I).List), Control, State, Read_Only); elsif not Children (I).Is_List and then Assigned (Children (I).Item.all) then Store := Children (I).Item.all; Real_Walk_Element (Children (I).Item.all, Control, State, Read_Only); if not Read_Only and then not Is_Equal (Store, Children (I).Item.all) then null; -- Free (Store); end if; end if; exit when Control /= Continue; end loop; end; end if; if Control = Abandon_Siblings then Control := Continue; end if; if Control = Continue then Post_Operation (Element, Control, State); end if; if Control = Abandon_Children then Control := Continue; end if; end Real_Walk_Element; end Asis.Gela.Iterator; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, Maxim Reznik -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the Maxim Reznik, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO; procedure Test is x: integer := 2147483648; begin Put('a'); end;
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" function GL.API.Subprogram_Reference (Function_Name : String) return System.Address; pragma Preelaborate (GL.API.Subprogram_Reference);
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A package is used to group elements, and provides a namespace for the -- grouped elements. ------------------------------------------------------------------------------ limited with AMF.CMOF.Named_Elements; with AMF.CMOF.Namespaces; limited with AMF.CMOF.Package_Merges.Collections; with AMF.CMOF.Packageable_Elements; limited with AMF.CMOF.Packageable_Elements.Collections; limited with AMF.CMOF.Packages.Collections; limited with AMF.CMOF.Types.Collections; package AMF.CMOF.Packages is pragma Preelaborate; type CMOF_Package is limited interface and AMF.CMOF.Packageable_Elements.CMOF_Packageable_Element and AMF.CMOF.Namespaces.CMOF_Namespace; type CMOF_Package_Access is access all CMOF_Package'Class; for CMOF_Package_Access'Storage_Size use 0; not overriding function Get_Packaged_Element (Self : not null access constant CMOF_Package) return AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element is abstract; -- Getter of Package::packagedElement. -- -- Specifies the packageable elements that are owned by this Package. not overriding function Get_Owned_Type (Self : not null access constant CMOF_Package) return AMF.CMOF.Types.Collections.Set_Of_CMOF_Type is abstract; -- Getter of Package::ownedType. -- -- References the packaged elements that are Types. not overriding function Get_Nested_Package (Self : not null access constant CMOF_Package) return AMF.CMOF.Packages.Collections.Set_Of_CMOF_Package is abstract; -- Getter of Package::nestedPackage. -- -- References the packaged elements that are Packages. not overriding function Get_Nesting_Package (Self : not null access constant CMOF_Package) return AMF.CMOF.Packages.CMOF_Package_Access is abstract; -- Getter of Package::nestingPackage. -- -- References the Package that owns this Package. not overriding procedure Set_Nesting_Package (Self : not null access CMOF_Package; To : AMF.CMOF.Packages.CMOF_Package_Access) is abstract; -- Setter of Package::nestingPackage. -- -- References the Package that owns this Package. not overriding function Get_Package_Merge (Self : not null access constant CMOF_Package) return AMF.CMOF.Package_Merges.Collections.Set_Of_CMOF_Package_Merge is abstract; -- Getter of Package::packageMerge. -- -- References the PackageMerges that are owned by this Package. not overriding function Get_Uri (Self : not null access constant CMOF_Package) return AMF.Optional_String is abstract; -- Getter of Package::uri. -- -- Provides an identifier for the package that can be used for many -- purposes. A URI is the universally unique identification of the package -- following the IETF URI specification, RFC 2396 -- http://www.ietf.org/rfc/rfc2396.txt. UML 1.4 and MOF 1.4 were assigned -- URIs to their outermost package. The package URI appears in XMI files -- when instances of the package’s classes are serialized. not overriding procedure Set_Uri (Self : not null access CMOF_Package; To : AMF.Optional_String) is abstract; -- Setter of Package::uri. -- -- Provides an identifier for the package that can be used for many -- purposes. A URI is the universally unique identification of the package -- following the IETF URI specification, RFC 2396 -- http://www.ietf.org/rfc/rfc2396.txt. UML 1.4 and MOF 1.4 were assigned -- URIs to their outermost package. The package URI appears in XMI files -- when instances of the package’s classes are serialized. overriding function Must_Be_Owned (Self : not null access constant CMOF_Package) return Boolean is abstract; -- Operation Package::mustBeOwned. -- -- The query mustBeOwned() indicates whether elements of this type must -- have an owner. not overriding function Visible_Members (Self : not null access constant CMOF_Package) return AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element is abstract; -- Operation Package::visibleMembers. -- -- The query visibleMembers() defines which members of a Package can be -- accessed outside it. not overriding function Makes_Visible (Self : not null access constant CMOF_Package; El : AMF.CMOF.Named_Elements.CMOF_Named_Element_Access) return Boolean is abstract; -- Operation Package::makesVisible. -- -- The query makesVisible() defines whether a Package makes an element -- visible outside itself. Elements with no visibility and elements with -- public visibility are made visible. end AMF.CMOF.Packages;
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Check_Positive2 is N : Integer; begin Put ("Enter an integer value: "); -- Put a String Get (N); -- Reads in an integer value Put (N); -- Put an Integer declare S : String := (if N > 0 then " is a positive number" else " is not a positive number"); begin Put_Line (S); end; end Check_Positive2;
with Ada.Float_Text_IO, Ada.Integer_Text_IO, Ada.Text_IO, Ada.Numerics.Elementary_Functions; procedure First_Class_Functions is use Ada.Float_Text_IO, Ada.Integer_Text_IO, Ada.Text_IO, Ada.Numerics.Elementary_Functions; function Sqr (X : Float) return Float is begin return X ** 2; end Sqr; type A_Function is access function (X : Float) return Float; generic F, G : A_Function; function Compose (X : Float) return Float; function Compose (X : Float) return Float is begin return F (G (X)); end Compose; Functions : array (Positive range <>) of A_Function := (Sin'Access, Cos'Access, Sqr'Access); Inverses : array (Positive range <>) of A_Function := (Arcsin'Access, Arccos'Access, Sqrt'Access); begin for I in Functions'Range loop declare function Identity is new Compose (Functions (I), Inverses (I)); Test_Value : Float := 0.5; Result : Float; begin Result := Identity (Test_Value); if Result = Test_Value then Put ("Example "); Put (I, Width => 0); Put_Line (" is perfect for the given test value."); else Put ("Example "); Put (I, Width => 0); Put (" is off by"); Put (abs (Result - Test_Value)); Put_Line (" for the given test value."); end if; end; end loop; end First_Class_Functions;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ W I D E _ C H A R A C T E R T S . U N I C O D E -- -- -- -- S p e c -- -- -- -- Copyright (C) 2005-2019, 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. -- -- -- ------------------------------------------------------------------------------ -- Unicode categorization routines for Wide_Wide_Character with System.UTF_32; package Ada.Wide_Wide_Characters.Unicode is pragma Pure; -- The following type defines the categories from the unicode definitions. -- The one addition we make is Fe, which represents the characters FFFE -- and FFFF in any of the planes. type Category is new System.UTF_32.Category; -- Cc Other, Control -- Cf Other, Format -- Cn Other, Not Assigned -- Co Other, Private Use -- Cs Other, Surrogate -- Ll Letter, Lowercase -- Lm Letter, Modifier -- Lo Letter, Other -- Lt Letter, Titlecase -- Lu Letter, Uppercase -- Mc Mark, Spacing Combining -- Me Mark, Enclosing -- Mn Mark, Nonspacing -- Nd Number, Decimal Digit -- Nl Number, Letter -- No Number, Other -- Pc Punctuation, Connector -- Pd Punctuation, Dash -- Pe Punctuation, Close -- Pf Punctuation, Final quote -- Pi Punctuation, Initial quote -- Po Punctuation, Other -- Ps Punctuation, Open -- Sc Symbol, Currency -- Sk Symbol, Modifier -- Sm Symbol, Math -- So Symbol, Other -- Zl Separator, Line -- Zp Separator, Paragraph -- Zs Separator, Space -- Fe relative position FFFE/FFFF in plane function Get_Category (U : Wide_Wide_Character) return Category; pragma Inline (Get_Category); -- Given a Wide_Wide_Character, returns corresponding Category, or Cn if -- the code does not have an assigned unicode category. -- The following functions perform category tests corresponding to lexical -- classes defined in the Ada standard. There are two interfaces for each -- function. The second takes a Category (e.g. returned by Get_Category). -- The first takes a Wide_Wide_Character. The form taking the -- Wide_Wide_Character is typically more efficient than calling -- Get_Category, but if several different tests are to be performed on the -- same code, it is more efficient to use Get_Category to get the category, -- then test the resulting category. function Is_Letter (U : Wide_Wide_Character) return Boolean; function Is_Letter (C : Category) return Boolean; pragma Inline (Is_Letter); -- Returns true iff U is a letter that can be used to start an identifier, -- or if C is one of the corresponding categories, which are the following: -- Letter, Uppercase (Lu) -- Letter, Lowercase (Ll) -- Letter, Titlecase (Lt) -- Letter, Modifier (Lm) -- Letter, Other (Lo) -- Number, Letter (Nl) function Is_Digit (U : Wide_Wide_Character) return Boolean; function Is_Digit (C : Category) return Boolean; pragma Inline (Is_Digit); -- Returns true iff U is a digit that can be used to extend an identifer, -- or if C is one of the corresponding categories, which are the following: -- Number, Decimal_Digit (Nd) function Is_Line_Terminator (U : Wide_Wide_Character) return Boolean; pragma Inline (Is_Line_Terminator); -- Returns true iff U is an allowed line terminator for source programs, -- if U is in the category Zp (Separator, Paragaph), or Zs (Separator, -- Line), or if U is a conventional line terminator (CR, LF, VT, FF). -- There is no category version for this function, since the set of -- characters does not correspond to a set of Unicode categories. function Is_Mark (U : Wide_Wide_Character) return Boolean; function Is_Mark (C : Category) return Boolean; pragma Inline (Is_Mark); -- Returns true iff U is a mark character which can be used to extend an -- identifier, or if C is one of the corresponding categories, which are -- the following: -- Mark, Non-Spacing (Mn) -- Mark, Spacing Combining (Mc) function Is_Other (U : Wide_Wide_Character) return Boolean; function Is_Other (C : Category) return Boolean; pragma Inline (Is_Other); -- Returns true iff U is an other format character, which means that it -- can be used to extend an identifier, but is ignored for the purposes of -- matching of identiers, or if C is one of the corresponding categories, -- which are the following: -- Other, Format (Cf) function Is_Punctuation (U : Wide_Wide_Character) return Boolean; function Is_Punctuation (C : Category) return Boolean; pragma Inline (Is_Punctuation); -- Returns true iff U is a punctuation character that can be used to -- separate pices of an identifier, or if C is one of the corresponding -- categories, which are the following: -- Punctuation, Connector (Pc) function Is_Space (U : Wide_Wide_Character) return Boolean; function Is_Space (C : Category) return Boolean; pragma Inline (Is_Space); -- Returns true iff U is considered a space to be ignored, or if C is one -- of the corresponding categories, which are the following: -- Separator, Space (Zs) function Is_Non_Graphic (U : Wide_Wide_Character) return Boolean; function Is_Non_Graphic (C : Category) return Boolean; pragma Inline (Is_Non_Graphic); -- Returns true iff U is considered to be a non-graphic character, or if C -- is one of the corresponding categories, which are the following: -- Other, Control (Cc) -- Other, Private Use (Co) -- Other, Surrogate (Cs) -- Separator, Line (Zl) -- Separator, Paragraph (Zp) -- FFFE or FFFF positions in any plane (Fe) -- -- Note that the Ada category format effector is subsumed by the above -- list of Unicode categories. -- -- Note that Other, Unassiged (Cn) is quite deliberately not included -- in the list of categories above. This means that should any of these -- code positions be defined in future with graphic characters they will -- be allowed without a need to change implementations or the standard. -- -- Note that Other, Format (Cf) is also quite deliberately not included -- in the list of categories above. This means that these characters can -- be included in character and string literals. -- The following function is used to fold to upper case, as required by -- the Ada 2005 standard rules for identifier case folding. Two -- identifiers are equivalent if they are identical after folding all -- letters to upper case using this routine. A fold to lower routine is -- also provided. function To_Lower_Case (U : Wide_Wide_Character) return Wide_Wide_Character; pragma Inline (To_Lower_Case); -- If U represents an upper case letter, returns the corresponding lower -- case letter, otherwise U is returned unchanged. The folding is locale -- independent as defined by documents referenced in the note in section -- 1 of ISO/IEC 10646:2003 function To_Upper_Case (U : Wide_Wide_Character) return Wide_Wide_Character; pragma Inline (To_Upper_Case); -- If U represents a lower case letter, returns the corresponding upper -- case letter, otherwise U is returned unchanged. The folding is locale -- independent as defined by documents referenced in the note in section -- 1 of ISO/IEC 10646:2003 end Ada.Wide_Wide_Characters.Unicode;
pragma License (Unrestricted); with Ada.Finalization; with System.Storage_Elements; package System.Storage_Pools is pragma Preelaborate; type Root_Storage_Pool is abstract limited new Ada.Finalization.Limited_Controlled with private; pragma Preelaborable_Initialization (Root_Storage_Pool); procedure Allocate ( Pool : in out Root_Storage_Pool; Storage_Address : out Address; Size_In_Storage_Elements : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count) is abstract; procedure Deallocate ( Pool : in out Root_Storage_Pool; Storage_Address : Address; Size_In_Storage_Elements : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count) is abstract; function Storage_Size (Pool : Root_Storage_Pool) return Storage_Elements.Storage_Count is abstract; -- to use in System.Finalization_Masters type Storage_Pool_Access is access all Root_Storage_Pool'Class; for Storage_Pool_Access'Storage_Size use 0; private type Root_Storage_Pool is abstract limited new Ada.Finalization.Limited_Controlled with null record; -- required for allocation with explicit 'Storage_Pool by compiler -- (s-stopoo.ads) procedure Allocate_Any ( Pool : in out Root_Storage_Pool'Class; Storage_Address : out Address; Size_In_Storage_Elements : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count); -- required for deallocation with explicit 'Storage_Pool by compiler -- (s-stopoo.ads) procedure Deallocate_Any ( Pool : in out Root_Storage_Pool'Class; Storage_Address : Address; Size_In_Storage_Elements : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count); -- required for extra parameter of built-in-place (s-stopoo.ads) subtype Root_Storage_Pool_Ptr is Storage_Pool_Access; end System.Storage_Pools;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . V A L _ B O O L -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- Copyright (c) 1992,1993,1994 NYU, All Rights Reserved -- -- -- -- The GNAT library is free software; you can redistribute it and/or modify -- -- it under terms of the GNU Library General Public License as published by -- -- the Free Software Foundation; either version 2, or (at your option) any -- -- later version. The GNAT 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 -- -- the GNAT library; see the file COPYING.LIB. If not, write to the Free -- -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -- -- -- ------------------------------------------------------------------------------ package System.Val_Bool is pragma Pure (Val_Bool); function Value_Boolean (Str : String) return Boolean; -- Computes Boolean'Value (Str). end System.Val_Bool;
with Ada.Calendar; use Ada.Calendar; with Ada.Containers.Generic_Array_Sort; with Ada.Containers.Vectors; with Ada.Exceptions; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Wide_Wide_Unbounded; use Ada.Strings.Wide_Wide_Unbounded; with Ada.Text_IO; with Ada.Unchecked_Deallocation; with GNAT.Traceback.Symbolic; with GNATCOLL.JSON; with GNATCOLL.Opt_Parse; with GNATCOLL.VFS; use GNATCOLL.VFS; with Langkit_Support.Adalog.Debug; use Langkit_Support.Adalog.Debug; with Langkit_Support.Slocs; use Langkit_Support.Slocs; with Langkit_Support.Text; use Langkit_Support.Text; with Libadalang.Analysis; use Libadalang.Analysis; with Libadalang.Common; use Libadalang.Common; with Libadalang.Helpers; use Libadalang.Helpers; with Libadalang.Iterators; use Libadalang.Iterators; with Put_Title; procedure Nameres is package String_Vectors is new Ada.Containers.Vectors (Positive, Unbounded_String); package J renames GNATCOLL.JSON; type Stats_Record is record Nb_Files_Analyzed : Natural := 0; Nb_Successes : Natural := 0; Nb_Fails : Natural := 0; Nb_Xfails : Natural := 0; Nb_Exception_Fails : Natural := 0; Max_Nb_Fails : Natural := 0; File_With_Most_Fails : Unbounded_String; end record; procedure Merge (Stats : in out Stats_Record; Other : Stats_Record); -- Merge data from Stats and Other into Stats type Config_Record is record Display_Slocs : Boolean := False; -- Whether to display slocs for resolved names Display_Short_Images : Boolean := False; -- Whether to display short images for resolved names end record; type Reference_Kind is (Any, Subp_Call, Subp_Overriding, Type_Derivation); -- Kind of reference for Find_All_References pragmas. Each kind leads to a -- specific find-all-references property: see Process_Refs below for -- associations. type Refs_Request is record Kind : Reference_Kind; Target : Basic_Decl; Imprecise_Fallback : Boolean; Show_Slocs : Boolean; From_Pragma : Pragma_Node; end record; package Refs_Request_Vectors is new Ada.Containers.Vectors (Positive, Refs_Request); type Job_Data_Record is record Stats : Stats_Record; Config : Config_Record; Refs_Requests : Refs_Request_Vectors.Vector; end record; type Job_Data_Array is array (Job_ID range <>) of Job_Data_Record; type Job_Data_Array_Access is access all Job_Data_Array; procedure Free is new Ada.Unchecked_Deallocation (Job_Data_Array, Job_Data_Array_Access); Job_Data : Job_Data_Array_Access; procedure App_Setup (Context : App_Context; Jobs : App_Job_Context_Array); procedure Job_Setup (Context : App_Job_Context); procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit); procedure Job_Post_Process (Context : App_Job_Context); procedure App_Post_Process (Context : App_Context; Jobs : App_Job_Context_Array); package App is new Libadalang.Helpers.App (Name => "nameres", Description => "Run Libadalang's name resolution on a file, set of files or project", Enable_Parallelism => True, App_Setup => App_Setup, Job_Setup => Job_Setup, Process_Unit => Process_Unit, Job_Post_Process => Job_Post_Process, App_Post_Process => App_Post_Process); package Args is use GNATCOLL.Opt_Parse; package File_Limit is new Parse_Option (App.Args.Parser, "-l", "--file-limit", "Stop program after N files", Integer, Default_Val => -1); package Discard_Errors_In_PLE is new Parse_Flag (App.Args.Parser, "-D", "--discard-PLE-errors", "Discard errors while constructing lexical envs"); package Quiet is new Parse_Flag (App.Args.Parser, "-q", "--quiet", "Quiet mode (no output on stdout)"); package JSON is new Parse_Flag (App.Args.Parser, "-J", "--json", "JSON mode (Structured output on stdout)"); package Stats is new Parse_Flag (App.Args.Parser, "-S", "--stats", "Output stats at the end of analysis"); package Resolve_All is new Parse_Flag (App.Args.Parser, "-A", "--all", "Resolve every cross reference"); package Solve_Line is new Parse_Option (App.Args.Parser, "-L", "--solve-line", "Only analyze line N", Natural, Default_Val => 0); package Only_Show_Failures is new Parse_Flag (App.Args.Parser, Long => "--only-show-failures", Help => "Only output failures on stdout"); package Imprecise_Fallback is new Parse_Flag (App.Args.Parser, Long => "--imprecise-fallback", Help => "Activate fallback mechanism for name resolution"); package Disable_Operator_Resolution is new Parse_Flag (App.Args.Parser, Long => "--disable-operator-resolution", Help => "Do not resolve unary/binary operations"); package Dump_Envs is new Parse_Flag (App.Args.Parser, "-E", "--dump-envs", Help => "Dump lexical envs after populating them"); package Do_Reparse is new Parse_Flag (App.Args.Parser, Long => "--reparse", Help => "Reparse units 10 times (hardening)"); package Time is new Parse_Flag (App.Args.Parser, Long => "--time", Short => "-T", Help => "Show the time it took to nameres each file. " & "Implies --quiet so that you only have timing info"); package Timeout is new Parse_Option (App.Args.Parser, "-t", "--timeout", "Timeout equation solving after N steps", Natural, Default_Val => 100_000); package No_Lookup_Cache is new Parse_Flag (App.Args.Parser, Long => "--no-lookup-cache", Help => "Deactivate lookup cache"); package Trace is new Parse_Flag (App.Args.Parser, "-T", "--trace", Help => "Trace logic equation solving"); package Debug is new Parse_Flag (App.Args.Parser, "-D", "--debug", Help => "Debug logic equation solving"); end Args; function Quiet return Boolean is (Args.Quiet.Get or else Args.JSON.Get or else Args.Time.Get); function Text (N : Ada_Node'Class) return String is (Image (Text (N))); function "+" (S : String) return Unbounded_String renames To_Unbounded_String; function "+" (S : Unbounded_String) return String renames To_String; function "+" (S : Unbounded_Text_Type) return Text_Type renames To_Wide_Wide_String; function "<" (Left, Right : Ada_Node) return Boolean is (Sloc_Range (Left).Start_Line < Sloc_Range (Right).Start_Line); procedure Sort is new Ada.Containers.Generic_Array_Sort (Index_Type => Positive, Element_Type => Ada_Node, Array_Type => Ada_Node_Array, "<" => "<"); function Decode_Boolean_Literal (T : Text_Type) return Boolean is (Boolean'Wide_Wide_Value (T)); procedure Process_File (Job_Data : in out Job_Data_Record; Unit : Analysis_Unit; Filename : String); function Do_Pragma_Test (Arg : Expr) return Ada_Node_Array is (P_Matching_Nodes (Arg)); -- Do the resolution associated to a Test pragma. -- -- This function is here to provide a simple breakpoint location for -- debugging sessions. procedure New_Line; procedure Put_Line (S : String); procedure Put (S : String); procedure Dump_Exception (E : Ada.Exceptions.Exception_Occurrence; Obj : in out J.JSON_Value); -- Dump the exception ``E``, honoring the ``Args.No_Traceback`` flag (e.g. -- don't show tracebacks when asked not to). If ``Obj`` is passed and -- ``Args.JSON`` is set, also set fields in ``Obj``. procedure Increment (Counter : in out Natural); type Supported_Pragma is (Ignored_Pragma, Error_In_Pragma, Pragma_Config, Pragma_Section, Pragma_Test, Pragma_Test_Statement, Pragma_Test_Statement_UID, Pragma_Test_Block, Pragma_Find_All_References); type Decoded_Pragma (Kind : Supported_Pragma) is record case Kind is when Ignored_Pragma => -- Nameres does not handle this pragma null; when Error_In_Pragma => -- We had trouble decoding this pragma Error_Sloc : Source_Location; Error_Message : Unbounded_String; when Pragma_Config => -- Tune nameres' settings Config_Name : Unbounded_Text_Type; Config_Expr : Expr; when Pragma_Section => -- Output headlines Section_Name : Unbounded_Text_Type; when Pragma_Test => -- Run name resolution on the given expression Test_Expr : Expr; Test_Debug : Boolean; when Pragma_Test_Statement | Pragma_Test_Statement_UID | Pragma_Test_Block => -- Run name resolution on the statement that precedes this pragma. -- -- For the UID version, but show the unique_identifying name of -- the declarations instead of the node image. This is used in -- case the node might change (for example in tests where we -- resolve runtime things). -- -- For the block version, run name resolution on all xref entry -- points in the statement that precedes this pragma, or on the -- whole compilation unit if top-level. Test_Target : Ada_Node; when Pragma_Find_All_References => -- Run the find-all-references property designated by Refs_Kind on -- Refs_Target, for all loaded units. If Refs_Target is null, run -- the find-all-reference property on all applicable nodes in this -- unit. Refs_Kind : Reference_Kind; Refs_Target : Basic_Decl; Refs_Imprecise_Fallback : Boolean; Refs_Show_Slocs : Boolean; end case; end record; function Decode_Pragma (Node : Pragma_Node) return Decoded_Pragma; ----------- -- Merge -- ----------- procedure Merge (Stats : in out Stats_Record; Other : Stats_Record) is begin Stats.Nb_Files_Analyzed := Stats.Nb_Files_Analyzed + Other.Nb_Files_Analyzed; Stats.Nb_Successes := Stats.Nb_Successes + Other.Nb_Successes; Stats.Nb_Fails := Stats.Nb_Fails + Other.Nb_Fails; Stats.Nb_Xfails := Stats.Nb_Xfails + Other.Nb_Xfails; Stats.Nb_Exception_Fails := Stats.Nb_Exception_Fails + Other.Nb_Exception_Fails; if Stats.Max_Nb_Fails < Other.Max_Nb_Fails then Stats.Max_Nb_Fails := Other.Max_Nb_Fails; Stats.File_With_Most_Fails := Other.File_With_Most_Fails; end if; end Merge; -------------- -- New_Line -- -------------- procedure New_Line is begin if not Quiet then Ada.Text_IO.New_Line; end if; end New_Line; -------------- -- Put_Line -- -------------- procedure Put_Line (S : String) is begin if not Quiet then Ada.Text_IO.Put_Line (S); end if; end Put_Line; --------- -- Put -- --------- procedure Put (S : String) is begin if not Quiet then Ada.Text_IO.Put (S); end if; end Put; -------------------- -- Dump_Exception -- -------------------- procedure Dump_Exception (E : Ada.Exceptions.Exception_Occurrence; Obj : in out J.JSON_Value) is begin App.Dump_Exception (E); if Args.JSON.Get then Obj.Set_Field ("success", False); Obj.Set_Field ("exception_message", Ada.Exceptions.Exception_Message (E)); if App.Args.Sym_Traceback.Get then Obj.Set_Field ("exception_traceback", GNAT.Traceback.Symbolic.Symbolic_Traceback (E)); else Obj.Set_Field ("exception_traceback", Ada.Exceptions.Exception_Information (E)); end if; Ada.Text_IO.Put_Line (Obj.Write); end if; end Dump_Exception; --------------- -- Increment -- --------------- procedure Increment (Counter : in out Natural) is begin Counter := Counter + 1; end Increment; ------------------- -- Decode_Pragma -- ------------------- function Decode_Pragma (Node : Pragma_Node) return Decoded_Pragma is Name : constant String := Text (Node.F_Id); Untyped_Args : constant Ada_Node_Array := Node.F_Args.Children; Args : array (Untyped_Args'Range) of Pragma_Argument_Assoc; function Error (Message : String) return Decoded_Pragma is ((Error_In_Pragma, Start_Sloc (Node.Sloc_Range), +Message)); -- Shortcut to build Error_In_Pragma records function N_Args_Error (Expected : Natural) return Decoded_Pragma is (Error ("expected " & Expected'Image & " pragma arguments, got" & Args'Length'Image)); function N_Args_Error (At_Least, At_Most : Natural) return Decoded_Pragma is (Error ("expected between" & At_Least'Image & " and" & At_Most'Image & " pragma arguments, got" & Args'Length'Image)); -- Return an Error_In_Pragma record for an unexpected number of pragma -- arguments. begin for I in Untyped_Args'Range loop Args (I) := Untyped_Args (I).As_Pragma_Argument_Assoc; end loop; if Name = "Config" then if Args'Length /= 1 then return N_Args_Error (1); elsif Args (1).F_Id.Is_Null then return Error ("Missing argument name"); elsif Args (1).F_Id.Kind /= Ada_Identifier then return Error ("Argument name must be an identifier"); else return (Pragma_Config, To_Unbounded_Text (Args (1).F_Id.Text), Args (1).F_Expr); end if; elsif Name = "Section" then if Args'Length /= 1 then return N_Args_Error (1); elsif not Args (1).F_Id.Is_Null then return Error ("No argument name allowed"); elsif Args (1).F_Expr.Kind /= Ada_String_Literal then return Error ("Section name must be a string literal"); else return (Pragma_Section, To_Unbounded_Text (Args (1).F_Expr .As_String_Literal.P_Denoted_Value)); end if; elsif Name = "Test" then if Args'Length not in 1 | 2 then return N_Args_Error (1, 2); end if; declare Result : Decoded_Pragma (Pragma_Test); begin if not Args (1).F_Id.Is_Null then return Error ("No argument name allowed"); end if; Result.Test_Expr := Args (1).F_Expr; if Args'Length > 1 then if not Args (2).F_Id.Is_Null then return Error ("No argument name allowed"); elsif Args (2).F_Expr.Kind /= Ada_Identifier or else Args (2).F_Expr.Text /= "Debug" then return Error ("When present, the second argument must be the" & "Debug identifier"); end if; Result.Test_Debug := True; else Result.Test_Debug := False; end if; return Result; end; elsif Name = "Test_Statement" then if Args'Length /= 0 then return N_Args_Error (0); end if; return (Pragma_Test_Statement, Node.Previous_Sibling); elsif Name = "Test_Statement_UID" then if Args'Length /= 0 then return N_Args_Error (0); end if; return (Pragma_Test_Statement_UID, Node.Previous_Sibling); elsif Name = "Test_Block" then if Args'Length /= 0 then return N_Args_Error (0); end if; declare Parent : constant Ada_Node := Node.Parent.Parent; Target : constant Ada_Node := (if Parent.Kind = Ada_Compilation_Unit then Parent.As_Compilation_Unit.F_Body else Node.Previous_Sibling); begin return (Pragma_Test_Block, Target); end; elsif Name = "Find_All_References" then if Args'Length not in 1 .. 4 then return N_Args_Error (1, 4); end if; declare Result : Decoded_Pragma (Pragma_Find_All_References); N : Positive := 1; -- Logical index of the next positional argument to process Target : Ada_Node := Node.Previous_Sibling; -- Temporary to compute the find-all-refs target. By default, -- target the declaration that precedes the pragma. Imprecise_Fallback : Boolean renames Result.Refs_Imprecise_Fallback; Show_Slocs : Boolean renames Result.Refs_Show_Slocs; begin Imprecise_Fallback := False; Show_Slocs := True; for A of Args loop if A.F_Id.Is_Null then -- This is a positional pragma argument case N is when 1 => if A.F_Expr.Kind /= Ada_Identifier then return Error ("Identifier expected"); end if; declare Name : constant Text_Type := A.F_Expr.Text; begin -- The first argument is the reference kind if Name = "Any" then Result.Refs_Kind := Any; elsif Name = "Calls" then Result.Refs_Kind := Subp_Call; elsif Name = "Overrides" then Result.Refs_Kind := Subp_Overriding; elsif Name = "Derived" then Result.Refs_Kind := Type_Derivation; else return Error ("Invalid reference kind: " & Image (Name)); end if; end; when 2 => -- The optional second argument is the find-all-refs -- target. case A.F_Expr.Kind is when Ada_Identifier => -- Raw identifier: directive to locate the target declare Name : constant Text_Type := A.F_Expr.Text; begin if Name = "All_Decls" then Target := No_Ada_Node; elsif Name = "Previous_Decl" then null; elsif Name = "Previous_Referenced_Decl" then -- Assume that the previous statement is a call: -- the target is the callee. Target := Target.As_Call_Stmt.F_Call.As_Ada_Node; if Target.Kind = Ada_Call_Expr then Target := Target.As_Call_Expr.F_Name .P_Referenced_Decl.As_Ada_Node; end if; else return Error ("Invalid target: " & Image (Name)); end if; end; when Ada_String_Literal => -- String literal: name of the target. Look for the -- last declaration with this name that appears in -- the source before this pragma. declare Name : constant Text_Type := A.F_Expr.As_String_Literal.P_Denoted_Value; It : Traverse_Iterator'Class := Find (Node.Unit.Root, Kind_In (Ada_Basic_Decl'First, Ada_Basic_Decl'Last)); N : Ada_Node; Pragma_Sloc : constant Source_Location := Start_Sloc (Node.Sloc_Range); begin Target := No_Ada_Node; Decl_Loop : while It.Next (N) and Start_Sloc (N.Sloc_Range) < Pragma_Sloc loop for DN of N.As_Basic_Decl.P_Defining_Names loop if DN.Text = Name then Target := N; exit Decl_Loop; end if; end loop; end loop Decl_Loop; if Target.Is_Null then return Error ("No declaration for " & Image (Name)); end if; end; when others => return Error ("Unexpected expression (identifier or" & " string literal expected)"); end case; when others => return Error ("Too many positional arguments"); end case; N := N + 1; else -- This is a named argument. The grammar should make sure -- that names for pragma arguments are identifiers. declare pragma Assert (A.F_Id.Kind = Ada_Identifier); Name : constant Text_Type := A.F_Id.Text; begin if Name = "Imprecise_Fallback" then Imprecise_Fallback := Decode_Boolean_Literal (A.F_Expr.Text); elsif Name = "Show_Slocs" then Show_Slocs := Decode_Boolean_Literal (A.F_Expr.Text); else return Error ("Unknown argument: " & Image (Name)); end if; end; end if; end loop; -- Make sure we received at least one positional argument if N = 1 then return Error ("Missing first positional argument"); end if; Result.Refs_Target := Target.As_Basic_Decl; return Result; end; else return (Kind => Ignored_Pragma); end if; end Decode_Pragma; --------------- -- App_Setup -- --------------- procedure App_Setup (Context : App_Context; Jobs : App_Job_Context_Array) is pragma Unreferenced (Context); begin if Args.No_Lookup_Cache.Get then Disable_Lookup_Cache (True); end if; if Args.Trace.Get then Set_Debug_State (Trace); elsif Args.Debug.Get then Set_Debug_State (Step); end if; Job_Data := new Job_Data_Array'(Jobs'Range => (others => <>)); end App_Setup; --------------- -- Job_Setup -- --------------- procedure Job_Setup (Context : App_Job_Context) is Ctx : Analysis_Context renames Context.Analysis_Ctx; begin Ctx.Discard_Errors_In_Populate_Lexical_Env (Args.Discard_Errors_In_PLE.Get); Ctx.Set_Logic_Resolution_Timeout (Args.Timeout.Get); end Job_Setup; ------------------ -- Process_Unit -- ------------------ procedure Process_Unit (Context : App_Job_Context; Unit : Analysis_Unit) is Job_Data : Job_Data_Record renames Nameres.Job_Data (Context.ID); Basename : constant String := +Create (+Unit.Get_Filename).Base_Name; Before, After : Time; Time_Elapsed : Duration; begin if not Quiet then Put_Title ('#', "Analyzing " & Basename); end if; Before := Clock; begin Process_File (Job_Data, Unit, Unit.Get_Filename); exception when E : others => Put_Line ("PLE failed with exception for file " & Basename); App.Dump_Exception (E); return; end; After := Clock; Time_Elapsed := After - Before; if Args.Time.Get then Ada.Text_IO.Put_Line ("Time elapsed in process file for " & Basename & ": " & Time_Elapsed'Image); end if; Increment (Job_Data.Stats.Nb_Files_Analyzed); if Args.File_Limit.Get /= -1 and then Job_Data.Stats.Nb_Files_Analyzed >= Args.File_Limit.Get then Abort_App ("Requested file limit reached: aborting"); end if; end Process_Unit; ------------------ -- Process_File -- ------------------ procedure Process_File (Job_Data : in out Job_Data_Record; Unit : Analysis_Unit; Filename : String) is Nb_File_Fails : Natural := 0; -- Number of name resolution failures not covered by XFAILs we had in -- this file. Config : Config_Record renames Job_Data.Config; Empty : Boolean := True; -- False if processing pragmas has output at least one line. True -- otherwise. function Is_Pragma_Node (N : Ada_Node) return Boolean is (Kind (N) = Ada_Pragma_Node); procedure Process_Pragma (Node : Ada_Node); -- Decode a pragma node and run actions accordingly (trigger name -- resolution, output a section name, ...). procedure Resolve_Node (Node : Ada_Node; Show_Slocs : Boolean := True); -- Run name resolution testing on Node. -- -- This involves running P_Resolve_Names on Node, displaying resolved -- references, updating statistics, creating a JSON report if requested, -- etc. function Is_Xref_Entry_Point (N : Ada_Node) return Boolean is (P_Xref_Entry_Point (N) and then (Args.Solve_Line.Get = 0 or else Natural (Sloc_Range (N).Start_Line) = Args.Solve_Line.Get)); -- Return whether we should use N as an entry point for name resolution -- testing. procedure Resolve_Block (Block : Ada_Node); -- Call Resolve_Node on all xref entry points (according to -- Is_Xref_Entry_Point) in Block except for Block itself. -------------------- -- Process_Pragma -- -------------------- procedure Process_Pragma (Node : Ada_Node) is P : constant Decoded_Pragma := Decode_Pragma (Node.As_Pragma_Node); begin case P.Kind is when Ignored_Pragma => null; when Error_In_Pragma => Put_Line (Image (P.Error_Sloc) & ": " & (+P.Error_Message)); Empty := False; when Pragma_Config => declare Value : constant Text_Type := Text (P.Config_Expr); begin if P.Config_Name = "Display_Slocs" then Config.Display_Slocs := Decode_Boolean_Literal (Value); elsif P.Config_Name = "Display_Short_Images" then Config.Display_Short_Images := Decode_Boolean_Literal (Value); else raise Program_Error with "Invalid configuration: " & Image (+P.Config_Name); end if; end; when Pragma_Section => if not Quiet then Put_Title ('-', Image (To_Wide_Wide_String (P.Section_Name))); end if; Empty := True; when Pragma_Test => Trigger_Envs_Debug (P.Test_Debug); declare Entities : Ada_Node_Array := Do_Pragma_Test (P.Test_Expr); begin Put_Line (Text (P.Test_Expr) & " resolves to:"); Sort (Entities); for E of Entities loop Put (" " & (if Config.Display_Short_Images then E.Short_Image else E.Debug_Text)); if Config.Display_Slocs then Put_Line (" at " & Image (Start_Sloc (E.Sloc_Range))); else New_Line; end if; end loop; if Entities'Length = 0 then Put_Line (" <none>"); end if; end; Empty := False; Trigger_Envs_Debug (False); when Pragma_Test_Statement | Pragma_Test_Statement_UID => Resolve_Node (Node => P.Test_Target, Show_Slocs => P.Kind /= Pragma_Test_Statement_UID); Empty := False; when Pragma_Test_Block => Resolve_Block (P.Test_Target); Empty := False; when Pragma_Find_All_References => Job_Data.Refs_Requests.Append ((P.Refs_Kind, P.Refs_Target, P.Refs_Imprecise_Fallback, P.Refs_Show_Slocs, Node.As_Pragma_Node)); end case; end Process_Pragma; ------------------- -- Resolve_Block -- ------------------- procedure Resolve_Block (Block : Ada_Node) is procedure Resolve_Entry_Point (Node : Ada_Node); -- Callback for tree traversal in Block ------------------------- -- Resolve_Entry_Point -- ------------------------- procedure Resolve_Entry_Point (Node : Ada_Node) is begin if Node /= Block then Resolve_Node (Node); end if; end Resolve_Entry_Point; It : Ada_Node_Iterators.Iterator'Class := Find (Block, Is_Xref_Entry_Point'Access); begin It.Iterate (Resolve_Entry_Point'Access); end Resolve_Block; ------------------ -- Resolve_Node -- ------------------ procedure Resolve_Node (Node : Ada_Node; Show_Slocs : Boolean := True) is function XFAIL return Boolean; -- If there is an XFAIL pragma for the node being resolved, show the -- message, and return True. function Print_Node (N : Ada_Node'Class) return Visit_Status; -- Callback for the tree traversal in Node. Print xref info for N. ---------------- -- Print_Node -- ---------------- function Print_Node (N : Ada_Node'Class) return Visit_Status is begin if not Quiet and then Kind (N) in Ada_Expr and then (Kind (N) not in Ada_Name or else not N.As_Name.P_Is_Defining) then Put_Line ("Expr: " & N.Short_Image); if Kind (N) in Ada_Name and then (not Args.Disable_Operator_Resolution.Get or else not (Kind (N) in Ada_Op)) then declare Decl_Name : constant Defining_Name := N.As_Name.P_Referenced_Defining_Name (Args.Imprecise_Fallback.Get); Referenced_Decl_Image : constant String := (if Show_Slocs or else Decl_Name.Is_Null then Image (Decl_Name) else Image (Decl_Name.P_Basic_Decl .P_Unique_Identifying_Name)); begin Put_Line (" references: " & Referenced_Decl_Image); end; end if; declare Decl : constant Base_Type_Decl := P_Expression_Type (As_Expr (N)); Decl_Image : constant String := (if Show_Slocs or else Decl.Is_Null then Image (Decl) else Image (Decl.P_Unique_Identifying_Name)); begin Put_Line (" type: " & Decl_Image); end; end if; return (if (P_Xref_Entry_Point (N) and then As_Ada_Node (N) /= Node) or else (Kind (N) in Ada_Defining_Name and then not P_Xref_Entry_Point (N)) then Over else Into); end Print_Node; ----------- -- XFAIL -- ----------- function XFAIL return Boolean is N : constant Ada_Node := Next_Sibling (Node); begin if not Is_Null (N) and then Kind (N) = Ada_Pragma_Node then if Child (N, 1).Text = "XFAIL_Nameres" then declare Arg : constant String_Literal := N.As_Pragma_Node.F_Args.Child (1) .As_Base_Assoc.P_Assoc_Expr.As_String_Literal; begin if Arg.Is_Null then raise Program_Error with "Invalid arg for " & N.Short_Image; end if; Put_Line ("XFAIL: " & Image (Arg.P_Denoted_Value, False)); Put_Line (""); end; end if; return True; end if; return False; end XFAIL; Verbose : constant Boolean := not (Quiet or else Args.Only_Show_Failures.Get); Output_JSON : constant Boolean := Args.JSON.Get; Dummy : Visit_Status; Obj : aliased J.JSON_Value; begin -- Pre-processing output if Output_JSON then Obj := J.Create_Object; Obj.Set_Field ("kind", "node_resolution"); Obj.Set_Field ("file", Filename); Obj.Set_Field ("sloc", Image (Node.Sloc_Range)); end if; if Verbose then Put_Title ('*', "Resolving xrefs for node " & Node.Short_Image); end if; if Langkit_Support.Adalog.Debug.Debug then Assign_Names_To_Logic_Vars (Node); end if; -- Perform name resolution if P_Resolve_Names (Node) or else Args.Imprecise_Fallback.Get then if not Args.Only_Show_Failures.Get then Dummy := Traverse (Node, Print_Node'Access); end if; Increment (Job_Data.Stats.Nb_Successes); if Output_JSON then Obj.Set_Field ("success", True); end if; else Put_Line ("Resolution failed for node " & Node.Short_Image); if XFAIL then Increment (Job_Data.Stats.Nb_Xfails); else Increment (Nb_File_Fails); end if; if Output_JSON then Obj.Set_Field ("success", False); end if; end if; -- Post-processing output if Verbose then Put_Line (""); end if; if Output_JSON then Ada.Text_IO.Put_Line (Obj.Write); end if; exception when E : others => Put_Line ("Resolution failed with exception for node " & Node.Short_Image); Dump_Exception (E, Obj); if XFAIL then Increment (Job_Data.Stats.Nb_Xfails); else Increment (Job_Data.Stats.Nb_Exception_Fails); Increment (Nb_File_Fails); end if; end Resolve_Node; begin -- Make sure there is no diagnostic for this unit. If there are, print -- them and do nothing else. if Has_Diagnostics (Unit) then for D of Diagnostics (Unit) loop Put_Line (Format_GNU_Diagnostic (Unit, D)); end loop; return; end if; -- Manually trigger PLE first, and if requested reparse the unit, to -- make sure that rebuilding lexical envs works correctly. Populate_Lexical_Env (Unit); if Args.Do_Reparse.Get then for I in 1 .. 10 loop Reparse (Unit); Populate_Lexical_Env (Unit); end loop; end if; Job_Data.Config := (others => <>); if Args.Dump_Envs.Get then Put_Title ('-', "Dumping envs for " & Filename); Dump_Lexical_Env (Unit); end if; if Args.Resolve_All.Get or Args.Solve_Line.Get /= 0 then Resolve_Block (Root (Unit)); end if; -- Run through all pragmas and execute the associated actions declare It : Traverse_Iterator'Class := Find (Unit.Root, Is_Pragma_Node'Access); begin It.Iterate (Process_Pragma'Access); end; if not Empty then New_Line; end if; -- Update statistics Job_Data.Stats.Nb_Fails := Job_Data.Stats.Nb_Fails + Nb_File_Fails; if Job_Data.Stats.Max_Nb_Fails < Nb_File_Fails then Job_Data.Stats.File_With_Most_Fails := +Filename; Job_Data.Stats.Max_Nb_Fails := Nb_File_Fails; end if; end Process_File; ---------------------- -- Job_Post_Process -- ---------------------- procedure Job_Post_Process (Context : App_Job_Context) is Job_Data : Job_Data_Record renames Nameres.Job_Data (Context.ID); Units : Analysis_Unit_Array (1 .. Natural (Context.Units_Processed.Length)); function Is_Refs_Target (Decl : Basic_Decl; Kind : Reference_Kind) return Boolean is (case Kind is when Any => True, when Subp_Call | Subp_Overriding => Decl.P_Is_Subprogram, when Type_Derivation => Decl.Kind = Ada_Type_Decl); -- Return whether Decl is a valid target for the given Kind request procedure Process_Refs (Target : Basic_Decl; Kind : Reference_Kind; Imprecise_Fallback : Boolean; Show_Slocs : Boolean); -- Call the find-all-reference property corresponding to Kind on Target ------------------ -- Process_Refs -- ------------------ procedure Process_Refs (Target : Basic_Decl; Kind : Reference_Kind; Imprecise_Fallback : Boolean; Show_Slocs : Boolean) is Empty : Boolean := True; What : constant String := (case Kind is when Any => "References to ", when Subp_Call => "Calls to ", when Subp_Overriding => "Overridings for ", when Type_Derivation => "Derivations for "); function Locator (Node : Ada_Node'Class) return String; -- Return a location string for Node suitable for test output procedure Print_Ref (Ref : Ada_Node'Class); ------------- -- Locator -- ------------- function Locator (Node : Ada_Node'Class) return String is File : constant String := +Create (+Node.Unit.Get_Filename).Base_Name; Sloc : constant String := Image (Node.Sloc_Range); begin return "(" & File & (if Show_Slocs then ", " & Sloc else "") & ")"; end Locator; --------------- -- Print_Ref -- --------------- procedure Print_Ref (Ref : Ada_Node'Class) is Ref_Decl : Ada_Node := Ref.As_Ada_Node; begin -- Follow Ref's parents chain until we have an xref entry point, -- to get meaningful references. while not Ref_Decl.Is_Null and then not Ref_Decl.Parent.Is_Null and then not Ref_Decl.P_Xref_Entry_Point loop Ref_Decl := Ref_Decl.Parent; end loop; declare Text : constant Text_Type := Ref_Decl.Text; Text_Last : Natural := Text'Last; begin -- Look for the first line break in Text for I in Text'Range loop if Text (I) in Chars.CR | Chars.LF then Text_Last := I - 1; exit; end if; end loop; Put_Line (" " & Image (Text (Text'First .. Text_Last)) & " " & Locator (Ref_Decl)); end; Empty := False; end Print_Ref; begin for DN of Target.P_Defining_Names loop Put_Line (What & DN.Debug_Text & " " & Locator (DN)); case Kind is when Any => for R of DN.P_Find_All_References (Units, Imprecise_Fallback) loop Print_Ref (Ref (R)); end loop; when Subp_Call => for R of DN.P_Find_All_Calls (Units, Imprecise_Fallback) loop Print_Ref (Ref (R)); end loop; when Subp_Overriding => for R of DN.P_Semantic_Parent.As_Basic_Decl.P_Find_All_Overrides (Units, Imprecise_Fallback) loop Print_Ref (R); end loop; when Type_Derivation => for R of DN.P_Semantic_Parent.As_Type_Decl .P_Find_All_Derived_Types (Units, Imprecise_Fallback) loop Print_Ref (R); end loop; end case; end loop; if Empty then Put_Line (" <none>"); end if; end Process_Refs; begin -- Compute the list of units for I in Units'Range loop Units (I) := Context.Units_Processed (I); end loop; -- Process all Find_All_References requests for R of Job_Data.Refs_Requests loop if R.Target.Is_Null then -- If there is no target, run the request on all valid targets in -- the unit that contains the pragma. declare It : Traverse_Iterator'Class := Find (R.From_Pragma.Unit.Root, Kind_In (Ada_Basic_Decl'First, Ada_Basic_Decl'Last)); Target : Ada_Node; T : Basic_Decl; begin while It.Next (Target) loop T := Target.As_Basic_Decl; if Is_Refs_Target (T, R.Kind) then Process_Refs (T, R.Kind, R.Imprecise_Fallback, R.Show_Slocs); end if; end loop; end; else Process_Refs (R.Target, R.Kind, R.Imprecise_Fallback, R.Show_Slocs); end if; end loop; end Job_Post_Process; ---------------------- -- App_Post_Process -- ---------------------- procedure App_Post_Process (Context : App_Context; Jobs : App_Job_Context_Array) is pragma Unreferenced (Context); Stats : Stats_Record; Total : Natural; begin -- Aggregate statistics from all jobs Stats := Job_Data (Jobs'First).Stats; for I in Jobs'First + 1 .. Jobs'Last loop Merge (Stats, Job_Data (I).Stats); end loop; Total := Stats.Nb_Successes + Stats.Nb_Fails + Stats.Nb_Xfails; if Args.Stats.Get and then Total > 0 then declare type Percentage is delta 0.01 range 0.0 .. 0.01 * 2.0**32; Percent_Successes : constant Percentage := Percentage (Float (Stats.Nb_Successes) / Float (Total) * 100.0); Percent_Failures : constant Percentage := Percentage (Float (Stats.Nb_Fails) / Float (Total) * 100.0); Percent_XFAIL : constant Percentage := Percentage (Float (Stats.Nb_Xfails) / Float (Total) * 100.0); begin Put_Line ("Resolved " & Total'Image & " nodes"); Put_Line ("Of which" & Stats.Nb_Successes'Image & " successes - " & Percent_Successes'Image & "%"); Put_Line ("Of which" & Stats.Nb_Fails'Image & " failures - " & Percent_Failures'Image & "%"); Put_Line ("Of which" & Stats.Nb_Xfails'Image & " XFAILS - " & Percent_XFAIL'Image & "%"); Put_Line ("File with most failures (" & Stats.Max_Nb_Fails'Image & "):" & (+Stats.File_With_Most_Fails)); end; end if; Free (Job_Data); Put_Line ("Done."); end App_Post_Process; begin App.Run; end Nameres;
-------------------------------------------------------------------------------- -- MIT License -- -- Copyright (c) 2020 Zane Myers -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in all -- copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- SOFTWARE. -------------------------------------------------------------------------------- with Vulkan.Math.GenFMatrix; with Vulkan.Math.GenDMatrix; use Vulkan.Math.GenFMatrix; use Vulkan.Math.GenDMatrix; -------------------------------------------------------------------------------- --< @group Vulkan Math Functions -------------------------------------------------------------------------------- --< @summary --< This package provides GLSL Matrix Built-in functions. --< --< @description --< All matrix functions operate on matrices of single-point or double-point --< floating point numbers. -------------------------------------------------------------------------------- package Vulkan.Math.Matrix is pragma Preelaborate; pragma Pure; end Vulkan.Math.Matrix;
-- C37209B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN THE SUBTYPE -- INDICATION IN A CONSTANT OBJECT DECLARATION SPECIFIES A -- CONSTRAINED SUBTYPE WITH DISCRIMINANTS AND THE INITIALIZATION -- VALUE DOES NOT BELONG TO THE SUBTYPE (I. E., THE DISCRIMINANT -- VALUE DOES NOT MATCH THOSE SPECIFIED BY THE CONSTRAINT). -- HISTORY: -- RJW 08/25/86 CREATED ORIGINAL TEST -- VCL 08/19/87 CHANGED THE RETURN TYPE OF FUNTION 'INIT' IN -- PACKAGE 'PRIV2' SO THAT 'INIT' IS UNCONSTRAINED, -- THUS NOT RAISING A CONSTRAINT ERROR ON RETURN FROM -- 'INIT'. WITH REPORT; USE REPORT; PROCEDURE C37209B IS BEGIN TEST ( "C37209B", "CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN " & "THE SUBTYPE INDICATION IN A CONSTANT " & "OBJECT DECLARATION SPECIFIES A CONSTRAINED " & "SUBTYPE WITH DISCRIMINANTS AND THE " & "INITIALIZATION VALUE DOES NOT BELONG TO " & "THE SUBTYPE (I. E., THE DISCRIMINANT VALUE " & "DOES NOT MATCH THOSE SPECIFIED BY THE " & "CONSTRAINT)" ); DECLARE TYPE REC (D : INTEGER) IS RECORD NULL; END RECORD; SUBTYPE REC1 IS REC (IDENT_INT (5)); BEGIN DECLARE R1 : CONSTANT REC1 := (D => IDENT_INT (10)); I : INTEGER := IDENT_INT (R1.D); BEGIN FAILED ( "NO EXCEPTION RAISED FOR DECLARATION OF " & "R1" ); EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION FOR R1 RAISED INSIDE BLOCK" ); END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "OTHER EXCEPTION RAISED AT DECLARATION OF " & "R1" ); END; BEGIN DECLARE PACKAGE PRIV1 IS TYPE REC (D : INTEGER) IS PRIVATE; SUBTYPE REC2 IS REC (IDENT_INT (5)); R2 : CONSTANT REC2; PRIVATE TYPE REC (D : INTEGER) IS RECORD NULL; END RECORD; R2 : CONSTANT REC2 := (D => IDENT_INT (10)); END PRIV1; USE PRIV1; BEGIN DECLARE I : INTEGER := IDENT_INT (R2.D); BEGIN FAILED ( "NO EXCEPTION RAISED AT DECLARATION " & "OF R2" ); END; END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "OTHER EXCEPTION RAISED AT DECLARATION " & "OF R2" ); END; BEGIN DECLARE PACKAGE PRIV2 IS TYPE REC (D : INTEGER) IS PRIVATE; SUBTYPE REC3 IS REC (IDENT_INT (5)); FUNCTION INIT (D : INTEGER) RETURN REC; PRIVATE TYPE REC (D : INTEGER) IS RECORD NULL; END RECORD; END PRIV2; PACKAGE BODY PRIV2 IS FUNCTION INIT (D : INTEGER) RETURN REC IS BEGIN RETURN (D => IDENT_INT (D)); END INIT; END PRIV2; USE PRIV2; BEGIN DECLARE R3 : CONSTANT REC3 := INIT (10); I : INTEGER := IDENT_INT (R3.D); BEGIN FAILED ( "NO EXCEPTION RAISED AT DECLARATION " & "OF R3" ); END; END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "OTHER EXCEPTION RAISED AT DECLARATION " & "OF R3" ); END; BEGIN DECLARE PACKAGE LPRIV IS TYPE REC (D : INTEGER) IS LIMITED PRIVATE; SUBTYPE REC4 IS REC (IDENT_INT (5)); R4 : CONSTANT REC4; PRIVATE TYPE REC (D : INTEGER) IS RECORD NULL; END RECORD; R4 : CONSTANT REC4 := (D => IDENT_INT (10)); END LPRIV; USE LPRIV; BEGIN DECLARE I : INTEGER := IDENT_INT (R4.D); BEGIN FAILED ( "NO EXCEPTION RAISED AT DECLARATION " & "OF R4" ); END; END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "OTHER EXCEPTION RAISED AT DECLARATION " & "OF R4" ); END; RESULT; END C37209B;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- SQL Database Access -- -- -- -- Testsuite Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision: 3927 $ $Date: 2013-05-02 22:43:26 +0300 (Чт., 02 мая 2013) $ ------------------------------------------------------------------------------ -- Checks whether wheter reopen connection hangs the driver. ------------------------------------------------------------------------------ with League.Strings; with League.Application; with SQL.Databases; with SQL.Options; with SQL.Queries; with Matreshka.Internals.SQL_Drivers.Oracle.Factory; procedure Test_337 is function "+" (Text : Wide_Wide_String) return League.Strings.Universal_String renames League.Strings.To_Universal_String; Driver : constant League.Strings.Universal_String := +"ORACLE"; Options : SQL.Options.SQL_Options; begin Options.Set (Matreshka.Internals.SQL_Drivers.Oracle.User_Option, League.Application.Environment.Value (+"ORACLE_TEST_USER")); Options.Set (Matreshka.Internals.SQL_Drivers.Oracle.Password_Option, League.Application.Environment.Value (+"ORACLE_TEST_PASSWORD")); Options.Set (Matreshka.Internals.SQL_Drivers.Oracle.Database_Option, +"TEST"); declare Database : SQL.Databases.SQL_Database := SQL.Databases.Create (Driver, Options); Query : SQL.Queries.SQL_Query; begin Database.Open; Query := Database.Query (+"select * from dual"); Query.Execute; Database.Close; Database.Open; end; end Test_337;
with Display.Basic; use Display.Basic; with Display; use Display; package Solar_System.Graphics is type Drawable_I is interface; procedure Draw(Drawable : Drawable_I; Canvas : Canvas_ID) is abstract; type Visible_Body_Decorator_T is abstract new Drawable_I and Still_Body_I with private; procedure Draw(Drawable : Visible_Body_Decorator_T; Canvas : Canvas_ID); function Get_X(Drawable : Visible_Body_Decorator_T) return Float; function Get_Y(Drawable : Visible_Body_Decorator_T) return Float; type Visible_Orbiting_Body_T is new Visible_Body_Decorator_T and Movable_I with private; procedure Move (B : in out Visible_Orbiting_Body_T); function Create_Visible(B : access Orbiting_Body_T; Radius : Float; Color : RGBA_T) return access Visible_Orbiting_Body_T; type Visible_Still_Body_T is new Visible_Body_Decorator_T with private; function Create_Visible(B : access Still_Body_T; Radius : Float; Color : RGBA_T) return access Visible_Still_Body_T; type Visible_Solar_System_T is new Drawable_I and Solar_System_I with private; function Create_Visible(S : access Solar_System_T) return access Visible_Solar_System_T; procedure Add_Still_Body(S : in out Visible_Solar_System_T; B : access Still_Body_I'Class); procedure Add_Moving_Body(S : in out Visible_Solar_System_T; B : access Movable_I'Class); procedure Draw(Drawable : Visible_Solar_System_T; Canvas : Canvas_ID); procedure Move (B : in out Visible_Solar_System_T); private type Sphere_Type is record Radius : Float; Color : RGBA_T; end record; type Visible_Body_Decorator_T is abstract new Drawable_I and Still_Body_I with record Graphic : Sphere_Type; Object_Ptr : access Body_Base_T'Class; end record; type Visible_Orbiting_Body_T is new Visible_Body_Decorator_T and Movable_I with null record; type Visible_Still_Body_T is new Visible_Body_Decorator_T with null record; type Visible_Solar_System_T is new Drawable_I and Solar_System_I with record Object_Ptr : access Solar_System_T; end record; end Solar_System.Graphics;
with AdaM.program_Unit, AdaM.Declaration, AdaM.a_Type, AdaM.Context, AdaM.Declaration.of_exception, Ada.Streams; package AdaM.Declaration.of_package is type Item is new Declaration.item and program_Unit.item with private; -- View -- type View is access all Item'Class; procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in View); procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out View); for View'write use View_write; for View'read use View_read; -- Vector -- package Vectors is new ada.Containers.Vectors (Positive, View); subtype Vector is Vectors.Vector; -- Forge -- function new_Package (Name : in Identifier := "") return Declaration.of_package.view; procedure free (Self : in out Declaration.of_package.view); overriding procedure destruct (Self : in out Item); -- Attributes -- overriding function Id (Self : access Item) return AdaM.Id; function full_Name (Self : in Item) return Identifier; overriding function to_Source (Self : in Item) return text_Vectors.Vector; function to_spec_Source (Self : in Item) return text_Vectors.Vector; function to_body_Source (Self : in Item) return text_Vectors.Vector; function Context (Self : in Item) return Context.view; function all_Types (Self : access Item) return AdaM.a_Type.Vector; function all_Exceptions (Self : access Item) return AdaM.Declaration.of_exception.Vector; function requires_Body (Self : in Item) return Boolean; procedure Parent_is (Self : in out Item; Now : in Declaration.of_package.View); function Parent (Self : in Item) return Declaration.of_package.view; function child_Packages (Self : in Item'Class) return Declaration.of_package.Vector; function child_Package (Self : in Item'Class; Named : in String) return Declaration.of_package.view; procedure add_Child (Self : in out Item; Child : in Declaration.of_package.view); function find (Self : in Item; Named : in Identifier) return AdaM.a_Type.view; function find (Self : in Item; Named : in Identifier) return AdaM.Declaration.of_exception.view; private type Item is new Declaration.item and program_Unit.item with record Parent : Declaration.of_package.view; Progenitors : Declaration.of_package.Vector; child_Packages : Declaration.of_package.Vector; Context : AdaM.Context.view; -- public_Entities : aliased Source.Entities; -- private_Entities : Source.Entities; -- body_Entities : Source.Entities; end record; -- Streams -- procedure Item_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in Item); procedure Item_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out Item); for Item'write use Item_write; for Item'read use Item_read; end AdaM.Declaration.of_package;
-- Copyright (c) 2021 Devin Hill -- zlib License -- see LICENSE for details. package GBA.Audio is type Sweep_Shift_Type is range 0 .. 7; type Frequency_Direction is ( Increasing , Decreasing ); for Frequency_Direction use ( Increasing => 0 , Decreasing => 1 ); type Sweep_Duration_Type is range 0 .. 7; type Sweep_Control_Info is record Shift : Sweep_Shift_Type; Frequency_Change : Frequency_Direction; Duration : Sweep_Duration_Type; end record with Size => 16; for Sweep_Control_Info use record Shift at 0 range 0 .. 2; Frequency_Change at 0 range 3 .. 3; Duration at 0 range 4 .. 6; end record; type Sound_Duration_Type is range 0 .. 63; type Wave_Pattern_Duty_Type is range 0 .. 3; type Envelope_Step_Type is range 0 .. 7; type Envelope_Direction is ( Increasing , Decreasing ); for Envelope_Direction use ( Increasing => 1 , Decreasing => 0 ); type Initial_Volume_Type is range 0 .. 15; type Duty_Length_Info is record Duration : Sound_Duration_Type; Wave_Pattern_Duty : Wave_Pattern_Duty_Type; Envelope_Step_Time : Envelope_Step_Type; Envelope_Change : Envelope_Direction; Initial_Volume : Initial_Volume_Type; end record with Size => 16; for Duty_Length_Info use record Duration at 0 range 0 .. 5; Wave_Pattern_Duty at 0 range 6 .. 7; Envelope_Step_Time at 0 range 8 .. 10; Envelope_Direction at 0 range 11 .. 11; Initial_Volume at 0 range 12 .. 15; end record; type Frequency_Type is range 0 .. 2047; type Frequency_Control_Info is record Frequency : Frequency_Type; Use_Duration : Boolean; Initial : Boolean; end record with Size => 16; for Frequency_Control_Info use record Frequency at 0 range 0 .. 10; Use_Duration at 0 range 14 .. 14; Initial at 0 range 15 .. 15; end record; end GBA.Audio;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName/> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>linebuffer</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>in_stream_V_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>in_stream.V.value.V</originalName> <rtlName/> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>8</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>out_stream_V_value_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>out_stream.V.value.V</originalName> <rtlName/> <coreName>FIFO_SRL</coreName> </Obj> <bitwidth>72</bitwidth> </Value> <direction>1</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>12</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>403</lineNumber> <contextFuncName>linebuffer_2D&amp;lt;4, 4, 1, 1, 1, 1, 3, 3, unsigned char&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d</first> <second class_id="11" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="12" tracking_level="0" version="0"> <first class_id="13" tracking_level="0" version="0"> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer&amp;lt;4, 4, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned char&amp;gt;</second> </first> <second>530</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_2D&amp;lt;4, 4, 1, 1, 1, 1, 3, 3, unsigned char&amp;gt;</second> </first> <second>403</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_3D&amp;lt;4, 4, 1, 1, 1, 3, 3, 1, 1, unsigned char&amp;gt;</second> </first> <second>492</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_4D&amp;lt;4, 4, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned char&amp;gt;</second> </first> <second>505</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>call_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>16</item> <item>17</item> <item>18</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>13</id> <name/> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>..</fileDirectory> <lineNumber>531</lineNumber> <contextFuncName>linebuffer&amp;lt;4, 4, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned char&amp;gt;</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer&amp;lt;4, 4, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, unsigned char&amp;gt;</second> </first> <second>531</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_5"> <Value> <Obj> <type>2</type> <id>15</id> <name>call</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <const_type>6</const_type> <content>&lt;constant:call&gt;</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_6"> <Obj> <type>3</type> <id>14</id> <name>linebuffer</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>2</count> <item_version>0</item_version> <item>12</item> <item>13</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_7"> <id>16</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_8"> <id>17</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_9"> <id>18</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>12</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_10"> <mId>1</mId> <mTag>linebuffer</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>14</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>33</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_11"> <port_list class_id="24" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port_list> <process_list class_id="25" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_12"> <type>0</type> <name>call_U0</name> <ssdmobj_id>12</ssdmobj_id> <pins class_id="27" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_13"> <port class_id="29" tracking_level="1" version="0" object_id="_14"> <name>in_stream_V_value_V</name> <dir>0</dir> <type>0</type> </port> <inst class_id="30" tracking_level="1" version="0" object_id="_15"> <type>0</type> <name>call_U0</name> <ssdmobj_id>12</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_16"> <port class_id_reference="29" object_id="_17"> <name>out_stream_V_value_V</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_15"/> </item> </pins> </item> </process_list> <channel_list class_id="31" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </channel_list> <net_list class_id="32" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </net_list> </mDfPipe> </item> </cdfg_regions> <fsm class_id="33" tracking_level="1" version="0" object_id="_18"> <states class_id="34" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="35" tracking_level="1" version="0" object_id="_19"> <id>1</id> <operations class_id="36" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="37" tracking_level="1" version="0" object_id="_20"> <id>12</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="35" object_id="_21"> <id>2</id> <operations> <count>11</count> <item_version>0</item_version> <item class_id_reference="37" object_id="_22"> <id>3</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_23"> <id>4</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_24"> <id>5</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_25"> <id>6</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_26"> <id>7</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_27"> <id>8</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_28"> <id>9</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_29"> <id>10</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_30"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="37" object_id="_31"> <id>12</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="37" object_id="_32"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="38" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="39" tracking_level="1" version="0" object_id="_33"> <inState>1</inState> <outState>2</outState> <condition class_id="40" tracking_level="0" version="0"> <id>0</id> <sop class_id="41" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="42" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="43" tracking_level="1" version="0" object_id="_34"> <dp_component_resource class_id="44" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="45" tracking_level="0" version="0"> <first>call_U0 (call)</first> <second class_id="46" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="47" tracking_level="0" version="0"> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>720</second> </item> <item> <first>LUT</first> <second>542</second> </item> </second> </item> </dp_component_resource> <dp_expression_resource> <count>0</count> <item_version>0</item_version> </dp_expression_resource> <dp_fifo_resource> <count>0</count> <item_version>0</item_version> </dp_fifo_resource> <dp_memory_resource> <count>0</count> <item_version>0</item_version> </dp_memory_resource> <dp_multiplexer_resource> <count>0</count> <item_version>0</item_version> </dp_multiplexer_resource> <dp_register_resource> <count>0</count> <item_version>0</item_version> </dp_register_resource> <dp_component_map class_id="48" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="49" tracking_level="0" version="0"> <first>call_U0 (call)</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> </dp_component_map> <dp_expression_map> <count>0</count> <item_version>0</item_version> </dp_expression_map> <dp_fifo_map> <count>0</count> <item_version>0</item_version> </dp_fifo_map> <dp_memory_map> <count>0</count> <item_version>0</item_version> </dp_memory_map> </res> <node_label_latency class_id="50" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="51" tracking_level="0" version="0"> <first>12</first> <second class_id="52" tracking_level="0" version="0"> <first>0</first> <second>1</second> </second> </item> <item> <first>13</first> <second> <first>1</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="53" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="54" tracking_level="0" version="0"> <first>14</first> <second class_id="55" tracking_level="0" version="0"> <first>0</first> <second>1</second> </second> </item> </bblk_ent_exit> <regions class_id="56" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="57" tracking_level="1" version="0" object_id="_35"> <region_name>linebuffer</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>14</item> </basic_blocks> <nodes> <count>11</count> <item_version>0</item_version> <item>3</item> <item>4</item> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> <item>10</item> <item>11</item> <item>12</item> <item>13</item> </nodes> <anchor_node>-1</anchor_node> <region_type>16</region_type> <interval>0</interval> <pipe_depth>0</pipe_depth> </item> </regions> <dp_fu_nodes class_id="58" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="59" tracking_level="0" version="0"> <first>36</first> <second> <count>2</count> <item_version>0</item_version> <item>12</item> <item>12</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="61" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>1</count> <item_version>0</item_version> <item class_id="62" tracking_level="0" version="0"> <first>grp_call_fu_36</first> <second> <count>2</count> <item_version>0</item_version> <item>12</item> <item>12</item> </second> </item> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="63" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>0</count> <item_version>0</item_version> </dp_reg_nodes> <dp_regname_nodes> <count>0</count> <item_version>0</item_version> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="64" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="65" tracking_level="0" version="0"> <first>in_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> </second> </item> <item> <first>out_stream_V_value_V</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>call</first> <second> <count>1</count> <item_version>0</item_version> <item>12</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="66" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="67" tracking_level="0" version="0"> <first>1</first> <second>FIFO_SRL</second> </item> <item> <first>2</first> <second>FIFO_SRL</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Program.Nodes.Record_Representation_Clauses is function Create (For_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Name : not null Program.Elements.Expressions .Expression_Access; Use_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Record_Token : not null Program.Lexical_Elements .Lexical_Element_Access; At_Token : Program.Lexical_Elements.Lexical_Element_Access; Mod_Token : Program.Lexical_Elements.Lexical_Element_Access; Mod_Clause_Expression : Program.Elements.Expressions.Expression_Access; Mod_Semicolon_Token : Program.Lexical_Elements.Lexical_Element_Access; Component_Clauses : not null Program.Elements.Component_Clauses .Component_Clause_Vector_Access; Semicolon_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Record_Representation_Clause is begin return Result : Record_Representation_Clause := (For_Token => For_Token, Name => Name, Use_Token => Use_Token, Record_Token => Record_Token, At_Token => At_Token, Mod_Token => Mod_Token, Mod_Clause_Expression => Mod_Clause_Expression, Mod_Semicolon_Token => Mod_Semicolon_Token, Component_Clauses => Component_Clauses, Semicolon_Token => Semicolon_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Name : not null Program.Elements.Expressions .Expression_Access; Mod_Clause_Expression : Program.Elements.Expressions.Expression_Access; Component_Clauses : not null Program.Elements.Component_Clauses .Component_Clause_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Record_Representation_Clause is begin return Result : Implicit_Record_Representation_Clause := (Name => Name, Mod_Clause_Expression => Mod_Clause_Expression, Component_Clauses => Component_Clauses, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Name (Self : Base_Record_Representation_Clause) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Name; end Name; overriding function Mod_Clause_Expression (Self : Base_Record_Representation_Clause) return Program.Elements.Expressions.Expression_Access is begin return Self.Mod_Clause_Expression; end Mod_Clause_Expression; overriding function Component_Clauses (Self : Base_Record_Representation_Clause) return not null Program.Elements.Component_Clauses .Component_Clause_Vector_Access is begin return Self.Component_Clauses; end Component_Clauses; overriding function For_Token (Self : Record_Representation_Clause) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.For_Token; end For_Token; overriding function Use_Token (Self : Record_Representation_Clause) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Use_Token; end Use_Token; overriding function Record_Token (Self : Record_Representation_Clause) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Record_Token; end Record_Token; overriding function At_Token (Self : Record_Representation_Clause) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.At_Token; end At_Token; overriding function Mod_Token (Self : Record_Representation_Clause) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Mod_Token; end Mod_Token; overriding function Mod_Semicolon_Token (Self : Record_Representation_Clause) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Mod_Semicolon_Token; end Mod_Semicolon_Token; overriding function Semicolon_Token (Self : Record_Representation_Clause) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Record_Representation_Clause) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Record_Representation_Clause) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Record_Representation_Clause) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : aliased in out Base_Record_Representation_Clause'Class) is begin Set_Enclosing_Element (Self.Name, Self'Unchecked_Access); if Self.Mod_Clause_Expression.Assigned then Set_Enclosing_Element (Self.Mod_Clause_Expression, Self'Unchecked_Access); end if; for Item in Self.Component_Clauses.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; null; end Initialize; overriding function Is_Record_Representation_Clause_Element (Self : Base_Record_Representation_Clause) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Record_Representation_Clause_Element; overriding function Is_Representation_Clause_Element (Self : Base_Record_Representation_Clause) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Representation_Clause_Element; overriding function Is_Clause_Element (Self : Base_Record_Representation_Clause) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Clause_Element; overriding procedure Visit (Self : not null access Base_Record_Representation_Clause; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Record_Representation_Clause (Self); end Visit; overriding function To_Record_Representation_Clause_Text (Self : aliased in out Record_Representation_Clause) return Program.Elements.Record_Representation_Clauses .Record_Representation_Clause_Text_Access is begin return Self'Unchecked_Access; end To_Record_Representation_Clause_Text; overriding function To_Record_Representation_Clause_Text (Self : aliased in out Implicit_Record_Representation_Clause) return Program.Elements.Record_Representation_Clauses .Record_Representation_Clause_Text_Access is pragma Unreferenced (Self); begin return null; end To_Record_Representation_Clause_Text; end Program.Nodes.Record_Representation_Clauses;
-- -- Copyright (c) 2015, John Leimon <jleimon@gmail.com> -- -- 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. -- pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Interfaces.C.Extensions; with System; package x86_64_linux_gnu_bits_pthreadtypes_h is subtype pthread_t is unsigned_long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:60 subtype pthread_attr_t_uu_size_array is Interfaces.C.char_array (0 .. 55); type pthread_attr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_attr_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:65 when others => uu_align : aliased long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:66 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_attr_t); pragma Unchecked_Union (pthread_attr_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:63 type uu_pthread_internal_list is record uu_prev : access uu_pthread_internal_list; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:77 uu_next : access uu_pthread_internal_list; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:78 end record; pragma Convention (C_Pass_By_Copy, uu_pthread_internal_list); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:75 subtype uu_pthread_list_t is uu_pthread_internal_list; subtype pthread_mutex_t_uu_size_array is Interfaces.C.char_array (0 .. 39); type pthread_mutex_t; type uu_pthread_mutex_s is record uu_lock : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:94 uu_count : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:95 uu_owner : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:96 uu_nusers : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:98 uu_kind : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:102 uu_spins : aliased short; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:104 uu_elision : aliased short; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:105 uu_list : aliased uu_pthread_list_t; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:106 end record; pragma Convention (C_Pass_By_Copy, uu_pthread_mutex_s); type pthread_mutex_t (discr : unsigned := 0) is record case discr is when 0 => uu_data : aliased uu_pthread_mutex_s; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:124 when 1 => uu_size : aliased pthread_mutex_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:125 when others => uu_align : aliased long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:126 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_mutex_t); pragma Unchecked_Union (pthread_mutex_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:127 -- skipped anonymous struct anon_11 subtype pthread_mutexattr_t_uu_size_array is Interfaces.C.char_array (0 .. 3); type pthread_mutexattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_mutexattr_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:131 when others => uu_align : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:132 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_mutexattr_t); pragma Unchecked_Union (pthread_mutexattr_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:133 -- skipped anonymous struct anon_12 subtype pthread_cond_t_uu_size_array is Interfaces.C.char_array (0 .. 47); type pthread_cond_t; type anon_14 is record uu_lock : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:142 uu_futex : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:143 uu_total_seq : aliased Extensions.unsigned_long_long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:144 uu_wakeup_seq : aliased Extensions.unsigned_long_long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:145 uu_woken_seq : aliased Extensions.unsigned_long_long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:146 uu_mutex : System.Address; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:147 uu_nwaiters : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:148 uu_broadcast_seq : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:149 end record; pragma Convention (C_Pass_By_Copy, anon_14); type pthread_cond_t (discr : unsigned := 0) is record case discr is when 0 => uu_data : aliased anon_14; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:150 when 1 => uu_size : aliased pthread_cond_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:151 when others => uu_align : aliased Long_Long_Integer; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:152 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_cond_t); pragma Unchecked_Union (pthread_cond_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:153 -- skipped anonymous struct anon_13 subtype pthread_condattr_t_uu_size_array is Interfaces.C.char_array (0 .. 3); type pthread_condattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_condattr_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:157 when others => uu_align : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:158 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_condattr_t); pragma Unchecked_Union (pthread_condattr_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:159 -- skipped anonymous struct anon_15 subtype pthread_key_t is unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:163 subtype pthread_once_t is int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:167 subtype pthread_rwlock_t_uu_size_array is Interfaces.C.char_array (0 .. 55); type pthread_rwlock_t; type anon_17 is record uu_lock : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:178 uu_nr_readers : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:179 uu_readers_wakeup : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:180 uu_writer_wakeup : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:181 uu_nr_readers_queued : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:182 uu_nr_writers_queued : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:183 uu_writer : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:184 uu_shared : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:185 uu_pad1 : aliased unsigned_long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:186 uu_pad2 : aliased unsigned_long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:187 uu_flags : aliased unsigned; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:190 end record; pragma Convention (C_Pass_By_Copy, anon_17); type pthread_rwlock_t (discr : unsigned := 0) is record case discr is when 0 => uu_data : aliased anon_17; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:192 when 1 => uu_size : aliased pthread_rwlock_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:211 when others => uu_align : aliased long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:212 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_rwlock_t); pragma Unchecked_Union (pthread_rwlock_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:213 -- skipped anonymous struct anon_16 subtype pthread_rwlockattr_t_uu_size_array is Interfaces.C.char_array (0 .. 7); type pthread_rwlockattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_rwlockattr_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:217 when others => uu_align : aliased long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:218 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_rwlockattr_t); pragma Unchecked_Union (pthread_rwlockattr_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:219 -- skipped anonymous struct anon_18 subtype pthread_spinlock_t is int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:225 subtype pthread_barrier_t_uu_size_array is Interfaces.C.char_array (0 .. 31); type pthread_barrier_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_barrier_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:232 when others => uu_align : aliased long; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:233 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_barrier_t); pragma Unchecked_Union (pthread_barrier_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:234 -- skipped anonymous struct anon_19 subtype pthread_barrierattr_t_uu_size_array is Interfaces.C.char_array (0 .. 3); type pthread_barrierattr_t (discr : unsigned := 0) is record case discr is when 0 => uu_size : aliased pthread_barrierattr_t_uu_size_array; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:238 when others => uu_align : aliased int; -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:239 end case; end record; pragma Convention (C_Pass_By_Copy, pthread_barrierattr_t); pragma Unchecked_Union (pthread_barrierattr_t); -- /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:240 -- skipped anonymous struct anon_20 end x86_64_linux_gnu_bits_pthreadtypes_h;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="14"> <syndb class_id="0" tracking_level="0" version="0"> <userIPLatency>-1</userIPLatency> <userIPName></userIPName> <cdfg class_id="1" tracking_level="1" version="0" object_id="_0"> <name>Loop_4_proc</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>hw_output_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo class_id="6" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>stream&amp;lt;AxiPackedStencil&amp;lt;unsigned char, 1, 1, 1, 1&amp;gt; &amp;gt;.V.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>hw_output_V_last_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>stream&amp;lt;AxiPackedStencil&amp;lt;unsigned char, 1, 1, 1, 1&amp;gt; &amp;gt;.V.last.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <direction>1</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_3"> <Value> <Obj> <type>1</type> <id>3</id> <name>p_mul_stencil_stream_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_4"> <Value> <Obj> <type>1</type> <id>4</id> <name>p_delayed_input_stencil_stream_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>38</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_5"> <Value> <Obj> <type>0</type> <id>9</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>55</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>11</id> <name>indvar_flatten</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>21</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>147</item> <item>148</item> <item>149</item> <item>150</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>12</id> <name>p_hw_output_y_scan_1</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>301</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second class_id="12" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="13" tracking_level="0" version="0"> <first class_id="14" tracking_level="0" version="0"> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>301</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>151</item> <item>152</item> <item>153</item> <item>154</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>13</id> <name>p_hw_output_x_scan_2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>_hw_output_x___scan_dim_0</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>155</item> <item>156</item> <item>157</item> <item>158</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>14</id> <name>exitcond_flatten</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>159</item> <item>161</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>15</id> <name>indvar_flatten_next</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>21</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>162</item> <item>164</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>16</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>165</item> <item>166</item> <item>167</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>19</id> <name>exitcond7</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>301</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>301</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>56</item> <item>58</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>20</id> <name>p_hw_output_x_scan_s</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>301</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>301</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>59</item> <item>61</item> <item>62</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>21</id> <name>p_hw_output_y_scan_2</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>299</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>299</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>64</item> <item>65</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>22</id> <name>tmp_3_mid1</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>334</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>334</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>66</item> <item>68</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>23</id> <name>tmp_1</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>334</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>334</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>69</item> <item>70</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>24</id> <name>tmp_3_mid2</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>334</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>334</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>71</item> <item>72</item> <item>73</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>25</id> <name>p_hw_output_y_scan_s</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>301</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>301</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>74</item> <item>75</item> <item>76</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>28</id> <name>tmp_value_V_4</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>307</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>307</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>78</item> <item>79</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>29</id> <name>tmp_value_V_5</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>312</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>312</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>80</item> <item>81</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>30</id> <name>p_471</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>318</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>318</second> </item> </second> </item> </inlineStackInfo> <originalName>_471</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>82</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>31</id> <name>p_s</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>321</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>321</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>84</item> <item>85</item> <item>87</item> <item>89</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>32</id> <name>p_474</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>321</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>321</second> </item> </second> </item> </inlineStackInfo> <originalName>_474</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>90</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>33</id> <name>p_479</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>326</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>326</second> </item> </second> </item> </inlineStackInfo> <originalName>_479</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>91</item> <item>92</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>34</id> <name>p_475</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>322</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>322</second> </item> </second> </item> </inlineStackInfo> <originalName>_475</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>93</item> <item>94</item> </oprand_edges> <opcode>sub</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>35</id> <name>tmp_12</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>325</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>325</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>96</item> <item>97</item> <item>98</item> <item>99</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>36</id> <name>p_478</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>325</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>325</second> </item> </second> </item> </inlineStackInfo> <originalName>_478</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>100</item> <item>102</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>37</id> <name>tmp_13</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>327</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>327</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>103</item> <item>104</item> <item>105</item> <item>106</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>38</id> <name>p_480</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>327</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>327</second> </item> </second> </item> </inlineStackInfo> <originalName>_480</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>107</item> <item>108</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>39</id> <name>tmp</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>330</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>330</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>110</item> <item>111</item> <item>113</item> <item>114</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>40</id> <name>tmp_14</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>329</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>329</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>116</item> <item>117</item> <item>118</item> <item>120</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>41</id> <name>tmp_15</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>328</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>328</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>121</item> <item>122</item> <item>124</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>42</id> <name>tmp_5_cast</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>329</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>329</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>125</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>43</id> <name>p_483</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>329</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>329</second> </item> </second> </item> </inlineStackInfo> <originalName>_483</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>126</item> <item>127</item> <item>128</item> </oprand_edges> <opcode>select</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>44</id> <name>p_483_cast</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>329</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>329</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>129</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>45</id> <name>p_484</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>331</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>331</second> </item> </second> </item> </inlineStackInfo> <originalName>_484</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>130</item> <item>131</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>46</id> <name>tmp_s</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>334</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>334</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>132</item> <item>134</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>47</id> <name>tmp_last_V</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>334</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>334</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.last.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>135</item> <item>136</item> </oprand_edges> <opcode>and</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>48</id> <name></name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>339</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>339</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>138</item> <item>139</item> <item>140</item> <item>141</item> <item>142</item> </oprand_edges> <opcode>write</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>50</id> <name>p_hw_output_x_scan_1</name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>301</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>301</second> </item> </second> </item> </inlineStackInfo> <originalName>_hw_output_x___scan_dim_0</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>143</item> <item>144</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>51</id> <name></name> <fileName>hls_target.cpp</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</fileDirectory> <lineNumber>301</lineNumber> <contextFuncName>hls_target</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/sharpen</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>hls_target.cpp</first> <second>hls_target</second> </first> <second>301</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>145</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>53</id> <name></name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>0</count> <item_version>0</item_version> </oprand_edges> <opcode>ret</opcode> <m_Display>0</m_Display> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>14</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_43"> <Value> <Obj> <type>2</type> <id>57</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1918</content> </item> <item class_id_reference="16" object_id="_44"> <Value> <Obj> <type>2</type> <id>60</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_45"> <Value> <Obj> <type>2</type> <id>63</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_46"> <Value> <Obj> <type>2</type> <id>67</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1077</content> </item> <item class_id_reference="16" object_id="_47"> <Value> <Obj> <type>2</type> <id>86</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>4</content> </item> <item class_id_reference="16" object_id="_48"> <Value> <Obj> <type>2</type> <id>88</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>7</content> </item> <item class_id_reference="16" object_id="_49"> <Value> <Obj> <type>2</type> <id>101</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_50"> <Value> <Obj> <type>2</type> <id>112</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>2</content> </item> <item class_id_reference="16" object_id="_51"> <Value> <Obj> <type>2</type> <id>119</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>3</content> </item> <item class_id_reference="16" object_id="_52"> <Value> <Obj> <type>2</type> <id>123</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_53"> <Value> <Obj> <type>2</type> <id>133</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>11</bitwidth> </Value> <const_type>0</const_type> <content>1917</content> </item> <item class_id_reference="16" object_id="_54"> <Value> <Obj> <type>2</type> <id>146</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>21</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_55"> <Value> <Obj> <type>2</type> <id>160</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>21</bitwidth> </Value> <const_type>0</const_type> <content>2067604</content> </item> <item class_id_reference="16" object_id="_56"> <Value> <Obj> <type>2</type> <id>163</id> <name>empty</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>21</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_57"> <Obj> <type>3</type> <id>10</id> <name>newFuncRoot</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>9</item> </node_objs> </item> <item class_id_reference="18" object_id="_58"> <Obj> <type>3</type> <id>17</id> <name>.preheader</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>6</count> <item_version>0</item_version> <item>11</item> <item>12</item> <item>13</item> <item>14</item> <item>15</item> <item>16</item> </node_objs> </item> <item class_id_reference="18" object_id="_59"> <Obj> <type>3</type> <id>52</id> <name>.preheader56</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>30</count> <item_version>0</item_version> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> <item>50</item> <item>51</item> </node_objs> </item> <item class_id_reference="18" object_id="_60"> <Obj> <type>3</type> <id>54</id> <name>.exitStub</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>53</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>89</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_61"> <id>55</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>9</sink_obj> </item> <item class_id_reference="20" object_id="_62"> <id>56</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_63"> <id>58</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_64"> <id>59</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_65"> <id>61</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_66"> <id>62</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_67"> <id>64</id> <edge_type>1</edge_type> <source_obj>63</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_68"> <id>65</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_69"> <id>66</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_70"> <id>68</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_71"> <id>69</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_72"> <id>70</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_73"> <id>71</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_74"> <id>72</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_75"> <id>73</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_76"> <id>74</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_77"> <id>75</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_78"> <id>76</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_79"> <id>79</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_80"> <id>81</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_81"> <id>82</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_82"> <id>85</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_83"> <id>87</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_84"> <id>89</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_85"> <id>90</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_86"> <id>91</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_87"> <id>92</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_88"> <id>93</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_89"> <id>94</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_90"> <id>97</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_91"> <id>98</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_92"> <id>99</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_93"> <id>100</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_94"> <id>102</id> <edge_type>1</edge_type> <source_obj>101</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_95"> <id>104</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_96"> <id>105</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_97"> <id>106</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_98"> <id>107</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_99"> <id>108</id> <edge_type>1</edge_type> <source_obj>101</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_100"> <id>111</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_101"> <id>113</id> <edge_type>1</edge_type> <source_obj>112</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_102"> <id>114</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_103"> <id>117</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_104"> <id>118</id> <edge_type>1</edge_type> <source_obj>112</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_105"> <id>120</id> <edge_type>1</edge_type> <source_obj>119</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_106"> <id>121</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_107"> <id>122</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_108"> <id>124</id> <edge_type>1</edge_type> <source_obj>123</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_109"> <id>125</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_110"> <id>126</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_111"> <id>127</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_112"> <id>128</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_113"> <id>129</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_114"> <id>130</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_115"> <id>131</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_116"> <id>132</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_117"> <id>134</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_118"> <id>135</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_119"> <id>136</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_120"> <id>139</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_121"> <id>140</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_122"> <id>141</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_123"> <id>142</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_124"> <id>143</id> <edge_type>1</edge_type> <source_obj>63</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_125"> <id>144</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_126"> <id>145</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>51</sink_obj> </item> <item class_id_reference="20" object_id="_127"> <id>147</id> <edge_type>1</edge_type> <source_obj>146</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_128"> <id>148</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_129"> <id>149</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_130"> <id>150</id> <edge_type>2</edge_type> <source_obj>52</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_131"> <id>151</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_132"> <id>152</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_133"> <id>153</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_134"> <id>154</id> <edge_type>2</edge_type> <source_obj>52</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_135"> <id>155</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_136"> <id>156</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_137"> <id>157</id> <edge_type>1</edge_type> <source_obj>50</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_138"> <id>158</id> <edge_type>2</edge_type> <source_obj>52</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_139"> <id>159</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_140"> <id>161</id> <edge_type>1</edge_type> <source_obj>160</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_141"> <id>162</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_142"> <id>164</id> <edge_type>1</edge_type> <source_obj>163</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_143"> <id>165</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_144"> <id>166</id> <edge_type>2</edge_type> <source_obj>52</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_145"> <id>167</id> <edge_type>2</edge_type> <source_obj>54</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_146"> <id>254</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>17</sink_obj> </item> <item class_id_reference="20" object_id="_147"> <id>255</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_148"> <id>256</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_149"> <id>257</id> <edge_type>2</edge_type> <source_obj>52</source_obj> <sink_obj>17</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_150"> <mId>1</mId> <mTag>Loop_4_proc</mTag> <mType>0</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>4</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>2067608</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_151"> <mId>2</mId> <mTag>Entry</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>10</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_152"> <mId>3</mId> <mTag>Loop 1</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>17</item> <item>52</item> </basic_blocks> <mII>1</mII> <mDepth>4</mDepth> <mMinTripCount>2067604</mMinTripCount> <mMaxTripCount>2067604</mMaxTripCount> <mMinLatency>2067606</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_153"> <mId>4</mId> <mTag>Return</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>54</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> </cdfg_regions> <fsm class_id="-1"></fsm> <res class_id="-1"></res> <node_label_latency class_id="26" tracking_level="0" version="0"> <count>38</count> <item_version>0</item_version> <item class_id="27" tracking_level="0" version="0"> <first>9</first> <second class_id="28" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>13</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>34</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>51</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>53</first> <second> <first>2</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="29" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="30" tracking_level="0" version="0"> <first>10</first> <second class_id="31" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>52</first> <second> <first>1</first> <second>4</second> </second> </item> <item> <first>54</first> <second> <first>2</first> <second>2</second> </second> </item> </bblk_ent_exit> <regions class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="1" version="0" object_id="_154"> <region_name>Loop 1</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>17</item> <item>52</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>4</pipe_depth> </item> </regions> <dp_fu_nodes class_id="34" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_fu_nodes> <dp_fu_nodes_expression class_id="35" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="36" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_mem_port_nodes> <dp_reg_nodes> <count>0</count> <item_version>0</item_version> </dp_reg_nodes> <dp_regname_nodes> <count>0</count> <item_version>0</item_version> </dp_regname_nodes> <dp_reg_phi> <count>0</count> <item_version>0</item_version> </dp_reg_phi> <dp_regname_phi> <count>0</count> <item_version>0</item_version> </dp_regname_phi> <dp_port_io_nodes class_id="37" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_port_io_nodes> <port2core class_id="38" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012-2015, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ pragma Restrictions (No_Elaboration_Code); -- GNAT: enforce generation of preinitialized data section instead of -- generation of elaboration code. package Matreshka.Internals.Unicode.Ucd.Core_01EE is pragma Preelaborate; Group_01EE : aliased constant Core_Second_Stage := (16#04# => -- 01EE04 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#20# => -- 01EE20 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#23# => -- 01EE23 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#25# .. 16#26# => -- 01EE25 .. 01EE26 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#28# => -- 01EE28 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#33# => -- 01EE33 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#38# => -- 01EE38 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#3A# => -- 01EE3A (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#3C# .. 16#41# => -- 01EE3C .. 01EE41 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#43# .. 16#46# => -- 01EE43 .. 01EE46 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#48# => -- 01EE48 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#4A# => -- 01EE4A (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#4C# => -- 01EE4C (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#50# => -- 01EE50 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#53# => -- 01EE53 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#55# .. 16#56# => -- 01EE55 .. 01EE56 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#58# => -- 01EE58 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#5A# => -- 01EE5A (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#5C# => -- 01EE5C (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#5E# => -- 01EE5E (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#60# => -- 01EE60 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#63# => -- 01EE63 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#65# .. 16#66# => -- 01EE65 .. 01EE66 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#6B# => -- 01EE6B (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#73# => -- 01EE73 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#78# => -- 01EE78 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#7D# => -- 01EE7D (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#7F# => -- 01EE7F (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#8A# => -- 01EE8A (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#9C# .. 16#A0# => -- 01EE9C .. 01EEA0 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#A4# => -- 01EEA4 (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#AA# => -- 01EEAA (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#BC# .. 16#EF# => -- 01EEBC .. 01EEEF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), 16#F0# .. 16#F1# => -- 01EEF0 .. 01EEF1 (Math_Symbol, Neutral, Other, Other, Other, Alphabetic, (Grapheme_Base | Math => True, others => False)), 16#F2# .. 16#FF# => -- 01EEF2 .. 01EEFF (Unassigned, Neutral, Other, Other, Other, Unknown, (others => False)), others => (Other_Letter, Neutral, Other, A_Letter, O_Letter, Alphabetic, (Other_Math | Alphabetic | Grapheme_Base | ID_Continue | ID_Start | Math | XID_Continue | XID_Start | Changes_When_NFKC_Casefolded => True, others => False))); end Matreshka.Internals.Unicode.Ucd.Core_01EE;
package ZMQ.Tests.TestCases is pragma Preelaborate; end ZMQ.Tests.TestCases;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- L I B . U T I L -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Uintp; use Uintp; package Lib.Util is -- This package implements a buffered write of library information procedure Write_Info_Char (C : Character); pragma Inline (Write_Info_Char); -- Adds one character to the info procedure Write_Info_Char_Code (Code : Char_Code); -- Write a single character code. Upper half values in the range -- 16#80..16#FF are written as Uhh (hh = 2 hex digits), and values -- greater than 16#FF are written as Whhhh (hhhh = 4 hex digits). function Write_Info_Col return Positive; -- Returns the column in which the next character will be written procedure Write_Info_EOL; -- Terminate current info line. This only flushes the buffer -- if there is not enough room for another complete line or -- if the host system needs a write for each line. procedure Write_Info_Initiate (Key : Character); -- Initiates write of new line to info file, the parameter is the keyword -- character for the line. The caller is responsible for writing the -- required blank after the key character if needed. procedure Write_Info_Nat (N : Nat); -- Adds image of N to Info_Buffer with no leading or trailing blanks procedure Write_Info_Int (N : Int); -- Adds image of N to Info_Buffer with no leading or trailing blanks. A -- minus sign is prepended for negative values. procedure Write_Info_Name (Name : Name_Id); procedure Write_Info_Name (Name : File_Name_Type); procedure Write_Info_Name (Name : Unit_Name_Type); -- Adds characters of Name to Info_Buffer. Note that in all cases, the -- name is written literally from the names table entry without modifying -- the case, using simply Get_Name_String. procedure Write_Info_Name_May_Be_Quoted (Name : File_Name_Type); -- Similar to Write_Info_Name, but if Name includes spaces, then it is -- quoted and the '"' are doubled. procedure Write_Info_Slit (S : String_Id); -- Write string literal value in format required for L/N lines in ali file procedure Write_Info_Str (Val : String); -- Adds characters of Val to Info_Buffer surrounded by quotes procedure Write_Info_Tab (Col : Positive); -- Tab out with blanks and HT's to column Col. If already at or past -- Col, writes a single blank, so that we do get a required field -- separation. procedure Write_Info_Terminate; -- Terminate current info line and output lines built in Info_Buffer procedure Write_Info_Uint (N : Uint); -- Adds decimal image of N to Info_Buffer with no leading or trailing -- blanks. A minus sign is prepended for negative values. end Lib.Util;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- A D A . I N T E R R U P T S . N A M E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1991-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the version for Cortex M4 SAM4S targets package Ada.Interrupts.Names is -- All identifiers in this unit are implementation defined pragma Implementation_Defined; -- The SAM4S datasheet defines peripheral indentifiers in Table 11-1 -- (page 41 of 1100E-ATARM-24-Jul-13). The meaningful number, the ID -- starts at 0. Unfortunately, Interrupt_ID 0 is reserved and the SysTick -- interrupt (a core interrupt) is handled by the runtime like other -- interrupts. So the first interrupt (supply controler) is numbered 2 -- while its ID is 0 in the manual. The offset of 2 is reflected in -- s-bbbosu-stm32f4.adb by the First_IRQ constant. Sys_Tick_Interrupt : constant Interrupt_ID := 1; SUPC_Interrupt : constant Interrupt_ID := 2; RSTC_Interrupt : constant Interrupt_ID := 3; RTC_Interrupt : constant Interrupt_ID := 4; RTT_Interrupt : constant Interrupt_ID := 5; WDT_Interrupt : constant Interrupt_ID := 6; PMC_Interrupt : constant Interrupt_ID := 7; EEFC0_Interrupt : constant Interrupt_ID := 8; EEFC1_Interrupt : constant Interrupt_ID := 9; UART0_Interrupt : constant Interrupt_ID := 10; UART1_Interrupt : constant Interrupt_ID := 11; SMC_Interrupt : constant Interrupt_ID := 12; PIOA_Interrupt : constant Interrupt_ID := 13; PIOB_Interrupt : constant Interrupt_ID := 14; PIOC_Interrupt : constant Interrupt_ID := 15; USART0_Interrupt : constant Interrupt_ID := 16; USART1_Interrupt : constant Interrupt_ID := 17; GSMCI_Interrupt : constant Interrupt_ID := 20; TWI0_Interrupt : constant Interrupt_ID := 21; TWO1_Interrupt : constant Interrupt_ID := 22; SPI_Interrupt : constant Interrupt_ID := 23; SSC_Interrupt : constant Interrupt_ID := 24; TC0_Interrupt : constant Interrupt_ID := 25; TC1_Interrupt : constant Interrupt_ID := 26; TC2_Interrupt : constant Interrupt_ID := 27; TC3_Interrupt : constant Interrupt_ID := 28; TC4_Interrupt : constant Interrupt_ID := 29; TC5_Interrupt : constant Interrupt_ID := 30; ADC_Interrupt : constant Interrupt_ID := 31; DACC_Interrupt : constant Interrupt_ID := 32; PWM_Interrupt : constant Interrupt_ID := 33; CRCCU_Interrupt : constant Interrupt_ID := 34; ACC_Interrupt : constant Interrupt_ID := 35; UDP_Interrupt : constant Interrupt_ID := 36; end Ada.Interrupts.Names;
with Ada.Text_IO; with Ada.Numerics.Float_Random; procedure Rock_Paper_Scissors is package Rand renames Ada.Numerics.Float_Random; Gen: Rand.Generator; type Choice is (Rock, Paper, Scissors); Cnt: array (Choice) of Natural := (1, 1, 1); -- for the initialization: pretend that each of Rock, Paper, -- and Scissors, has been played once by the human -- else the first computer choice would be deterministic function Computer_Choice return Choice is Random_Number: Natural := Integer(Rand.Random(Gen) * (Float(Cnt(Rock)) + Float(Cnt(Paper)) + Float(Cnt(Scissors)))); begin if Random_Number < Cnt(Rock) then -- guess the human will choose Rock return Paper; elsif Random_Number - Cnt(Rock) < Cnt(Paper) then -- guess the human will choose Paper return Scissors; else -- guess the human will choose Scissors return Rock; end if; end Computer_Choice; Finish_The_Game: exception; function Human_Choice return Choice is Done: Boolean := False; T: constant String := "enter ""r"" for Rock, ""p"" for Paper, or ""s"" for Scissors""!"; U: constant String := "or enter ""q"" to Quit the game"; Result: Choice; begin Ada.Text_IO.Put_Line(T); Ada.Text_IO.Put_Line(U); while not Done loop Done := True; declare S: String := Ada.Text_IO.Get_Line; begin if S="r" or S="R" then Result := Rock; elsif S="p" or S = "P" then Result := Paper; elsif S="s" or S="S" then Result := Scissors; elsif S="q" or S="Q" then raise Finish_The_Game; else Done := False; end if; end; end loop; return Result; end Human_Choice; type Result is (Human_Wins, Draw, Computer_Wins); function "<" (X, Y: Choice) return Boolean is -- X < Y if X looses against Y begin case X is when Rock => return (Y = Paper); when Paper => return (Y = Scissors); when Scissors => return (Y = Rock); end case; end "<"; Score: array(Result) of Natural := (0, 0, 0); C,H: Choice; Res: Result; begin -- play the game loop C := Computer_Choice; -- the computer makes its choice first H := Human_Choice; -- now ask the player for his/her choice Cnt(H) := Cnt(H) + 1; -- update the counts for the AI if C < H then Res := Human_Wins; elsif H < C then Res := Computer_Wins; else Res := Draw; end if; Ada.Text_IO.Put_Line("COMPUTER'S CHOICE: " & Choice'Image(C) & " RESULT: " & Result'Image(Res)); Ada.Text_IO.New_Line; Score(Res) := Score(Res) + 1; end loop; exception when Finish_The_Game => Ada.Text_IO.New_Line; for R in Score'Range loop Ada.Text_IO.Put_Line(Result'Image(R) & Natural'Image(Score(R))); end loop; end Rock_Paper_Scissors;
with TLSF.Block.Types; with TLSF.Context; with TLSF.Proof.Model.Block; package TLSF.Proof.Model.Context with SPARK_Mode, Ghost, Abstract_State => (State) is package BT renames TLSF.Block.Types; package TC renames TLSF.Context; package MB renames TLSF.Proof.Model.Block; use type BT.Address; use type BT.Size; use type BT.Address_Space; use type MB.Formal_Model; function Has_Model (Context : TC.Context) return Boolean with Global => State; function Get_Block_Model (Context : TC.Context) return MB.Formal_Model with Global => State, Pre => Has_Model (Context), Post => Get_Block_Model'Result.Mem_Region = Context.Memory.Region; procedure Set_Block_Model (Context : TC.Context; Blocks_Model : MB.Formal_Model) with Global => (In_Out => State), Pre => Has_Model (Context), Post => Has_Model (Context) and Get_Block_Model (Context) = Blocks_Model; procedure Init_Model (Context : TC.Context) with Global => (In_Out => State), Post => Has_Model (Context) and then Get_Block_Model (Context) = MB.Init_Model (Context.Memory.Region); end TLSF.Proof.Model.Context;
-- RUN: %llvmgcc -S %s package Field_Order is type Tagged_Type is abstract tagged null record; type With_Discriminant (L : Positive) is new Tagged_Type with record S : String (1 .. L); end record; end;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- An object flow is an activity edge that can have objects or data passing -- along it. -- -- Object flows have support for multicast/receive, token selection from -- object nodes, and transformation of tokens. ------------------------------------------------------------------------------ with AMF.UML.Activity_Edges; limited with AMF.UML.Behaviors; package AMF.UML.Object_Flows is pragma Preelaborate; type UML_Object_Flow is limited interface and AMF.UML.Activity_Edges.UML_Activity_Edge; type UML_Object_Flow_Access is access all UML_Object_Flow'Class; for UML_Object_Flow_Access'Storage_Size use 0; not overriding function Get_Is_Multicast (Self : not null access constant UML_Object_Flow) return Boolean is abstract; -- Getter of ObjectFlow::isMulticast. -- -- Tells whether the objects in the flow are passed by multicasting. not overriding procedure Set_Is_Multicast (Self : not null access UML_Object_Flow; To : Boolean) is abstract; -- Setter of ObjectFlow::isMulticast. -- -- Tells whether the objects in the flow are passed by multicasting. not overriding function Get_Is_Multireceive (Self : not null access constant UML_Object_Flow) return Boolean is abstract; -- Getter of ObjectFlow::isMultireceive. -- -- Tells whether the objects in the flow are gathered from respondents to -- multicasting. not overriding procedure Set_Is_Multireceive (Self : not null access UML_Object_Flow; To : Boolean) is abstract; -- Setter of ObjectFlow::isMultireceive. -- -- Tells whether the objects in the flow are gathered from respondents to -- multicasting. not overriding function Get_Selection (Self : not null access constant UML_Object_Flow) return AMF.UML.Behaviors.UML_Behavior_Access is abstract; -- Getter of ObjectFlow::selection. -- -- Selects tokens from a source object node. not overriding procedure Set_Selection (Self : not null access UML_Object_Flow; To : AMF.UML.Behaviors.UML_Behavior_Access) is abstract; -- Setter of ObjectFlow::selection. -- -- Selects tokens from a source object node. not overriding function Get_Transformation (Self : not null access constant UML_Object_Flow) return AMF.UML.Behaviors.UML_Behavior_Access is abstract; -- Getter of ObjectFlow::transformation. -- -- Changes or replaces data tokens flowing along edge. not overriding procedure Set_Transformation (Self : not null access UML_Object_Flow; To : AMF.UML.Behaviors.UML_Behavior_Access) is abstract; -- Setter of ObjectFlow::transformation. -- -- Changes or replaces data tokens flowing along edge. end AMF.UML.Object_Flows;
with GESTE; package Player is procedure Move (Pt : GESTE.Pix_Point); function Position return GESTE.Pix_Point; procedure Update; procedure Jump; procedure Move_Left; procedure Move_Right; end Player;
-- Swagger Petstore -- This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special_key` to test the authorization filters. -- -- OpenAPI spec version: 1.0.0 -- Contact: apiteam@swagger.io -- -- NOTE: This package is auto generated by the swagger code generator 2.4.0-SNAPSHOT. -- https://github.com/swagger-api/swagger-codegen.git -- Do not edit the class manually. package body Samples.Petstore.Models is use Swagger.Streams; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ApiResponse_Type) is begin Into.Start_Entity (Name); Into.Write_Entity ("code", Value.Code); Into.Write_Entity ("type", Value.P_Type); Into.Write_Entity ("message", Value.Message); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in ApiResponse_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ApiResponse_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "code", Value.Code); Swagger.Streams.Deserialize (Object, "type", Value.P_Type); Swagger.Streams.Deserialize (Object, "message", Value.Message); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out ApiResponse_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : ApiResponse_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Tag_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); Into.Write_Entity ("name", Value.Name); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Tag_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Tag_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "name", Value.Name); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Tag_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Tag_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Category_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); Into.Write_Entity ("name", Value.Name); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Category_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Category_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "name", Value.Name); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Category_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Category_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Pet_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); Serialize (Into, "category", Value.Category); Into.Write_Entity ("name", Value.Name); Serialize (Into, "photoUrls", Value.Photo_Urls); Serialize (Into, "tags", Value.Tags); Into.Write_Entity ("status", Value.Status); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Pet_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Pet_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Deserialize (Object, "category", Value.Category); Swagger.Streams.Deserialize (Object, "name", Value.Name); Swagger.Streams.Deserialize (Object, "photoUrls", Value.Photo_Urls); Deserialize (Object, "tags", Value.Tags); Swagger.Streams.Deserialize (Object, "status", Value.Status); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Pet_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Pet_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in User_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); Into.Write_Entity ("username", Value.Username); Into.Write_Entity ("firstName", Value.First_Name); Into.Write_Entity ("lastName", Value.Last_Name); Into.Write_Entity ("email", Value.Email); Into.Write_Entity ("password", Value.Password); Into.Write_Entity ("phone", Value.Phone); Into.Write_Entity ("userStatus", Value.User_Status); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in User_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out User_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "username", Value.Username); Swagger.Streams.Deserialize (Object, "firstName", Value.First_Name); Swagger.Streams.Deserialize (Object, "lastName", Value.Last_Name); Swagger.Streams.Deserialize (Object, "email", Value.Email); Swagger.Streams.Deserialize (Object, "password", Value.Password); Swagger.Streams.Deserialize (Object, "phone", Value.Phone); Swagger.Streams.Deserialize (Object, "userStatus", Value.User_Status); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out User_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : User_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Order_Type) is begin Into.Start_Entity (Name); Serialize (Into, "id", Value.Id); Serialize (Into, "petId", Value.Pet_Id); Into.Write_Entity ("quantity", Value.Quantity); Into.Write_Entity ("shipDate", Value.Ship_Date); Into.Write_Entity ("status", Value.Status); Into.Write_Entity ("complete", Value.Complete); Into.End_Entity (Name); end Serialize; procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class; Name : in String; Value : in Order_Type_Vectors.Vector) is begin Into.Start_Array (Name); for Item of Value loop Serialize (Into, "", Item); end loop; Into.End_Array (Name); end Serialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Order_Type) is Object : Swagger.Value_Type; begin Swagger.Streams.Deserialize (From, Name, Object); Swagger.Streams.Deserialize (Object, "id", Value.Id); Swagger.Streams.Deserialize (Object, "petId", Value.Pet_Id); Swagger.Streams.Deserialize (Object, "quantity", Value.Quantity); Deserialize (Object, "shipDate", Value.Ship_Date); Swagger.Streams.Deserialize (Object, "status", Value.Status); Swagger.Streams.Deserialize (Object, "complete", Value.Complete); end Deserialize; procedure Deserialize (From : in Swagger.Value_Type; Name : in String; Value : out Order_Type_Vectors.Vector) is List : Swagger.Value_Array_Type; Item : Order_Type; begin Value.Clear; Swagger.Streams.Deserialize (From, Name, List); for Data of List loop Deserialize (Data, "", Item); Value.Append (Item); end loop; end Deserialize; end Samples.Petstore.Models;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2009, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package body Matreshka.Internals.Unicode.Ucd is --------------------- -- Generic_Element -- --------------------- function Generic_Element (Data : First_Stage_Array; Code : Code_Point) return Element_Type is begin return Data (First_Stage_Index (Code / Second_Stage_Index'Modulus)) (Second_Stage_Index (Code mod Second_Stage_Index'Modulus)); end Generic_Element; end Matreshka.Internals.Unicode.Ucd;
-- Copyright 2008-2014 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is function Ident (P : Parameter) return Parameter is begin return P; end Ident; procedure Do_Nothing (P : in out Parameter) is begin null; end Do_Nothing; end Pck;
-- Test program. Read a valid toml-test compatible JSON description on the -- standard input and emit a corresponding TOML document on the standard -- output. with Ada.Containers.Generic_Array_Sort; with Ada.Strings.Unbounded; with Ada.Text_IO; with GNATCOLL.JSON; with TOML; with TOML.Generic_Dump; procedure Ada_TOML_Encode is use type Ada.Strings.Unbounded.Unbounded_String; use all type GNATCOLL.JSON.JSON_Value_Type; package US renames Ada.Strings.Unbounded; package IO renames Ada.Text_IO; package J renames GNATCOLL.JSON; type Stdout_Stream is null record; procedure Put (Stream : in out Stdout_Stream; Bytes : String); -- Callback for TOML.Generic_Dump function Interpret (Desc : J.JSON_Value) return TOML.TOML_Value; -- Interpret the given toml-test compatible JSON description (Value) and -- return the corresponding TOML value. type String_Array is array (Positive range <>) of US.Unbounded_String; procedure Sort_Strings is new Ada.Containers.Generic_Array_Sort (Index_Type => Positive, Element_Type => US.Unbounded_String, Array_Type => String_Array, "<" => US."<"); function Sorted_Keys (Desc : J.JSON_Value) return String_Array with Pre => Desc.Kind = JSON_Object_Type; -- Return a sorted array for all keys in the Desc object --------- -- Put -- --------- procedure Put (Stream : in out Stdout_Stream; Bytes : String) is pragma Unreferenced (Stream); begin IO.Put (Bytes); end Put; ----------------- -- Sorted_Keys -- ----------------- function Sorted_Keys (Desc : J.JSON_Value) return String_Array is Count : Natural := 0; procedure Count_CB (Dummy_Name : J.UTF8_String; Dummy_Value : J.JSON_Value); -------------- -- Count_CB -- -------------- procedure Count_CB (Dummy_Name : J.UTF8_String; Dummy_Value : J.JSON_Value) is begin Count := Count + 1; end Count_CB; begin Desc.Map_JSON_Object (Count_CB'Access); return Result : String_Array (1 .. Count) do declare I : Positive := Result'First; procedure Read_Entry (Name : J.UTF8_String; Dummy_Value : J.JSON_Value); ---------------- -- Read_Entry -- ---------------- procedure Read_Entry (Name : J.UTF8_String; Dummy_Value : J.JSON_Value) is begin Result (I) := US.To_Unbounded_String (Name); I := I + 1; end Read_Entry; begin Desc.Map_JSON_Object (Read_Entry'Access); Sort_Strings (Result); end; end return; end Sorted_Keys; --------------- -- Interpret -- --------------- function Interpret (Desc : J.JSON_Value) return TOML.TOML_Value is Time_Base_Length : constant := 8; Time_Milli_Length : constant := 4; Date_Length : constant := 10; Local_Datetime_Base_Length : constant := Date_Length + 1 + Time_Base_Length; Offset_Datetime_Base_Length : constant := Local_Datetime_Base_Length + 1; Offset_Full_Length : constant := 6; function Decode_Offset_Datetime (S : String) return TOML.Any_Offset_Datetime; function Decode_Local_Datetime (S : String) return TOML.Any_Local_Datetime; function Decode_Date (S : String) return TOML.Any_Local_Date; function Decode_Time (S : String) return TOML.Any_Local_Time; ---------------------------- -- Decode_Offset_Datetime -- ---------------------------- function Decode_Offset_Datetime (S : String) return TOML.Any_Offset_Datetime is use type TOML.Any_Local_Offset; pragma Assert (S'Length >= Offset_Datetime_Base_Length); Offset : TOML.Any_Local_Offset; Unknown_Offset : Boolean; I : constant Positive := S'First; Last : Positive := S'Last; begin if S (Last) = 'Z' then Last := Last - 1; Offset := 0; Unknown_Offset := False; else declare pragma Assert (S (Last - 2) = ':'); Offset_Sign : Character renames S (Last - 5); Hour_Offset : String renames S (Last - 4 .. Last - 3); Minute_Offset : String renames S (Last - 1 .. Last); begin Offset := 60 * TOML.Any_Local_Offset'Value (Hour_Offset) + TOML.Any_Local_Offset'Value (Minute_Offset); case Offset_Sign is when '-' => Offset := -Offset; when '+' => null; when others => raise Program_Error; end case; Unknown_Offset := Offset = 0 and then Offset_Sign = '-'; Last := Last - Offset_Full_Length; end; end if; declare Local_Datetime : constant TOML.Any_Local_Datetime := Decode_Local_Datetime (S (I .. Last)); begin return (Local_Datetime, Offset, Unknown_Offset); end; end Decode_Offset_Datetime; --------------------------- -- Decode_Local_Datetime -- --------------------------- function Decode_Local_Datetime (S : String) return TOML.Any_Local_Datetime is I : constant Positive := S'First; pragma Assert (S'Length >= Local_Datetime_Base_Length); pragma Assert (S (I + Date_Length) = 'T'); Date : constant TOML.Any_Local_Date := Decode_Date (S (I .. I + Date_Length - 1)); Time : constant TOML.Any_Local_Time := Decode_Time (S (I + Date_Length + 1 .. S'Last)); begin return (Date, Time); end Decode_Local_Datetime; ----------------- -- Decode_Date -- ----------------- function Decode_Date (S : String) return TOML.Any_Local_Date is I : constant Positive := S'First; pragma Assert (S'Length = Date_Length); pragma Assert (S (I + 4) = '-'); pragma Assert (S (I + 7) = '-'); Year : String renames S (I + 0 .. I + 3); Month : String renames S (I + 5 .. I + 6); Day : String renames S (I + 8 .. I + 9); begin return (TOML.Any_Year'Value (Year), TOML.Any_Month'Value (Month), TOML.Any_Day'Value (Day)); end Decode_Date; ----------------- -- Decode_Time -- ----------------- function Decode_Time (S : String) return TOML.Any_Local_Time is I : constant Positive := S'First; pragma Assert (S'Length in Time_Base_Length | Time_Base_Length + Time_Milli_Length); pragma Assert (S (I + 2) = ':'); pragma Assert (S (I + 5) = ':'); Hour : String renames S (I + 0 .. I + 1); Minute : String renames S (I + 3 .. I + 4); Second : String renames S (I + 6 .. I + 7); Millisecond : TOML.Any_Millisecond := 0; begin if S'Length /= Time_Base_Length then pragma Assert (S (I + Time_Base_Length) = '.'); Millisecond := TOML.Any_Millisecond'Value (S (I + Time_Base_Length + 1 .. S'Last)); end if; return (TOML.Any_Hour'Value (Hour), TOML.Any_Minute'Value (Minute), TOML.Any_Second'Value (Second), Millisecond); end Decode_Time; Result : TOML.TOML_Value; begin case Desc.Kind is when JSON_Object_Type => declare Keys : constant String_Array := Sorted_Keys (Desc); begin if Keys'Length = 2 and then Keys (1) = US.To_Unbounded_String ("type") and then Keys (2) = US.To_Unbounded_String ("value") then declare T : constant String := Desc.Get ("type"); V : constant J.JSON_Value := Desc.Get ("value"); begin if T = "string" then declare S : constant String := V.Get; begin Result := TOML.Create_String (S); end; elsif T = "float" then declare S : constant String := V.Get; I : Positive := S'First; Positive : Boolean := True; Value : TOML.Any_Float; begin if S (I) = '+' then I := I + 1; elsif S (I) = '-' then Positive := False; I := I + 1; end if; if S (I .. S'Last) = "nan" then Value := (Kind => TOML.NaN, Positive => Positive); elsif S (I .. S'Last) = "inf" then Value := (Kind => TOML.Infinity, Positive => Positive); else declare use type TOML.Valid_Float; VF : TOML.Valid_Float := TOML.Valid_Float'Value (S (I .. S'Last)); begin if not Positive then VF := -VF; end if; Value := (Kind => TOML.Regular, Value => VF); end; end if; Result := TOML.Create_Float (Value); end; elsif T = "integer" then declare S : constant String := V.Get; begin Result := TOML.Create_Integer (TOML.Any_Integer'Value (S)); end; elsif T = "bool" then declare S : constant String := V.Get; begin Result := TOML.Create_Boolean (Boolean'Value (S)); end; elsif T = "datetime" then Result := TOML.Create_Offset_Datetime (Decode_Offset_Datetime (V.Get)); elsif T = "datetime-local" then Result := TOML.Create_Local_Datetime (Decode_Local_Datetime (V.Get)); elsif T = "date-local" then Result := TOML.Create_Local_Date (Decode_Date (V.Get)); elsif T = "time-local" then Result := TOML.Create_Local_Time (Decode_Time (V.Get)); elsif T = "array" then Result := Interpret (V); else raise Program_Error with "unhandled value type: " & T; end if; end; else Result := TOML.Create_Table; for K of Keys loop declare Item : constant TOML.TOML_Value := Interpret (Desc.Get (US.To_String (K))); begin Result.Set (K, Item); end; end loop; end if; end; when JSON_Array_Type => declare Elements : constant J.JSON_Array := Desc.Get; begin Result := TOML.Create_Array; for I in 1 .. J.Length (Elements) loop Result.Append (Interpret (J.Get (Elements, I))); end loop; end; when others => raise Program_Error; end case; return Result; end Interpret; procedure Dump is new TOML.Generic_Dump (Stdout_Stream, Put); Input : US.Unbounded_String; Description : J.JSON_Value; Result : TOML.TOML_Value; Stdout : Stdout_Stream := (null record); begin -- Read the stdin until end of file and store its content in Input loop begin declare Line : constant String := IO.Get_Line; begin US.Append (Input, Line); end; exception when IO.End_Error => exit; end; end loop; -- Decode this input as JSON Description := J.Read (US.To_String (Input)); -- Build the TOML document from the JSON description and output it on the -- standard output. Result := Interpret (Description); Dump (Stdout, Result); end Ada_TOML_Encode;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.CMOF.Classes; with AMF.CMOF.Properties; limited with AMF.Extents; with League.Holders; package AMF.Elements is pragma Preelaborate; type Abstract_Element is limited interface; type Element_Access is access all Abstract_Element'Class; ---------------------- -- MOF Operations -- ---------------------- not overriding function Get_Meta_Class (Self : not null access constant Abstract_Element) return AMF.CMOF.Classes.CMOF_Class_Access is abstract; -- Returns the Class that describes this element. not overriding function Container (Self : not null access constant Abstract_Element) return AMF.Elements.Element_Access is abstract; -- Returns the parent container of this element if any. Return null if -- there is no containing element. not overriding function Get (Self : not null access constant Abstract_Element; Property : not null AMF.CMOF.Properties.CMOF_Property_Access) return League.Holders.Holder is abstract; -- Gets the value of the given property. If the Property has multiplicity -- upper bound of 1, get() returns the value of the Property. If Property -- has multiplicity upper bound >1, get() returns a ReflectiveCollection -- containing the values of the Property. If there are no values, the -- ReflectiveCollection returned is empty. -- -- Exception: throws IllegalArgumentException if Property is not a member -- of the Class from class(). not overriding procedure Set (Self : not null access Abstract_Element; Property : not null AMF.CMOF.Properties.CMOF_Property_Access; Value : League.Holders.Holder) is abstract; -- If the Property has multiplicity upper bound = 1, set() atomically -- updates the value of the Property to the object parameter. If Property -- has multiplicity upper bound >1, the Object must be a kind of -- ReflectiveCollection. The behavior is identical to the following -- operations performed atomically: -- -- ReflectiveSequence list = element.get(property); -- list.clear(); -- list.addAll((ReflectiveCollection) object); -- -- There is no return value. Exception: throws IllegalArgumentException if -- Property is not a member of the Class from getMetaClass(). -- -- Exception: throws ClassCastException if the Property’s type -- isInstance(element) returns false and Property has multi-plicity upper -- bound = 1. -- -- Exception: throws ClassCastException if Element is not a -- ReflectiveCollection and Property has multiplicity upper bound > 1. -- -- Exception: throws IllegalArgumentException if element is null, Property -- is of type Class, and the multiplicity upper bound > 1. ---------------------- -- AMF Extensions -- ---------------------- not overriding function Extent (Self : not null access constant Abstract_Element) return AMF.Extents.Extent_Access is abstract; -- Returns extents which contains element. end AMF.Elements;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Elements.Expressions; with Program.Lexical_Elements; with Program.Element_Vectors; with Program.Elements.Membership_Tests; with Program.Element_Visitors; package Program.Nodes.Membership_Tests is pragma Preelaborate; type Membership_Test is new Program.Nodes.Node and Program.Elements.Membership_Tests.Membership_Test and Program.Elements.Membership_Tests.Membership_Test_Text with private; function Create (Expression : not null Program.Elements.Expressions.Expression_Access; Not_Token : Program.Lexical_Elements.Lexical_Element_Access; In_Token : not null Program.Lexical_Elements.Lexical_Element_Access; Choices : not null Program.Element_Vectors.Element_Vector_Access) return Membership_Test; type Implicit_Membership_Test is new Program.Nodes.Node and Program.Elements.Membership_Tests.Membership_Test with private; function Create (Expression : not null Program.Elements.Expressions .Expression_Access; Choices : not null Program.Element_Vectors .Element_Vector_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Not : Boolean := False) return Implicit_Membership_Test with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Membership_Test is abstract new Program.Nodes.Node and Program.Elements.Membership_Tests.Membership_Test with record Expression : not null Program.Elements.Expressions.Expression_Access; Choices : not null Program.Element_Vectors.Element_Vector_Access; end record; procedure Initialize (Self : in out Base_Membership_Test'Class); overriding procedure Visit (Self : not null access Base_Membership_Test; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Expression (Self : Base_Membership_Test) return not null Program.Elements.Expressions.Expression_Access; overriding function Choices (Self : Base_Membership_Test) return not null Program.Element_Vectors.Element_Vector_Access; overriding function Is_Membership_Test (Self : Base_Membership_Test) return Boolean; overriding function Is_Expression (Self : Base_Membership_Test) return Boolean; type Membership_Test is new Base_Membership_Test and Program.Elements.Membership_Tests.Membership_Test_Text with record Not_Token : Program.Lexical_Elements.Lexical_Element_Access; In_Token : not null Program.Lexical_Elements.Lexical_Element_Access; end record; overriding function To_Membership_Test_Text (Self : in out Membership_Test) return Program.Elements.Membership_Tests.Membership_Test_Text_Access; overriding function Not_Token (Self : Membership_Test) return Program.Lexical_Elements.Lexical_Element_Access; overriding function In_Token (Self : Membership_Test) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Has_Not (Self : Membership_Test) return Boolean; type Implicit_Membership_Test is new Base_Membership_Test with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; Has_Not : Boolean; end record; overriding function To_Membership_Test_Text (Self : in out Implicit_Membership_Test) return Program.Elements.Membership_Tests.Membership_Test_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Membership_Test) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Membership_Test) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Membership_Test) return Boolean; overriding function Has_Not (Self : Implicit_Membership_Test) return Boolean; end Program.Nodes.Membership_Tests;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with System.Machine_Code; use System.Machine_Code; package body Memory_Barriers is ---------------------------------- -- Data_Synchronization_Barrier -- ---------------------------------- procedure Data_Synchronization_Barrier is pragma Suppress (All_Checks); begin Asm ("DSB #0xF", Volatile => True); -- 15 is 'Sy", ie "full system" end Data_Synchronization_Barrier; end Memory_Barriers;
----------------------------------------------------------------------- -- users - User creation, password tests -- Copyright (C) 2009, 2010, 2011, 2012, 2017, 2018 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Test_Caller; with Util.Measures; with Util.Log.Loggers; with ADO; with ADO.Sessions; with ADO.SQL; with ADO.Objects; with Ada.Calendar; with AWA.Users.Modules; with AWA.Tests.Helpers.Users; package body AWA.Users.Services.Tests is use ADO; use ADO.Objects; Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Users.Services.Tests"); package Caller is new Util.Test_Caller (Test, "Users.Services"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test AWA.Users.Services.Create_User", Test_Create_User'Access); Caller.Add_Test (Suite, "Test AWA.Users.Services.Close_Session", Test_Logout_User'Access); Caller.Add_Test (Suite, "Test AWA.Users.Services.Authenticate, Close_Session", Test_Login_User'Access); Caller.Add_Test (Suite, "Test AWA.Users.Services.Lost_Password, Reset_Password", Test_Reset_Password_User'Access); Caller.Add_Test (Suite, "Test AWA.Users.Module.Get_User_Module", Test_Get_Module'Access); end Add_Tests; -- ------------------------------ -- Test creation of a user -- ------------------------------ procedure Test_Create_User (T : in out Test) is Principal : AWA.Tests.Helpers.Users.Test_User; begin -- Create the user AWA.Tests.Helpers.Users.Create_User (Principal); T.Assert (not Principal.User.Is_Null, "User is created"); T.Assert (Principal.User.Get_Id > 0, "User has an allocated key"); T.Assert (Principal.Email.Get_Id > 0, "Email has an allocated key"); T.Assert (not Principal.Session.Is_Null, "Session must be created"); T.Assert (Principal.Session.Get_End_Date.Is_Null, "Session must be opened"); -- Verify the user session declare use type Ada.Calendar.Time; S1 : Session_Ref; U1 : User_Ref; T1 : constant Ada.Calendar.Time := Principal.Session.Get_Start_Date; begin Principal.Manager.Verify_Session (Id => Principal.Session.Get_Id, Session => S1, User => U1); T.Assert (not S1.Is_Null, "Null session returned by Verify_Session"); T.Assert (not U1.Is_Null, "Null user returned by Verify_Session"); T.Assert (S1.Get_End_Date.Is_Null, "Session must not be finished"); -- After we read the date/time from the database, we can loose -- the sub-second precision and we can't safely compare with the -- original. T.Assert (T1 - 1.0 <= S1.Get_Start_Date, "Invalid start date"); T.Assert (T1 + 1.0 >= S1.Get_Start_Date, "Invalid start date"); Principal.Manager.Close_Session (Principal.Session.Get_Id); end; end Test_Create_User; -- ------------------------------ -- Test logout of a user -- ------------------------------ procedure Test_Logout_User (T : in out Test) is Principal : AWA.Tests.Helpers.Users.Test_User; begin -- Create the user AWA.Tests.Helpers.Users.Create_User (Principal); T.Assert (not Principal.User.Is_Null, "User is created"); T.Assert (Principal.User.Get_Id > 0, "User has an allocated key"); T.Assert (Principal.Email.Get_Id > 0, "Email has an allocated key"); AWA.Tests.Helpers.Users.Logout (Principal); -- Verify the user session declare S1 : Session_Ref; U1 : User_Ref; begin Principal.Manager.Verify_Session (Id => Principal.Session.Get_Id, Session => S1, User => U1); T.Assert (False, "Verify_Session should report a non-existent session"); exception when Not_Found => null; end; begin AWA.Tests.Helpers.Users.Logout (Principal); T.Assert (False, "Second logout should report a non-existent session"); exception when Not_Found => null; end; end Test_Logout_User; -- ------------------------------ -- Test creation of a user -- ------------------------------ procedure Test_Login_User (T : in out Test) is use type Ada.Calendar.Time; Principal : AWA.Tests.Helpers.Users.Test_User; T1 : Ada.Calendar.Time; begin begin Principal.Email.Set_Email ("nobody@gmail.com"); AWA.Tests.Helpers.Users.Login (Principal); T.Assert (False, "Login succeeded with an invalid user name"); exception when Not_Found => null; end; -- Create the user T1 := Ada.Calendar.Clock; AWA.Tests.Helpers.Users.Create_User (Principal); Log.Info ("Created user and session is {0}", ADO.Identifier'Image (Principal.Session.Get_Id)); AWA.Tests.Helpers.Users.Logout (Principal); delay 1.0; AWA.Tests.Helpers.Users.Login (Principal); Log.Info ("Logout and login with session {0}", ADO.Identifier'Image (Principal.Session.Get_Id)); T.Assert (not Principal.User.Is_Null, "User is created"); T.Assert (Principal.User.Get_Id > 0, "User has an allocated key"); T.Assert (Principal.Email.Get_Id > 0, "Email has an allocated key"); T.Assert (not Principal.Session.Is_Null, "Session is not created"); -- Verify the user session declare S1 : Session_Ref; U1 : User_Ref; Ts : constant Ada.Calendar.Time := Principal.Session.Get_Start_Date; T2 : constant Ada.Calendar.Time := Ada.Calendar.Clock; begin Principal.Manager.Verify_Session (Id => Principal.Session.Get_Id, Session => S1, User => U1); T.Assert (not S1.Is_Null, "Null session returned by Verify_Session"); T.Assert (not U1.Is_Null, "Null user returned by Verify_Session"); T.Assert (S1.Get_End_Date.Is_Null, "Session end date must be null"); T.Assert (Ts - 1.0 <= S1.Get_Start_Date, "Invalid start date 1"); T.Assert (Ts + 1.0 >= S1.Get_Start_Date, "Invalid start date 2"); -- Storing a date in the database will loose some precision. T.Assert (S1.Get_Start_Date >= T1 - 1.0, "Start date is invalid 1"); T.Assert (S1.Get_Start_Date <= T2 + 10.0, "Start date is invalid 3"); Principal.Manager.Close_Session (Principal.Session.Get_Id); end; end Test_Login_User; -- ------------------------------ -- Test password reset process -- ------------------------------ procedure Test_Reset_Password_User (T : in out Test) is use type AWA.Users.Principals.Principal_Access; Principal : AWA.Tests.Helpers.Users.Test_User; Key : AWA.Users.Models.Access_Key_Ref; begin -- Create the user AWA.Tests.Helpers.Users.Create_User (Principal); AWA.Tests.Helpers.Users.Logout (Principal); -- Start the lost password process. Principal.Manager.Lost_Password (Email => Principal.Email.Get_Email); AWA.Tests.Helpers.Users.Login (Principal); -- Get the access key to reset the password declare DB : ADO.Sessions.Session := Principal.Manager.Get_Session; Query : ADO.SQL.Query; Found : Boolean; begin -- Find the access key Query.Set_Filter ("user_id = ?"); Query.Bind_Param (1, Principal.User.Get_Id); Key.Find (DB, Query, Found); T.Assert (Found, "Access key for lost_password process not found"); Principal.Manager.Reset_Password (Key => Key.Get_Access_Key, Password => "newadmin", IpAddr => "192.168.1.2", Principal => Principal.Principal); T.Assert (Principal.Principal /= null, "No principal returned"); Principal.User := Principal.Principal.Get_User; Principal.Session := Principal.Principal.Get_Session; -- Search the access key again, it must have been removed. Key.Find (DB, Query, Found); T.Assert (not Found, "The access key is still present in the database"); end; T.Assert (not Principal.User.Is_Null, "User is created"); T.Assert (Principal.User.Get_Id > 0, "User has an allocated key"); T.Assert (Principal.Email.Get_Id > 0, "Email has an allocated key"); T.Assert (not Principal.Session.Is_Null, "Session is not created"); AWA.Tests.Helpers.Users.Logout (Principal); end Test_Reset_Password_User; -- ------------------------------ -- Test Get_User_Module operation -- ------------------------------ procedure Test_Get_Module (T : in out Test) is use type AWA.Users.Modules.User_Module_Access; begin declare M : constant AWA.Users.Modules.User_Module_Access := AWA.Users.Modules.Get_User_Module; begin T.Assert (M /= null, "Get_User_Module returned null"); end; declare S : Util.Measures.Stamp; M : AWA.Users.Modules.User_Module_Access; begin for I in 1 .. 1_000 loop M := AWA.Users.Modules.Get_User_Module; end loop; Util.Measures.Report (S, "Get_User_Module (1000)"); T.Assert (M /= null, "Get_User_Module returned null"); end; end Test_Get_Module; end AWA.Users.Services.Tests;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Manifestations.Collections is pragma Preelaborate; package UML_Manifestation_Collections is new AMF.Generic_Collections (UML_Manifestation, UML_Manifestation_Access); type Set_Of_UML_Manifestation is new UML_Manifestation_Collections.Set with null record; Empty_Set_Of_UML_Manifestation : constant Set_Of_UML_Manifestation; type Ordered_Set_Of_UML_Manifestation is new UML_Manifestation_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Manifestation : constant Ordered_Set_Of_UML_Manifestation; type Bag_Of_UML_Manifestation is new UML_Manifestation_Collections.Bag with null record; Empty_Bag_Of_UML_Manifestation : constant Bag_Of_UML_Manifestation; type Sequence_Of_UML_Manifestation is new UML_Manifestation_Collections.Sequence with null record; Empty_Sequence_Of_UML_Manifestation : constant Sequence_Of_UML_Manifestation; private Empty_Set_Of_UML_Manifestation : constant Set_Of_UML_Manifestation := (UML_Manifestation_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Manifestation : constant Ordered_Set_Of_UML_Manifestation := (UML_Manifestation_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Manifestation : constant Bag_Of_UML_Manifestation := (UML_Manifestation_Collections.Bag with null record); Empty_Sequence_Of_UML_Manifestation : constant Sequence_Of_UML_Manifestation := (UML_Manifestation_Collections.Sequence with null record); end AMF.UML.Manifestations.Collections;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2008,2011 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.18 $ -- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_User_Data; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Header_Handler; use Sample.Header_Handler; with Sample.Explanation; use Sample.Explanation; with Sample.Menu_Demo.Handler; with Sample.Curses_Demo; with Sample.Form_Demo; with Sample.Menu_Demo; with Sample.Text_IO_Demo; with GNAT.OS_Lib; package body Sample is type User_Data is record Data : Integer; end record; type User_Access is access User_Data; package Ud is new Terminal_Interface.Curses.Menus.Menu_User_Data (User_Data, User_Access); package Id is new Terminal_Interface.Curses.Menus.Item_User_Data (User_Data, User_Access); procedure Whow is procedure Main_Menu; procedure Main_Menu is function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean; package Mh is new Sample.Menu_Demo.Handler (My_Driver); I : Item_Array_Access := new Item_Array' (New_Item ("Curses Core Demo"), New_Item ("Menu Demo"), New_Item ("Form Demo"), New_Item ("Text IO Demo"), Null_Item); M : Menu := New_Menu (I); D1, D2 : User_Access; I1, I2 : User_Access; function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean is Idx : constant Positive := Get_Index (Current (M)); begin if K in User_Key_Code'Range then if K = QUIT then return True; elsif K = SELECT_ITEM then if Idx <= 4 then Hide (Pan); Update_Panels; end if; case Idx is when 1 => Sample.Curses_Demo.Demo; when 2 => Sample.Menu_Demo.Demo; when 3 => Sample.Form_Demo.Demo; when 4 => Sample.Text_IO_Demo.Demo; when others => null; end case; if Idx <= 4 then Top (Pan); Show (Pan); Update_Panels; Update_Screen; end if; end if; end if; return False; end My_Driver; begin if (1 + Item_Count (M)) /= I'Length then raise Constraint_Error; end if; D1 := new User_Data'(Data => 4711); Ud.Set_User_Data (M, D1); I1 := new User_Data'(Data => 1174); Id.Set_User_Data (I.all (1), I1); Set_Spacing (Men => M, Row => 2); Default_Labels; Notepad ("MAINPAD"); Mh.Drive_Me (M, " Demo "); Ud.Get_User_Data (M, D2); pragma Assert (D1 = D2); pragma Assert (D1.Data = D2.Data); Id.Get_User_Data (I.all (1), I2); pragma Assert (I1 = I2); pragma Assert (I1.Data = I2.Data); Delete (M); Free (I, True); end Main_Menu; begin Initialize (PC_Style_With_Index); Init_Header_Handler; Init_Screen; if Has_Colors then Start_Color; Init_Pair (Pair => Default_Colors, Fore => Black, Back => White); Init_Pair (Pair => Menu_Back_Color, Fore => Black, Back => Cyan); Init_Pair (Pair => Menu_Fore_Color, Fore => Red, Back => Cyan); Init_Pair (Pair => Menu_Grey_Color, Fore => White, Back => Cyan); Init_Pair (Pair => Notepad_Color, Fore => Black, Back => Yellow); Init_Pair (Pair => Help_Color, Fore => Blue, Back => Cyan); Init_Pair (Pair => Form_Back_Color, Fore => Black, Back => Cyan); Init_Pair (Pair => Form_Fore_Color, Fore => Red, Back => Cyan); Init_Pair (Pair => Header_Color, Fore => Black, Back => Green); Set_Background (Ch => (Color => Default_Colors, Attr => Normal_Video, Ch => ' ')); Set_Character_Attributes (Attr => Normal_Video, Color => Default_Colors); Erase; Set_Soft_Label_Key_Attributes (Color => Header_Color); -- This propagates the attributes to the label window Refresh_Soft_Label_Keys; end if; Init_Keyboard_Handler; Set_Echo_Mode (False); Set_Raw_Mode; Set_Meta_Mode; Set_KeyPad_Mode; -- Initialize the Function Key Environment -- We have some fixed key throughout this sample Main_Menu; End_Windows; Curses_Free_All; exception when Event : others => Terminal_Interface.Curses.End_Windows; Text_IO.Put ("Exception: "); Text_IO.Put (Exception_Name (Event)); Text_IO.New_Line; GNAT.OS_Lib.OS_Exit (1); end Whow; end Sample;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.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_Reduce_Actions is ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant UML_Reduce_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_Reduce_Action (AMF.UML.Reduce_Actions.UML_Reduce_Action_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant UML_Reduce_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_Reduce_Action (AMF.UML.Reduce_Actions.UML_Reduce_Action_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant UML_Reduce_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_Reduce_Action (Visitor, AMF.UML.Reduce_Actions.UML_Reduce_Action_Access (Self), Control); end if; end Visit_Element; -------------------- -- Get_Collection -- -------------------- overriding function Get_Collection (Self : not null access constant UML_Reduce_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_Collection (Self.Element))); end Get_Collection; -------------------- -- Set_Collection -- -------------------- overriding procedure Set_Collection (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Collection (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Collection; -------------------- -- Get_Is_Ordered -- -------------------- overriding function Get_Is_Ordered (Self : not null access constant UML_Reduce_Action_Proxy) return Boolean is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Ordered (Self.Element); end Get_Is_Ordered; -------------------- -- Set_Is_Ordered -- -------------------- overriding procedure Set_Is_Ordered (Self : not null access UML_Reduce_Action_Proxy; To : Boolean) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Ordered (Self.Element, To); end Set_Is_Ordered; ----------------- -- Get_Reducer -- ----------------- overriding function Get_Reducer (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Behaviors.UML_Behavior_Access is begin return AMF.UML.Behaviors.UML_Behavior_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Reducer (Self.Element))); end Get_Reducer; ----------------- -- Set_Reducer -- ----------------- overriding procedure Set_Reducer (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Behaviors.UML_Behavior_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Reducer (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Reducer; ---------------- -- Get_Result -- ---------------- overriding function Get_Result (Self : not null access constant UML_Reduce_Action_Proxy) return AMF.UML.Output_Pins.UML_Output_Pin_Access is begin return AMF.UML.Output_Pins.UML_Output_Pin_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Result (Self.Element))); end Get_Result; ---------------- -- Set_Result -- ---------------- overriding procedure Set_Result (Self : not null access UML_Reduce_Action_Proxy; To : AMF.UML.Output_Pins.UML_Output_Pin_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Result (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Result; ----------------- -- Get_Context -- ----------------- overriding function Get_Context (Self : not null access constant UML_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_Action_Proxy.Context"; return Context (Self); end Context; ------------------------ -- Is_Consistent_With -- ------------------------ overriding function Is_Consistent_With (Self : not null access constant UML_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_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_Reduce_Action_Proxy.Namespace"; return Namespace (Self); end Namespace; end AMF.Internals.UML_Reduce_Actions;
pragma Check_Policy (Trace => Off); with Ada.Command_Line; with Ada.Environment_Variables; with Ada.Processes; with Ada.Streams.Stream_IO.Pipes; with Ada.Text_IO.Text_Streams; procedure process is use type Ada.Command_Line.Exit_Status; Target : constant String := Standard'Target_Name; In_Windows : constant Boolean := Target (Target'Length - 6 .. Target'Last) = "mingw32"; begin declare -- making command line Command : Ada.Processes.Command_Type; begin Ada.Processes.Append (Command, "echo"); Ada.Processes.Append (Command, "x"); Ada.Processes.Append (Command, "y z"); declare S1 : constant String := Ada.Processes.Image (Command); C2 : constant Ada.Processes.Command_Type := Ada.Processes.Value (S1); S2 : constant String := Ada.Processes.Image (C2); begin pragma Check (Trace, Ada.Debug.Put (S1)); pragma Assert (S1 = S2); null; end; end; declare -- transfer command line Command : Ada.Processes.Command_Type; begin Ada.Processes.Append (Command, "echo"); Ada.Processes.Append (Command, Ada.Command_Line.Iterate); pragma Check (Trace, Ada.Debug.Put (Ada.Processes.Image (Command))); end; declare -- shell Code : Ada.Command_Line.Exit_Status; begin -- ls if In_Windows then Ada.Processes.Shell ("cmd /c dir > nul", Code); else Ada.Processes.Shell ("ls > /dev/null", Code); end if; pragma Check (Trace, Ada.Debug.Put (Ada.Command_Line.Exit_Status'Image (Code))); pragma Assert (Code = 0); if In_Windows then Ada.Processes.Shell ("cmd /c dir $$$ > nul 2> nul", Code); else Ada.Processes.Shell ("ls @@@ 2> /dev/null", Code); -- is not existing end if; pragma Check (Trace, Ada.Debug.Put (Ada.Command_Line.Exit_Status'Image (Code))); pragma Assert (Code in 1 .. 2); -- GNU ls returns 2 -- error case begin Ada.Processes.Shell ("acats 2> /dev/null", Code); -- dir raise Program_Error; exception when Ada.Processes.Name_Error => null; end; end; declare -- spawn C : Ada.Processes.Process; Input_Reading, Input_Writing: Ada.Streams.Stream_IO.File_Type; Output_Reading, Output_Writing: Ada.Streams.Stream_IO.File_Type; begin -- env Ada.Environment_Variables.Set ("ahaha", "ufufu"); Ada.Streams.Stream_IO.Pipes.Create (Output_Reading, Output_Writing); if In_Windows then Ada.Processes.Create (C, "C:\msys32\usr\bin\env.exe", Output => Output_Writing); else Ada.Processes.Create (C, "/usr/bin/env", Output => Output_Writing); end if; Ada.Streams.Stream_IO.Close (Output_Writing); Ada.Processes.Wait (C); declare File : Ada.Text_IO.File_Type; Success : Boolean := False; begin Ada.Text_IO.Text_Streams.Open ( File, Ada.Text_IO.In_File, Ada.Streams.Stream_IO.Stream (Output_Reading)); Reading : begin loop declare Line : constant String := Ada.Text_IO.Get_Line (File); begin pragma Check (Trace, Ada.Debug.Put (Line)); if Line = "ahaha=ufufu" then Success := True; end if; end; end loop; exception when Ada.Text_IO.End_Error => null; end Reading; pragma Assert (Ada.Text_IO.End_Of_File (File)); Ada.Text_IO.Close (File); pragma Assert (Success); end; Ada.Streams.Stream_IO.Close (Output_Reading); -- cat Ada.Streams.Stream_IO.Pipes.Create (Input_Reading, Input_Writing); Ada.Streams.Stream_IO.Pipes.Create (Output_Reading, Output_Writing); String'Write (Ada.Streams.Stream_IO.Stream (Input_Writing), "0123456789" & ASCII.LF); Ada.Streams.Stream_IO.Close (Input_Writing); if In_Windows then Ada.Processes.Create (C, "C:\msys32\usr\bin\cat.exe", Input => Input_Reading, Output => Output_Writing); else Ada.Processes.Create (C, "cat", Search_Path => True, Input => Input_Reading, Output => Output_Writing); end if; declare Terminated : Boolean; begin Ada.Processes.Wait_Immediate (C, Terminated => Terminated); pragma Assert (not Terminated); end; Ada.Streams.Stream_IO.Close (Input_Reading); Ada.Streams.Stream_IO.Close (Output_Writing); Ada.Processes.Wait (C); declare Buffer : String (1 .. 11); begin String'Read (Ada.Streams.Stream_IO.Stream (Output_Reading), Buffer); pragma Check (Trace, Ada.Debug.Put (Buffer)); pragma Assert (Buffer = "0123456789" & ASCII.LF); pragma Assert (Ada.Streams.Stream_IO.End_Of_File (Output_Reading)); end; Ada.Streams.Stream_IO.Close (Output_Reading); -- sleep and abort if In_Windows then Ada.Processes.Create (C, "C:\msys32\usr\bin\sleep.exe 2"); else Ada.Processes.Create (C, "sleep 2", Search_Path => True); end if; Ada.Processes.Abort_Process (C); declare Code : Ada.Command_Line.Exit_Status; begin Ada.Processes.Wait (C, Code); pragma Check (Trace, Check => Ada.Debug.Put (Ada.Command_Line.Exit_Status'Image (Code))); end; -- error case begin Ada.Processes.Create (C, "acats"); -- dir Ada.Debug.Put ("fallthrough from Create"); declare Code : Ada.Command_Line.Exit_Status; begin -- In Linux and glibc < 2.26, posix_spawn can't return the error. Ada.Processes.Wait (C, Code); if Code = 127 then raise Ada.Processes.Name_Error; end if; Ada.Debug.Put (Ada.Command_Line.Exit_Status'Image (Code)); end; raise Program_Error; exception when Ada.Processes.Use_Error => -- In Darwin, errno may be EACCES. null; when Ada.Processes.Name_Error => -- In FreeBSD, errno may be ENOENT. -- In Windows, the executable attribute is missing. -- ERROR_FILE_NOT_FOUND may be returned. null; end; end; pragma Debug (Ada.Debug.Put ("OK")); end process;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- U N A M E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Namet; use Namet; with Types; use Types; package Uname is --------------------------- -- Unit Name Conventions -- --------------------------- -- Units are associated with a unique ASCII name as follows. First we have -- the fully expanded name of the unit, with lower case letters (except -- for the use of upper case letters for encoding upper half and wide -- characters, as described in Namet), and periods. Following this is one -- of the following suffixes: -- %s for package/subprogram/generic declarations (specs) -- %b for package/subprogram/generic bodies and subunits -- Unit names are stored in the names table, and referred to by the -- corresponding Name_Id values. The type Unit_Name_Type, derived from -- Name_Id, is used to indicate that a Name_Id value that holds a unit name -- (as defined above) is expected. -- Note: as far as possible the conventions for unit names are encapsulated -- in this package. The one exception is that package Fname, which provides -- conversion routines from unit names to file names must be aware of the -- precise conventions that are used. ------------------- -- Display Names -- ------------------- -- For display purposes, unit names are printed out with the suffix -- " (body)" for a body and " (spec)" for a spec. These formats are -- used for the Write_Unit_Name and Get_Unit_Name_String subprograms. ----------------- -- Subprograms -- ----------------- function Get_Body_Name (N : Unit_Name_Type) return Unit_Name_Type; -- Given the name of a spec, this function returns the name of the -- corresponding body, i.e. characters %s replaced by %b function Get_Parent_Body_Name (N : Unit_Name_Type) return Unit_Name_Type; -- Given the name of a subunit, returns the name of the parent body function Get_Parent_Spec_Name (N : Unit_Name_Type) return Unit_Name_Type; -- Given the name of a child unit spec or body, returns the unit name -- of the parent spec. Returns No_Name if the given name is not the name -- of a child unit. procedure Get_External_Unit_Name_String (N : Unit_Name_Type); -- Given the name of a body or spec unit, this procedure places in -- Name_Buffer the name of the unit with periods replaced by double -- underscores. The spec/body indication is eliminated. The length -- of the stored name is placed in Name_Len. All letters are lower -- case, corresponding to the string used in external names. function Get_Spec_Name (N : Unit_Name_Type) return Unit_Name_Type; -- Given the name of a body, this function returns the name of the -- corresponding spec, i.e. characters %b replaced by %s function Get_Unit_Name (N : Node_Id) return Unit_Name_Type; -- This procedure returns the unit name that corresponds to the given node, -- which is one of the following: -- -- N_Subprogram_Declaration (spec) cases -- N_Package_Declaration -- N_Generic_Declaration -- N_With_Clause -- N_Function_Instantiation -- N_Package_Instantiation -- N_Procedure_Instantiation -- N_Pragma (Elaborate case) -- -- N_Package_Body (body) cases -- N_Subprogram_Body -- N_Identifier -- N_Selected_Component -- -- N_Subprogram_Body_Stub (subunit) cases -- N_Package_Body_Stub -- N_Task_Body_Stub -- N_Protected_Body_Stub -- N_Subunit procedure Get_Unit_Name_String (N : Unit_Name_Type; Suffix : Boolean := True); -- Places the display name of the unit in Name_Buffer and sets Name_Len to -- the length of the stored name, i.e. it uses the same interface as the -- Get_Name_String routine in the Namet package. The name is decoded and -- contains an indication of spec or body if Boolean parameter Suffix is -- True. function Is_Body_Name (N : Unit_Name_Type) return Boolean; -- Returns True iff the given name is the unit name of a body (i.e. if -- it ends with the characters %b). function Is_Child_Name (N : Unit_Name_Type) return Boolean; -- Returns True iff the given name is a child unit name (of either a -- body or a spec). function Is_Spec_Name (N : Unit_Name_Type) return Boolean; -- Returns True iff the given name is the unit name of a specification -- (i.e. if it ends with the characters %s). function Name_To_Unit_Name (N : Name_Id) return Unit_Name_Type; -- Given the Id of the Ada name of a unit, this function returns the -- corresponding unit name of the spec (by appending %s to the name). function New_Child (Old : Unit_Name_Type; Newp : Unit_Name_Type) return Unit_Name_Type; -- Old is a child unit name (for either a body or spec). Newp is the unit -- name of the actual parent (this may be different from the parent in -- old). The returned unit name is formed by taking the parent name from -- Newp and the child unit name from Old, with the result being a body or -- spec depending on Old. For example: -- -- Old = A.B.C (body) -- Newp = A.R (spec) -- result = A.R.C (body) -- -- See spec of Load_Unit for extensive discussion of why this routine -- needs to be used (the call in the body of Load_Unit is the only one). function Uname_Ge (Left, Right : Unit_Name_Type) return Boolean; function Uname_Gt (Left, Right : Unit_Name_Type) return Boolean; function Uname_Le (Left, Right : Unit_Name_Type) return Boolean; function Uname_Lt (Left, Right : Unit_Name_Type) return Boolean; -- These functions perform lexicographic ordering of unit names. The -- ordering is suitable for printing, and is not quite a straightforward -- comparison of the names, since the convention is that specs appear -- before bodies. Note that the standard = and /= operators work fine -- because all unit names are hashed into the name table, so if two names -- are the same, they always have the same Name_Id value. procedure Write_Unit_Name (N : Unit_Name_Type); -- Given a unit name, this procedure writes the display name to the -- standard output file. Name_Buffer and Name_Len are set as described -- above for the Get_Unit_Name_String call on return. end Uname;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 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. -- -- -- ------------------------------------------------------------------------------ -- This package provides utility routines for use with the Data Watchpoint -- Trace (DWT) facility defined by ARM for Cortex M processors. As such it -- should be vendor-independent. with HAL; use HAL; package Cortex_M.DWT is -- Data Watchpoint Trace pragma Elaborate_Body; -- The assumption is that application code will access the registers of -- the DWT directly, via the SVD-generated package Cortex_M_SVD.DWT, -- except when the convenience routines below are utilized. ---------------------------- -- Convenience functions -- ---------------------------- -- DWT reset values. These constant are the control register considered -- as unsigned 32-bit values for convenient comparison using the function -- below. The values are just the NUMCOMP nibble and the boolean flags in -- the next nibble. No_DWT_Present : constant UInt32 := 0; Only_One_Comparator : constant UInt32 := 16#1000_0000#; -- 268435456 dec One_Comparator_Watchpoints : constant UInt32 := 16#1F00_0000#; -- 520093696 dec Four_Comparators_Watchpoints_And_Triggers : constant UInt32 := 16#4000_0000#; -- 1073741824 dec Four_Comparators_Watchpoints_Only : constant UInt32 := 16#4F00_0000#; -- 1325400064 dec function DWT_Reset_Value return UInt32 with Inline; -- Returns the value of the DWT.CTRL register as a word, for convenient -- comparison to the constants above. procedure Enable_DWT_Unit with Post => DWT_Unit_Enabled, Inline; -- Sets the trace enable bit (TRCENA) in the Debug Exception & Monitor Ctrl -- (DEMCR) register within the Cortex M Debug peripheral. procedure Disable_DWT_Unit with Post => not DWT_Unit_Enabled, Inline; -- Clears the trace enable bit (TRCENA) in the Debug Exception & Monitor -- Ctrl (DEMCR) register within the Cortex M Debug peripheral. function DWT_Unit_Enabled return Boolean with Inline; end Cortex_M.DWT;
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual --------------------------------------------------------------------------- with Ada.Numerics.Complex_Types; with Ada.Numerics.Generic_Complex_Elementary_Functions; package Ada.Numerics.Complex_Elementary_Functions is new Ada.Numerics.Generic_Complex_Elementary_Functions (Ada.Numerics.Complex_Types);
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- A D A . E X C E P T I O N S . P O L L -- -- (version supporting asynchronous abort test and time slicing) -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This version is for targets that do not support per-thread asynchronous -- signals or that do not handle async timers properly. On such targets, we -- require compilation with the -gnatP switch that activates periodic polling. -- Then in the body of the polling routine we test for asynchronous abort and -- yield periodically. -- This is currently used only by Interix pragma Warnings (Off); -- Allow withing of non-Preelaborated units in Ada 2005 mode where this -- package will be categorized as Preelaborate. See AI-362 for details. -- It is safe in the context of the run-time to violate the rules! with System.Soft_Links; -- used for Check_Abort_Status pragma Warnings (On); separate (Ada.Exceptions) ---------- -- Poll -- ---------- procedure Poll is begin if Counter = 10000 then Counter := 0; delay 0.0; else Counter := Counter + 1; end if; -- Test for asynchronous abort on each poll if System.Soft_Links.Check_Abort_Status.all /= 0 then raise Standard'Abort_Signal; end if; end Poll;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Terminfo -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2006,2009 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.6 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Ada.Unchecked_Conversion; package body Terminal_Interface.Curses.Terminfo is function Is_MinusOne_Pointer (P : chars_ptr) return Boolean; function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is type Weird_Address is new System.Storage_Elements.Integer_Address; Invalid_Pointer : constant Weird_Address := -1; function To_Weird is new Ada.Unchecked_Conversion (Source => chars_ptr, Target => Weird_Address); begin if To_Weird (P) = Invalid_Pointer then return True; else return False; end if; end Is_MinusOne_Pointer; pragma Inline (Is_MinusOne_Pointer); ------------------------------------------------------------------------------ function Get_Flag (Name : String) return Boolean is function tigetflag (id : char_array) return Curses_Bool; pragma Import (C, tigetflag); Txt : char_array (0 .. Name'Length); Length : size_t; begin To_C (Name, Txt, Length); if tigetflag (Txt) = Curses_Bool (Curses_True) then return True; else return False; end if; end Get_Flag; ------------------------------------------------------------------------------ procedure Get_String (Name : String; Value : out Terminfo_String; Result : out Boolean) is function tigetstr (id : char_array) return chars_ptr; pragma Import (C, tigetstr, "tigetstr"); Txt : char_array (0 .. Name'Length); Length : size_t; Txt2 : chars_ptr; begin To_C (Name, Txt, Length); Txt2 := tigetstr (Txt); if Txt2 = Null_Ptr then Result := False; elsif Is_MinusOne_Pointer (Txt2) then raise Curses_Exception; else Value := Terminfo_String (Fill_String (Txt2)); Result := True; end if; end Get_String; ------------------------------------------------------------------------------ function Has_String (Name : String) return Boolean is function tigetstr (id : char_array) return chars_ptr; pragma Import (C, tigetstr, "tigetstr"); Txt : char_array (0 .. Name'Length); Length : size_t; Txt2 : chars_ptr; begin To_C (Name, Txt, Length); Txt2 := tigetstr (Txt); if Txt2 = Null_Ptr then return False; elsif Is_MinusOne_Pointer (Txt2) then raise Curses_Exception; else return True; end if; end Has_String; ------------------------------------------------------------------------------ function Get_Number (Name : String) return Integer is function tigetstr (s : char_array) return C_Int; pragma Import (C, tigetstr); Txt : char_array (0 .. Name'Length); Length : size_t; begin To_C (Name, Txt, Length); return Integer (tigetstr (Txt)); end Get_Number; ------------------------------------------------------------------------------ procedure Put_String (Str : Terminfo_String; affcnt : Natural := 1; putc : putctype := null) is function tputs (str : char_array; affcnt : C_Int; putc : putctype) return C_Int; function putp (str : char_array) return C_Int; pragma Import (C, tputs); pragma Import (C, putp); Txt : char_array (0 .. Str'Length); Length : size_t; Err : C_Int; begin To_C (String (Str), Txt, Length); if putc = null then Err := putp (Txt); else Err := tputs (Txt, C_Int (affcnt), putc); end if; if Err = Curses_Err then raise Curses_Exception; end if; end Put_String; end Terminal_Interface.Curses.Terminfo;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . C O N C A T _ 9 -- -- -- -- B o d y -- -- -- -- Copyright (C) 2008-2019, 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. -- -- -- ------------------------------------------------------------------------------ pragma Compiler_Unit_Warning; with System.Concat_8; package body System.Concat_9 is pragma Suppress (All_Checks); ------------------ -- Str_Concat_9 -- ------------------ procedure Str_Concat_9 (R : out String; S1, S2, S3, S4, S5, S6, S7, S8, S9 : String) is F, L : Natural; begin F := R'First; L := F + S1'Length - 1; R (F .. L) := S1; F := L + 1; L := F + S2'Length - 1; R (F .. L) := S2; F := L + 1; L := F + S3'Length - 1; R (F .. L) := S3; F := L + 1; L := F + S4'Length - 1; R (F .. L) := S4; F := L + 1; L := F + S5'Length - 1; R (F .. L) := S5; F := L + 1; L := F + S6'Length - 1; R (F .. L) := S6; F := L + 1; L := F + S7'Length - 1; R (F .. L) := S7; F := L + 1; L := F + S8'Length - 1; R (F .. L) := S8; F := L + 1; L := R'Last; R (F .. L) := S9; end Str_Concat_9; ------------------------- -- Str_Concat_Bounds_9 -- ------------------------- procedure Str_Concat_Bounds_9 (Lo, Hi : out Natural; S1, S2, S3, S4, S5, S6, S7, S8, S9 : String) is begin System.Concat_8.Str_Concat_Bounds_8 (Lo, Hi, S2, S3, S4, S5, S6, S7, S8, S9); if S1 /= "" then Hi := S1'Last + Hi - Lo + 1; Lo := S1'First; end if; end Str_Concat_Bounds_9; end System.Concat_9;
with Ada.Text_IO; with HAL; use HAL; with Hex_Dump; procedure TC_Hexdump is Data : UInt8_Array (1 .. 650); Cnt : UInt8 := 0; begin for Elt of Data loop Elt := Cnt; Cnt := Cnt + 1; end loop; Hex_Dump.Hex_Dump (Data => Data, Put_Line => Ada.Text_IO.Put_Line'Access, Base_Addr => 16#1_0000#); end TC_Hexdump;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Mouse -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2008,2009 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.24 $ -- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Interfaces.C; use Interfaces.C; use Interfaces; package body Terminal_Interface.Curses.Mouse is use type System.Bit_Order; function Has_Mouse return Boolean is function Mouse_Avail return C_Int; pragma Import (C, Mouse_Avail, "has_mouse"); begin if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then return True; else return False; end if; end Has_Mouse; function Get_Mouse return Mouse_Event is type Event_Access is access all Mouse_Event; function Getmouse (Ev : Event_Access) return C_Int; pragma Import (C, Getmouse, "getmouse"); Event : aliased Mouse_Event; begin if Getmouse (Event'Access) = Curses_Err then raise Curses_Exception; end if; return Event; end Get_Mouse; procedure Register_Reportable_Event (Button : Mouse_Button; State : Button_State; Mask : in out Event_Mask) is Button_Nr : constant Natural := Mouse_Button'Pos (Button); State_Nr : constant Natural := Button_State'Pos (State); begin if Button in Modifier_Keys and then State /= Pressed then raise Curses_Exception; else if Button in Real_Buttons then Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr); else Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4)); end if; end if; end Register_Reportable_Event; procedure Register_Reportable_Events (Button : Mouse_Button; State : Button_States; Mask : in out Event_Mask) is begin for S in Button_States'Range loop if State (S) then Register_Reportable_Event (Button, S, Mask); end if; end loop; end Register_Reportable_Events; function Start_Mouse (Mask : Event_Mask := All_Events) return Event_Mask is function MMask (M : Event_Mask; O : access Event_Mask) return Event_Mask; pragma Import (C, MMask, "mousemask"); R : Event_Mask; Old : aliased Event_Mask; begin R := MMask (Mask, Old'Access); if R = No_Events then Beep; end if; return Old; end Start_Mouse; procedure End_Mouse (Mask : Event_Mask := No_Events) is begin if Mask /= No_Events then Beep; end if; end End_Mouse; procedure Dispatch_Event (Mask : Event_Mask; Button : out Mouse_Button; State : out Button_State); procedure Dispatch_Event (Mask : Event_Mask; Button : out Mouse_Button; State : out Button_State) is L : Event_Mask; begin Button := Alt; -- preset to non real button; if (Mask and BUTTON1_EVENTS) /= 0 then Button := Left; elsif (Mask and BUTTON2_EVENTS) /= 0 then Button := Middle; elsif (Mask and BUTTON3_EVENTS) /= 0 then Button := Right; elsif (Mask and BUTTON4_EVENTS) /= 0 then Button := Button4; end if; if Button in Real_Buttons then L := 2 ** (6 * Mouse_Button'Pos (Button)); for I in Button_State'Range loop if (Mask and L) /= 0 then State := I; exit; end if; L := 2 * L; end loop; else State := Pressed; if (Mask and BUTTON_CTRL) /= 0 then Button := Control; elsif (Mask and BUTTON_SHIFT) /= 0 then Button := Shift; elsif (Mask and BUTTON_ALT) /= 0 then Button := Alt; end if; end if; end Dispatch_Event; procedure Get_Event (Event : Mouse_Event; Y : out Line_Position; X : out Column_Position; Button : out Mouse_Button; State : out Button_State) is Mask : constant Event_Mask := Event.Bstate; begin X := Column_Position (Event.X); Y := Line_Position (Event.Y); Dispatch_Event (Mask, Button, State); end Get_Event; procedure Unget_Mouse (Event : Mouse_Event) is function Ungetmouse (Ev : Mouse_Event) return C_Int; pragma Import (C, Ungetmouse, "ungetmouse"); begin if Ungetmouse (Event) = Curses_Err then raise Curses_Exception; end if; end Unget_Mouse; function Enclosed_In_Window (Win : Window := Standard_Window; Event : Mouse_Event) return Boolean is function Wenclose (Win : Window; Y : C_Int; X : C_Int) return Curses_Bool; pragma Import (C, Wenclose, "wenclose"); begin if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X)) = Curses_Bool_False then return False; else return True; end if; end Enclosed_In_Window; function Mouse_Interval (Msec : Natural := 200) return Natural is function Mouseinterval (Msec : C_Int) return C_Int; pragma Import (C, Mouseinterval, "mouseinterval"); begin return Natural (Mouseinterval (C_Int (Msec))); end Mouse_Interval; end Terminal_Interface.Curses.Mouse;
----------------------------------------------------------------------- -- package body Crout_LU, LU decomposition, with equation solving -- Copyright (C) 2008-2018 Jonathan S. Parker. -- -- 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. ----------------------------------------------------------------------- -- PACKAGE runge_pc_2 -- -- Exclusively for initializing Predictor-Corrector arrays. -- -- The 8th order Runge Kutta formula of Prince and Dormand -- (Journal of Computational and Applied Math. -- vol. 7, p. 67 (1981)). -- -- The program integrates (d/dt)**2 Y = F (t, Y) where t is the -- independent variable (e.g. time), vector Y is the -- dependent variable, and F is some function. generic type Real is digits <>; -- The independent variable. It's called Time -- throughout the package as though the differential -- equation dY/dt = F (t, Y) were time dependent. Of cource -- it can have any meaning. type Dyn_Index is range <>; type Dynamical_Variable is array(Dyn_Index) of Real; -- The dependent variable. -- We require its exact form here so that some inner loop -- optimizations can be performed below. -- A two dimension array makes this package useful -- for a very wide range of problems. If your Dynamical -- variable is really just a one-dimensional array, then you can still -- use it here (and with almost no loss in performance.) -- Just give the Dyn_Index a range 0..0. ( It's best to do -- this to the Vector_Range_1 rather than Vector_Range_2.) -- -- To use this routine one must reduce higher order differential -- Equations to 1st order. -- For example a 3rd order equation in X becomes a first order -- equation in the vector Y = (X, dX/dt, d/dt(dX/dt)). with function F (Time : Real; Y : Dynamical_Variable) return Dynamical_Variable is <>; -- Defines the equation to be integrated as -- dY/dt = F (t, Y). Even if the equation is t or Y -- independent, it must be entered in this form. with function "*" (Left : Real; Right : Dynamical_Variable) return Dynamical_Variable is <>; -- Defines multiplication of the independent by the -- dependent variable. An operation of this sort must exist by -- definition of the derivative, dY/dt = (Y(t+dt) - Y(t)) / dt, -- which requires multiplication of the (inverse) independent -- variable t, by the Dynamical variable Y (the dependent variable). with function "+" (Left : Dynamical_Variable; Right : Dynamical_Variable) return Dynamical_Variable is <>; -- Defines summation of the dependent variable. Again, this -- operation must exist by the definition of the derivative, -- dY/dt = (Y(t+dt) - Y(t)) / dt = (Y(t+dt) + (-1)*Y(t)) / dt. with function "-" (Left : Dynamical_Variable; Right : Dynamical_Variable) return Dynamical_Variable is <>; -- operation must exist by the definition of the derivative, -- dY/dt = (Y(t+dt) - Y(t)) / dt package runge_pc_2 is procedure Integrate (Final_Y : out Dynamical_Variable; Final_deriv_Of_Y : out Dynamical_Variable; Final_Time : in Real; Initial_Y : in Dynamical_Variable; Initial_deriv_Of_Y : in Dynamical_Variable; Initial_Time : in Real; No_Of_Steps : in Real); end runge_pc_2;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2018, Universidad Politécnica de Madrid -- -- -- -- 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 Ada.Streams; use Ada.Streams; package body Serial_Ports is ------------------------ -- Internal procedures-- ------------------------ procedure Await_Data_Available (This : USART; Timeout : Time_Span := Time_Span_Last; Timed_Out : out Boolean) with Inline; procedure Await_Send_Ready (This : USART) with Inline; function Last_Index (First : Stream_Element_Offset; Count : Long_Integer) return Stream_Element_Offset with Inline; -------------------------- -- Await_Data_Available -- -------------------------- procedure Await_Data_Available (This : USART; Timeout : Time_Span := Time_Span_Last; Timed_Out : out Boolean) is Deadline : constant Time := Clock + Timeout; begin Timed_Out := True; while Clock < Deadline loop if Rx_Ready (This) then Timed_Out := False; exit; end if; end loop; end Await_Data_Available; ---------------------- -- Await_Send_Ready -- ---------------------- procedure Await_Send_Ready (This : USART) is begin loop exit when Tx_Ready (This); end loop; end Await_Send_Ready; ---------------- -- Last_Index -- ---------------- function Last_Index (First : Stream_Element_Offset; Count : Long_Integer) return Stream_Element_Offset is begin if First = Stream_Element_Offset'First and then Count = 0 then -- we need to return First - 1, but cannot raise Constraint_Error; -- per RM else return First + Stream_Element_Offset (Count) - 1; end if; end Last_Index; ---------------- -- Initialize -- ---------------- procedure Initialize (This : in out Serial_Port) is Configuration : GPIO_Port_Configuration; Device_Pins : constant GPIO_Points := This.Device.Rx_Pin & This.Device.Tx_Pin; begin Enable_Clock (Device_Pins); Enable_Clock (This.Device.Transceiver.all); Configuration := (Mode => Mode_AF, AF => This.Device.Transceiver_AF, AF_Speed => Speed_50MHz, AF_Output_Type => Push_Pull, Resistors => Pull_Up); Configure_IO (Device_Pins, Configuration); end Initialize; --------------- -- Configure -- --------------- procedure Configure (This : in out Serial_Port; Baud_Rate : Baud_Rates; Parity : Parities := No_Parity; Data_Bits : Word_Lengths := Word_Length_8; End_Bits : Stop_Bits := Stopbits_1; Control : Flow_Control := No_Flow_Control) is begin Disable (This.Device.Transceiver.all); Set_Baud_Rate (This.Device.Transceiver.all, Baud_Rate); Set_Mode (This.Device.Transceiver.all, Tx_Rx_Mode); Set_Stop_Bits (This.Device.Transceiver.all, End_Bits); Set_Word_Length (This.Device.Transceiver.all, Data_Bits); Set_Parity (This.Device.Transceiver.all, Parity); Set_Flow_Control (This.Device.Transceiver.all, Control); Enable (This.Device.Transceiver.all); end Configure; ---------- -- Read -- ---------- overriding procedure Read (This : in out Serial_Port; Buffer : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) is Raw : UInt9; Timed_Out : Boolean; Count : Long_Integer := 0; begin Receiving : for K in Buffer'Range loop Await_Data_Available (This.Device.Transceiver.all, This.Timeout, Timed_Out); exit Receiving when Timed_Out; Receive (This.Device.Transceiver.all, Raw); Buffer (K) := Stream_Element (Raw); Count := Count + 1; end loop Receiving; Last := Last_Index (Buffer'First, Count); end Read; ----------- -- Write -- ----------- overriding procedure Write (This : in out Serial_Port; Buffer : Ada.Streams.Stream_Element_Array) is begin for Next of Buffer loop Await_Send_Ready (This.Device.Transceiver.all); Transmit (This.Device.Transceiver.all, Stream_Element'Pos (Next)); end loop; end Write; end Serial_Ports;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014-2105, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ package Servlet.Event_Listeners is pragma Preelaborate; type Event_Listener is limited interface; type Event_Listener_Access is access all Event_Listener'Class; end Servlet.Event_Listeners;
-- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- This software was developed by John Self of the Arcadia project -- at the University of California, Irvine. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and that any documentation, -- advertising materials, and other materials related to such -- distribution and use acknowledge that the software was developed -- by the University of California, Irvine. The name of the -- University may not be used to endorse or promote products derived -- from this software without specific prior written permission. -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -- TITLE external_file_manager -- AUTHOR: John Self (UCI) -- DESCRIPTION opens external files for other functions -- NOTES This package opens external files, and thus may be system dependent -- because of limitations on file names. -- This version is for VAX/VMS -- Modified for VAX/VMS by Simon Wright (sjwright@cix.compulink.co.uk) -- 2.9.92 with TEXT_IO; use TEXT_IO; package EXTERNAL_FILE_MANAGER is STANDARD_ERROR : FILE_TYPE; procedure GET_IO_FILE(F : in out FILE_TYPE); procedure GET_DFA_FILE(F : in out FILE_TYPE); procedure GET_SCANNER_FILE(F : in out FILE_TYPE); procedure GET_BACKTRACK_FILE(F : in out FILE_TYPE); procedure INITIALIZE_FILES; end EXTERNAL_FILE_MANAGER;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This program generates tables for Shift JIS codec. with Ada.Command_Line; with Ada.Strings.Fixed; with Ada.Text_IO; procedure Gen_SHIFTJIS is type Code_Unit_32 is mod 2**32; type Code_Unit_16 is mod 2**16; type Code_Unit_8 is mod 2**8; type Code_Unit_32_Array is array (Code_Unit_8) of Code_Unit_32; type Code_Unit_32_Array_Access is access all Code_Unit_32_Array; type Expansion is record First : Code_Unit_32; Second : Code_Unit_32; end record; function Image (Item : Code_Unit_8) return String; function Image (Item : Code_Unit_32) return String; ----------- -- Image -- ----------- function Image (Item : Code_Unit_8) return String is Hex : constant array (Code_Unit_8 range 0 .. 15) of Character := "0123456789ABCDEF"; begin return Result : String (1 .. 2) do Result (1) := Hex (Item / 16); Result (2) := Hex (Item mod 16); end return; end Image; ----------- -- Image -- ----------- function Image (Item : Code_Unit_32) return String is Hex : constant array (Code_Unit_32 range 0 .. 15) of Character := "0123456789ABCDEF"; begin if Item <= 16#FFFF# then return Result : String (1 .. 4) do Result (1) := Hex (Item / 16 ** 3); Result (2) := Hex ((Item / 16 ** 2) mod 16); Result (3) := Hex ((Item / 16) mod 16); Result (4) := Hex (Item mod 16); end return; else return Result : String (1 .. 7) do Result (1) := Hex (Item / 16 ** 5); Result (2) := Hex ((Item / 16 ** 4) mod 16); Result (3) := '_'; Result (4) := Hex ((Item / 16 ** 3) mod 16); Result (5) := Hex ((Item / 16 ** 2) mod 16); Result (6) := Hex ((Item / 16) mod 16); Result (7) := Hex (Item mod 16); end return; end if; end Image; Undefined : constant Code_Unit_32 := 16#FFFF_FFFF#; Reserved : constant Code_Unit_32 := 16#FFFF_FFFE#; Double_Bytes : constant Code_Unit_32 := 16#FFFF_FFFD#; First_Expansion : constant Code_Unit_32 := 16#FFFF_FF00#; File : Ada.Text_IO.File_Type; Buffer : String (1 .. 256); Last : Natural; First : Positive; Tab : Natural; Plus : Natural; Encoded_Code : Code_Unit_16; Low_Code : Code_Unit_8; High_Code : Code_Unit_8; Unicode_Code : Code_Unit_32; Single_Map : array (Code_Unit_8) of Code_Unit_32 := (others => Undefined); Double_Map : array (Code_Unit_8) of Code_Unit_32_Array_Access; Expansion_List : array (First_Expansion .. First_Expansion + 32) of Expansion; Last_Expansion : Code_Unit_32 := First_Expansion - 1; Valid_Second : array (Code_Unit_8) of Boolean := (others => False); begin Ada.Text_IO.Open (File, Ada.Text_IO.In_File, Ada.Command_Line.Argument (1)); while not Ada.Text_IO.End_Of_File (File) loop Ada.Text_IO.Get_Line (File, Buffer, Last); if Last /= 0 and Buffer (1) /= '#' then First := Buffer'First; Tab := Ada.Strings.Fixed.Index (Buffer (First .. Last), "" & ASCII.HT); Encoded_Code := Code_Unit_16'Value ("16#" & Buffer (First + 2 .. Tab - 1) & '#'); Low_Code := Code_Unit_8 (Encoded_Code mod 256); High_Code := Code_Unit_8 (Encoded_Code / 256); First := Tab + 1; Tab := Ada.Strings.Fixed.Index (Buffer (First .. Last), "" & ASCII.HT); if High_Code = 0 then if First = Tab then Single_Map (Low_Code) := Reserved; else Unicode_Code := Code_Unit_32'Value ("16#" & Buffer (First + 2 .. Tab - 1) & '#'); Single_Map (Low_Code) := Unicode_Code; end if; else if Double_Map (High_Code) = null then Double_Map (High_Code) := new Code_Unit_32_Array'(others => Undefined); Single_Map (High_Code) := Double_Bytes; end if; if First = Tab then Double_Map (High_Code) (Low_Code) := Reserved; else Plus := Ada.Strings.Fixed.Index (Buffer (First + 2 .. Tab - 1), "+"); if Plus = 0 then Unicode_Code := Code_Unit_32'Value ("16#" & Buffer (First + 2 .. Tab - 1) & '#'); Double_Map (High_Code) (Low_Code) := Unicode_Code; else Last_Expansion := Last_Expansion + 1; Expansion_List (Last_Expansion) := (Code_Unit_32'Value ("16#" & Buffer (First + 2 .. Plus - 1) & '#'), Code_Unit_32'Value ("16#" & Buffer (Plus + 1 .. Tab - 1) & '#')); Double_Map (High_Code) (Low_Code) := Last_Expansion; end if; end if; end if; end if; end loop; Ada.Text_IO.Close (File); -- Analysis for J in Double_Map'Range loop if Double_Map (J) /= null then for K in Double_Map (J)'Range loop if Double_Map (J) (K) /= Undefined then Valid_Second (K) := True; end if; end loop; end if; end loop; -- Generation Ada.Text_IO.Put_Line ("-----------------------------------------------------------------------" & "-------"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- Matreshka Project " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- Localization, Internationalization, Globalization for Ada " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- Runtime Library Component " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-----------------------------------------------------------------------" & "-------"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- Copyright © 2010, Vadim Godunko <vgodunko@gmail.com> " & " --"); Ada.Text_IO.Put_Line ("-- All rights reserved. " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- Redistribution and use in source and binary forms, with or without " & " --"); Ada.Text_IO.Put_Line ("-- modification, are permitted provided that the following conditions " & " --"); Ada.Text_IO.Put_Line ("-- are met: " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- * Redistributions of source code must retain the above copyright " & " --"); Ada.Text_IO.Put_Line ("-- notice, this list of conditions and the following disclaimer. " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- * Redistributions in binary form must reproduce the above copyright" & " --"); Ada.Text_IO.Put_Line ("-- notice, this list of conditions and the following disclaimer in t" & "he --"); Ada.Text_IO.Put_Line ("-- documentation and/or other materials provided with the distributi" & "on. --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- * Neither the name of the Vadim Godunko, IE nor the names of its " & " --"); Ada.Text_IO.Put_Line ("-- contributors may be used to endorse or promote products derived f" & "rom --"); Ada.Text_IO.Put_Line ("-- this software without specific prior written permission. " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " & " --"); Ada.Text_IO.Put_Line ("-- ""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT " & " --"); Ada.Text_IO.Put_Line ("-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO" & "R --"); Ada.Text_IO.Put_Line ("-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT" & " --"); Ada.Text_IO.Put_Line ("-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTA" & "L, --"); Ada.Text_IO.Put_Line ("-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIM" & "ITED --"); Ada.Text_IO.Put_Line ("-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, " & "OR --"); Ada.Text_IO.Put_Line ("-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY " & "OF --"); Ada.Text_IO.Put_Line ("-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING" & " --"); Ada.Text_IO.Put_Line ("-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS " & " --"); Ada.Text_IO.Put_Line ("-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. " & " --"); Ada.Text_IO.Put_Line ("-- " & " --"); Ada.Text_IO.Put_Line ("-----------------------------------------------------------------------" & "-------"); Ada.Text_IO.Put_Line ("-- $Revision$ $Date$"); Ada.Text_IO.Put_Line ("-----------------------------------------------------------------------" & "-------"); Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line ("private package Matreshka.Internals.Text_Codecs.SHIFTJIS.Tables is"); Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" pragma Preelaborate;"); -- Generate meta class table -- -- 0 - Single/Valid -- 1 - Single/Invalid -- 2 - First/Valid -- 3 - First/Invalid -- 4 - Invalid/Valid -- 5 - Invalid/Invalid Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" Meta_Class :"); Ada.Text_IO.Put_Line (" constant array (Ada.Streams.Stream_Element)"); Ada.Text_IO.Put_Line (" of SHIFTJIS_Meta_Class"); Ada.Text_IO.Put (" := ("); for J in Single_Map'Range loop if Single_Map (J) = Undefined or Single_Map (J) = Reserved then if Valid_Second (J) then Ada.Text_IO.Put ("4"); else Ada.Text_IO.Put ("5"); end if; elsif Single_Map (J) = Double_Bytes then if Valid_Second (J) then Ada.Text_IO.Put ("2"); else Ada.Text_IO.Put ("3"); end if; else if Valid_Second (J) then Ada.Text_IO.Put ("0"); else Ada.Text_IO.Put ("1"); end if; end if; if J = 255 then Ada.Text_IO.Put_Line (");"); elsif J mod 16 = 15 then Ada.Text_IO.Put_Line (","); Ada.Text_IO.Put (" "); else Ada.Text_IO.Put (", "); end if; end loop; -- Generate single byte conversion table Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" Decode_Single :"); Ada.Text_IO.Put_Line (" constant array (Ada.Streams.Stream_Element)"); Ada.Text_IO.Put_Line (" of Matreshka.Internals.Unicode.Code_Point"); Ada.Text_IO.Put (" := ("); for J in Single_Map'Range loop if Single_Map (J) = Undefined or Single_Map (J) = Reserved or Single_Map (J) = Double_Bytes then Ada.Text_IO.Put ("16#0000#"); else Ada.Text_IO.Put ("16#" & Image (Single_Map (J)) & '#'); end if; if J = 255 then Ada.Text_IO.Put_Line (");"); elsif J mod 4 = 3 then Ada.Text_IO.Put_Line (","); Ada.Text_IO.Put (" "); else Ada.Text_IO.Put (", "); end if; end loop; -- Generate secondary tables for double byte conversion Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" Decode_Double_Invalid : aliased constant SHIFTJIS_Code_Point_Array"); Ada.Text_IO.Put_Line (" := (16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#,"); Ada.Text_IO.Put_Line (" 16#0000#, 16#0000#, 16#0000#, 16#0000#);"); for J in Double_Map'Range loop if Double_Map (J) /= null then Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" Decode_Double_" & Image (J) & " : aliased constant SHIFTJIS_Code_Point_Array"); Ada.Text_IO.Put (" := ("); for K in Double_Map (J)'Range loop if Double_Map (J) (K) = Undefined or Double_Map (J) (K) = Reserved then Ada.Text_IO.Put ("16#0000#"); elsif Double_Map (J) (K) >= First_Expansion then Ada.Text_IO.Put ("16#" & Image (Double_Map (J) (K) - First_Expansion + 1) & '#'); else Ada.Text_IO.Put ("16#" & Image (Double_Map (J) (K)) & '#'); end if; if K = 255 then Ada.Text_IO.Put_Line (");"); elsif K mod 4 = 3 then Ada.Text_IO.Put_Line (","); Ada.Text_IO.Put (" "); else Ada.Text_IO.Put (", "); end if; end loop; end if; end loop; -- Generate double byte encoding table Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" Decode_Double :"); Ada.Text_IO.Put_Line (" constant array (Ada.Streams.Stream_Element)"); Ada.Text_IO.Put_Line (" of not null SHIFTJIS_Code_Point_Array_Access"); Ada.Text_IO.Put (" := ("); for J in Double_Map'Range loop if Double_Map (J) /= null then Ada.Text_IO.Put ("Decode_Double_" & Image (J) & "'Access"); else Ada.Text_IO.Put ("Decode_Double_Invalid'Access"); end if; if J = 255 then Ada.Text_IO.Put_Line (");"); elsif J mod 2 = 1 then Ada.Text_IO.Put_Line (","); Ada.Text_IO.Put (" "); else Ada.Text_IO.Put (", "); end if; end loop; -- Generate expansion table Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" Expansion :"); Ada.Text_IO.Put_Line (" constant array (Matreshka.Internals.Unicode.Code_Unit_32 range 1 .." & Code_Unit_32'Image (Last_Expansion - First_Expansion + 1) & ")"); Ada.Text_IO.Put_Line (" of SHIFTJIS_Expansion_Pair"); Ada.Text_IO.Put (" := ("); for J in First_Expansion .. Last_Expansion loop Ada.Text_IO.Put ("(16#" & Image (Expansion_List (J).First) & "#, 16#" & Image (Expansion_List (J).Second) & "#)"); if J = Last_Expansion then Ada.Text_IO.Put_Line (");"); elsif J mod 2 = 1 then Ada.Text_IO.Put_Line (","); Ada.Text_IO.Put (" "); else Ada.Text_IO.Put (", "); end if; end loop; Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line ("end Matreshka.Internals.Text_Codecs.SHIFTJIS.Tables;"); end Gen_SHIFTJIS;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 4 9 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 49 package System.Pack_49 is pragma Preelaborate; Bits : constant := 49; type Bits_49 is mod 2 ** Bits; for Bits_49'Size use Bits; function Get_49 (Arr : System.Address; N : Natural) return Bits_49; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_49 (Arr : System.Address; N : Natural; E : Bits_49); -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. end System.Pack_49;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../License.txt with Ada.Characters.Latin_1; with Ada.Directories; with Ada.Exceptions; with File_Operations; with Utilities; with PortScan.Log; package body Port_Specification.Web is package LAT renames Ada.Characters.Latin_1; package DIR renames Ada.Directories; package FOP renames File_Operations; package LOG renames PortScan.Log; package UTL renames Utilities; -------------------------------------------------------------------------------------------- -- produce_page -------------------------------------------------------------------------------------------- procedure produce_page (specs : Portspecs; variant : String; dossier : TIO.File_Type; portdir : String; blocked : String; created : CAL.Time; changed : CAL.Time; devscan : Boolean) is begin TIO.Put_Line (dossier, page_header ("Ravenport: " & specs.get_namebase)); TIO.Put_Line (dossier, generate_body (specs => specs, variant => variant, portdir => portdir, blocked => blocked, created => created, changed => changed, devscan => devscan)); TIO.Put_Line (dossier, page_footer); end produce_page; -------------------------------------------------------------------------------------------- -- escape_value -------------------------------------------------------------------------------------------- function escape_value (raw : String) return String is function htmlval (rawchar : Character) return String; focus : constant String := LAT.Ampersand & LAT.Quotation & LAT.Less_Than_Sign & LAT.Greater_Than_Sign; curlen : Natural := raw'Length; result : String (1 .. raw'Length * 6) := (others => ' '); function htmlval (rawchar : Character) return String is begin case rawchar is when LAT.Ampersand => return "&amp;"; when LAT.Quotation => return "&quot;"; when LAT.Less_Than_Sign => return "&lt;"; when LAT.Greater_Than_Sign => return "&gt;"; when others => return ""; end case; end htmlval; begin result (1 .. curlen) := raw; for x in focus'Range loop if HT.count_char (result (1 .. curlen), focus (x)) > 0 then declare newstr : constant String := HT.replace_char (result (1 .. curlen), focus (x), htmlval (focus (x))); begin curlen := newstr'Length; result (1 .. curlen) := newstr; end; end if; end loop; return result (1 .. curlen); end escape_value; -------------------------------------------------------------------------------------------- -- nvpair -------------------------------------------------------------------------------------------- function nvpair (name, value : String) return String is begin return " " & name & LAT.Equals_Sign & LAT.Quotation & escape_value (value) & LAT.Quotation; end nvpair; -------------------------------------------------------------------------------------------- -- page_header -------------------------------------------------------------------------------------------- function page_header (title : String) return String is bing : constant String := LAT.Greater_Than_Sign & LAT.LF; content : constant String := "Ravenports individual port description"; csslink : constant String := "../../../style/ravenports.css"; cctrl : constant String := "public, max-age=21600"; -- valid 6 hours begin return "<!doctype html" & bing & "<html" & nvpair ("lang", "en") & bing & "<head" & bing & " <title>" & escape_value (title) & "</title" & bing & " <meta" & nvpair ("charset", "utf-8") & bing & " <meta" & nvpair ("name", "description") & nvpair ("content", content) & bing & " <meta" & nvpair ("http-equiv", "Cache-Control") & nvpair ("content", cctrl) & bing & " <link" & nvpair ("rel", "stylesheet") & nvpair ("href", csslink) & bing & "</head" & bing & "<body>"; end page_header; -------------------------------------------------------------------------------------------- -- page_footer -------------------------------------------------------------------------------------------- function page_footer return String is bing : constant String := LAT.Greater_Than_Sign & LAT.LF; link1val : constant String := "Ravenports catalog"; link2val : constant String := "Ravenports official site"; begin return " <div" & nvpair ("id", "footer") & bing & " <div" & nvpair ("id", "catlink") & ">" & link ("../../../index.html", "footlink", link1val) & " | " & link ("http://www.ravenports.com/", "footlink", link2val) & "</div" & bing & " </div" & bing & "</body>" & LAT.LF & "</html>"; end page_footer; -------------------------------------------------------------------------------------------- -- div -------------------------------------------------------------------------------------------- function div (id, value : String) return String is begin return "<div" & nvpair ("id", id) & ">" & escape_value (value) & "</div>" & LAT.LF; end div; -------------------------------------------------------------------------------------------- -- body_template -------------------------------------------------------------------------------------------- function body_template return String is ediv : constant String := "</div>" & LAT.LF; etd : constant String := "</td>" & LAT.LF; etr : constant String := "</tr>" & LAT.LF; btr : constant String := "<tr>" & LAT.LF; raw : constant String := " <div id='namebase'>@NAMEBASE@" & ediv & " <div id='shortblock'>" & LAT.LF & " <table id='sbt1'>" & LAT.LF & " <tbody>" & LAT.LF & " " & btr & " <td>Port variant" & etd & " <td id='variant'>@VARIANT@" & etd & " " & etr & " " & btr & " <td>Summary" & etd & " <td id='summary'>@TAGLINE@" & etd & " " & etr & "@BROKEN@" & "@DEPRECATED@" & "@ONLY_PLATFORM@" & "@EXC_PLATFORM@" & "@EXC_ARCH@" & " " & btr & " <td>Package version" & etd & " <td id='pkgversion'>@PKGVERSION@" & etd & " " & etr & " " & btr & " <td>Homepage" & etd & " <td id='homepage'>@HOMEPAGE@" & etd & " " & etr & " " & btr & " <td>Keywords" & etd & " <td id='keywords'>@KEYWORDS@" & etd & " " & etr & " " & btr & " <td>Maintainer" & etd & " <td id='maintainer'>@MAINTAINER@" & etd & " " & etr & " " & btr & " <td>License" & etd & " <td id='license'>@LICENSE@" & etd & " " & etr & " " & btr & " <td>Other variants" & etd & " <td id='othervar'>@OTHERVAR@" & etd & " " & etr & " " & btr & " <td>Ravenports" & etd & " <td id='ravenports'>@LNK_BUILDSHEET@ | @LNK_HISTORY_BS@" & etd & " " & etr & " " & btr & " <td>Ravensource" & etd & " <td id='ravensource'>@LNK_PORT@ | @LNK_HISTORY_PORT@" & etd & " " & etr & " " & btr & " <td>Last modified" & etd & " <td id='mdate'>@MDATETIME@" & etd & " " & etr & " " & btr & " <td>Port created" & etd & " <td id='cdate'>@CDATETIME@" & etd & " " & etr & " </tbody>" & LAT.LF & " </table>" & LAT.LF & " " & ediv & " <div id='pkgdesc'>" & LAT.LF & " <div id='pdtitle'>Subpackage Descriptions" & ediv & " <table id='pdt2'>" & LAT.LF & " <tbody>" & LAT.LF & "@DESCBODY@" & " </tbody>" & LAT.LF & " </table>" & LAT.LF & " " & ediv & " <div id='options'>" & LAT.LF & " <div id='optiontitle'>" & "Configuration Switches (platform-specific settings discarded)" & ediv & " <div id='optionblock'>@OPTIONBLOCK@" & ediv & " " & ediv & " <div id='dependencies'>" & LAT.LF & " <div id='deptitle'>Package Dependencies by Type" & ediv & " <table id='dpt3'>" & LAT.LF & " <tbody>" & LAT.LF & "@DEPBODY@" & " </tbody>" & LAT.LF & " </table>" & LAT.LF & " " & ediv & " <div id='master_sites'>" & LAT.LF & " <div id='mstitle'>Download groups" & ediv & " <table id='dlt4'>" & LAT.LF & " <tbody>" & LAT.LF & "@SITES@" & " </tbody>" & LAT.LF & " </table>" & LAT.LF & " " & ediv & " <div id='distinfo'>" & LAT.LF & " <div id='disttitle'>Distribution File Information" & ediv & " <div id='distblock'>@DISTINFO@" & ediv & " " & ediv & " <div id='upstream'>" & LAT.LF & " <div id='ustitle'>Ports that require @NAMEBASE@:@VARIANT@" & ediv & " <div id='upstream_inner'>" & LAT.LF & " <table id='ust5'>" & LAT.LF & " <tbody>" & LAT.LF & "@UPSTREAM@" & " </tbody>" & LAT.LF & " </table>" & LAT.LF & " " & ediv & " </div>"; begin return HT.replace_all (S => raw, reject => LAT.Apostrophe, shiny => LAT.Quotation); end body_template; -------------------------------------------------------------------------------------------- -- two_cell_row_template -------------------------------------------------------------------------------------------- function two_cell_row_template return String is begin return " <tr>" & LAT.LF & " <td>@CELL1@</td>" & LAT.LF & " <td>@CELL2@</td>" & LAT.LF & " </tr>" & LAT.LF; end two_cell_row_template; -------------------------------------------------------------------------------------------- -- link -------------------------------------------------------------------------------------------- function link (href, link_class, value : String) return String is begin return "<a" & nvpair ("href", href) & nvpair ("class", link_class) & ">" & value & "</a>"; end link; -------------------------------------------------------------------------------------------- -- format_homepage -------------------------------------------------------------------------------------------- function format_homepage (homepage : String) return String is begin if homepage = homepage_none then return "No known homepage"; end if; return link (homepage, "hplink", homepage); end format_homepage; -------------------------------------------------------------------------------------------- -- list_scheme -------------------------------------------------------------------------------------------- function list_scheme (licenses, scheme : String) return String is stripped : constant String := HT.replace_all (licenses, LAT.Quotation, ' '); begin if HT.IsBlank (licenses) then return "Not yet specified"; end if; if scheme = "single" then return stripped; end if; return stripped & LAT.Space & LAT.Left_Parenthesis & scheme & LAT.Right_Parenthesis; end list_scheme; -------------------------------------------------------------------------------------------- -- other_variants -------------------------------------------------------------------------------------------- function other_variants (specs : Portspecs; variant : String) return String is nvar : Natural := specs.get_number_of_variants; counter : Natural := 0; result : HT.Text; begin if nvar = 1 then return "There are no other variants."; end if; for x in 1 .. nvar loop declare nextvar : constant String := specs.get_list_item (sp_variants, x); begin if nextvar /= variant then counter := counter + 1; if counter > 1 then HT.SU.Append (result, " | "); end if; HT.SU.Append (result, link ("../" & nextvar & "/", "ovlink", nextvar)); end if; end; end loop; return HT.USS (result); end other_variants; -------------------------------------------------------------------------------------------- -- subpackage_description_block -------------------------------------------------------------------------------------------- function subpackage_description_block (specs : Portspecs; namebase : String; variant : String; portdir : String) return String is function description (variant, subpackage : String) return String; num_pkgs : Natural := specs.get_subpackage_length (variant); result : HT.Text; id2 : constant String := namebase & LAT.Hyphen & variant; function description (variant, subpackage : String) return String is trunk : constant String := portdir & "/descriptions/desc."; desc1 : constant String := trunk & subpackage & "." & variant; desc2 : constant String := trunk & subpackage; begin if DIR.Exists (desc1) then return FOP.get_file_contents (desc1); elsif DIR.Exists (desc2) then return FOP.get_file_contents (desc2); end if; if subpackage = "docs" then return "This is the documents subpackage of the " & id2 & " port."; elsif subpackage = "examples" then return "This is the examples subpackage of the " & id2 & " port."; elsif subpackage = "nls" then return "This is the native language support subpackage of the " & id2 & " port."; elsif subpackage = "complete" then return "This is the " & id2 & " metapackage." & LAT.LF & "It pulls in all subpackages of " & id2 & "."; else return "Subpackage description undefined (port maintainer error)."; end if; end description; begin for x in 1 .. num_pkgs loop declare row : HT.Text := HT.SUS (two_cell_row_template); spkg : constant String := specs.get_subpackage_item (variant, x); begin -- Don't escape CELL2, it's preformatted row := HT.replace_substring (row, "@CELL1@", spkg); row := HT.replace_substring (row, "@CELL2@", description (variant, spkg)); HT.SU.Append (result, row); end; end loop; return HT.USS (result); end subpackage_description_block; -------------------------------------------------------------------------------------------- -- dependency_block -------------------------------------------------------------------------------------------- function dependency_block (specs : Portspecs) return String is function link_block (field : spec_field) return String; procedure add_row (field : spec_field; listlen : Natural); result : HT.Text; nb : constant Natural := specs.get_list_length (sp_build_deps); nbr : constant Natural := specs.get_list_length (sp_buildrun_deps); nr : constant Natural := specs.get_list_length (sp_run_deps); xr : constant Natural := Natural (specs.extra_rundeps.Length); sb : constant Natural := Natural (specs.opsys_b_deps.Length); sbr : constant Natural := Natural (specs.opsys_br_deps.Length); sr : constant Natural := Natural (specs.opsys_r_deps.Length); procedure add_row (field : spec_field; listlen : Natural) is begin if listlen > 0 then declare row : HT.Text := HT.SUS (two_cell_row_template); begin if field = sp_build_deps then row := HT.replace_substring (row, "@CELL1@", "Build (only)"); elsif field = sp_buildrun_deps then row := HT.replace_substring (row, "@CELL1@", "Build and Runtime"); else row := HT.replace_substring (row, "@CELL1@", "Runtime (only)"); end if; row := HT.replace_substring (row, "@CELL2@", link_block (field)); HT.SU.Append (result, row); end; end if; end add_row; function link_block (field : spec_field) return String is procedure spkg_scan (position : list_crate.Cursor); procedure opsys_scan (position : list_crate.Cursor); procedure dump_dep (position : string_crate.Cursor); procedure process_opsys_dep (position : string_crate.Cursor); procedure dump_opsys_dep (position : def_crate.Cursor); listlen : constant Natural := specs.get_list_length (field); cell : HT.Text; spkg : HT.Text; ostr : HT.Text; tempstore : def_crate.Map; procedure spkg_scan (position : list_crate.Cursor) is rec : group_list renames list_crate.Element (position); begin spkg := rec.group; rec.list.Iterate (dump_dep'Access); end spkg_scan; procedure opsys_scan (position : list_crate.Cursor) is rec : group_list renames list_crate.Element (position); begin ostr := rec.group; rec.list.Iterate (process_opsys_dep'Access); end opsys_scan; procedure dump_dep (position : string_crate.Cursor) is dep : String := HT.USS (string_crate.Element (position)); namebase : String := HT.specific_field (dep, 1, ":"); bucket : String := UTL.bucket (namebase); variant : String := HT.specific_field (dep, 3, ":"); href : String := "../../../bucket_" & bucket & "/" & namebase & "/" & variant; value : String := dep & " (" & HT.USS (spkg) & " subpackage)"; lnk : String := link (href, "deplink", value); begin if HT.IsBlank (cell) then HT.SU.Append (cell, LAT.LF & lnk); else HT.SU.Append (cell, "<br/>" & LAT.LF & lnk); end if; end dump_dep; procedure dump_opsys_dep (position : def_crate.Cursor) is dep : String := HT.USS (def_crate.Key (position)); namebase : String := HT.specific_field (dep, 1, ":"); bucket : String := UTL.bucket (namebase); variant : String := HT.specific_field (dep, 3, ":"); href : String := "../../../bucket_" & bucket & "/" & namebase & "/" & variant; value : String := dep & " (" & HT.USS (def_crate.Element (position)) & ")"; lnk : String := link (href, "deplink", value); begin if HT.IsBlank (cell) then HT.SU.Append (cell, LAT.LF & lnk); else HT.SU.Append (cell, "<br/>" & LAT.LF & lnk); end if; end dump_opsys_dep; procedure process_opsys_dep (position : string_crate.Cursor) is new_index : HT.Text renames string_crate.Element (position); new_value : HT.Text; begin if tempstore.Contains (new_index) then new_value := tempstore.Element (new_index); HT.SU.Append (new_value, ", " & HT.USS (ostr)); tempstore.Delete (new_index); tempstore.Insert (new_index, new_value); else tempstore.Insert (new_index, ostr); end if; end process_opsys_dep; begin for x in 1 .. listlen loop declare dep : String := specs.get_list_item (field, x); namebase : String := HT.specific_field (dep, 1, ":"); bucket : String := UTL.bucket (namebase); variant : String := HT.specific_field (dep, 3, ":"); href : String := "../../../bucket_" & bucket & "/" & namebase & "/" & variant; lnk : String := link (href, "deplink", dep); begin if x = 1 then HT.SU.Append (cell, LAT.LF & lnk); else HT.SU.Append (cell, "<br/>" & LAT.LF & lnk); end if; end; end loop; if field = sp_build_deps then specs.opsys_b_deps.Iterate (opsys_scan'Access); end if; if field = sp_buildrun_deps then specs.opsys_br_deps.Iterate (opsys_scan'Access); end if; if field = sp_run_deps then specs.opsys_r_deps.Iterate (opsys_scan'Access); specs.extra_rundeps.Iterate (spkg_scan'Access); end if; tempstore.Iterate (dump_opsys_dep'Access); return HT.USS (cell); end link_block; begin if nb + nr + nbr + xr = 0 then return " <tr><td>This package has no dependency requirements of any kind.</td></tr>"; end if; add_row (sp_build_deps, nb + sb); add_row (sp_buildrun_deps, nbr + sbr); add_row (sp_run_deps, nr + sr + xr); return HT.USS (result); end dependency_block; -------------------------------------------------------------------------------------------- -- retrieve_distinfo -------------------------------------------------------------------------------------------- function retrieve_distinfo (specs : Portspecs; portdir : String) return String is distinfo : String := portdir & "/distinfo"; begin if DIR.Exists (distinfo) then return FOP.get_file_contents (distinfo); else return "This port does not contain distinfo information."; end if; end retrieve_distinfo; -------------------------------------------------------------------------------------------- -- master_sites_block -------------------------------------------------------------------------------------------- function master_sites_block (specs : Portspecs) return String is package crate is new CON.Vectors (Index_Type => Positive, Element_Type => HT.Text, "=" => HT.SU."="); package local_sorter is new crate.Generic_Sorting ("<" => HT.SU."<"); procedure group_scan (position : crate.Cursor); procedure gather (position : list_crate.Cursor); procedure dump_sites (position : string_crate.Cursor); function make_link (site : String) return String; num_groups : constant Natural := Natural (specs.dl_sites.Length); first_group : constant String := HT.USS (list_crate.Element (specs.dl_sites.First).group); cell2 : HT.Text; result : HT.Text; groups : crate.Vector; function make_link (site : String) return String is lnk : constant String := link (site, "sitelink", site); begin if HT.contains (site, "://") then return lnk; else return "mirror://" & site; end if; end make_link; procedure dump_sites (position : string_crate.Cursor) is site_string : HT.Text renames string_crate.Element (position); lnk : constant String := make_link (HT.USS (site_string)); begin if HT.IsBlank (cell2) then HT.SU.Append (cell2, lnk); else HT.SU.Append (cell2, "<br/>" & LAT.LF & lnk); end if; end dump_sites; procedure gather (position : list_crate.Cursor) is name : HT.Text renames list_crate.Key (position); begin if not HT.equivalent (name, dlgroup_main) then groups.Append (name); end if; end gather; procedure group_scan (position : crate.Cursor) is index : HT.Text renames crate.Element (position); rec : group_list renames specs.dl_sites.Element (index); cell1 : constant String := HT.USS (rec.group); row : HT.Text := HT.SUS (two_cell_row_template); begin cell2 := HT.SU.Null_Unbounded_String; rec.list.Iterate (dump_sites'Access); row := HT.replace_substring (row, "@CELL1@", cell1); row := HT.replace_substring (row, "@CELL2@", HT.USS (cell2)); HT.SU.Append (result, row); end group_scan; begin if num_groups = 1 and then first_group = dlgroup_none then return " <tr><td>This port does not download anything.</td></tr>"; end if; specs.dl_sites.Iterate (gather'Access); local_sorter.Sort (Container => groups); if specs.dl_sites.Contains (HT.SUS (dlgroup_main)) then groups.Prepend (HT.SUS (dlgroup_main)); end if; groups.Iterate (group_scan'Access); return HT.USS (result); end master_sites_block; -------------------------------------------------------------------------------------------- -- deprecated_message -------------------------------------------------------------------------------------------- function deprecated_message (specs : Portspecs) return String is row1 : HT.Text := HT.SUS (two_cell_row_template); row2 : HT.Text := HT.SUS (two_cell_row_template); begin if HT.IsBlank (specs.deprecated) then return ""; end if; row1 := HT.replace_substring (row1, "@CELL1@", "DEPRECATED"); row1 := HT.replace_substring (row1, "@CELL2@", HT.USS (specs.deprecated)); row2 := HT.replace_substring (row2, "@CELL1@", "Expiration Date"); row2 := HT.replace_substring (row2, "@CELL2@", HT.USS (specs.expire_date)); return HT.USS (row1) & HT.USS (row2); end deprecated_message; -------------------------------------------------------------------------------------------- -- broken_attributes -------------------------------------------------------------------------------------------- function broken_attributes (specs : Portspecs) return String is procedure group_scan (position : list_crate.Cursor); procedure dump_messages (position : string_crate.Cursor); row1 : HT.Text := HT.SUS (two_cell_row_template); content : HT.Text; index : HT.Text; procedure group_scan (position : list_crate.Cursor) is rec : group_list renames list_crate.Element (position); begin index := rec.group; rec.list.Iterate (dump_messages'Access); end group_scan; procedure dump_messages (position : string_crate.Cursor) is message : HT.Text renames string_crate.Element (position); esc_msg : String := "[" & HT.USS (index) & "] " & escape_value (HT.USS (message)); begin if HT.IsBlank (content) then HT.SU.Append (content, LAT.LF & esc_msg); else HT.SU.Append (content, "<br/>" & LAT.LF & esc_msg); end if; end dump_messages; begin if specs.broken.Is_Empty then return ""; end if; specs.broken.Iterate (group_scan'Access); row1 := HT.replace_substring (row1, "@CELL1@", "BROKEN"); row1 := HT.replace_substring (row1, "@CELL2@", HT.USS (content)); return HT.USS (row1); end broken_attributes; -------------------------------------------------------------------------------------------- -- inclusive_platform -------------------------------------------------------------------------------------------- function inclusive_platform (specs : Portspecs) return String is procedure dump (position : string_crate.Cursor); row1 : HT.Text := HT.SUS (two_cell_row_template); content : HT.Text; procedure dump (position : string_crate.Cursor) is message : HT.Text renames string_crate.Element (position); begin if HT.IsBlank (content) then HT.SU.Append (content, message); else HT.SU.Append (content, " | " & HT.USS (message)); end if; end dump; begin if specs.inc_opsys.Is_Empty then return ""; end if; specs.inc_opsys.Iterate (dump'Access); row1 := HT.replace_substring (row1, "@CELL1@", "Only for platform"); row1 := HT.replace_substring (row1, "@CELL2@", HT.USS (content)); return HT.USS (row1); end inclusive_platform; -------------------------------------------------------------------------------------------- -- exclusive_platform -------------------------------------------------------------------------------------------- function exclusive_platform (specs : Portspecs) return String is procedure dump (position : string_crate.Cursor); row1 : HT.Text := HT.SUS (two_cell_row_template); content : HT.Text; procedure dump (position : string_crate.Cursor) is message : HT.Text renames string_crate.Element (position); begin if HT.IsBlank (content) then HT.SU.Append (content, message); else HT.SU.Append (content, " | " & HT.USS (message)); end if; end dump; begin if specs.exc_opsys.Is_Empty then return ""; end if; specs.exc_opsys.Iterate (dump'Access); row1 := HT.replace_substring (row1, "@CELL1@", "Exclude platform"); row1 := HT.replace_substring (row1, "@CELL2@", HT.USS (content)); return HT.USS (row1); end exclusive_platform; -------------------------------------------------------------------------------------------- -- exclusive_arch -------------------------------------------------------------------------------------------- function exclusive_arch (specs : Portspecs) return String is procedure dump (position : string_crate.Cursor); row1 : HT.Text := HT.SUS (two_cell_row_template); content : HT.Text; procedure dump (position : string_crate.Cursor) is message : HT.Text renames string_crate.Element (position); begin if HT.IsBlank (content) then HT.SU.Append (content, message); else HT.SU.Append (content, " | " & HT.USS (message)); end if; end dump; begin if specs.exc_arch.Is_Empty then return ""; end if; specs.exc_arch.Iterate (dump'Access); row1 := HT.replace_substring (row1, "@CELL1@", "Exclude architecture"); row1 := HT.replace_substring (row1, "@CELL2@", HT.USS (content)); return HT.USS (row1); end exclusive_arch; -------------------------------------------------------------------------------------------- -- upstream -------------------------------------------------------------------------------------------- function upstream (blocked : String) return String is markers : HT.Line_Markers; result : HT.Text; begin if HT.IsBlank (blocked) then return "<tr><td>No other ports depend on this one.</td></tr>" & LAT.LF; end if; HT.initialize_markers (blocked, markers); loop exit when not HT.next_line_present (blocked, markers); declare line : constant String := HT.extract_line (blocked, markers); cell : constant String := HT.specific_field (line, 1, ";"); href : constant String := HT.specific_field (line, 2, ";"); lnk : constant String := link (href, "upslink", cell); row1 : HT.Text := HT.SUS (two_cell_row_template); begin row1 := HT.replace_substring (row1, "@CELL1@", lnk); row1 := HT.replace_substring (row1, "@CELL2@", HT.specific_field (line, 3, ";")); HT.SU.Append (result, row1); end; end loop; return HT.USS (result); exception when issue : others => return "<tr><td>" & Ada.Exceptions.Exception_Message (issue) & "</td></tr>" & LAT.LF & "<tr><td>" & blocked & "</td></tr>" & LAT.LF; end upstream; -------------------------------------------------------------------------------------------- -- generate_body -------------------------------------------------------------------------------------------- function generate_body (specs : Portspecs; variant : String; portdir : String; blocked : String; created : CAL.Time; changed : CAL.Time; devscan : Boolean) return String is result : HT.Text := HT.SUS (body_template); namebase : constant String := specs.get_namebase; bucket : constant String := UTL.bucket (namebase); catport : constant String := "bucket_" & bucket & "/" & namebase; subject : constant String := "Ravenports:%20" & specs.get_namebase & "%20port"; homepage : constant String := format_homepage (specs.get_field_value (sp_homepage)); tagline : constant String := escape_value (specs.get_tagline (variant)); isocdate : constant String := LOG.timestamp (created, True); isomdate : constant String := LOG.timestamp (changed, True); licenses : constant String := list_scheme (specs.get_field_value (sp_licenses), specs.get_license_scheme); lnk_bs : constant String := link ("https://raw.githubusercontent.com/jrmarino/Ravenports/master/" & catport, "ghlink", "Buildsheet"); lnk_bshy : constant String := link ("https://github.com/jrmarino/Ravenports/commits/master/" & catport, "histlink", "History"); lnk_port : constant String := link ("https://github.com/jrmarino/ravensource/tree/master/" & catport, "ghlink", "Port Directory"); lnk_pthy : constant String := link ("https://github.com/jrmarino/ravensource/commits/master/" & catport, "histlink", "History"); begin result := HT.replace_substring (result, "@NAMEBASE@", namebase); result := HT.replace_substring (result, "@NAMEBASE@", namebase); result := HT.replace_substring (result, "@VARIANT@", variant); result := HT.replace_substring (result, "@VARIANT@", variant); result := HT.replace_substring (result, "@HOMEPAGE@", homepage); result := HT.replace_substring (result, "@TAGLINE@", tagline); result := HT.replace_substring (result, "@PKGVERSION@", specs.calculate_pkgversion); result := HT.replace_substring (result, "@MAINTAINER@", specs.get_web_contacts (subject)); result := HT.replace_substring (result, "@KEYWORDS@", specs.get_field_value (sp_keywords)); result := HT.replace_substring (result, "@LICENSE@", licenses); result := HT.replace_substring (result, "@CDATETIME@", isocdate); result := HT.replace_substring (result, "@MDATETIME@", isomdate); result := HT.replace_substring (result, "@LNK_BUILDSHEET@", lnk_bs); result := HT.replace_substring (result, "@LNK_HISTORY_BS@", lnk_bshy); result := HT.replace_substring (result, "@LNK_PORT@", lnk_port); result := HT.replace_substring (result, "@LNK_HISTORY_PORT@", lnk_pthy); result := HT.replace_substring (result, "@OTHERVAR@", other_variants (specs, variant)); result := HT.replace_substring (result, "@OPTIONBLOCK@", specs.options_summary (variant)); result := HT.replace_substring (result, "@DISTINFO@", retrieve_distinfo (specs, portdir)); result := HT.replace_substring (result, "@DEPBODY@", dependency_block (specs)); result := HT.replace_substring (result, "@SITES@", master_sites_block (specs)); result := HT.replace_substring (result, "@DEPRECATED@", deprecated_message (specs)); result := HT.replace_substring (result, "@BROKEN@", broken_attributes (specs)); result := HT.replace_substring (result, "@ONLY_PLATFORM@", inclusive_platform (specs)); result := HT.replace_substring (result, "@EXC_PLATFORM@", exclusive_platform (specs)); result := HT.replace_substring (result, "@EXC_ARCH@", exclusive_arch (specs)); result := HT.replace_substring (result, "@UPSTREAM@", upstream (blocked)); result := HT.replace_substring (result, "@DESCBODY@", subpackage_description_block (specs, namebase, variant, portdir)); return HT.USS (result); end generate_body; -------------------------------------------------------------------------------------------- -- generate_catalog_index -------------------------------------------------------------------------------------------- function generate_catalog_index (dossier : TIO.File_Type; row_assembly_block : String) return Boolean is begin declare template_file : String := host_localbase & "/share/ravenadm/catalog.template"; template : constant String := FOP.get_file_contents (template_file); fullpage : HT.Text := HT.SUS (template); begin fullpage := HT.replace_substring (fullpage, "@ROW_ASSY@", row_assembly_block); TIO.Put_Line (dossier, HT.USS (fullpage)); return True; end; exception when others => TIO.Put_Line ("Failed to create the web site index"); return False; end generate_catalog_index; end Port_Specification.Web;
-- { dg-do compile } -- { dg-options "-O2 -fdump-tree-optimized" } function Volatile7 return Integer is type Vol is new Integer; pragma Volatile (Vol); type R is record X : Vol := 0; end record; V : R; begin for J in 1 .. 10 loop V.X := V.X + 1; end loop; return Integer (V.X); end; -- { dg-final { scan-tree-dump "goto" "optimized" } }
with GESTE; with GESTE.Grid; pragma Style_Checks (Off); package Game_Assets.level_1 is -- level_1 Width : constant := 20; Height : constant := 16; Tile_Width : constant := 8; Tile_Height : constant := 8; -- Backcolor package Backcolor is Width : constant := 20; Height : constant := 20; Data : aliased GESTE.Grid.Grid_Data := (( 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2), ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2)) ; end Backcolor; -- Back package Back is Width : constant := 20; Height : constant := 20; Data : aliased GESTE.Grid.Grid_Data := (( 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9), ( 9, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 10, 0, 10), ( 10, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 9), ( 9, 0, 0, 0, 9, 0, 0, 10, 0, 0, 9, 0, 0, 10, 0, 10), ( 10, 0, 0, 0, 10, 0, 0, 9, 0, 0, 10, 0, 0, 9, 0, 9), ( 9, 0, 0, 0, 9, 0, 0, 10, 0, 0, 9, 0, 0, 10, 0, 10), ( 10, 0, 0, 9, 10, 0, 0, 9, 0, 0, 10, 0, 0, 0, 0, 9), ( 9, 0, 0, 10, 9, 0, 0, 10, 0, 0, 9, 10, 9, 10, 9, 10), ( 10, 0, 0, 9, 10, 0, 0, 9, 0, 0, 0, 0, 0, 0, 10, 9), ( 9, 0, 0, 10, 9, 0, 0, 10, 0, 0, 9, 10, 0, 0, 9, 10), ( 10, 0, 0, 9, 10, 0, 0, 9, 0, 0, 10, 0, 0, 0, 10, 9), ( 9, 0, 0, 10, 9, 0, 0, 10, 0, 0, 9, 0, 0, 0, 9, 10), ( 10, 0, 0, 9, 10, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 9), ( 9, 0, 0, 10, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 9, 10), ( 10, 0, 0, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 0), ( 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0), ( 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0), ( 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 0, 9, 0), ( 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 0, 10, 0), ( 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 0, 9, 0)) ; end Back; -- Front package Front is Width : constant := 20; Height : constant := 20; Data : aliased GESTE.Grid.Grid_Data := (( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 13, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 16, 0, 0), ( 0, 0, 0, 0, 27, 0, 0, 19, 0, 0, 27, 0, 0, 19, 0, 0), ( 0, 0, 0, 43, 19, 0, 0, 28, 0, 0, 13, 0, 0, 28, 0, 0), ( 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 19, 0, 0, 0, 0, 0), ( 0, 0, 0, 27, 0, 0, 0, 27, 0, 0, 28, 0, 0, 0, 0, 0), ( 0, 0, 0, 13, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 13, 0), ( 0, 0, 0, 16, 0, 0, 22, 16, 0, 0, 27, 0, 0, 26, 16, 0), ( 0, 0, 0, 19, 0, 0, 25, 19, 0, 0, 16, 0, 0, 0, 19, 0), ( 0, 0, 0, 19, 0, 0, 0, 28, 0, 0, 13, 0, 0, 0, 13, 0), ( 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 16, 0, 0, 44, 16, 0), ( 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 19, 0, 0, 11, 19, 0), ( 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), ( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) ; end Front; package Chests is Objects : Object_Array := ( 0 => ( Kind => POINT_OBJ, Id => 5, Name => null, X => 1.36000E+02, Y => 1.12000E+02, Width => 8.00000E+00, Height => 8.00000E+00, Flip_Vertical => FALSE, Flip_Horizontal => FALSE, Tile_Id => 3, Str => null ) ); end Chests; package Markers is Objects : Object_Array := ( 0 => ( Kind => POINT_OBJ, Id => 1, Name => new String'("Spawn"), X => 8.00000E+00, Y => 1.20000E+02, Width => 8.00000E+00, Height => 8.00000E+00, Flip_Vertical => FALSE, Flip_Horizontal => TRUE, Tile_Id => 4, Str => null ), 1 => ( Kind => POINT_OBJ, Id => 9, Name => new String'("Finish"), X => 1.52000E+02, Y => 1.12000E+02, Width => 8.00000E+00, Height => 8.00000E+00, Flip_Vertical => FALSE, Flip_Horizontal => FALSE, Tile_Id => 5, Str => null ) ); Spawn : aliased constant Object := ( Kind => POINT_OBJ, Id => 1, Name => new String'("Spawn"), X => 8.00000E+00, Y => 1.20000E+02, Width => 8.00000E+00, Height => 8.00000E+00, Flip_Vertical => FALSE, Flip_Horizontal => TRUE, Tile_Id => 4, Str => null ); Finish : aliased constant Object := ( Kind => POINT_OBJ, Id => 9, Name => new String'("Finish"), X => 1.52000E+02, Y => 1.12000E+02, Width => 8.00000E+00, Height => 8.00000E+00, Flip_Vertical => FALSE, Flip_Horizontal => FALSE, Tile_Id => 5, Str => null ); end Markers; end Game_Assets.level_1;
-- This spec has been automatically generated from STM32WB55x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.WWDG is pragma Preelaborate; --------------- -- Registers -- --------------- subtype CR_T_Field is HAL.UInt7; type CR_Register is record T : CR_T_Field := 16#0#; WDGA : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record T at 0 range 0 .. 6; WDGA at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype CFR_W_Field is HAL.UInt7; subtype CFR_WDGTB_Field is HAL.UInt3; type CFR_Register is record W : CFR_W_Field := 16#0#; -- unspecified Reserved_7_8 : HAL.UInt2 := 16#0#; EWI : Boolean := False; -- unspecified Reserved_10_10 : HAL.Bit := 16#0#; WDGTB : CFR_WDGTB_Field := 16#0#; -- unspecified Reserved_14_31 : HAL.UInt18 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CFR_Register use record W at 0 range 0 .. 6; Reserved_7_8 at 0 range 7 .. 8; EWI at 0 range 9 .. 9; Reserved_10_10 at 0 range 10 .. 10; WDGTB at 0 range 11 .. 13; Reserved_14_31 at 0 range 14 .. 31; end record; type SR_Register is record EWIF : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SR_Register use record EWIF at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; ----------------- -- Peripherals -- ----------------- type WWDG_Peripheral is record CR : aliased CR_Register; CFR : aliased CFR_Register; SR : aliased SR_Register; end record with Volatile; for WWDG_Peripheral use record CR at 16#0# range 0 .. 31; CFR at 16#4# range 0 .. 31; SR at 16#8# range 0 .. 31; end record; WWDG_Periph : aliased WWDG_Peripheral with Import, Address => System'To_Address (16#40002C00#); end STM32_SVD.WWDG;
-- CC3232A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT A PRIVATE OR LIMITED PRIVATE FORMAL TYPE DENOTES ITS -- ACTUAL PARAMETER A FLOATING POINT TYPE, AND OPERATIONS OF THE -- FORMAL TYPE ARE IDENTIFIED WITH CORRESPONDING OPERATIONS OF THE -- ACTUAL TYPE. -- HISTORY: -- TBN 09/15/88 CREATED ORIGINAL TEST. -- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X. WITH REPORT; USE REPORT; PROCEDURE CC3232A IS TYPE FLOAT IS DIGITS 5 RANGE 0.0 .. 10.0; GENERIC TYPE T IS PRIVATE; PACKAGE P IS SUBTYPE SUB_T IS T; PAC_VAR : T; END P; GENERIC TYPE T IS LIMITED PRIVATE; PACKAGE LP IS SUBTYPE SUB_T IS T; PAC_VAR : T; END LP; FUNCTION IDENT_FLO (X : FLOAT) RETURN FLOAT IS BEGIN IF EQUAL (3, 3) THEN RETURN X; ELSE RETURN (0.0); END IF; END IDENT_FLO; BEGIN TEST ("CC3232A", "CHECK THAT A PRIVATE OR LIMITED PRIVATE " & "FORMAL TYPE DENOTES ITS ACTUAL PARAMETER A " & "FLOATING POINT TYPE, AND OPERATIONS OF THE " & "FORMAL TYPE ARE IDENTIFIED WITH CORRESPONDING " & "OPERATIONS OF THE ACTUAL TYPE"); DECLARE -- PRIVATE TYPE. OBJ_INT : INTEGER := 1; OBJ_FLO : FLOAT := 1.0; PACKAGE P1 IS NEW P (FLOAT); USE P1; TYPE NEW_T IS NEW SUB_T; OBJ_NEWT : NEW_T; BEGIN PAC_VAR := SUB_T'(1.0); IF PAC_VAR /= OBJ_FLO THEN FAILED ("INCORRECT RESULTS - 1"); END IF; OBJ_FLO := IDENT_FLO (PAC_VAR) + IDENT_FLO (OBJ_FLO); IF OBJ_FLO <= PAC_VAR THEN FAILED ("INCORRECT RESULTS - 2"); END IF; PAC_VAR := PAC_VAR * OBJ_FLO; IF PAC_VAR NOT IN FLOAT THEN FAILED ("INCORRECT RESULTS - 3"); END IF; IF OBJ_FLO NOT IN SUB_T THEN FAILED ("INCORRECT RESULTS - 4"); END IF; PAC_VAR := 1.0; OBJ_FLO := 1.0; OBJ_FLO := PAC_VAR * OBJ_FLO; IF OBJ_FLO /= 1.0 THEN FAILED ("INCORRECT RESULTS - 5"); END IF; OBJ_FLO := 1.0; OBJ_FLO := OBJ_FLO / OBJ_FLO; IF OBJ_FLO /= 1.0 THEN FAILED ("INCORRECT RESULTS - 6"); END IF; PAC_VAR := 1.0; OBJ_FLO := PAC_VAR ** OBJ_INT; IF OBJ_FLO /= 1.0 THEN FAILED ("INCORRECT RESULTS - 7"); END IF; IF SUB_T'DIGITS /= 5 THEN FAILED ("INCORRECT RESULTS - 8"); END IF; OBJ_NEWT := 1.0; OBJ_NEWT := OBJ_NEWT - 1.0; IF OBJ_NEWT NOT IN NEW_T THEN FAILED ("INCORRECT RESULTS - 9"); END IF; IF NEW_T'DIGITS /= 5 THEN FAILED ("INCORRECT RESULTS - 10"); END IF; END; DECLARE -- LIMITED PRIVATE TYPE. OBJ_INT : INTEGER := 1; OBJ_FLO : FLOAT := 1.0; PACKAGE P1 IS NEW LP (FLOAT); USE P1; TYPE NEW_T IS NEW SUB_T; OBJ_NEWT : NEW_T; BEGIN PAC_VAR := SUB_T'(1.0); IF PAC_VAR /= OBJ_FLO THEN FAILED ("INCORRECT RESULTS - 1"); END IF; OBJ_FLO := IDENT_FLO (PAC_VAR) + IDENT_FLO (OBJ_FLO); IF OBJ_FLO <= PAC_VAR THEN FAILED ("INCORRECT RESULTS - 2"); END IF; PAC_VAR := PAC_VAR * OBJ_FLO; IF PAC_VAR NOT IN FLOAT THEN FAILED ("INCORRECT RESULTS - 3"); END IF; IF OBJ_FLO NOT IN SUB_T THEN FAILED ("INCORRECT RESULTS - 4"); END IF; PAC_VAR := 1.0; OBJ_FLO := 1.0; OBJ_FLO := PAC_VAR * OBJ_FLO; IF OBJ_FLO /= 1.0 THEN FAILED ("INCORRECT RESULTS - 5"); END IF; OBJ_FLO := 1.0; OBJ_FLO := OBJ_FLO / OBJ_FLO; IF OBJ_FLO /= 1.0 THEN FAILED ("INCORRECT RESULTS - 6"); END IF; PAC_VAR := 1.0; OBJ_FLO := PAC_VAR ** OBJ_INT; IF OBJ_FLO /= 1.0 THEN FAILED ("INCORRECT RESULTS - 7"); END IF; IF SUB_T'DIGITS /= 5 THEN FAILED ("INCORRECT RESULTS - 8"); END IF; OBJ_NEWT := 1.0; OBJ_NEWT := OBJ_NEWT - 1.0; IF OBJ_NEWT NOT IN NEW_T THEN FAILED ("INCORRECT RESULTS - 9"); END IF; IF NEW_T'DIGITS /= 5 THEN FAILED ("INCORRECT RESULTS - 10"); END IF; END; RESULT; END CC3232A;
with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Latex_Writer is type Style_Spec (<>) is private; type Table_Handler (<>) is tagged private; type Length_Unit is (Pt, Cm, Mm, Inch); type Latex_Length is private; subtype Em_Length is Float; Zero : constant Latex_Length; function "+" (X, Y : Latex_Length) return Latex_Length; function "-" (X, Y : Latex_Length) return Latex_Length; function "*" (X : Float; Y : Latex_Length) return Latex_Length; -- function "*" (X : Em_Length; Y : Latex_Length) return Latex_Length; function Value (X : Latex_Length; Unit : Length_Unit) return Float; function Image (X : Latex_Length; Unit : Length_Unit := Pt; Full : Boolean := True) return String; function "/" (X : Latex_Length; Y : Latex_Length) return Float; function Inch return Latex_Length; function Pt return Latex_Length; function Cm return Latex_Length; function Mm return Latex_Length; type Parameter_List (<>) is private; function "and" (X, Y : String) return Parameter_List; function "and" (X : Parameter_List; Y : String) return Parameter_List; procedure Within (Output : File_Access; Env_Name : String; Callback : access procedure (Output : File_Access); Parameter : String := ""); procedure Within_Table_Like (Output : File_Access; Env_Name : String; Callback : access procedure (Output : File_Access; Table : in out Table_Handler)); procedure Within_Table_Like (Output : File_Access; Env_Name : String; Callback : access procedure (Output : File_Access; Table : in out Table_Handler); Parameter : String); procedure Within_Table_Like (Output : File_Access; Env_Name : String; Callback : access procedure (Output : File_Access; Table : in out Table_Handler); Parameters : Parameter_List); procedure Within_Table (Output : File_Access; Table_Spec : String; Callback : access procedure (Output : File_Access; Table : in out Table_Handler); Default_Style : String := ""; Default_Head : String := ""; Caption : String := ""; Width : String := "\textwidth"); procedure Put (Table : in out Table_Handler; Content : String; Style : String := ""); type Bar_Position is (Default, Left, Right, Both, None); procedure Head (Table : in out Table_Handler; Content : String; Bar : Bar_Position := Default; Style : String := ""); procedure New_Row (Table : in out Table_Handler); procedure Hline (Table : in out Table_Handler; Full : Boolean := True); procedure Cline (Table : in out Table_Handler; From, To : Positive); procedure Multicolumn (Table : in out Table_Handler; Span : Positive; Spec : String; Content : String); procedure Print_Default_Macro (Output : File_Access; Command_Name : String; Definition : String; N_Parameters : Natural); type Align_Type is (Center, Left, Right); function Hbox (Content : String; Size : Latex_Length := Zero; Align : Align_Type := Center) return String; private -- 1 Cm ~ 30 Pt, 10_000 Pt ~ 3m type Basic_Latex_Length_Pt is delta 2.0 ** (-16) range -10_000.0 .. 10_000.0; type Latex_Length is new Basic_Latex_Length_Pt; Zero : constant Latex_Length := 0.0; pragma Warnings (Off, "static fixed-point value is not a multiple of Small"); Point_Per_Unit : constant array (Length_Unit) of Basic_Latex_Length_Pt := (Pt => 1.0, Mm => 2.84, Cm => 28.4, Inch => 72.27); subtype Unit_Name is String (1 .. 2); Unit_Image : constant array (Length_Unit) of Unit_Name := (Pt => "pt", Mm => "mm", Cm => "cm", Inch => "in"); function "+" (X, Y : Latex_Length) return Latex_Length is (Latex_Length (Basic_Latex_Length_Pt (X)+Basic_Latex_Length_Pt (Y))); function "-" (X, Y : Latex_Length) return Latex_Length is (Latex_Length (Basic_Latex_Length_Pt (X)-Basic_Latex_Length_Pt (Y))); function "*" (X : Float; Y : Latex_Length) return Latex_Length is (Latex_Length (X * Float (Y))); -- function "*" (X : Em_Length; Y : Latex_Length) return Latex_Length -- is (Float (X) * Y); function "/" (X : Latex_Length; Y : Latex_Length) return Float is (Float (X) / Float (Y)); function Value (X : Latex_Length; Unit : Length_Unit) return Float is (Float (X) / Float (Point_Per_Unit (Unit))); function Image (X : Latex_Length; Unit : Length_Unit := Pt; Full : Boolean := True) return String is (Basic_Latex_Length_Pt'Image (Basic_Latex_Length_Pt (X) / Point_Per_Unit (Unit)) & (if Full then Unit_Image (Unit) else "")); function Inch return Latex_Length is (Latex_Length (Point_Per_Unit (Inch))); function Pt return Latex_Length is (Latex_Length (Point_Per_Unit (Pt))); function Cm return Latex_Length is (Latex_Length (Point_Per_Unit (Cm))); function Mm return Latex_Length is (Latex_Length (Point_Per_Unit (Mm))); type Style_Spec is new String; type Table_State is (Begin_Row, Middle_Row); type Table_Handler is tagged record State : Table_State; Output : File_Access; Default_Style : Unbounded_String; Default_Head : Unbounded_String; end record; type Parameter_List is array (Positive range <>) of Unbounded_String; function "and" (X, Y : String) return Parameter_List is (Parameter_List'(1 => To_Unbounded_String (X), 2 => To_Unbounded_String (Y))); function "and" (X : Parameter_List; Y : String) return Parameter_List is (X & Parameter_List'(1 => To_Unbounded_String (Y))); end Latex_Writer;
package body Neural.Privvy is procedure dummy is begin null; end dummy; -- placeholder for future subprograms. end Neural.Privvy;
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr> -- MIT license. Please refer to the LICENSE file. package body Apsepp.Test_Event_Class.Impl is ---------------------------------------------------------------------------- package body Derivation is ----------------------------------------------------- overriding procedure Set (Obj : in out Test_Event_FCTNA; Data : Test_Event_Data) is begin Test_Event (Obj).Set (Data); -- Inherited procedure call. Obj.Previous_Child_Tag := Data.Previous_Child_Tag; end Set; ----------------------------------------------------- overriding function Previous_Child_Tag (Obj : Test_Event_FCTNA) return Tag is begin return Obj.Previous_Child_Tag; end Previous_Child_Tag; ----------------------------------------------------- overriding procedure Set (Obj : in out Test_Event_TRC; Data : Test_Event_Data) is begin Test_Event (Obj).Set (Data); -- Inherited procedure call. Obj.Last_Cancelled_R_Index := Data.R_Index; end Set; ----------------------------------------------------- overriding function Last_Cancelled_R_Index (Obj : Test_Event_TRC) return Test_Routine_Index is begin return Obj.Last_Cancelled_R_Index; end Last_Cancelled_R_Index; ----------------------------------------------------- end Derivation; ---------------------------------------------------------------------------- end Apsepp.Test_Event_Class.Impl;
---------------------------------------------------------------- -- ZLib for Ada thick binding. -- -- -- -- Copyright (C) 2002-2003 Dmitriy Anisimkov -- -- -- -- Open source license information is in the zlib.ads file. -- ---------------------------------------------------------------- -- $Id: zlib-thin.ads,v 1.1.1.1 2011/06/10 09:34:40 andrew Exp $ with Interfaces.C.Strings; with System; private package ZLib.Thin is -- From zconf.h MAX_MEM_LEVEL : constant := 9; -- zconf.h:105 -- zconf.h:105 MAX_WBITS : constant := 15; -- zconf.h:115 -- 32K LZ77 window -- zconf.h:115 SEEK_SET : constant := 8#0000#; -- zconf.h:244 -- Seek from beginning of file. -- zconf.h:244 SEEK_CUR : constant := 1; -- zconf.h:245 -- Seek from current position. -- zconf.h:245 SEEK_END : constant := 2; -- zconf.h:246 -- Set file pointer to EOF plus "offset" -- zconf.h:246 type Byte is new Interfaces.C.unsigned_char; -- 8 bits -- zconf.h:214 type UInt is new Interfaces.C.unsigned; -- 16 bits or more -- zconf.h:216 type Int is new Interfaces.C.int; type ULong is new Interfaces.C.unsigned_long; -- 32 bits or more -- zconf.h:217 subtype Chars_Ptr is Interfaces.C.Strings.chars_ptr; type ULong_Access is access ULong; type Int_Access is access Int; subtype Voidp is System.Address; -- zconf.h:232 subtype Byte_Access is Voidp; Nul : constant Voidp := System.Null_Address; -- end from zconf Z_NO_FLUSH : constant := 8#0000#; -- zlib.h:125 -- zlib.h:125 Z_PARTIAL_FLUSH : constant := 1; -- zlib.h:126 -- will be removed, use -- Z_SYNC_FLUSH instead -- zlib.h:126 Z_SYNC_FLUSH : constant := 2; -- zlib.h:127 -- zlib.h:127 Z_FULL_FLUSH : constant := 3; -- zlib.h:128 -- zlib.h:128 Z_FINISH : constant := 4; -- zlib.h:129 -- zlib.h:129 Z_OK : constant := 8#0000#; -- zlib.h:132 -- zlib.h:132 Z_STREAM_END : constant := 1; -- zlib.h:133 -- zlib.h:133 Z_NEED_DICT : constant := 2; -- zlib.h:134 -- zlib.h:134 Z_ERRNO : constant := -1; -- zlib.h:135 -- zlib.h:135 Z_STREAM_ERROR : constant := -2; -- zlib.h:136 -- zlib.h:136 Z_DATA_ERROR : constant := -3; -- zlib.h:137 -- zlib.h:137 Z_MEM_ERROR : constant := -4; -- zlib.h:138 -- zlib.h:138 Z_BUF_ERROR : constant := -5; -- zlib.h:139 -- zlib.h:139 Z_VERSION_ERROR : constant := -6; -- zlib.h:140 -- zlib.h:140 Z_NO_COMPRESSION : constant := 8#0000#; -- zlib.h:145 -- zlib.h:145 Z_BEST_SPEED : constant := 1; -- zlib.h:146 -- zlib.h:146 Z_BEST_COMPRESSION : constant := 9; -- zlib.h:147 -- zlib.h:147 Z_DEFAULT_COMPRESSION : constant := -1; -- zlib.h:148 -- zlib.h:148 Z_FILTERED : constant := 1; -- zlib.h:151 -- zlib.h:151 Z_HUFFMAN_ONLY : constant := 2; -- zlib.h:152 -- zlib.h:152 Z_DEFAULT_STRATEGY : constant := 8#0000#; -- zlib.h:153 -- zlib.h:153 Z_BINARY : constant := 8#0000#; -- zlib.h:156 -- zlib.h:156 Z_ASCII : constant := 1; -- zlib.h:157 -- zlib.h:157 Z_UNKNOWN : constant := 2; -- zlib.h:158 -- zlib.h:158 Z_DEFLATED : constant := 8; -- zlib.h:161 -- zlib.h:161 Z_NULL : constant := 8#0000#; -- zlib.h:164 -- for initializing zalloc, zfree, opaque -- zlib.h:164 type gzFile is new Voidp; -- zlib.h:646 type Z_Stream is private; type Z_Streamp is access all Z_Stream; -- zlib.h:89 type alloc_func is access function (Opaque : Voidp; Items : UInt; Size : UInt) return Voidp; -- zlib.h:63 type free_func is access procedure (opaque : Voidp; address : Voidp); function zlibVersion return Chars_Ptr; function Deflate (strm : Z_Streamp; flush : Int) return Int; function DeflateEnd (strm : Z_Streamp) return Int; function Inflate (strm : Z_Streamp; flush : Int) return Int; function InflateEnd (strm : Z_Streamp) return Int; function deflateSetDictionary (strm : Z_Streamp; dictionary : Byte_Access; dictLength : UInt) return Int; function deflateCopy (dest : Z_Streamp; source : Z_Streamp) return Int; -- zlib.h:478 function deflateReset (strm : Z_Streamp) return Int; -- zlib.h:495 function deflateParams (strm : Z_Streamp; level : Int; strategy : Int) return Int; -- zlib.h:506 function inflateSetDictionary (strm : Z_Streamp; dictionary : Byte_Access; dictLength : UInt) return Int; -- zlib.h:548 function inflateSync (strm : Z_Streamp) return Int; -- zlib.h:565 function inflateReset (strm : Z_Streamp) return Int; -- zlib.h:580 function compress (dest : Byte_Access; destLen : ULong_Access; source : Byte_Access; sourceLen : ULong) return Int; -- zlib.h:601 function compress2 (dest : Byte_Access; destLen : ULong_Access; source : Byte_Access; sourceLen : ULong; level : Int) return Int; -- zlib.h:615 function uncompress (dest : Byte_Access; destLen : ULong_Access; source : Byte_Access; sourceLen : ULong) return Int; function gzopen (path : Chars_Ptr; mode : Chars_Ptr) return gzFile; function gzdopen (fd : Int; mode : Chars_Ptr) return gzFile; function gzsetparams (file : gzFile; level : Int; strategy : Int) return Int; function gzread (file : gzFile; buf : Voidp; len : UInt) return Int; function gzwrite (file : in gzFile; buf : in Voidp; len : in UInt) return Int; function gzprintf (file : in gzFile; format : in Chars_Ptr) return Int; function gzputs (file : in gzFile; s : in Chars_Ptr) return Int; function gzgets (file : gzFile; buf : Chars_Ptr; len : Int) return Chars_Ptr; function gzputc (file : gzFile; char : Int) return Int; function gzgetc (file : gzFile) return Int; function gzflush (file : gzFile; flush : Int) return Int; function gzseek (file : gzFile; offset : Int; whence : Int) return Int; function gzrewind (file : gzFile) return Int; function gztell (file : gzFile) return Int; function gzeof (file : gzFile) return Int; function gzclose (file : gzFile) return Int; function gzerror (file : gzFile; errnum : Int_Access) return Chars_Ptr; function adler32 (adler : ULong; buf : Byte_Access; len : UInt) return ULong; function crc32 (crc : ULong; buf : Byte_Access; len : UInt) return ULong; function deflateInit (strm : Z_Streamp; level : Int; version : Chars_Ptr; stream_size : Int) return Int; function deflateInit2 (strm : Z_Streamp; level : Int; method : Int; windowBits : Int; memLevel : Int; strategy : Int; version : Chars_Ptr; stream_size : Int) return Int; function Deflate_Init (strm : Z_Streamp; level : Int; method : Int; windowBits : Int; memLevel : Int; strategy : Int) return Int; pragma Inline (Deflate_Init); function inflateInit (strm : Z_Streamp; version : Chars_Ptr; stream_size : Int) return Int; function inflateInit2 (strm : in Z_Streamp; windowBits : in Int; version : in Chars_Ptr; stream_size : in Int) return Int; function inflateBackInit (strm : in Z_Streamp; windowBits : in Int; window : in Byte_Access; version : in Chars_Ptr; stream_size : in Int) return Int; -- Size of window have to be 2**windowBits. function Inflate_Init (strm : Z_Streamp; windowBits : Int) return Int; pragma Inline (Inflate_Init); function zError (err : Int) return Chars_Ptr; function inflateSyncPoint (z : Z_Streamp) return Int; function get_crc_table return ULong_Access; -- Interface to the available fields of the z_stream structure. -- The application must update next_in and avail_in when avail_in has -- dropped to zero. It must update next_out and avail_out when avail_out -- has dropped to zero. The application must initialize zalloc, zfree and -- opaque before calling the init function. procedure Set_In (Strm : in out Z_Stream; Buffer : in Voidp; Size : in UInt); pragma Inline (Set_In); procedure Set_Out (Strm : in out Z_Stream; Buffer : in Voidp; Size : in UInt); pragma Inline (Set_Out); procedure Set_Mem_Func (Strm : in out Z_Stream; Opaque : in Voidp; Alloc : in alloc_func; Free : in free_func); pragma Inline (Set_Mem_Func); function Last_Error_Message (Strm : in Z_Stream) return String; pragma Inline (Last_Error_Message); function Avail_Out (Strm : in Z_Stream) return UInt; pragma Inline (Avail_Out); function Avail_In (Strm : in Z_Stream) return UInt; pragma Inline (Avail_In); function Total_In (Strm : in Z_Stream) return ULong; pragma Inline (Total_In); function Total_Out (Strm : in Z_Stream) return ULong; pragma Inline (Total_Out); function inflateCopy (dest : in Z_Streamp; Source : in Z_Streamp) return Int; function compressBound (Source_Len : in ULong) return ULong; function deflateBound (Strm : in Z_Streamp; Source_Len : in ULong) return ULong; function gzungetc (C : in Int; File : in gzFile) return Int; function zlibCompileFlags return ULong; private type Z_Stream is record -- zlib.h:68 Next_In : Voidp := Nul; -- next input byte Avail_In : UInt := 0; -- number of bytes available at next_in Total_In : ULong := 0; -- total nb of input bytes read so far Next_Out : Voidp := Nul; -- next output byte should be put there Avail_Out : UInt := 0; -- remaining free space at next_out Total_Out : ULong := 0; -- total nb of bytes output so far msg : Chars_Ptr; -- last error message, NULL if no error state : Voidp; -- not visible by applications zalloc : alloc_func := null; -- used to allocate the internal state zfree : free_func := null; -- used to free the internal state opaque : Voidp; -- private data object passed to -- zalloc and zfree data_type : Int; -- best guess about the data type: -- ascii or binary adler : ULong; -- adler32 value of the uncompressed -- data reserved : ULong; -- reserved for future use end record; pragma Convention (C, Z_Stream); pragma Import (C, zlibVersion, "zlibVersion"); pragma Import (C, Deflate, "deflate"); pragma Import (C, DeflateEnd, "deflateEnd"); pragma Import (C, Inflate, "inflate"); pragma Import (C, InflateEnd, "inflateEnd"); pragma Import (C, deflateSetDictionary, "deflateSetDictionary"); pragma Import (C, deflateCopy, "deflateCopy"); pragma Import (C, deflateReset, "deflateReset"); pragma Import (C, deflateParams, "deflateParams"); pragma Import (C, inflateSetDictionary, "inflateSetDictionary"); pragma Import (C, inflateSync, "inflateSync"); pragma Import (C, inflateReset, "inflateReset"); pragma Import (C, compress, "compress"); pragma Import (C, compress2, "compress2"); pragma Import (C, uncompress, "uncompress"); pragma Import (C, gzopen, "gzopen"); pragma Import (C, gzdopen, "gzdopen"); pragma Import (C, gzsetparams, "gzsetparams"); pragma Import (C, gzread, "gzread"); pragma Import (C, gzwrite, "gzwrite"); pragma Import (C, gzprintf, "gzprintf"); pragma Import (C, gzputs, "gzputs"); pragma Import (C, gzgets, "gzgets"); pragma Import (C, gzputc, "gzputc"); pragma Import (C, gzgetc, "gzgetc"); pragma Import (C, gzflush, "gzflush"); pragma Import (C, gzseek, "gzseek"); pragma Import (C, gzrewind, "gzrewind"); pragma Import (C, gztell, "gztell"); pragma Import (C, gzeof, "gzeof"); pragma Import (C, gzclose, "gzclose"); pragma Import (C, gzerror, "gzerror"); pragma Import (C, adler32, "adler32"); pragma Import (C, crc32, "crc32"); pragma Import (C, deflateInit, "deflateInit_"); pragma Import (C, inflateInit, "inflateInit_"); pragma Import (C, deflateInit2, "deflateInit2_"); pragma Import (C, inflateInit2, "inflateInit2_"); pragma Import (C, zError, "zError"); pragma Import (C, inflateSyncPoint, "inflateSyncPoint"); pragma Import (C, get_crc_table, "get_crc_table"); -- since zlib 1.2.0: pragma Import (C, inflateCopy, "inflateCopy"); pragma Import (C, compressBound, "compressBound"); pragma Import (C, deflateBound, "deflateBound"); pragma Import (C, gzungetc, "gzungetc"); pragma Import (C, zlibCompileFlags, "zlibCompileFlags"); pragma Import (C, inflateBackInit, "inflateBackInit_"); -- I stopped binding the inflateBack routines, becouse realize that -- it does not support zlib and gzip headers for now, and have no -- symmetric deflateBack routines. -- ZLib-Ada is symmetric regarding deflate/inflate data transformation -- and has a similar generic callback interface for the -- deflate/inflate transformation based on the regular Deflate/Inflate -- routines. -- pragma Import (C, inflateBack, "inflateBack"); -- pragma Import (C, inflateBackEnd, "inflateBackEnd"); end ZLib.Thin;
----------------------------------------------------------------------- -- asf.responses.mockup -- ASF Response mockup -- Copyright (C) 2010, 2011 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- private with Util.Streams.Texts; private with Util.Strings.Maps; -- The <b>ASF.Responses.Mockup</b> provides a fake response object to simulate -- an HTTP response. package ASF.Responses.Mockup is -- ------------------------------ -- Response Mockup -- ------------------------------ -- The response mockup implements a fake HTTP response object type Response is new ASF.Responses.Response with private; -- Returns a boolean indicating whether the named response header has already -- been set. function Contains_Header (Resp : in Response; Name : in String) return Boolean; -- Iterate over the response headers and executes the <b>Process</b> procedure. procedure Iterate_Headers (Resp : in Response; Process : not null access procedure (Name : in String; Value : in String)); -- Sets a response header with the given name and value. If the header had already -- been set, the new value overwrites the previous one. The containsHeader -- method can be used to test for the presence of a header before setting its value. procedure Set_Header (Resp : in out Response; Name : in String; Value : in String); -- Adds a response header with the given name and value. -- This method allows response headers to have multiple values. procedure Add_Header (Resp : in out Response; Name : in String; Value : in String); -- Returns the value of the specified response header as a String. If the response -- did not include a header of the specified name, this method returns null. -- If there are multiple headers with the same name, this method returns the -- first head in the response. The header name is case insensitive. You can use -- this method with any response header. function Get_Header (Resp : in Response; Name : in String) return String; -- Get the content written to the mockup output stream. procedure Read_Content (Resp : in out Response; Into : out Ada.Strings.Unbounded.Unbounded_String); -- Clear the response content. -- This operation removes any content held in the output stream, clears the status, -- removes any header in the response. procedure Clear (Resp : in out Response); private -- Initialize the response mockup output stream. overriding procedure Initialize (Resp : in out Response); type Response is new ASF.Responses.Response with record Content : aliased Util.Streams.Texts.Print_Stream; Headers : Util.Strings.Maps.Map; end record; end ASF.Responses.Mockup;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . I N D E F I N I T E _ V E C T O R S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2006, 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 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Finalization; with Ada.Streams; generic type Index_Type is range <>; type Element_Type (<>) is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Ada.Containers.Indefinite_Vectors is pragma Preelaborate; subtype Extended_Index is Index_Type'Base range Index_Type'First - 1 .. Index_Type'Min (Index_Type'Base'Last - 1, Index_Type'Last) + 1; No_Index : constant Extended_Index := Extended_Index'First; type Vector is tagged private; pragma Preelaborable_Initialization (Vector); type Cursor is private; pragma Preelaborable_Initialization (Cursor); Empty_Vector : constant Vector; No_Element : constant Cursor; function "=" (Left, Right : Vector) return Boolean; function To_Vector (Length : Count_Type) return Vector; function To_Vector (New_Item : Element_Type; Length : Count_Type) return Vector; function "&" (Left, Right : Vector) return Vector; function "&" (Left : Vector; Right : Element_Type) return Vector; function "&" (Left : Element_Type; Right : Vector) return Vector; function "&" (Left, Right : Element_Type) return Vector; function Capacity (Container : Vector) return Count_Type; procedure Reserve_Capacity (Container : in out Vector; Capacity : Count_Type); function Length (Container : Vector) return Count_Type; procedure Set_Length (Container : in out Vector; Length : Count_Type); function Is_Empty (Container : Vector) return Boolean; procedure Clear (Container : in out Vector); function To_Cursor (Container : Vector; Index : Extended_Index) return Cursor; function To_Index (Position : Cursor) return Extended_Index; function Element (Container : Vector; Index : Index_Type) return Element_Type; function Element (Position : Cursor) return Element_Type; procedure Replace_Element (Container : in out Vector; Index : Index_Type; New_Item : Element_Type); procedure Replace_Element (Container : in out Vector; Position : Cursor; New_Item : Element_Type); procedure Query_Element (Container : Vector; Index : Index_Type; Process : not null access procedure (Element : Element_Type)); procedure Query_Element (Position : Cursor; Process : not null access procedure (Element : Element_Type)); procedure Update_Element (Container : in out Vector; Index : Index_Type; Process : not null access procedure (Element : in out Element_Type)); procedure Update_Element (Container : in out Vector; Position : Cursor; Process : not null access procedure (Element : in out Element_Type)); procedure Move (Target : in out Vector; Source : in out Vector); procedure Insert (Container : in out Vector; Before : Extended_Index; New_Item : Vector); procedure Insert (Container : in out Vector; Before : Cursor; New_Item : Vector); procedure Insert (Container : in out Vector; Before : Cursor; New_Item : Vector; Position : out Cursor); procedure Insert (Container : in out Vector; Before : Extended_Index; New_Item : Element_Type; Count : Count_Type := 1); procedure Insert (Container : in out Vector; Before : Cursor; New_Item : Element_Type; Count : Count_Type := 1); procedure Insert (Container : in out Vector; Before : Cursor; New_Item : Element_Type; Position : out Cursor; Count : Count_Type := 1); procedure Prepend (Container : in out Vector; New_Item : Vector); procedure Prepend (Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1); procedure Append (Container : in out Vector; New_Item : Vector); procedure Append (Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1); procedure Insert_Space (Container : in out Vector; Before : Extended_Index; Count : Count_Type := 1); procedure Insert_Space (Container : in out Vector; Before : Cursor; Position : out Cursor; Count : Count_Type := 1); procedure Delete (Container : in out Vector; Index : Extended_Index; Count : Count_Type := 1); procedure Delete (Container : in out Vector; Position : in out Cursor; Count : Count_Type := 1); procedure Delete_First (Container : in out Vector; Count : Count_Type := 1); procedure Delete_Last (Container : in out Vector; Count : Count_Type := 1); procedure Reverse_Elements (Container : in out Vector); procedure Swap (Container : in out Vector; I, J : Index_Type); procedure Swap (Container : in out Vector; I, J : Cursor); function First_Index (Container : Vector) return Index_Type; function First (Container : Vector) return Cursor; function First_Element (Container : Vector) return Element_Type; function Last_Index (Container : Vector) return Extended_Index; function Last (Container : Vector) return Cursor; function Last_Element (Container : Vector) return Element_Type; function Next (Position : Cursor) return Cursor; procedure Next (Position : in out Cursor); function Previous (Position : Cursor) return Cursor; procedure Previous (Position : in out Cursor); function Find_Index (Container : Vector; Item : Element_Type; Index : Index_Type := Index_Type'First) return Extended_Index; function Find (Container : Vector; Item : Element_Type; Position : Cursor := No_Element) return Cursor; function Reverse_Find_Index (Container : Vector; Item : Element_Type; Index : Index_Type := Index_Type'Last) return Extended_Index; function Reverse_Find (Container : Vector; Item : Element_Type; Position : Cursor := No_Element) return Cursor; function Contains (Container : Vector; Item : Element_Type) return Boolean; function Has_Element (Position : Cursor) return Boolean; procedure Iterate (Container : Vector; Process : not null access procedure (Position : Cursor)); procedure Reverse_Iterate (Container : Vector; Process : not null access procedure (Position : Cursor)); generic with function "<" (Left, Right : Element_Type) return Boolean is <>; package Generic_Sorting is function Is_Sorted (Container : Vector) return Boolean; procedure Sort (Container : in out Vector); procedure Merge (Target : in out Vector; Source : in out Vector); end Generic_Sorting; private pragma Inline (First_Index); pragma Inline (Last_Index); pragma Inline (Element); pragma Inline (First_Element); pragma Inline (Last_Element); pragma Inline (Query_Element); pragma Inline (Update_Element); pragma Inline (Replace_Element); pragma Inline (Contains); type Element_Access is access Element_Type; type Elements_Type is array (Index_Type range <>) of Element_Access; function "=" (L, R : Elements_Type) return Boolean is abstract; type Elements_Access is access Elements_Type; use Ada.Finalization; type Vector is new Controlled with record Elements : Elements_Access; Last : Extended_Index := No_Index; Busy : Natural := 0; Lock : Natural := 0; end record; procedure Adjust (Container : in out Vector); procedure Finalize (Container : in out Vector); use Ada.Streams; procedure Write (Stream : not null access Root_Stream_Type'Class; Container : Vector); for Vector'Write use Write; procedure Read (Stream : not null access Root_Stream_Type'Class; Container : out Vector); for Vector'Read use Read; Empty_Vector : constant Vector := (Controlled with null, No_Index, 0, 0); type Vector_Access is access constant Vector; for Vector_Access'Storage_Size use 0; type Cursor is record Container : Vector_Access; Index : Index_Type := Index_Type'First; end record; procedure Write (Stream : not null access Root_Stream_Type'Class; Position : Cursor); for Cursor'Write use Write; procedure Read (Stream : not null access Root_Stream_Type'Class; Position : out Cursor); for Cursor'Read use Read; No_Element : constant Cursor := Cursor'(null, Index_Type'First); end Ada.Containers.Indefinite_Vectors;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Enumeration_Literals.Collections is pragma Preelaborate; package UML_Enumeration_Literal_Collections is new AMF.Generic_Collections (UML_Enumeration_Literal, UML_Enumeration_Literal_Access); type Set_Of_UML_Enumeration_Literal is new UML_Enumeration_Literal_Collections.Set with null record; Empty_Set_Of_UML_Enumeration_Literal : constant Set_Of_UML_Enumeration_Literal; type Ordered_Set_Of_UML_Enumeration_Literal is new UML_Enumeration_Literal_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Enumeration_Literal : constant Ordered_Set_Of_UML_Enumeration_Literal; type Bag_Of_UML_Enumeration_Literal is new UML_Enumeration_Literal_Collections.Bag with null record; Empty_Bag_Of_UML_Enumeration_Literal : constant Bag_Of_UML_Enumeration_Literal; type Sequence_Of_UML_Enumeration_Literal is new UML_Enumeration_Literal_Collections.Sequence with null record; Empty_Sequence_Of_UML_Enumeration_Literal : constant Sequence_Of_UML_Enumeration_Literal; private Empty_Set_Of_UML_Enumeration_Literal : constant Set_Of_UML_Enumeration_Literal := (UML_Enumeration_Literal_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Enumeration_Literal : constant Ordered_Set_Of_UML_Enumeration_Literal := (UML_Enumeration_Literal_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Enumeration_Literal : constant Bag_Of_UML_Enumeration_Literal := (UML_Enumeration_Literal_Collections.Bag with null record); Empty_Sequence_Of_UML_Enumeration_Literal : constant Sequence_Of_UML_Enumeration_Literal := (UML_Enumeration_Literal_Collections.Sequence with null record); end AMF.UML.Enumeration_Literals.Collections;
with System.Formatting; with System.Long_Long_Integer_Types; package body System.Version_Control is subtype Word_Unsigned is Long_Long_Integer_Types.Word_Unsigned; -- implementation function Get_Version_String (V : Unsigned_Types.Unsigned) return Version_String is Last : Natural; Error : Boolean; begin return Result : Version_String do Formatting.Image ( Word_Unsigned (V), Result, Last, Base => 16, Width => Version_String'Length, Error => Error); pragma Assert (not Error and then Last = Result'Last); end return; end Get_Version_String; end System.Version_Control;
------------------------------------------------------------------------------- -- Title : Blinky example status file -- -- File : main.ads -- Author : Vitor Finotti -- Created on : 2019-04-25 14:53:55 -- Description : -- -- -- ------------------------------------------------------------------------------- package Main is procedure Run; pragma Export (C, Run, "main"); end Main;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G . P R O T E C T E D _ O B J E C T S . -- -- E N T R I E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains all the simple primitives related to -- Protected_Objects with entries (i.e init, lock, unlock). -- The handling of protected objects with no entries is done in -- System.Tasking.Protected_Objects, the complex routines for protected -- objects with entries in System.Tasking.Protected_Objects.Operations. -- The split between Entries and Operations is needed to break circular -- dependencies inside the run time. -- Note: the compiler generates direct calls to this interface, via Rtsfind. -- Any changes to this interface may require corresponding compiler changes. with Ada.Finalization; -- used for Limited_Controlled with Unchecked_Conversion; package System.Tasking.Protected_Objects.Entries is pragma Elaborate_Body; subtype Positive_Protected_Entry_Index is Protected_Entry_Index range 1 .. Protected_Entry_Index'Last; type Find_Body_Index_Access is access function (O : System.Address; E : Protected_Entry_Index) return Protected_Entry_Index; type Protected_Entry_Body_Array is array (Positive_Protected_Entry_Index range <>) of Entry_Body; -- This is an array of the executable code for all entry bodies of -- a protected type. type Protected_Entry_Body_Access is access all Protected_Entry_Body_Array; type Protected_Entry_Queue_Array is array (Protected_Entry_Index range <>) of Entry_Queue; -- This type contains the GNARL state of a protected object. The -- application-defined portion of the state (i.e. private objects) -- is maintained by the compiler-generated code. -- note that there is a simplified version of this type declared in -- System.Tasking.PO_Simple that handle the simple case (no entries). type Protection_Entries (Num_Entries : Protected_Entry_Index) is new Ada.Finalization.Limited_Controlled with record L : aliased Task_Primitives.Lock; -- The underlying lock associated with a Protection_Entries. -- Note that you should never (un)lock Object.L directly, but instead -- use Lock_Entries/Unlock_Entries. Compiler_Info : System.Address; -- Pointer to compiler-generated record representing protected object Call_In_Progress : Entry_Call_Link; -- Pointer to the entry call being executed (if any) Ceiling : System.Any_Priority; -- Ceiling priority associated with the protected object New_Ceiling : System.Any_Priority; -- New ceiling priority associated to the protected object. In case -- of assignment of a new ceiling priority to the protected object the -- frontend generates a call to set_ceiling to save the new value in -- this field. After such assignment this value can be read by means -- of the 'Priority attribute, which generates a call to get_ceiling. -- However, the ceiling of the protected object will not be changed -- until completion of the protected action in which the assignment -- has been executed (AARM D.5.2 (10/2)). Owner : Task_Id; -- This field contains the protected object's owner. Null_Task -- indicates that the protected object is not currently being used. -- This information is used for detecting the type of potentially -- blocking operations described in the ARM 9.5.1, par. 15 (external -- calls on a protected subprogram with the same target object as that -- of the protected action). Old_Base_Priority : System.Any_Priority; -- Task's base priority when the protected operation was called Pending_Action : Boolean; -- Flag indicating that priority has been dipped temporarily in order -- to avoid violating the priority ceiling of the lock associated with -- this protected object, in Lock_Server. The flag tells Unlock_Server -- or Unlock_And_Update_Server to restore the old priority to -- Old_Base_Priority. This is needed because of situations (bad -- language design?) where one needs to lock a PO but to do so would -- violate the priority ceiling. For example, this can happen when an -- entry call has been requeued to a lower-priority object, and the -- caller then tries to cancel the call while its own priority is -- higher than the ceiling of the new PO. Finalized : Boolean := False; -- Set to True by Finalize to make this routine idempotent Entry_Bodies : Protected_Entry_Body_Access; -- Pointer to an array containing the executable code for all entry -- bodies of a protected type. -- The following function maps the entry index in a call (which denotes -- the queue to the proper entry) into the body of the entry. Find_Body_Index : Find_Body_Index_Access; Entry_Queues : Protected_Entry_Queue_Array (1 .. Num_Entries); end record; -- No default initial values for this type, since call records -- will need to be re-initialized before every use. type Protection_Entries_Access is access all Protection_Entries'Class; -- See comments in s-tassta.adb about the implicit call to Current_Master -- generated by this declaration. function To_Address is new Unchecked_Conversion (Protection_Entries_Access, System.Address); function To_Protection is new Unchecked_Conversion (System.Address, Protection_Entries_Access); function Get_Ceiling (Object : Protection_Entries_Access) return System.Any_Priority; -- Returns the new ceiling priority of the protected object function Has_Interrupt_Or_Attach_Handler (Object : Protection_Entries_Access) return Boolean; -- Returns True if an Interrupt_Handler or Attach_Handler pragma applies -- to the protected object. That is to say this primitive returns False for -- Protection, but is overriden to return True when interrupt handlers are -- declared so the check required by C.3.1(11) can be implemented in -- System.Tasking.Protected_Objects.Initialize_Protection. procedure Initialize_Protection_Entries (Object : Protection_Entries_Access; Ceiling_Priority : Integer; Compiler_Info : System.Address; Entry_Bodies : Protected_Entry_Body_Access; Find_Body_Index : Find_Body_Index_Access); -- Initialize the Object parameter so that it can be used by the runtime -- to keep track of the runtime state of a protected object. procedure Lock_Entries (Object : Protection_Entries_Access); -- Lock a protected object for write access. Upon return, the caller owns -- the lock to this object, and no other call to Lock or Lock_Read_Only -- with the same argument will return until the corresponding call to -- Unlock has been made by the caller. Program_Error is raised in case of -- ceiling violation. procedure Lock_Entries (Object : Protection_Entries_Access; Ceiling_Violation : out Boolean); -- Same as above, but return the ceiling violation status instead of -- raising Program_Error. procedure Lock_Read_Only_Entries (Object : Protection_Entries_Access); -- Lock a protected object for read access. Upon return, the caller owns -- the lock for read access, and no other calls to Lock with the same -- argument will return until the corresponding call to Unlock has been -- made by the caller. Other calls to Lock_Read_Only may (but need not) -- return before the call to Unlock, and the corresponding callers will -- also own the lock for read access. -- -- Note: we are not currently using this interface, it is provided for -- possible future use. At the current time, everyone uses Lock for both -- read and write locks. procedure Set_Ceiling (Object : Protection_Entries_Access; Prio : System.Any_Priority); -- Sets the new ceiling priority of the protected object procedure Unlock_Entries (Object : Protection_Entries_Access); -- Relinquish ownership of the lock for the object represented by the -- Object parameter. If this ownership was for write access, or if it was -- for read access where there are no other read access locks outstanding, -- one (or more, in the case of Lock_Read_Only) of the tasks waiting on -- this lock (if any) will be given the lock and allowed to return from -- the Lock or Lock_Read_Only call. private procedure Finalize (Object : in out Protection_Entries); -- Clean up a Protection object; in particular, finalize the associated -- Lock object. end System.Tasking.Protected_Objects.Entries;
-- Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with System; package Pck is function Ident (I : Integer) return Integer; procedure Do_Nothing (A : System.Address); end Pck;
procedure Input_1 is generic type T is private; type Index is range <>; type Array_T is array (Index range <>) of T; Null_Value : T; with function Img (A, B: T) return boolean; procedure Generic_Reverse_Array (X : in out Array_T); procedure Generic_Reverse_Array (X : in out Array_T) is begin for I in X'First .. (X'Last + X'First) / 2 loop declare Tmp : T; X_Left : T renames X (I); X_Right : T renames X (X'Last + X'First - I); begin Tmp := X_Left; X_Left := X_Right; X_Right := Tmp; end; end loop; end Generic_Reverse_Array; type Color is (None, Black, Red, Green, Blue, White); type Color_Array is array (Integer range <>) of Color; procedure Reverse_Color_Array is new Generic_Reverse_Array (T => Color, Index => Integer, Array_T => Color_Array, Null_Value => None); type Shape is (None, Circle, Triangle, Square); type Shape_Array is array (Integer range <>) of Shape; procedure Reverse_Shape_Array is new Generic_Reverse_Array (T => Shape, Index => Integer, Array_T => Shape_Array, Null_Value => None); begin null; end Input_1;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . D E C I M A L -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package Ada.Decimal is pragma Pure; -- The compiler makes a number of assumptions based on the following five -- constants (e.g. there is an assumption that decimal values can always -- be represented in 64-bit signed binary form), so code modifications are -- required to increase these constants. Max_Scale : constant := +18; Min_Scale : constant := -18; Min_Delta : constant := 1.0E-18; Max_Delta : constant := 1.0E+18; Max_Decimal_Digits : constant := 18; generic type Dividend_Type is delta <> digits <>; type Divisor_Type is delta <> digits <>; type Quotient_Type is delta <> digits <>; type Remainder_Type is delta <> digits <>; procedure Divide (Dividend : Dividend_Type; Divisor : Divisor_Type; Quotient : out Quotient_Type; Remainder : out Remainder_Type); private pragma Inline (Divide); end Ada.Decimal;
-- CD7101D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT FOR MIN_INT AND MAX_INT IN PACKAGE SYSTEM, -- INTEGER'FIRST >= MIN_INT AND INTEGER'LAST <= MAX_INT. -- HISTORY: -- JET 09/10/87 CREATED ORIGINAL TEST. WITH SYSTEM; WITH REPORT; USE REPORT; PROCEDURE CD7101D IS BEGIN TEST ("CD7101D", "CHECK THAT FOR MIN_INT AND MAX_INT IN PACKAGE " & "SYSTEM, INTEGER'FIRST >= MIN_INT AND INTEGER'" & "LAST <= MAX_INT"); IF INTEGER'POS (INTEGER'FIRST) < SYSTEM.MIN_INT THEN FAILED ("INCORRECT VALUE FOR SYSTEM.MIN_INT"); END IF; IF INTEGER'POS (INTEGER'LAST) > SYSTEM.MAX_INT THEN FAILED ("INCORRECT VALUE FOR SYSTEM.MAX_INT"); END IF; RESULT; END CD7101D;
----------------------------------------------------------------------- -- awa-images-modules -- Image management module -- Copyright (C) 2012, 2016 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with AWA.Modules.Get; with AWA.Applications; with AWA.Storages.Modules; with AWA.Services.Contexts; with AWA.Modules.Beans; with AWA.Images.Beans; with ADO.Sessions; with Util.Strings; with Util.Log.Loggers; package body AWA.Images.Modules is Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Images.Module"); package Register is new AWA.Modules.Beans (Module => Image_Module, Module_Access => Image_Module_Access); -- ------------------------------ -- Job worker procedure to identify an image and generate its thumnbnail. -- ------------------------------ procedure Thumbnail_Worker (Job : in out AWA.Jobs.Services.Abstract_Job_Type'Class) is Module : constant Image_Module_Access := Get_Image_Module; begin Module.Do_Thumbnail_Job (Job); end Thumbnail_Worker; -- ------------------------------ -- Initialize the image module. -- ------------------------------ overriding procedure Initialize (Plugin : in out Image_Module; App : in AWA.Modules.Application_Access; Props : in ASF.Applications.Config) is begin Log.Info ("Initializing the image module"); -- Setup the resource bundles. App.Register ("imageMsg", "images"); Register.Register (Plugin => Plugin, Name => "AWA.Images.Beans.Image_List_Bean", Handler => AWA.Images.Beans.Create_Image_List_Bean'Access); Register.Register (Plugin => Plugin, Name => "AWA.Images.Beans.Image_Bean", Handler => AWA.Images.Beans.Create_Image_Bean'Access); App.Add_Servlet ("image", Plugin.Image_Servlet'Unchecked_Access); AWA.Modules.Module (Plugin).Initialize (App, Props); Plugin.Add_Listener (AWA.Storages.Modules.NAME, Plugin'Unchecked_Access); end Initialize; -- ------------------------------ -- Configures the module after its initialization and after having read its XML configuration. -- ------------------------------ overriding procedure Configure (Plugin : in out Image_Module; Props : in ASF.Applications.Config) is pragma Unreferenced (Props); use type AWA.Jobs.Modules.Job_Module_Access; begin -- Create the image manager when everything is initialized. Plugin.Manager := Plugin.Create_Image_Manager; Plugin.Job_Module := AWA.Jobs.Modules.Get_Job_Module; if Plugin.Job_Module = null then Log.Error ("Cannot find the AWA Job module for the image thumbnail generation"); else Plugin.Job_Module.Register (Definition => Thumbnail_Job_Definition.Factory); end if; end Configure; -- ------------------------------ -- Get the image manager. -- ------------------------------ function Get_Image_Manager (Plugin : in Image_Module) return Services.Image_Service_Access is begin return Plugin.Manager; end Get_Image_Manager; -- ------------------------------ -- Create an image manager. This operation can be overridden to provide another -- image service implementation. -- ------------------------------ function Create_Image_Manager (Plugin : in Image_Module) return Services.Image_Service_Access is Result : constant Services.Image_Service_Access := new Services.Image_Service; begin Result.Initialize (Plugin); return Result; end Create_Image_Manager; -- ------------------------------ -- Create a thumbnail job for the image. -- ------------------------------ procedure Make_Thumbnail_Job (Plugin : in Image_Module; Image : in AWA.Images.Models.Image_Ref'Class) is pragma Unreferenced (Plugin); J : AWA.Jobs.Services.Job_Type; begin J.Set_Parameter ("image_id", Image); J.Schedule (Thumbnail_Job_Definition.Factory.all); end Make_Thumbnail_Job; -- ------------------------------ -- Returns true if the storage file has an image mime type. -- ------------------------------ function Is_Image (File : in AWA.Storages.Models.Storage_Ref'Class) return Boolean is Mime : constant String := File.Get_Mime_Type; Pos : constant Natural := Util.Strings.Index (Mime, '/'); begin if Pos = 0 then return False; else return Mime (Mime'First .. Pos - 1) = "image"; end if; end Is_Image; -- ------------------------------ -- Create an image instance. -- ------------------------------ procedure Create_Image (Plugin : in Image_Module; File : in AWA.Storages.Models.Storage_Ref'Class) is begin if File.Get_Original.Is_Null then declare Ctx : constant AWA.Services.Contexts.Service_Context_Access := AWA.Services.Contexts.Current; DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx); Img : AWA.Images.Models.Image_Ref; begin Img.Set_Width (0); Img.Set_Height (0); Img.Set_Thumb_Height (0); Img.Set_Thumb_Width (0); Img.Set_Storage (File); Img.Set_Folder (File.Get_Folder); Img.Set_Owner (File.Get_Owner); Img.Save (DB); Plugin.Make_Thumbnail_Job (Img); end; end if; end Create_Image; -- ------------------------------ -- The `On_Create` procedure is called by `Notify_Create` to notify the creation of the item. -- ------------------------------ overriding procedure On_Create (Instance : in Image_Module; Item : in AWA.Storages.Models.Storage_Ref'Class) is begin if Is_Image (Item) then Instance.Create_Image (Item); end if; end On_Create; -- ------------------------------ -- The `On_Update` procedure is called by `Notify_Update` to notify the update of the item. -- ------------------------------ overriding procedure On_Update (Instance : in Image_Module; Item : in AWA.Storages.Models.Storage_Ref'Class) is begin if Is_Image (Item) then Instance.Create_Image (Item); else Instance.Manager.Delete_Image (Item); end if; end On_Update; -- ------------------------------ -- The `On_Delete` procedure is called by `Notify_Delete` to notify the deletion of the item. -- ------------------------------ overriding procedure On_Delete (Instance : in Image_Module; Item : in AWA.Storages.Models.Storage_Ref'Class) is begin Instance.Manager.Delete_Image (Item); end On_Delete; -- ------------------------------ -- Thumbnail job to identify the image dimension and produce a thumbnail. -- ------------------------------ procedure Do_Thumbnail_Job (Plugin : in Image_Module; Job : in out AWA.Jobs.Services.Abstract_Job_Type'Class) is Image_Id : constant ADO.Identifier := Job.Get_Parameter ("image_id"); begin Plugin.Manager.Build_Thumbnail (Image_Id); end Do_Thumbnail_Job; -- ------------------------------ -- Get the image module instance associated with the current application. -- ------------------------------ function Get_Image_Module return Image_Module_Access is function Get is new AWA.Modules.Get (Image_Module, Image_Module_Access, NAME); begin return Get; end Get_Image_Module; -- ------------------------------ -- Get the image manager instance associated with the current application. -- ------------------------------ function Get_Image_Manager return Services.Image_Service_Access is Module : constant Image_Module_Access := Get_Image_Module; begin if Module = null then Log.Error ("There is no active Storage_Module"); return null; else return Module.Get_Image_Manager; end if; end Get_Image_Manager; end AWA.Images.Modules;
-- -- 3.3.1 Object Declarations -- -- object_declaration ::= -- defining_identifier_list : [aliased] [constant] subtype_indication [:= expression]; -- | defining_identifier_list : [aliased] [constant] array_type_definition [:= expression]; -- | single_task_declaration -- | single_protected_declaration -- -- defining_identifier_list ::= -- defining_identifier {, defining_identifier} -- -- NOTE: This module is not compilation is used only for testing purposes -- procedure Object_Declaration is -- Example of a multiple object declaration: -- the multiple object declaration John, Paul : Person_Name := new Person(Sex => M); -- see 3.10.1 -- is equivalent to the two single object declarations in the order given John2 : Person_Name := new Person(Sex => M); Paul2 : Person_Name := new Person(Sex => M); -- Examples of variable declarations: Count, Sum : Integer; Size : Integer range 0 .. 10_000 := 0; Sorted : Boolean := False; Color_Table : array(1 .. Max) of Color; Option : Bit_Vector(1 .. 10) := (others => True); Hello : constant String := "Hi, world."; -- Examples of constant declarations: Limit : constant Integer := 10_000; Low_Limit : constant Integer := Limit/10; Tolerance : constant Real := Dispersion(1.15); begin null; end Object_Declaration;
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2014-2016 Vitalij Bondarenko <vibondare@gmail.com> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and/or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ with Interfaces.C.Strings; use Interfaces.C.Strings; package body L10n.Langinfo is ----------------- -- Nl_Langinfo -- ----------------- function Nl_Langinfo (Item : Locale_Item) return String is function Internal (Item : Locale_Item) return chars_ptr; pragma Import (C, Internal, "nl_langinfo"); R : chars_ptr := Internal (Item); begin if R = Null_Ptr then return ""; else return Value (R); end if; exception when others => return ""; end Nl_Langinfo; end L10n.Langinfo;
with Tridiagonal_LU; With Text_IO; use Text_IO; procedure tridiag_tst_1 is type Real is digits 15; package rio is new Text_IO.Float_IO(Real); use rio; Type Index is range 1..40; Package Tri is new Tridiagonal_LU (Real, Index); use Tri; SolutionVector : Column; D : Matrix := (others => (others => 0.0)); A : Matrix; UnitVector : Column; ZeroVector : constant Column := (others => 0.0); Index_First : Index := Index'First; Index_Last : Index := Index'Last; RealMaxIndex : Real; Test : Real; begin Put("Input First Index Of Matrix To Invert. (e.g. 2)"); New_Line; get(RealMaxIndex); Index_First := Index (RealMaxIndex); Put("Input Last Index Of Matrix To Invert. (e.g. 8)"); New_Line; get(RealMaxIndex); Index_Last := Index (RealMaxIndex); -- if Banded_Matrix_Desired then -- Construct a banded matrix: for I in Index loop D(0)(I) := 0.3; end loop; for Row in Index'First..Index'Last loop D(1)(Row) := 0.9; end loop; for Row in Index'First..Index'Last loop D(-1)(Row) := 0.5; end loop; A := D; LU_Decompose (A, Index_First, Index_Last); -- Get Nth column of the inverse matrix -- Col := N; Put("Output should be the Identity matrix."); new_Line; for Col in Index range Index_First..Index_Last loop UnitVector := ZeroVector; UnitVector(Col) := 1.0; Solve (SolutionVector, A, UnitVector, Index_First, Index_Last); New_Line; -- Multiply SolutionVector times tridiagonal D: for Row in Index_First..Index_Last loop Test := 0.0; if Row > Index_First then Test := Test + D(-1)(Row) * SolutionVector(Row-1); end if; Test := Test + D(0)(Row) * SolutionVector(Row); if Row < Index_Last then Test := Test + D(1)(Row) * SolutionVector(Row+1); end if; Put (Test, 2, 3, 3); Put (" "); end loop; end loop; end;
----------------------------------------------------------------------- -- asf-streams -- Print streams for servlets -- Copyright (C) 2010, 2011, 2012, 2013 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Streams; with Ada.Strings.Unbounded; with Ada.Strings.Wide_Wide_Unbounded; with Ada.Finalization; with Util.Streams; with Util.Streams.Texts; with EL.Objects; package ASF.Streams is -- pragma Preelaborate; -- ----------------------- -- Print stream -- ----------------------- -- The <b>Print_Stream</b> is an output stream which provides helper methods -- for writing text streams. type Print_Stream is new Ada.Finalization.Limited_Controlled and Util.Streams.Output_Stream with private; procedure Initialize (Stream : in out Print_Stream; To : in Util.Streams.Texts.Print_Stream_Access); -- Initialize the stream procedure Initialize (Stream : in out Print_Stream; To : in Print_Stream'Class); -- Write an integer on the stream. procedure Write (Stream : in out Print_Stream; Item : in Integer); -- Write a string on the stream. procedure Write (Stream : in out Print_Stream; Item : in Ada.Strings.Unbounded.Unbounded_String); -- Write a string on the stream. procedure Write (Stream : in out Print_Stream; Item : in Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String); -- Write a raw character on the stream. procedure Write (Stream : in out Print_Stream; Char : in Character); -- Write a raw string on the stream. procedure Write (Stream : in out Print_Stream; Item : in String); -- Write a raw string on the stream. procedure Write_Wide (Stream : in out Print_Stream; Item : in Wide_Wide_String); -- Write the object converted into a string on the stream. procedure Write (Stream : in out Print_Stream; Item : in EL.Objects.Object); -- Write the buffer array to the output stream. procedure Write (Stream : in out Print_Stream; Buffer : in Ada.Streams.Stream_Element_Array); -- Flush the buffer by writing on the output stream. -- Raises Data_Error if there is no output stream. procedure Flush (Stream : in out Print_Stream); -- Write into the text stream. procedure Write (Stream : in out Print_Stream; Print : access procedure (Into : in out Util.Streams.Texts.Print_Stream'Class)); -- Close the text stream. overriding procedure Close (Stream : in out Print_Stream); private type Print_Stream is new Ada.Finalization.Limited_Controlled and Util.Streams.Output_Stream with record Target : Util.Streams.Texts.Print_Stream_Access; end record; end ASF.Streams;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . S T R I N G _ O P S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains functions for runtime operations on strings -- (other than runtime comparison, found in s-strcom.ads). -- NOTE: This package is obsolescent. It is no longer used by the compiler -- which now generates concatenation inline. It is retained only because -- it may be used during bootstrapping using old versions of the compiler. pragma Compiler_Unit_Warning; package System.String_Ops is pragma Pure; function Str_Concat (X, Y : String) return String; -- Concatenate two strings and return resulting string function Str_Concat_SC (X : String; Y : Character) return String; -- Concatenate string and character function Str_Concat_CS (X : Character; Y : String) return String; -- Concatenate character and string function Str_Concat_CC (X, Y : Character) return String; -- Concatenate two characters end System.String_Ops;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . N U M E R I C S . G E N E R I C _ C O M P L E X _ T Y P E S -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-1997 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 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ generic type Real is digits <>; package Ada.Numerics.Generic_Complex_Types is pragma Pure (Generic_Complex_Types); type Complex is record Re, Im : Real'Base; end record; pragma Complex_Representation (Complex); type Imaginary is private; i : constant Imaginary; j : constant Imaginary; function Re (X : Complex) return Real'Base; function Im (X : Complex) return Real'Base; function Im (X : Imaginary) return Real'Base; procedure Set_Re (X : in out Complex; Re : in Real'Base); procedure Set_Im (X : in out Complex; Im : in Real'Base); procedure Set_Im (X : out Imaginary; Im : in Real'Base); function Compose_From_Cartesian (Re, Im : Real'Base) return Complex; function Compose_From_Cartesian (Re : Real'Base) return Complex; function Compose_From_Cartesian (Im : Imaginary) return Complex; function Modulus (X : Complex) return Real'Base; function "abs" (Right : Complex) return Real'Base renames Modulus; function Argument (X : Complex) return Real'Base; function Argument (X : Complex; Cycle : Real'Base) return Real'Base; function Compose_From_Polar ( Modulus, Argument : Real'Base) return Complex; function Compose_From_Polar ( Modulus, Argument, Cycle : Real'Base) return Complex; function "+" (Right : Complex) return Complex; function "-" (Right : Complex) return Complex; function Conjugate (X : Complex) return Complex; function "+" (Left, Right : Complex) return Complex; function "-" (Left, Right : Complex) return Complex; function "*" (Left, Right : Complex) return Complex; function "/" (Left, Right : Complex) return Complex; function "**" (Left : Complex; Right : Integer) return Complex; function "+" (Right : Imaginary) return Imaginary; function "-" (Right : Imaginary) return Imaginary; function Conjugate (X : Imaginary) return Imaginary renames "-"; function "abs" (Right : Imaginary) return Real'Base; function "+" (Left, Right : Imaginary) return Imaginary; function "-" (Left, Right : Imaginary) return Imaginary; function "*" (Left, Right : Imaginary) return Real'Base; function "/" (Left, Right : Imaginary) return Real'Base; function "**" (Left : Imaginary; Right : Integer) return Complex; function "<" (Left, Right : Imaginary) return Boolean; function "<=" (Left, Right : Imaginary) return Boolean; function ">" (Left, Right : Imaginary) return Boolean; function ">=" (Left, Right : Imaginary) return Boolean; function "+" (Left : Complex; Right : Real'Base) return Complex; function "+" (Left : Real'Base; Right : Complex) return Complex; function "-" (Left : Complex; Right : Real'Base) return Complex; function "-" (Left : Real'Base; Right : Complex) return Complex; function "*" (Left : Complex; Right : Real'Base) return Complex; function "*" (Left : Real'Base; Right : Complex) return Complex; function "/" (Left : Complex; Right : Real'Base) return Complex; function "/" (Left : Real'Base; Right : Complex) return Complex; function "+" (Left : Complex; Right : Imaginary) return Complex; function "+" (Left : Imaginary; Right : Complex) return Complex; function "-" (Left : Complex; Right : Imaginary) return Complex; function "-" (Left : Imaginary; Right : Complex) return Complex; function "*" (Left : Complex; Right : Imaginary) return Complex; function "*" (Left : Imaginary; Right : Complex) return Complex; function "/" (Left : Complex; Right : Imaginary) return Complex; function "/" (Left : Imaginary; Right : Complex) return Complex; function "+" (Left : Imaginary; Right : Real'Base) return Complex; function "+" (Left : Real'Base; Right : Imaginary) return Complex; function "-" (Left : Imaginary; Right : Real'Base) return Complex; function "-" (Left : Real'Base; Right : Imaginary) return Complex; function "*" (Left : Imaginary; Right : Real'Base) return Imaginary; function "*" (Left : Real'Base; Right : Imaginary) return Imaginary; function "/" (Left : Imaginary; Right : Real'Base) return Imaginary; function "/" (Left : Real'Base; Right : Imaginary) return Imaginary; private type Imaginary is new Real'Base; i : constant Imaginary := 1.0; j : constant Imaginary := 1.0; pragma Inline ("+"); pragma Inline ("-"); pragma Inline ("*"); pragma Inline ("<"); pragma Inline ("<="); pragma Inline (">"); pragma Inline (">="); pragma Inline ("abs"); pragma Inline (Compose_From_Cartesian); pragma Inline (Conjugate); pragma Inline (Im); pragma Inline (Re); pragma Inline (Set_Im); pragma Inline (Set_Re); end Ada.Numerics.Generic_Complex_Types;
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package avx512dqintrin_h is -- Copyright (C) 2014-2017 Free Software Foundation, Inc. -- This file is part of GCC. -- GCC is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- GCC is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- 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/>. -- skipped func _ktest_mask8_u8 -- skipped func _ktestz_mask8_u8 -- skipped func _ktestc_mask8_u8 -- skipped func _ktest_mask16_u8 -- skipped func _ktestz_mask16_u8 -- skipped func _ktestc_mask16_u8 -- skipped func _kortest_mask8_u8 -- skipped func _kortestz_mask8_u8 -- skipped func _kortestc_mask8_u8 -- skipped func _kadd_mask8 -- skipped func _kadd_mask16 -- skipped func _cvtmask8_u32 -- skipped func _cvtu32_mask8 -- skipped func _load_mask8 -- skipped func _store_mask8 -- skipped func _knot_mask8 -- skipped func _kor_mask8 -- skipped func _kxnor_mask8 -- skipped func _kxor_mask8 -- skipped func _kand_mask8 -- skipped func _kandn_mask8 -- skipped func _mm512_broadcast_f64x2 -- skipped func _mm512_mask_broadcast_f64x2 -- skipped func _mm512_maskz_broadcast_f64x2 -- skipped func _mm512_broadcast_i64x2 -- skipped func _mm512_mask_broadcast_i64x2 -- skipped func _mm512_maskz_broadcast_i64x2 -- skipped func _mm512_broadcast_f32x2 -- skipped func _mm512_mask_broadcast_f32x2 -- skipped func _mm512_maskz_broadcast_f32x2 -- skipped func _mm512_broadcast_i32x2 -- skipped func _mm512_mask_broadcast_i32x2 -- skipped func _mm512_maskz_broadcast_i32x2 -- skipped func _mm512_broadcast_f32x8 -- skipped func _mm512_mask_broadcast_f32x8 -- skipped func _mm512_maskz_broadcast_f32x8 -- skipped func _mm512_broadcast_i32x8 -- skipped func _mm512_mask_broadcast_i32x8 -- skipped func _mm512_maskz_broadcast_i32x8 -- skipped func _mm512_mullo_epi64 -- skipped func _mm512_mask_mullo_epi64 -- skipped func _mm512_maskz_mullo_epi64 -- skipped func _mm512_xor_pd -- skipped func _mm512_mask_xor_pd -- skipped func _mm512_maskz_xor_pd -- skipped func _mm512_xor_ps -- skipped func _mm512_mask_xor_ps -- skipped func _mm512_maskz_xor_ps -- skipped func _mm512_or_pd -- skipped func _mm512_mask_or_pd -- skipped func _mm512_maskz_or_pd -- skipped func _mm512_or_ps -- skipped func _mm512_mask_or_ps -- skipped func _mm512_maskz_or_ps -- skipped func _mm512_and_pd -- skipped func _mm512_mask_and_pd -- skipped func _mm512_maskz_and_pd -- skipped func _mm512_and_ps -- skipped func _mm512_mask_and_ps -- skipped func _mm512_maskz_and_ps -- skipped func _mm512_andnot_pd -- skipped func _mm512_mask_andnot_pd -- skipped func _mm512_maskz_andnot_pd -- skipped func _mm512_andnot_ps -- skipped func _mm512_mask_andnot_ps -- skipped func _mm512_maskz_andnot_ps -- skipped func _mm512_movepi32_mask -- skipped func _mm512_movepi64_mask -- skipped func _mm512_movm_epi32 -- skipped func _mm512_movm_epi64 -- skipped func _mm512_cvttpd_epi64 -- skipped func _mm512_mask_cvttpd_epi64 -- skipped func _mm512_maskz_cvttpd_epi64 -- skipped func _mm512_cvttpd_epu64 -- skipped func _mm512_mask_cvttpd_epu64 -- skipped func _mm512_maskz_cvttpd_epu64 -- skipped func _mm512_cvttps_epi64 -- skipped func _mm512_mask_cvttps_epi64 -- skipped func _mm512_maskz_cvttps_epi64 -- skipped func _mm512_cvttps_epu64 -- skipped func _mm512_mask_cvttps_epu64 -- skipped func _mm512_maskz_cvttps_epu64 -- skipped func _mm512_cvtpd_epi64 -- skipped func _mm512_mask_cvtpd_epi64 -- skipped func _mm512_maskz_cvtpd_epi64 -- skipped func _mm512_cvtpd_epu64 -- skipped func _mm512_mask_cvtpd_epu64 -- skipped func _mm512_maskz_cvtpd_epu64 -- skipped func _mm512_cvtps_epi64 -- skipped func _mm512_mask_cvtps_epi64 -- skipped func _mm512_maskz_cvtps_epi64 -- skipped func _mm512_cvtps_epu64 -- skipped func _mm512_mask_cvtps_epu64 -- skipped func _mm512_maskz_cvtps_epu64 -- skipped func _mm512_cvtepi64_ps -- skipped func _mm512_mask_cvtepi64_ps -- skipped func _mm512_maskz_cvtepi64_ps -- skipped func _mm512_cvtepu64_ps -- skipped func _mm512_mask_cvtepu64_ps -- skipped func _mm512_maskz_cvtepu64_ps -- skipped func _mm512_cvtepi64_pd -- skipped func _mm512_mask_cvtepi64_pd -- skipped func _mm512_maskz_cvtepi64_pd -- skipped func _mm512_cvtepu64_pd -- skipped func _mm512_mask_cvtepu64_pd -- skipped func _mm512_maskz_cvtepu64_pd end avx512dqintrin_h;
-- Copyright 2008-2014 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is procedure Do_Nothing (A : System.Address) is begin null; end Do_Nothing; end Pck;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASKING.PROTECTED_OBJECTS.OPERATIONS -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains all the extended primitives related to protected -- objects with entries. -- The handling of protected objects with no entries is done in -- System.Tasking.Protected_Objects, the simple routines for protected -- objects with entries in System.Tasking.Protected_Objects.Entries. The -- split between Entries and Operations is needed to break circular -- dependencies inside the run time. -- Note: the compiler generates direct calls to this interface, via Rtsfind. -- Any changes to this interface may require corresponding compiler changes. with Ada.Exceptions; with System.Tasking.Protected_Objects.Entries; package System.Tasking.Protected_Objects.Operations is pragma Elaborate_Body; type Communication_Block is private; -- Objects of this type are passed between GNARL calls to allow RTS -- information to be preserved. procedure Protected_Entry_Call (Object : Entries.Protection_Entries_Access; E : Protected_Entry_Index; Uninterpreted_Data : System.Address; Mode : Call_Modes; Block : out Communication_Block); -- Make a protected entry call to the specified object. -- Pend a protected entry call on the protected object represented -- by Object. A pended call is not queued; it may be executed immediately -- or queued, depending on the state of the entry barrier. -- -- E -- The index representing the entry to be called. -- -- Uninterpreted_Data -- This will be returned by Next_Entry_Call when this call is serviced. -- It can be used by the compiler to pass information between the -- caller and the server, in particular entry parameters. -- -- Mode -- The kind of call to be pended -- -- Block -- Information passed between runtime calls by the compiler procedure Timed_Protected_Entry_Call (Object : Entries.Protection_Entries_Access; E : Protected_Entry_Index; Uninterpreted_Data : System.Address; Timeout : Duration; Mode : Delay_Modes; Entry_Call_Successful : out Boolean); -- Same as the Protected_Entry_Call but with time-out specified. -- This routines is used when we do not use ATC mechanism to implement -- timed entry calls. procedure Service_Entries (Object : Entries.Protection_Entries_Access); pragma Inline (Service_Entries); procedure PO_Service_Entries (Self_ID : Task_Id; Object : Entries.Protection_Entries_Access; Unlock_Object : Boolean := True); -- Service all entry queues of the specified object, executing the -- corresponding bodies of any queued entry calls that are waiting -- on True barriers. This is used when the state of a protected -- object may have changed, in particular after the execution of -- the statement sequence of a protected procedure. -- -- Note that servicing an entry may change the value of one or more -- barriers, so this routine keeps checking barriers until all of -- them are closed. -- -- This must be called with abort deferred and with the corresponding -- object locked. -- -- If Unlock_Object is set True, then Object is unlocked on return, -- otherwise Object remains locked and the caller is responsible for -- the required unlock. procedure Complete_Entry_Body (Object : Entries.Protection_Entries_Access); -- Called from within an entry body procedure, indicates that the -- corresponding entry call has been serviced. procedure Exceptional_Complete_Entry_Body (Object : Entries.Protection_Entries_Access; Ex : Ada.Exceptions.Exception_Id); -- Perform all of the functions of Complete_Entry_Body. In addition, -- report in Ex the exception whose propagation terminated the entry -- body to the runtime system. procedure Cancel_Protected_Entry_Call (Block : in out Communication_Block); -- Attempt to cancel the most recent protected entry call. If the call is -- not queued abortably, wait until it is or until it has completed. -- If the call is actually cancelled, the called object will be -- locked on return from this call. Get_Cancelled (Block) can be -- used to determine if the cancellation took place; there -- may be entries needing service in this case. -- -- Block passes information between this and other runtime calls. function Enqueued (Block : Communication_Block) return Boolean; -- Returns True if the Protected_Entry_Call which returned the -- specified Block object was queued; False otherwise. function Cancelled (Block : Communication_Block) return Boolean; -- Returns True if the Protected_Entry_Call which returned the -- specified Block object was cancelled, False otherwise. procedure Requeue_Protected_Entry (Object : Entries.Protection_Entries_Access; New_Object : Entries.Protection_Entries_Access; E : Protected_Entry_Index; With_Abort : Boolean); -- If Object = New_Object, queue the protected entry call on Object -- currently being serviced on the queue corresponding to the entry -- represented by E. -- -- If Object /= New_Object, transfer the call to New_Object.E, -- executing or queuing it as appropriate. -- -- With_Abort---True if the call is to be queued abortably, false -- otherwise. procedure Requeue_Task_To_Protected_Entry (New_Object : Entries.Protection_Entries_Access; E : Protected_Entry_Index; With_Abort : Boolean); -- Transfer task entry call currently being serviced to entry E -- on New_Object. -- -- With_Abort---True if the call is to be queued abortably, false -- otherwise. function Protected_Count (Object : Entries.Protection_Entries'Class; E : Protected_Entry_Index) return Natural; -- Return the number of entry calls to E on Object function Protected_Entry_Caller (Object : Entries.Protection_Entries'Class) return Task_Id; -- Return value of E'Caller, where E is the protected entry currently -- being handled. This will only work if called from within an entry -- body, as required by the LRM (C.7.1(14)). -- For internal use only procedure PO_Do_Or_Queue (Self_ID : Task_Id; Object : Entries.Protection_Entries_Access; Entry_Call : Entry_Call_Link); -- This procedure either executes or queues an entry call, depending -- on the status of the corresponding barrier. It assumes that abort -- is deferred and that the specified object is locked. private type Communication_Block is record Self : Task_Id; Enqueued : Boolean := True; Cancelled : Boolean := False; end record; pragma Volatile (Communication_Block); -- When a program contains limited interfaces, the compiler generates the -- predefined primitives associated with dispatching selects. One of the -- parameters of these routines is of type Communication_Block. Even if -- the program lacks implementing concurrent types, the tasking runtime is -- dragged in unconditionally because of Communication_Block. To avoid this -- case, the compiler uses type Dummy_Communication_Block which defined in -- System.Soft_Links. If the structure of Communication_Block is changed, -- the corresponding dummy type must be changed as well. -- The Communication_Block seems to be a relic. At the moment, the -- compiler seems to be generating unnecessary conditional code based on -- this block. See the code generated for async. select with task entry -- call for another way of solving this ??? end System.Tasking.Protected_Objects.Operations;
pragma License (Unrestricted); -- implementation unit required by compiler package System.Task_Info is pragma Preelaborate; -- required for task and pragma Task_Info by compiler (s-parame.ads) type Scope_Type is (Process_Scope, System_Scope, Default_Scope); pragma Discard_Names (Scope_Type); type Task_Info_Type is new Scope_Type; pragma Discard_Names (Task_Info_Type); Unspecified_Task_Info : constant Task_Info_Type := Default_Scope; end System.Task_Info;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements.Generic_Hash; function AMF.CMOF.Classifiers.Hash is new AMF.Elements.Generic_Hash (CMOF_Classifier, CMOF_Classifier_Access);
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . T E X T _ I O . C O M P L E X _ I O -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2009, 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Complex_Types; generic with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>); package Ada.Text_IO.Complex_IO is Default_Fore : Field := 2; Default_Aft : Field := Complex_Types.Real'Digits - 1; Default_Exp : Field := 3; procedure Get (File : File_Type; Item : out Complex_Types.Complex; Width : Field := 0); procedure Get (Item : out Complex_Types.Complex; Width : Field := 0); procedure Put (File : File_Type; Item : Complex_Types.Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Put (Item : Complex_Types.Complex; Fore : Field := Default_Fore; Aft : Field := Default_Aft; Exp : Field := Default_Exp); procedure Get (From : String; Item : out Complex_Types.Complex; Last : out Positive); procedure Put (To : out String; Item : Complex_Types.Complex; Aft : Field := Default_Aft; Exp : Field := Default_Exp); private pragma Inline (Get); pragma Inline (Put); end Ada.Text_IO.Complex_IO;
with Ada.Containers.Vectors; with Ada.Strings.Unbounded; package Command_Line is package S_U renames Ada.Strings.Unbounded; package Input_File_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => S_U.Unbounded_String, "=" => S_U."="); function Parse_Command_Line (Input_Files : out Input_File_Vectors.Vector; Recurse_Projects : out Boolean; Directory_Prefix : out S_U.Unbounded_String; Output_File : out S_U.Unbounded_String) return Boolean; end Command_Line;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Wide_Wide_Text_IO; with Matreshka.Internals.Unicode.Ucd; package body Matreshka.CLDR.AllKeys_Reader is function Parse_Code_Points (Image : Wide_Wide_String; Index : in out Positive) return Matreshka.CLDR.Collation_Data.Code_Point_Array_Access; function Parse_Collation_Elements (Image : Wide_Wide_String; Index : in out Positive) return Matreshka.CLDR.Collation_Data.Collation_Element_Array_Access; procedure Parse_Code_Point (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural; Value : out Matreshka.Internals.Unicode.Code_Point; Success : out Boolean); -- Parses single collation element. procedure Parse_Collation_Element (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural; Value : out Matreshka.CLDR.Collation_Data.Collation_Element; Success : out Boolean); -- Parses single collation element. procedure Parse_Collation_Weight (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural; Value : out Matreshka.Internals.Unicode.Ucd.Collation_Weight; Success : out Boolean); -- Parses hexadecimal collation weight value. procedure Skip_Spaces (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural); -- Skip spaces and comments. ----------------------- -- Load_AllKeys_File -- ----------------------- function Load_AllKeys_File (File_Name : League.Strings.Universal_String) return Matreshka.CLDR.Collation_Data.Collation_Information_Access is use type Matreshka.CLDR.Collation_Data.Collation_Record_Access; Result : Matreshka.CLDR.Collation_Data.Collation_Information_Access; File : Ada.Wide_Wide_Text_IO.File_Type; Buffer : Wide_Wide_String (1 .. 1024); Last : Natural; Current_Record : Matreshka.CLDR.Collation_Data.Collation_Record_Access; Aux_Record : Matreshka.CLDR.Collation_Data.Collation_Record_Access; Index : Positive; begin Result := new Matreshka.CLDR.Collation_Data.Collation_Information; Ada.Wide_Wide_Text_IO.Open (File, Ada.Wide_Wide_Text_IO.In_File, File_Name.To_UTF_8_String, "wcem=8"); while not Ada.Wide_Wide_Text_IO.End_Of_File (File) loop Index := Buffer'First; Ada.Wide_Wide_Text_IO.Get_Line (File, Buffer, Last); Skip_Spaces (Buffer, Index, Last); if Index > Last then -- Skip empty or comment line. null; elsif Buffer (Index) = '@' then -- Ignore @version line. null; else Current_Record := new Matreshka.CLDR.Collation_Data.Collation_Record; Current_Record.Contractors := Parse_Code_Points (Buffer (Index .. Last), Index); Index := Index + 1; Current_Record.Collations := Parse_Collation_Elements (Buffer (Index .. Last), Index); -- Link collation is sorting order. if Result.Lower_Record = null then Result.Lower_Record := Current_Record; Result.Greater_Record := Current_Record; else Current_Record.Less_Or_Equal := Result.Greater_Record; Result.Greater_Record.Greater_Or_Equal := Current_Record; Result.Greater_Record := Current_Record; end if; -- Link collation into the list of code point's collation. Aux_Record := Result.Collations (Current_Record.Contractors (1)); if Aux_Record = null then Result.Collations (Current_Record.Contractors (1)) := Current_Record; else while Aux_Record.Next /= null loop Aux_Record := Aux_Record.Next; end loop; Aux_Record.Next := Current_Record; end if; end if; end loop; Ada.Wide_Wide_Text_IO.Close (File); return Result; end Load_AllKeys_File; ---------------------- -- Parse_Code_Point -- ---------------------- procedure Parse_Code_Point (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural; Value : out Matreshka.Internals.Unicode.Code_Point; Success : out Boolean) is use type Matreshka.Internals.Unicode.Code_Point; begin Success := False; Value := 0; Skip_Spaces (Buffer, Index, Last); while Index <= Last loop case Buffer (Index) is when '0' .. '9' => Success := True; Value := Value * 16 + Wide_Wide_Character'Pos (Buffer (Index)) - Wide_Wide_Character'Pos ('0'); when 'A' .. 'F' => Success := True; Value := Value * 16 + Wide_Wide_Character'Pos (Buffer (Index)) - Wide_Wide_Character'Pos ('A') + 10; when 'a' .. 'f' => Success := True; Value := Value * 16 + Wide_Wide_Character'Pos (Buffer (Index)) - Wide_Wide_Character'Pos ('a') + 10; when others => exit; end case; Index := Index + 1; end loop; end Parse_Code_Point; ----------------------- -- Parse_Code_Points -- ----------------------- function Parse_Code_Points (Image : Wide_Wide_String; Index : in out Positive) return Matreshka.CLDR.Collation_Data.Code_Point_Array_Access is Result : Matreshka.CLDR.Collation_Data.Code_Point_Array (1 .. 3); Used : Natural := 0; Success : Boolean; begin loop Skip_Spaces (Image, Index, Image'Last); exit when Index > Image'Last; exit when Image (Index) = ';'; Parse_Code_Point (Image, Index, Image'Last, Result (Used + 1), Success); if not Success then raise Program_Error; end if; Used := Used + 1; end loop; return new Matreshka.CLDR.Collation_Data.Code_Point_Array' (Result (1 .. Used)); end Parse_Code_Points; ----------------------------- -- Parse_Collation_Element -- ----------------------------- procedure Parse_Collation_Element (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural; Value : out Matreshka.CLDR.Collation_Data.Collation_Element; Success : out Boolean) is begin Value := (False, 0, 0, 0, 0); Success := False; if Index > Last or else Buffer (Index) /= '[' then return; end if; Index := Index + 1; case Buffer (Index) is when '*' => Value.Is_Variable := True; when '.' => Value.Is_Variable := False; when others => return; end case; Index := Index + 1; Parse_Collation_Weight (Buffer, Index, Last, Value.Primary, Success); if not Success then return; end if; if Buffer (Index) /= '.' then Success := False; return; end if; Index := Index + 1; Parse_Collation_Weight (Buffer, Index, Last, Value.Secondary, Success); if not Success then return; end if; if Buffer (Index) /= '.' then Success := False; return; end if; Index := Index + 1; Parse_Collation_Weight (Buffer, Index, Last, Value.Trinary, Success); if not Success then return; end if; if Buffer (Index) /= '.' then Success := False; return; end if; Index := Index + 1; Parse_Code_Point (Buffer, Index, Last, Value.Code, Success); if not Success then return; end if; if Buffer (Index) /= ']' then Success := False; return; end if; Index := Index + 1; end Parse_Collation_Element; ------------------------------ -- Parse_Collation_Elements -- ------------------------------ function Parse_Collation_Elements (Image : Wide_Wide_String; Index : in out Positive) return Matreshka.CLDR.Collation_Data.Collation_Element_Array_Access is Result : Matreshka.CLDR.Collation_Data.Collation_Element_Array (1 .. 18); Used : Natural := 0; Success : Boolean; begin loop Skip_Spaces (Image, Index, Image'Last); exit when Index > Image'Last; Parse_Collation_Element (Image, Index, Image'Last, Result (Used + 1), Success); if not Success then raise Program_Error; end if; Used := Used + 1; end loop; return new Matreshka.CLDR.Collation_Data.Collation_Element_Array' (Result (1 .. Used)); end Parse_Collation_Elements; ---------------------------- -- Parse_Collation_Weight -- ---------------------------- procedure Parse_Collation_Weight (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural; Value : out Matreshka.Internals.Unicode.Ucd.Collation_Weight; Success : out Boolean) is use type Matreshka.Internals.Unicode.Ucd.Collation_Weight; begin Value := 0; Success := False; while Index <= Last loop case Buffer (Index) is when '0' .. '9' => Success := True; Value := Value * 16 + Wide_Wide_Character'Pos (Buffer (Index)) - Wide_Wide_Character'Pos ('0'); when 'A' .. 'F' => Success := True; Value := Value * 16 + Wide_Wide_Character'Pos (Buffer (Index)) - Wide_Wide_Character'Pos ('A') + 10; when 'a' .. 'f' => Success := True; Value := Value * 16 + Wide_Wide_Character'Pos (Buffer (Index)) - Wide_Wide_Character'Pos ('a') + 10; when others => exit; end case; Index := Index + 1; end loop; end Parse_Collation_Weight; ----------------- -- Skip_Spaces -- ----------------- procedure Skip_Spaces (Buffer : Wide_Wide_String; Index : in out Positive; Last : Natural) is begin while Index <= Last loop case Buffer (Index) is when ' ' => Index := Index + 1; when '#' | '%' => Index := Last + 1; return; when others => return; end case; end loop; end Skip_Spaces; end Matreshka.CLDR.AllKeys_Reader;
package impact.d3.triangle_Callback -- -- Provides a callback for each overlapping triangle when calling processAllTriangles. -- -- This callback is called by processAllTriangles for all 'impact.d3.Shape.concave' derived class, -- such as 'impact.d3.Shape.concave.triangle_mesh.bvh', -- 'impact.d3.Shape.concave.static_plane' and -- 'impact.d3.Shape.concave.height_field_terrain'. -- is type Item is abstract tagged null record; procedure destruct (Self : in out Item) is null; procedure processTriangle (Self : in out Item; triangle : access math.Matrix_3x3; -- each row is a vertex ... tbd: improve ? partId : in Integer; triangleIndex : in Integer) is abstract; type btInternalTriangleIndexCallback is abstract tagged null record; procedure destruct (Self : in out btInternalTriangleIndexCallback) is null; procedure internalProcessTriangleIndex (Self : in out btInternalTriangleIndexCallback; triangle : access math.Matrix_3x3; partId : in Integer; triangleIndex : in Integer) is null; end impact.d3.triangle_Callback;
with DOM.Core; with Route_Aggregator; use Route_Aggregator; with Route_Aggregator_Communication; use Route_Aggregator_Communication; with Route_Aggregator_Common; use Route_Aggregator_Common; with Ada.Containers.Ordered_Maps; with Ada.Containers.Ordered_Sets; with AVTAS.LMCP.Types; with AFRL.CMASI.EntityState; use AFRL.CMASI.EntityState; with Afrl.Cmasi.EntityConfiguration; use Afrl.Cmasi.EntityConfiguration; with Uxas.Messages.Lmcptask.UniqueAutomationRequest; use Uxas.Messages.Lmcptask.UniqueAutomationRequest; with UxAS.Messages.Lmcptask.TaskPlanOptions; use UxAS.Messages.Lmcptask.TaskPlanOptions; package UxAS.Comms.LMCP_Net_Client.Service.Route_Aggregation is type Route_Aggregator_Service is new Service_Base with private; Type_Name : constant String := "RouteAggregatorService"; Directory_Name : constant String := ""; -- static const std::vector<std::string> -- s_registryServiceTypeNames() function Registry_Service_Type_Names return Service_Type_Names_List; -- static ServiceBase* -- create() function Create return Any_Service; private type Route_Aggregator_Service is new Service_Base with record -- the following types are defined in SPARK code Mailbox : Route_Aggregator_Mailbox; State : Route_Aggregator_State; Config : Route_Aggregator_Configuration_Data; end record; overriding procedure Configure (This : in out Route_Aggregator_Service; XML_Node : DOM.Core.Element; Result : out Boolean); overriding procedure Initialize (This : in out Route_Aggregator_Service; Result : out Boolean); overriding procedure Process_Received_LMCP_Message (This : in out Route_Aggregator_Service; Received_Message : not null Any_LMCP_Message; Should_Terminate : out Boolean); end UxAS.Comms.LMCP_Net_Client.Service.Route_Aggregation;
------------------------------------------------------------------------------ -- -- -- Unicode Utilities -- -- -- -- Case Folding Utilities -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package Unicode.Case_Folding with Pure is end;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P R J . A T T R . P M -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2010, 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 body Prj.Attr.PM is ------------------- -- Add_Attribute -- ------------------- procedure Add_Attribute (To_Package : Package_Node_Id; Attribute_Name : Name_Id; Attribute_Node : out Attribute_Node_Id) is begin -- Only add attribute if package is already defined and is not unknown if To_Package /= Empty_Package and then To_Package /= Unknown_Package then Attrs.Append ( (Name => Attribute_Name, Var_Kind => Undefined, Optional_Index => False, Attr_Kind => Unknown, Read_Only => False, Others_Allowed => False, Next => Package_Attributes.Table (To_Package.Value).First_Attribute)); Package_Attributes.Table (To_Package.Value).First_Attribute := Attrs.Last; Attribute_Node := (Value => Attrs.Last); end if; end Add_Attribute; ------------------------- -- Add_Unknown_Package -- ------------------------- procedure Add_Unknown_Package (Name : Name_Id; Id : out Package_Node_Id) is begin Package_Attributes.Increment_Last; Id := (Value => Package_Attributes.Last); Package_Attributes.Table (Id.Value) := (Name => Name, Known => False, First_Attribute => Empty_Attr); end Add_Unknown_Package; end Prj.Attr.PM;
----------------------------------------------------------------------- -- akt-commands-list -- List commands to report database information for admin tool -- Copyright (C) 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Strings; with ADO.Sessions; with ADO.Statements; with ADO.Schemas; with ADO.Queries; with AWA.Commands.Models; package body AWA.Commands.List is procedure List (Command : in out Command_Type; Context : in out Context_Type; Session : in out ADO.Sessions.Master_Session; Query : in ADO.Queries.Context; Prefix : in String); procedure Database_Summary (Command : in out Command_Type; Context : in out Context_Type; Session : in out ADO.Sessions.Master_Session); -- ------------------------------ -- List some database information. -- ------------------------------ overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type) is begin Command_Drivers.Application_Command_Type (Command).Execute (Name, Args, Context); end Execute; overriding procedure Execute (Command : in out Command_Type; Application : in out AWA.Applications.Application'Class; Args : in Argument_List'Class; Context : in out Context_Type) is pragma Unreferenced (Args); Session : ADO.Sessions.Master_Session; Query : ADO.Queries.Context; begin Application.Load_Bundle (Name => "commands", Locale => "en", Bundle => Command.Bundle); Session := Application.Get_Master_Session; if Command.List_Users then Query.Set_Query (AWA.Commands.Models.Query_Command_User_List); List (Command, Context, Session, Query, "command_user_list_"); end if; if Command.List_Sessions then Query.Set_Query (AWA.Commands.Models.Query_Command_Session_List); List (Command, Context, Session, Query, "command_session_list_"); end if; if Command.List_Jobs then Query.Set_Query (AWA.Commands.Models.Query_Command_Job_List); List (Command, Context, Session, Query, "command_job_list_"); end if; if Command.List_Tables then Database_Summary (Command, Context, Session); end if; end Execute; procedure List (Command : in out Command_Type; Context : in out Context_Type; Session : in out ADO.Sessions.Master_Session; Query : in ADO.Queries.Context; Prefix : in String) is function Get_Label (Name : in String) return String; function Get_Label (Name : in String) return String is Result : constant String := Command.Bundle.Get (Prefix & Name); begin if Util.Strings.Index (Result, ':') > 0 then return Result; else return Result & ":10"; end if; end Get_Label; Statement : ADO.Statements.Query_Statement; Print_Names : Boolean := True; begin Statement := Session.Create_Statement (Query); Statement.Execute; while Statement.Has_Elements loop if Print_Names then Context.Console.Start_Title; for I in 1 .. Statement.Get_Column_Count loop declare Info : constant String := Get_Label (Statement.Get_Column_Name (I - 1)); Pos : constant Natural := Util.Strings.Index (Info, ':'); begin Context.Console.Print_Title (Field_Number (I), Info (Info'First .. Pos - 1), Natural'Value (Info (Pos + 1 .. Info'Last))); end; end loop; Context.Console.End_Title; Print_Names := False; end if; Context.Console.Start_Row; for I in 1 .. Statement.Get_Column_Count loop if not Statement.Is_Null (I - 1) then Context.Console.Print_Field (Field_Number (I), Statement.Get_String (I - 1)); end if; end loop; Context.Console.End_Row; Statement.Next; end loop; end List; procedure Database_Summary (Command : in out Command_Type; Context : in out Context_Type; Session : in out ADO.Sessions.Master_Session) is pragma Unreferenced (Command); use ADO.Schemas; Schema : ADO.Schemas.Schema_Definition; Iter : Table_Cursor; Col : Field_Number := 1; begin Session.Load_Schema (Schema); Context.Console.Start_Title; Context.Console.Print_Title (1, "Table", 30); Context.Console.Print_Title (2, " Count", 8); Context.Console.Print_Title (3, "", 3); Context.Console.Print_Title (4, "Table", 30); Context.Console.Print_Title (5, " Count", 8); Context.Console.End_Title; -- Dump the database schema using SQL create table forms. Iter := Get_Tables (Schema); while Has_Element (Iter) loop declare Table : constant Table_Definition := Element (Iter); Count : Natural; Statement : ADO.Statements.Query_Statement; begin if Col = 1 then Context.Console.Start_Row; end if; Context.Console.Print_Field (Col, Get_Name (Table)); Statement := Session.Create_Statement ("SELECT COUNT(*) FROM " & Get_Name (Table)); Statement.Execute; Count := Statement.Get_Integer (0); Context.Console.Print_Field (Col + 1, Count, Consoles.J_RIGHT); if Col >= 3 then Context.Console.End_Row; Col := 1; else Context.Console.Print_Field (Col + 2, ""); Col := Col + 3; end if; end; Next (Iter); end loop; if Col /= 1 then Context.Console.End_Row; end if; end Database_Summary; -- ------------------------------ -- Setup the command before parsing the arguments and executing it. -- ------------------------------ overriding procedure Setup (Command : in out Command_Type; Config : in out GNAT.Command_Line.Command_Line_Configuration; Context : in out Context_Type) is begin GC.Set_Usage (Config => Config, Usage => Command.Get_Name & " [arguments]", Help => Command.Get_Description); Command_Drivers.Application_Command_Type (Command).Setup (Config, Context); GC.Define_Switch (Config => Config, Output => Command.List_Users'Access, Switch => "-u", Long_Switch => "--users", Help => -("List the users")); GC.Define_Switch (Config => Config, Output => Command.List_Jobs'Access, Switch => "-j", Long_Switch => "--jobs", Help => -("List the jobs")); GC.Define_Switch (Config => Config, Output => Command.List_Sessions'Access, Switch => "-s", Long_Switch => "--sessions", Help => -("List the sessions")); GC.Define_Switch (Config => Config, Output => Command.List_Tables'Access, Switch => "-t", Long_Switch => "--tables", Help => -("List the database tables")); end Setup; -- ------------------------------ -- Write the help associated with the command. -- ------------------------------ overriding procedure Help (Command : in out Command_Type; Name : in String; Context : in out Context_Type) is pragma Unreferenced (Command, Context); begin null; end Help; begin Command_Drivers.Driver.Add_Command ("list", -("list information"), Command'Access); end AWA.Commands.List;
-- Copyright 2010-2021 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Pck is type Shape is abstract tagged record X, Y: Integer; end record; function Position_X (S : in Shape) return Integer; type Circle is new Shape with record R : Integer; end record; function Area (C : in Circle) return Integer; end Pck;
with Ada.Text_IO; use Ada.Text_IO; procedure Test is procedure P(x,y,:integer) is begin x := 0; end; begin P(0); end;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S E M -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2016, 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 Atree; use Atree; with Debug; use Debug; with Debug_A; use Debug_A; with Elists; use Elists; with Exp_SPARK; use Exp_SPARK; with Expander; use Expander; with Fname; use Fname; with Ghost; use Ghost; with Lib; use Lib; with Lib.Load; use Lib.Load; with Nlists; use Nlists; with Output; use Output; with Restrict; use Restrict; with Sem_Attr; use Sem_Attr; with Sem_Aux; use Sem_Aux; with Sem_Ch2; use Sem_Ch2; with Sem_Ch3; use Sem_Ch3; with Sem_Ch4; use Sem_Ch4; with Sem_Ch5; use Sem_Ch5; with Sem_Ch6; use Sem_Ch6; with Sem_Ch7; use Sem_Ch7; with Sem_Ch8; use Sem_Ch8; with Sem_Ch9; use Sem_Ch9; with Sem_Ch10; use Sem_Ch10; with Sem_Ch11; use Sem_Ch11; with Sem_Ch12; use Sem_Ch12; with Sem_Ch13; use Sem_Ch13; with Sem_Prag; use Sem_Prag; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Stand; use Stand; with Stylesw; use Stylesw; with Uintp; use Uintp; with Uname; use Uname; with Unchecked_Deallocation; pragma Warnings (Off, Sem_Util); -- Suppress warnings of unused with for Sem_Util (used only in asserts) package body Sem is Debug_Unit_Walk : Boolean renames Debug_Flag_Dot_WW; -- Controls debugging printouts for Walk_Library_Items Outer_Generic_Scope : Entity_Id := Empty; -- Global reference to the outer scope that is generic. In a non-generic -- context, it is empty. At the moment, it is only used for avoiding -- freezing of external references in generics. Comp_Unit_List : Elist_Id := No_Elist; -- Used by Walk_Library_Items. This is a list of N_Compilation_Unit nodes -- processed by Semantics, in an appropriate order. Initialized to -- No_Elist, because it's too early to call New_Elmt_List; we will set it -- to New_Elmt_List on first use. generic with procedure Action (Withed_Unit : Node_Id); procedure Walk_Withs_Immediate (CU : Node_Id; Include_Limited : Boolean); -- Walk all the with clauses of CU, and call Action for the with'ed unit. -- Ignore limited withs, unless Include_Limited is True. CU must be an -- N_Compilation_Unit. generic with procedure Action (Withed_Unit : Node_Id); procedure Walk_Withs (CU : Node_Id; Include_Limited : Boolean); -- Same as Walk_Withs_Immediate, but also include with clauses on subunits -- of this unit, since they count as dependences on their parent library -- item. CU must be an N_Compilation_Unit whose Unit is not an N_Subunit. ------------- -- Analyze -- ------------- -- WARNING: This routine manages Ghost regions. Return statements must be -- replaced by gotos which jump to the end of the routine and restore the -- Ghost mode. procedure Analyze (N : Node_Id) is Mode : Ghost_Mode_Type; Mode_Set : Boolean := False; begin Debug_A_Entry ("analyzing ", N); -- Immediate return if already analyzed if Analyzed (N) then Debug_A_Exit ("analyzing ", N, " (done, analyzed already)"); return; end if; -- A declaration may be subject to pragma Ghost. Set the mode now to -- ensure that any nodes generated during analysis and expansion are -- marked as Ghost. if Is_Declaration (N) then Mark_And_Set_Ghost_Declaration (N, Mode); Mode_Set := True; end if; -- Otherwise processing depends on the node kind case Nkind (N) is when N_Abort_Statement => Analyze_Abort_Statement (N); when N_Abstract_Subprogram_Declaration => Analyze_Abstract_Subprogram_Declaration (N); when N_Accept_Alternative => Analyze_Accept_Alternative (N); when N_Accept_Statement => Analyze_Accept_Statement (N); when N_Aggregate => Analyze_Aggregate (N); when N_Allocator => Analyze_Allocator (N); when N_And_Then => Analyze_Short_Circuit (N); when N_Assignment_Statement => Analyze_Assignment (N); when N_Asynchronous_Select => Analyze_Asynchronous_Select (N); when N_At_Clause => Analyze_At_Clause (N); when N_Attribute_Reference => Analyze_Attribute (N); when N_Attribute_Definition_Clause => Analyze_Attribute_Definition_Clause (N); when N_Block_Statement => Analyze_Block_Statement (N); when N_Case_Expression => Analyze_Case_Expression (N); when N_Case_Statement => Analyze_Case_Statement (N); when N_Character_Literal => Analyze_Character_Literal (N); when N_Code_Statement => Analyze_Code_Statement (N); when N_Compilation_Unit => Analyze_Compilation_Unit (N); when N_Component_Declaration => Analyze_Component_Declaration (N); when N_Compound_Statement => Analyze_Compound_Statement (N); when N_Conditional_Entry_Call => Analyze_Conditional_Entry_Call (N); when N_Delay_Alternative => Analyze_Delay_Alternative (N); when N_Delay_Relative_Statement => Analyze_Delay_Relative (N); when N_Delay_Until_Statement => Analyze_Delay_Until (N); when N_Delta_Aggregate => Analyze_Aggregate (N); when N_Entry_Body => Analyze_Entry_Body (N); when N_Entry_Body_Formal_Part => Analyze_Entry_Body_Formal_Part (N); when N_Entry_Call_Alternative => Analyze_Entry_Call_Alternative (N); when N_Entry_Declaration => Analyze_Entry_Declaration (N); when N_Entry_Index_Specification => Analyze_Entry_Index_Specification (N); when N_Enumeration_Representation_Clause => Analyze_Enumeration_Representation_Clause (N); when N_Exception_Declaration => Analyze_Exception_Declaration (N); when N_Exception_Renaming_Declaration => Analyze_Exception_Renaming (N); when N_Exit_Statement => Analyze_Exit_Statement (N); when N_Expanded_Name => Analyze_Expanded_Name (N); when N_Explicit_Dereference => Analyze_Explicit_Dereference (N); when N_Expression_Function => Analyze_Expression_Function (N); when N_Expression_With_Actions => Analyze_Expression_With_Actions (N); when N_Extended_Return_Statement => Analyze_Extended_Return_Statement (N); when N_Extension_Aggregate => Analyze_Aggregate (N); when N_Formal_Object_Declaration => Analyze_Formal_Object_Declaration (N); when N_Formal_Package_Declaration => Analyze_Formal_Package_Declaration (N); when N_Formal_Subprogram_Declaration => Analyze_Formal_Subprogram_Declaration (N); when N_Formal_Type_Declaration => Analyze_Formal_Type_Declaration (N); when N_Free_Statement => Analyze_Free_Statement (N); when N_Freeze_Entity => Analyze_Freeze_Entity (N); when N_Freeze_Generic_Entity => Analyze_Freeze_Generic_Entity (N); when N_Full_Type_Declaration => Analyze_Full_Type_Declaration (N); when N_Function_Call => Analyze_Function_Call (N); when N_Function_Instantiation => Analyze_Function_Instantiation (N); when N_Generic_Function_Renaming_Declaration => Analyze_Generic_Function_Renaming (N); when N_Generic_Package_Declaration => Analyze_Generic_Package_Declaration (N); when N_Generic_Package_Renaming_Declaration => Analyze_Generic_Package_Renaming (N); when N_Generic_Procedure_Renaming_Declaration => Analyze_Generic_Procedure_Renaming (N); when N_Generic_Subprogram_Declaration => Analyze_Generic_Subprogram_Declaration (N); when N_Goto_Statement => Analyze_Goto_Statement (N); when N_Handled_Sequence_Of_Statements => Analyze_Handled_Statements (N); when N_Identifier => Analyze_Identifier (N); when N_If_Expression => Analyze_If_Expression (N); when N_If_Statement => Analyze_If_Statement (N); when N_Implicit_Label_Declaration => Analyze_Implicit_Label_Declaration (N); when N_In => Analyze_Membership_Op (N); when N_Incomplete_Type_Declaration => Analyze_Incomplete_Type_Decl (N); when N_Indexed_Component => Analyze_Indexed_Component_Form (N); when N_Integer_Literal => Analyze_Integer_Literal (N); when N_Iterator_Specification => Analyze_Iterator_Specification (N); when N_Itype_Reference => Analyze_Itype_Reference (N); when N_Label => Analyze_Label (N); when N_Loop_Parameter_Specification => Analyze_Loop_Parameter_Specification (N); when N_Loop_Statement => Analyze_Loop_Statement (N); when N_Not_In => Analyze_Membership_Op (N); when N_Null => Analyze_Null (N); when N_Null_Statement => Analyze_Null_Statement (N); when N_Number_Declaration => Analyze_Number_Declaration (N); when N_Object_Declaration => Analyze_Object_Declaration (N); when N_Object_Renaming_Declaration => Analyze_Object_Renaming (N); when N_Operator_Symbol => Analyze_Operator_Symbol (N); when N_Op_Abs => Analyze_Unary_Op (N); when N_Op_Add => Analyze_Arithmetic_Op (N); when N_Op_And => Analyze_Logical_Op (N); when N_Op_Concat => Analyze_Concatenation (N); when N_Op_Divide => Analyze_Arithmetic_Op (N); when N_Op_Eq => Analyze_Equality_Op (N); when N_Op_Expon => Analyze_Arithmetic_Op (N); when N_Op_Ge => Analyze_Comparison_Op (N); when N_Op_Gt => Analyze_Comparison_Op (N); when N_Op_Le => Analyze_Comparison_Op (N); when N_Op_Lt => Analyze_Comparison_Op (N); when N_Op_Minus => Analyze_Unary_Op (N); when N_Op_Mod => Analyze_Mod (N); when N_Op_Multiply => Analyze_Arithmetic_Op (N); when N_Op_Ne => Analyze_Equality_Op (N); when N_Op_Not => Analyze_Negation (N); when N_Op_Or => Analyze_Logical_Op (N); when N_Op_Plus => Analyze_Unary_Op (N); when N_Op_Rem => Analyze_Arithmetic_Op (N); when N_Op_Rotate_Left => Analyze_Arithmetic_Op (N); when N_Op_Rotate_Right => Analyze_Arithmetic_Op (N); when N_Op_Shift_Left => Analyze_Arithmetic_Op (N); when N_Op_Shift_Right => Analyze_Arithmetic_Op (N); when N_Op_Shift_Right_Arithmetic => Analyze_Arithmetic_Op (N); when N_Op_Subtract => Analyze_Arithmetic_Op (N); when N_Op_Xor => Analyze_Logical_Op (N); when N_Or_Else => Analyze_Short_Circuit (N); when N_Others_Choice => Analyze_Others_Choice (N); when N_Package_Body => Analyze_Package_Body (N); when N_Package_Body_Stub => Analyze_Package_Body_Stub (N); when N_Package_Declaration => Analyze_Package_Declaration (N); when N_Package_Instantiation => Analyze_Package_Instantiation (N); when N_Package_Renaming_Declaration => Analyze_Package_Renaming (N); when N_Package_Specification => Analyze_Package_Specification (N); when N_Parameter_Association => Analyze_Parameter_Association (N); when N_Pragma => Analyze_Pragma (N); when N_Private_Extension_Declaration => Analyze_Private_Extension_Declaration (N); when N_Private_Type_Declaration => Analyze_Private_Type_Declaration (N); when N_Procedure_Call_Statement => Analyze_Procedure_Call (N); when N_Procedure_Instantiation => Analyze_Procedure_Instantiation (N); when N_Protected_Body => Analyze_Protected_Body (N); when N_Protected_Body_Stub => Analyze_Protected_Body_Stub (N); when N_Protected_Definition => Analyze_Protected_Definition (N); when N_Protected_Type_Declaration => Analyze_Protected_Type_Declaration (N); when N_Qualified_Expression => Analyze_Qualified_Expression (N); when N_Quantified_Expression => Analyze_Quantified_Expression (N); when N_Raise_Expression => Analyze_Raise_Expression (N); when N_Raise_Statement => Analyze_Raise_Statement (N); when N_Raise_xxx_Error => Analyze_Raise_xxx_Error (N); when N_Range => Analyze_Range (N); when N_Range_Constraint => Analyze_Range (Range_Expression (N)); when N_Real_Literal => Analyze_Real_Literal (N); when N_Record_Representation_Clause => Analyze_Record_Representation_Clause (N); when N_Reference => Analyze_Reference (N); when N_Requeue_Statement => Analyze_Requeue (N); when N_Simple_Return_Statement => Analyze_Simple_Return_Statement (N); when N_Selected_Component => Find_Selected_Component (N); -- ??? why not Analyze_Selected_Component, needs comments when N_Selective_Accept => Analyze_Selective_Accept (N); when N_Single_Protected_Declaration => Analyze_Single_Protected_Declaration (N); when N_Single_Task_Declaration => Analyze_Single_Task_Declaration (N); when N_Slice => Analyze_Slice (N); when N_String_Literal => Analyze_String_Literal (N); when N_Subprogram_Body => Analyze_Subprogram_Body (N); when N_Subprogram_Body_Stub => Analyze_Subprogram_Body_Stub (N); when N_Subprogram_Declaration => Analyze_Subprogram_Declaration (N); when N_Subprogram_Renaming_Declaration => Analyze_Subprogram_Renaming (N); when N_Subtype_Declaration => Analyze_Subtype_Declaration (N); when N_Subtype_Indication => Analyze_Subtype_Indication (N); when N_Subunit => Analyze_Subunit (N); when N_Target_Name => Analyze_Target_Name (N); when N_Task_Body => Analyze_Task_Body (N); when N_Task_Body_Stub => Analyze_Task_Body_Stub (N); when N_Task_Definition => Analyze_Task_Definition (N); when N_Task_Type_Declaration => Analyze_Task_Type_Declaration (N); when N_Terminate_Alternative => Analyze_Terminate_Alternative (N); when N_Timed_Entry_Call => Analyze_Timed_Entry_Call (N); when N_Triggering_Alternative => Analyze_Triggering_Alternative (N); when N_Type_Conversion => Analyze_Type_Conversion (N); when N_Unchecked_Expression => Analyze_Unchecked_Expression (N); when N_Unchecked_Type_Conversion => Analyze_Unchecked_Type_Conversion (N); when N_Use_Package_Clause => Analyze_Use_Package (N); when N_Use_Type_Clause => Analyze_Use_Type (N); when N_Validate_Unchecked_Conversion => null; when N_Variant_Part => Analyze_Variant_Part (N); when N_With_Clause => Analyze_With_Clause (N); -- A call to analyze the Empty node is an error, but most likely it -- is an error caused by an attempt to analyze a malformed piece of -- tree caused by some other error, so if there have been any other -- errors, we just ignore it, otherwise it is a real internal error -- which we complain about. -- We must also consider the case of call to a runtime function that -- is not available in the configurable runtime. when N_Empty => pragma Assert (Serious_Errors_Detected /= 0 or else Configurable_Run_Time_Violations /= 0); null; -- A call to analyze the error node is simply ignored, to avoid -- causing cascaded errors (happens of course only in error cases) -- Disable expansion in case it is still enabled, to prevent other -- subsequent compiler glitches. when N_Error => Expander_Mode_Save_And_Set (False); null; -- Push/Pop nodes normally don't come through an analyze call. An -- exception is the dummy ones bracketing a subprogram body. In any -- case there is nothing to be done to analyze such nodes. when N_Push_Pop_xxx_Label => null; -- SCIL nodes don't need analysis because they are decorated when -- they are built. They are added to the tree by Insert_Actions and -- the call to analyze them is generated when the full list is -- analyzed. when N_SCIL_Dispatch_Table_Tag_Init | N_SCIL_Dispatching_Call | N_SCIL_Membership_Test => null; -- For the remaining node types, we generate compiler abort, because -- these nodes are always analyzed within the Sem_Chn routines and -- there should never be a case of making a call to the main Analyze -- routine for these node kinds. For example, an N_Access_Definition -- node appears only in the context of a type declaration, and is -- processed by the analyze routine for type declarations. when N_Abortable_Part | N_Access_Definition | N_Access_Function_Definition | N_Access_Procedure_Definition | N_Access_To_Object_Definition | N_Aspect_Specification | N_Case_Expression_Alternative | N_Case_Statement_Alternative | N_Compilation_Unit_Aux | N_Component_Association | N_Component_Clause | N_Component_Definition | N_Component_List | N_Constrained_Array_Definition | N_Contract | N_Decimal_Fixed_Point_Definition | N_Defining_Character_Literal | N_Defining_Identifier | N_Defining_Operator_Symbol | N_Defining_Program_Unit_Name | N_Delta_Constraint | N_Derived_Type_Definition | N_Designator | N_Digits_Constraint | N_Discriminant_Association | N_Discriminant_Specification | N_Elsif_Part | N_Entry_Call_Statement | N_Enumeration_Type_Definition | 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_Private_Type_Definition | N_Formal_Incomplete_Type_Definition | N_Formal_Signed_Integer_Type_Definition | N_Function_Specification | N_Generic_Association | N_Index_Or_Discriminant_Constraint | N_Iterated_Component_Association | N_Iteration_Scheme | N_Mod_Clause | N_Modular_Type_Definition | N_Ordinary_Fixed_Point_Definition | N_Parameter_Specification | N_Pragma_Argument_Association | N_Procedure_Specification | N_Real_Range_Specification | N_Record_Definition | N_Signed_Integer_Type_Definition | N_Unconstrained_Array_Definition | N_Unused_At_End | N_Unused_At_Start | N_Variant => raise Program_Error; end case; Debug_A_Exit ("analyzing ", N, " (done)"); -- Now that we have analyzed the node, we call the expander to perform -- possible expansion. We skip this for subexpressions, because we don't -- have the type yet, and the expander will need to know the type before -- it can do its job. For subexpression nodes, the call to the expander -- happens in Sem_Res.Resolve. A special exception is Raise_xxx_Error, -- which can appear in a statement context, and needs expanding now in -- the case (distinguished by Etype, as documented in Sinfo). -- The Analyzed flag is also set at this point for non-subexpression -- nodes (in the case of subexpression nodes, we can't set the flag yet, -- since resolution and expansion have not yet been completed). Note -- that for N_Raise_xxx_Error we have to distinguish the expression -- case from the statement case. if Nkind (N) not in N_Subexpr or else (Nkind (N) in N_Raise_xxx_Error and then Etype (N) = Standard_Void_Type) then Expand (N); -- Replace a reference to a renaming with the renamed object for SPARK. -- In general this modification is performed by Expand_SPARK, however -- certain constructs may not reach the resolution or expansion phase -- and thus remain unchanged. The replacement is not performed when the -- construct is overloaded as resolution must first take place. This is -- also not done when analyzing a generic to preserve the original tree -- and because the reference may become overloaded in the instance. elsif GNATprove_Mode and then Nkind_In (N, N_Expanded_Name, N_Identifier) and then not Is_Overloaded (N) and then not Inside_A_Generic then Expand_SPARK_Potential_Renaming (N); end if; if Mode_Set then Restore_Ghost_Mode (Mode); end if; end Analyze; -- Version with check(s) suppressed procedure Analyze (N : Node_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Svs : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Analyze (N); Scope_Suppress.Suppress := Svs; end; elsif Suppress = Overflow_Check then declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Analyze (N); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Analyze; ------------------ -- Analyze_List -- ------------------ procedure Analyze_List (L : List_Id) is Node : Node_Id; begin Node := First (L); while Present (Node) loop Analyze (Node); Next (Node); end loop; end Analyze_List; -- Version with check(s) suppressed procedure Analyze_List (L : List_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Svs : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Analyze_List (L); Scope_Suppress.Suppress := Svs; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Analyze_List (L); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Analyze_List; -------------------------- -- Copy_Suppress_Status -- -------------------------- procedure Copy_Suppress_Status (C : Check_Id; From : Entity_Id; To : Entity_Id) is Found : Boolean; pragma Warnings (Off, Found); procedure Search_Stack (Top : Suppress_Stack_Entry_Ptr; Found : out Boolean); -- Search given suppress stack for matching entry for entity. If found -- then set Checks_May_Be_Suppressed on To, and push an appropriate -- entry for To onto the local suppress stack. ------------------ -- Search_Stack -- ------------------ procedure Search_Stack (Top : Suppress_Stack_Entry_Ptr; Found : out Boolean) is Ptr : Suppress_Stack_Entry_Ptr; begin Ptr := Top; while Ptr /= null loop if Ptr.Entity = From and then (Ptr.Check = All_Checks or else Ptr.Check = C) then if Ptr.Suppress then Set_Checks_May_Be_Suppressed (To, True); Push_Local_Suppress_Stack_Entry (Entity => To, Check => C, Suppress => True); Found := True; return; end if; end if; Ptr := Ptr.Prev; end loop; Found := False; return; end Search_Stack; -- Start of processing for Copy_Suppress_Status begin if not Checks_May_Be_Suppressed (From) then return; end if; -- First search the global entity suppress table for a matching entry. -- We also search this in reverse order so that if there are multiple -- pragmas for the same entity, the last one applies. Search_Stack (Global_Suppress_Stack_Top, Found); if Found then return; end if; -- Now search the local entity suppress stack, we search this in -- reverse order so that we get the innermost entry that applies to -- this case if there are nested entries. Note that for the purpose -- of this procedure we are ONLY looking for entries corresponding -- to a two-argument Suppress, where the second argument matches From. Search_Stack (Local_Suppress_Stack_Top, Found); end Copy_Suppress_Status; ------------------------- -- Enter_Generic_Scope -- ------------------------- procedure Enter_Generic_Scope (S : Entity_Id) is begin if No (Outer_Generic_Scope) then Outer_Generic_Scope := S; end if; end Enter_Generic_Scope; ------------------------ -- Exit_Generic_Scope -- ------------------------ procedure Exit_Generic_Scope (S : Entity_Id) is begin if S = Outer_Generic_Scope then Outer_Generic_Scope := Empty; end if; end Exit_Generic_Scope; ----------------------- -- Explicit_Suppress -- ----------------------- function Explicit_Suppress (E : Entity_Id; C : Check_Id) return Boolean is Ptr : Suppress_Stack_Entry_Ptr; begin if not Checks_May_Be_Suppressed (E) then return False; else Ptr := Global_Suppress_Stack_Top; while Ptr /= null loop if Ptr.Entity = E and then (Ptr.Check = All_Checks or else Ptr.Check = C) then return Ptr.Suppress; end if; Ptr := Ptr.Prev; end loop; end if; return False; end Explicit_Suppress; ----------------------------- -- External_Ref_In_Generic -- ----------------------------- function External_Ref_In_Generic (E : Entity_Id) return Boolean is Scop : Entity_Id; begin -- Entity is global if defined outside of current outer_generic_scope: -- Either the entity has a smaller depth that the outer generic, or it -- is in a different compilation unit, or it is defined within a unit -- in the same compilation, that is not within the outer_generic. if No (Outer_Generic_Scope) then return False; elsif Scope_Depth (Scope (E)) < Scope_Depth (Outer_Generic_Scope) or else not In_Same_Source_Unit (E, Outer_Generic_Scope) then return True; else Scop := Scope (E); while Present (Scop) loop if Scop = Outer_Generic_Scope then return False; elsif Scope_Depth (Scop) < Scope_Depth (Outer_Generic_Scope) then return True; else Scop := Scope (Scop); end if; end loop; return True; end if; end External_Ref_In_Generic; ---------------- -- Initialize -- ---------------- procedure Initialize is Next : Suppress_Stack_Entry_Ptr; procedure Free is new Unchecked_Deallocation (Suppress_Stack_Entry, Suppress_Stack_Entry_Ptr); begin -- Free any global suppress stack entries from a previous invocation -- of the compiler (in the normal case this loop does nothing). while Suppress_Stack_Entries /= null loop Next := Suppress_Stack_Entries.Next; Free (Suppress_Stack_Entries); Suppress_Stack_Entries := Next; end loop; Local_Suppress_Stack_Top := null; Global_Suppress_Stack_Top := null; -- Clear scope stack, and reset global variables Scope_Stack.Init; Unloaded_Subunits := False; end Initialize; ------------------------------ -- Insert_After_And_Analyze -- ------------------------------ procedure Insert_After_And_Analyze (N : Node_Id; M : Node_Id) is Node : Node_Id; begin if Present (M) then -- If we are not at the end of the list, then the easiest -- coding is simply to insert before our successor. if Present (Next (N)) then Insert_Before_And_Analyze (Next (N), M); -- Case of inserting at the end of the list else -- Capture the Node_Id of the node to be inserted. This Node_Id -- will still be the same after the insert operation. Node := M; Insert_After (N, M); -- Now just analyze from the inserted node to the end of -- the new list (note that this properly handles the case -- where any of the analyze calls result in the insertion of -- nodes after the analyzed node, expecting analysis). while Present (Node) loop Analyze (Node); Mark_Rewrite_Insertion (Node); Next (Node); end loop; end if; end if; end Insert_After_And_Analyze; -- Version with check(s) suppressed procedure Insert_After_And_Analyze (N : Node_Id; M : Node_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Svs : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Insert_After_And_Analyze (N, M); Scope_Suppress.Suppress := Svs; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Insert_After_And_Analyze (N, M); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Insert_After_And_Analyze; ------------------------------- -- Insert_Before_And_Analyze -- ------------------------------- procedure Insert_Before_And_Analyze (N : Node_Id; M : Node_Id) is Node : Node_Id; begin if Present (M) then -- Capture the Node_Id of the first list node to be inserted. -- This will still be the first node after the insert operation, -- since Insert_List_After does not modify the Node_Id values. Node := M; Insert_Before (N, M); -- The insertion does not change the Id's of any of the nodes in -- the list, and they are still linked, so we can simply loop from -- the original first node until we meet the node before which the -- insertion is occurring. Note that this properly handles the case -- where any of the analyzed nodes insert nodes after themselves, -- expecting them to get analyzed. while Node /= N loop Analyze (Node); Mark_Rewrite_Insertion (Node); Next (Node); end loop; end if; end Insert_Before_And_Analyze; -- Version with check(s) suppressed procedure Insert_Before_And_Analyze (N : Node_Id; M : Node_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Svs : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Insert_Before_And_Analyze (N, M); Scope_Suppress.Suppress := Svs; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Insert_Before_And_Analyze (N, M); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Insert_Before_And_Analyze; ----------------------------------- -- Insert_List_After_And_Analyze -- ----------------------------------- procedure Insert_List_After_And_Analyze (N : Node_Id; L : List_Id) is After : constant Node_Id := Next (N); Node : Node_Id; begin if Is_Non_Empty_List (L) then -- Capture the Node_Id of the first list node to be inserted. -- This will still be the first node after the insert operation, -- since Insert_List_After does not modify the Node_Id values. Node := First (L); Insert_List_After (N, L); -- Now just analyze from the original first node until we get to the -- successor of the original insertion point (which may be Empty if -- the insertion point was at the end of the list). Note that this -- properly handles the case where any of the analyze calls result in -- the insertion of nodes after the analyzed node (possibly calling -- this routine recursively). while Node /= After loop Analyze (Node); Mark_Rewrite_Insertion (Node); Next (Node); end loop; end if; end Insert_List_After_And_Analyze; -- Version with check(s) suppressed procedure Insert_List_After_And_Analyze (N : Node_Id; L : List_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Svs : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Insert_List_After_And_Analyze (N, L); Scope_Suppress.Suppress := Svs; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Insert_List_After_And_Analyze (N, L); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Insert_List_After_And_Analyze; ------------------------------------ -- Insert_List_Before_And_Analyze -- ------------------------------------ procedure Insert_List_Before_And_Analyze (N : Node_Id; L : List_Id) is Node : Node_Id; begin if Is_Non_Empty_List (L) then -- Capture the Node_Id of the first list node to be inserted. This -- will still be the first node after the insert operation, since -- Insert_List_After does not modify the Node_Id values. Node := First (L); Insert_List_Before (N, L); -- The insertion does not change the Id's of any of the nodes in -- the list, and they are still linked, so we can simply loop from -- the original first node until we meet the node before which the -- insertion is occurring. Note that this properly handles the case -- where any of the analyzed nodes insert nodes after themselves, -- expecting them to get analyzed. while Node /= N loop Analyze (Node); Mark_Rewrite_Insertion (Node); Next (Node); end loop; end if; end Insert_List_Before_And_Analyze; -- Version with check(s) suppressed procedure Insert_List_Before_And_Analyze (N : Node_Id; L : List_Id; Suppress : Check_Id) is begin if Suppress = All_Checks then declare Svs : constant Suppress_Array := Scope_Suppress.Suppress; begin Scope_Suppress.Suppress := (others => True); Insert_List_Before_And_Analyze (N, L); Scope_Suppress.Suppress := Svs; end; else declare Svg : constant Boolean := Scope_Suppress.Suppress (Suppress); begin Scope_Suppress.Suppress (Suppress) := True; Insert_List_Before_And_Analyze (N, L); Scope_Suppress.Suppress (Suppress) := Svg; end; end if; end Insert_List_Before_And_Analyze; ---------- -- Lock -- ---------- procedure Lock is begin Scope_Stack.Locked := True; Scope_Stack.Release; end Lock; ---------------- -- Preanalyze -- ---------------- procedure Preanalyze (N : Node_Id) is Save_Full_Analysis : constant Boolean := Full_Analysis; begin Full_Analysis := False; Expander_Mode_Save_And_Set (False); Analyze (N); Expander_Mode_Restore; Full_Analysis := Save_Full_Analysis; end Preanalyze; -------------------------------------- -- Push_Global_Suppress_Stack_Entry -- -------------------------------------- procedure Push_Global_Suppress_Stack_Entry (Entity : Entity_Id; Check : Check_Id; Suppress : Boolean) is begin Global_Suppress_Stack_Top := new Suppress_Stack_Entry' (Entity => Entity, Check => Check, Suppress => Suppress, Prev => Global_Suppress_Stack_Top, Next => Suppress_Stack_Entries); Suppress_Stack_Entries := Global_Suppress_Stack_Top; return; end Push_Global_Suppress_Stack_Entry; ------------------------------------- -- Push_Local_Suppress_Stack_Entry -- ------------------------------------- procedure Push_Local_Suppress_Stack_Entry (Entity : Entity_Id; Check : Check_Id; Suppress : Boolean) is begin Local_Suppress_Stack_Top := new Suppress_Stack_Entry' (Entity => Entity, Check => Check, Suppress => Suppress, Prev => Local_Suppress_Stack_Top, Next => Suppress_Stack_Entries); Suppress_Stack_Entries := Local_Suppress_Stack_Top; return; end Push_Local_Suppress_Stack_Entry; --------------- -- Semantics -- --------------- procedure Semantics (Comp_Unit : Node_Id) is procedure Do_Analyze; -- Perform the analysis of the compilation unit ---------------- -- Do_Analyze -- ---------------- -- WARNING: This routine manages Ghost regions. Return statements must -- be replaced by gotos which jump to the end of the routine and restore -- the Ghost mode. procedure Do_Analyze is Save_Ghost_Mode : constant Ghost_Mode_Type := Ghost_Mode; -- Generally style checks are preserved across compilations, with -- one exception: s-oscons.ads, which allows arbitrary long lines -- unconditionally, and has no restore mechanism, because it is -- intended as a lowest-level Pure package. Save_Max_Line : constant Int := Style_Max_Line_Length; List : Elist_Id; begin List := Save_Scope_Stack; Push_Scope (Standard_Standard); -- Set up a clean environment before analyzing Install_Ghost_Mode (None); Outer_Generic_Scope := Empty; Scope_Suppress := Suppress_Options; Scope_Stack.Table (Scope_Stack.Last).Component_Alignment_Default := Configuration_Component_Alignment; Scope_Stack.Table (Scope_Stack.Last).Is_Active_Stack_Base := True; -- Now analyze the top level compilation unit node Analyze (Comp_Unit); -- Check for scope mismatch on exit from compilation pragma Assert (Current_Scope = Standard_Standard or else Comp_Unit = Cunit (Main_Unit)); -- Then pop entry for Standard, and pop implicit types Pop_Scope; Restore_Scope_Stack (List); Restore_Ghost_Mode (Save_Ghost_Mode); Style_Max_Line_Length := Save_Max_Line; end Do_Analyze; -- Local variables -- The following locations save the corresponding global flags and -- variables so that they can be restored on completion. This is needed -- so that calls to Rtsfind start with the proper default values for -- these variables, and also that such calls do not disturb the settings -- for units being analyzed at a higher level. S_Current_Sem_Unit : constant Unit_Number_Type := Current_Sem_Unit; S_Full_Analysis : constant Boolean := Full_Analysis; S_GNAT_Mode : constant Boolean := GNAT_Mode; S_Global_Dis_Names : constant Boolean := Global_Discard_Names; S_In_Assertion_Expr : constant Nat := In_Assertion_Expr; S_In_Default_Expr : constant Boolean := In_Default_Expr; S_In_Spec_Expr : constant Boolean := In_Spec_Expression; S_Inside_A_Generic : constant Boolean := Inside_A_Generic; S_Outer_Gen_Scope : constant Entity_Id := Outer_Generic_Scope; S_Style_Check : constant Boolean := Style_Check; Already_Analyzed : constant Boolean := Analyzed (Comp_Unit); Curunit : constant Unit_Number_Type := Get_Cunit_Unit_Number (Comp_Unit); -- New value of Current_Sem_Unit Generic_Main : constant Boolean := Nkind (Unit (Cunit (Main_Unit))) in N_Generic_Declaration; -- If the main unit is generic, every compiled unit, including its -- context, is compiled with expansion disabled. Is_Main_Unit_Or_Main_Unit_Spec : constant Boolean := Curunit = Main_Unit or else (Nkind (Unit (Cunit (Main_Unit))) = N_Package_Body and then Library_Unit (Cunit (Main_Unit)) = Cunit (Curunit)); -- Configuration flags have special settings when compiling a predefined -- file as a main unit. This applies to its spec as well. Ext_Main_Source_Unit : constant Boolean := In_Extended_Main_Source_Unit (Comp_Unit); -- Determine if unit is in extended main source unit Save_Config_Switches : Config_Switches_Type; -- Variable used to save values of config switches while we analyze the -- new unit, to be restored on exit for proper recursive behavior. Save_Cunit_Restrictions : Save_Cunit_Boolean_Restrictions; -- Used to save non-partition wide restrictions before processing new -- unit. All with'ed units are analyzed with config restrictions reset -- and we need to restore these saved values at the end. -- Start of processing for Semantics begin if Debug_Unit_Walk then if Already_Analyzed then Write_Str ("(done)"); end if; Write_Unit_Info (Get_Cunit_Unit_Number (Comp_Unit), Unit (Comp_Unit), Prefix => "--> "); Indent; end if; Compiler_State := Analyzing; Current_Sem_Unit := Curunit; -- Compile predefined units with GNAT_Mode set to True, to properly -- process the categorization stuff. However, do not set GNAT_Mode -- to True for the renamings units (Text_IO, IO_Exceptions, Direct_IO, -- Sequential_IO) as this would prevent pragma Extend_System from being -- taken into account, for example when Text_IO is renaming DEC.Text_IO. if Is_Predefined_File_Name (Unit_File_Name (Current_Sem_Unit), Renamings_Included => False) then GNAT_Mode := True; end if; -- For generic main, never do expansion if Generic_Main then Expander_Mode_Save_And_Set (False); -- Non generic case else Expander_Mode_Save_And_Set -- Turn on expansion if generating code (Operating_Mode = Generate_Code -- Or if special debug flag -gnatdx is set or else Debug_Flag_X -- Or if in configuration run-time mode. We do this so we get -- error messages about missing entities in the run-time even -- if we are compiling in -gnatc (no code generation) mode. -- Similar processing applies to No_Run_Time_Mode. However, -- don't do this if debug flag -gnatd.Z is set or when we are -- compiling a separate unit (this is to handle a situation -- where this new processing causes trouble). or else ((Configurable_Run_Time_Mode or No_Run_Time_Mode) and then not Debug_Flag_Dot_ZZ and then Nkind (Unit (Cunit (Main_Unit))) /= N_Subunit)); end if; Full_Analysis := True; Inside_A_Generic := False; In_Assertion_Expr := 0; In_Default_Expr := False; In_Spec_Expression := False; Set_Comes_From_Source_Default (False); -- Save current config switches and reset then appropriately Save_Opt_Config_Switches (Save_Config_Switches); Set_Opt_Config_Switches (Is_Internal_File_Name (Unit_File_Name (Current_Sem_Unit)), Is_Main_Unit_Or_Main_Unit_Spec); -- Save current non-partition-wide restrictions Save_Cunit_Restrictions := Cunit_Boolean_Restrictions_Save; -- For unit in main extended unit, we reset the configuration values -- for the non-partition-wide restrictions. For other units reset them. if Ext_Main_Source_Unit then Restore_Config_Cunit_Boolean_Restrictions; else Reset_Cunit_Boolean_Restrictions; end if; -- Turn off style checks for unit that is not in the extended main -- source unit. This improves processing efficiency for such units -- (for which we don't want style checks anyway, and where they will -- get suppressed), and is definitely needed to stop some style checks -- from invading the run-time units (e.g. overriding checks). if not Ext_Main_Source_Unit then Style_Check := False; -- If this is part of the extended main source unit, set style check -- mode to match the style check mode of the main source unit itself. else Style_Check := Style_Check_Main; end if; -- Only do analysis of unit that has not already been analyzed if not Analyzed (Comp_Unit) then Initialize_Version (Current_Sem_Unit); -- Do analysis, and then append the compilation unit onto the -- Comp_Unit_List, if appropriate. This is done after analysis, -- so if this unit depends on some others, they have already been -- appended. We ignore bodies, except for the main unit itself, and -- for subprogram bodies that act as specs. We have also to guard -- against ill-formed subunits that have an improper context. Do_Analyze; if Present (Comp_Unit) and then Nkind (Unit (Comp_Unit)) in N_Proper_Body and then (Nkind (Unit (Comp_Unit)) /= N_Subprogram_Body or else not Acts_As_Spec (Comp_Unit)) and then not In_Extended_Main_Source_Unit (Comp_Unit) then null; else Append_New_Elmt (Comp_Unit, To => Comp_Unit_List); if Debug_Unit_Walk then Write_Str ("Appending "); Write_Unit_Info (Get_Cunit_Unit_Number (Comp_Unit), Unit (Comp_Unit)); end if; end if; end if; -- Save indication of dynamic elaboration checks for ALI file Set_Dynamic_Elab (Current_Sem_Unit, Dynamic_Elaboration_Checks); -- Restore settings of saved switches to entry values Current_Sem_Unit := S_Current_Sem_Unit; Full_Analysis := S_Full_Analysis; Global_Discard_Names := S_Global_Dis_Names; GNAT_Mode := S_GNAT_Mode; In_Assertion_Expr := S_In_Assertion_Expr; In_Default_Expr := S_In_Default_Expr; In_Spec_Expression := S_In_Spec_Expr; Inside_A_Generic := S_Inside_A_Generic; Outer_Generic_Scope := S_Outer_Gen_Scope; Style_Check := S_Style_Check; Restore_Opt_Config_Switches (Save_Config_Switches); -- Deal with restore of restrictions Cunit_Boolean_Restrictions_Restore (Save_Cunit_Restrictions); Expander_Mode_Restore; if Debug_Unit_Walk then Outdent; if Already_Analyzed then Write_Str ("(done)"); end if; Write_Unit_Info (Get_Cunit_Unit_Number (Comp_Unit), Unit (Comp_Unit), Prefix => "<-- "); end if; end Semantics; -------- -- ss -- -------- function ss (Index : Int) return Scope_Stack_Entry is begin return Scope_Stack.Table (Index); end ss; --------- -- sst -- --------- function sst return Scope_Stack_Entry is begin return ss (Scope_Stack.Last); end sst; ------------ -- Unlock -- ------------ procedure Unlock is begin Scope_Stack.Locked := False; end Unlock; ------------------------ -- Walk_Library_Items -- ------------------------ procedure Walk_Library_Items is type Unit_Number_Set is array (Main_Unit .. Last_Unit) of Boolean; pragma Pack (Unit_Number_Set); Main_CU : constant Node_Id := Cunit (Main_Unit); Seen, Done : Unit_Number_Set := (others => False); -- Seen (X) is True after we have seen unit X in the walk. This is used -- to prevent processing the same unit more than once. Done (X) is True -- after we have fully processed X, and is used only for debugging -- printouts and assertions. Do_Main : Boolean := False; -- Flag to delay processing the main body until after all other units. -- This is needed because the spec of the main unit may appear in the -- context of some other unit. We do not want this to force processing -- of the main body before all other units have been processed. -- -- Another circularity pattern occurs when the main unit is a child unit -- and the body of an ancestor has a with-clause of the main unit or on -- one of its children. In both cases the body in question has a with- -- clause on the main unit, and must be excluded from the traversal. In -- some convoluted cases this may lead to a CodePeer error because the -- spec of a subprogram declared in an instance within the parent will -- not be seen in the main unit. function Depends_On_Main (CU : Node_Id) return Boolean; -- The body of a unit that is withed by the spec of the main unit may in -- turn have a with_clause on that spec. In that case do not traverse -- the body, to prevent loops. It can also happen that the main body has -- a with_clause on a child, which of course has an implicit with on its -- parent. It's OK to traverse the child body if the main spec has been -- processed, otherwise we also have a circularity to avoid. procedure Do_Action (CU : Node_Id; Item : Node_Id); -- Calls Action, with some validity checks procedure Do_Unit_And_Dependents (CU : Node_Id; Item : Node_Id); -- Calls Do_Action, first on the units with'ed by this one, then on -- this unit. If it's an instance body, do the spec first. If it is -- an instance spec, do the body last. procedure Do_Withed_Unit (Withed_Unit : Node_Id); -- Apply Do_Unit_And_Dependents to a unit in a context clause procedure Process_Bodies_In_Context (Comp : Node_Id); -- The main unit and its spec may depend on bodies that contain generics -- that are instantiated in them. Iterate through the corresponding -- contexts before processing main (spec/body) itself, to process bodies -- that may be present, together with their context. The spec of main -- is processed wherever it appears in the list of units, while the body -- is processed as the last unit in the list. --------------------- -- Depends_On_Main -- --------------------- function Depends_On_Main (CU : Node_Id) return Boolean is CL : Node_Id; MCU : constant Node_Id := Unit (Main_CU); begin CL := First (Context_Items (CU)); -- Problem does not arise with main subprograms if not Nkind_In (MCU, N_Package_Body, N_Package_Declaration) then return False; end if; while Present (CL) loop if Nkind (CL) = N_With_Clause and then Library_Unit (CL) = Main_CU and then not Done (Get_Cunit_Unit_Number (Library_Unit (CL))) then return True; end if; Next (CL); end loop; return False; end Depends_On_Main; --------------- -- Do_Action -- --------------- procedure Do_Action (CU : Node_Id; Item : Node_Id) is begin -- This calls Action at the end. All the preceding code is just -- assertions and debugging output. pragma Assert (No (CU) or else Nkind (CU) = N_Compilation_Unit); case Nkind (Item) is when N_Generic_Function_Renaming_Declaration | N_Generic_Package_Declaration | N_Generic_Package_Renaming_Declaration | N_Generic_Procedure_Renaming_Declaration | N_Generic_Subprogram_Declaration | N_Package_Declaration | N_Package_Renaming_Declaration | N_Subprogram_Declaration | N_Subprogram_Renaming_Declaration => -- Specs are OK null; when N_Package_Body => -- Package bodies are processed separately if the main unit -- depends on them. null; when N_Subprogram_Body => -- A subprogram body must be the main unit pragma Assert (Acts_As_Spec (CU) or else CU = Cunit (Main_Unit)); null; when N_Function_Instantiation | N_Package_Instantiation | N_Procedure_Instantiation => -- Can only happen if some generic body (needed for gnat2scil -- traversal, but not by GNAT) is not available, ignore. null; -- All other cases cannot happen when N_Subunit => pragma Assert (False, "subunit"); null; when N_Null_Statement => -- Do not call Action for an ignored ghost unit pragma Assert (Is_Ignored_Ghost_Node (Original_Node (Item))); return; when others => pragma Assert (False); null; end case; if Present (CU) then pragma Assert (Item /= Stand.Standard_Package_Node); pragma Assert (Item = Unit (CU)); declare Unit_Num : constant Unit_Number_Type := Get_Cunit_Unit_Number (CU); procedure Assert_Done (Withed_Unit : Node_Id); -- Assert Withed_Unit is already Done, unless it's a body. It -- might seem strange for a with_clause to refer to a body, but -- this happens in the case of a generic instantiation, which -- gets transformed into the instance body (and the instance -- spec is also created). With clauses pointing to the -- instantiation end up pointing to the instance body. ----------------- -- Assert_Done -- ----------------- procedure Assert_Done (Withed_Unit : Node_Id) is begin if not Done (Get_Cunit_Unit_Number (Withed_Unit)) then if not Nkind_In (Unit (Withed_Unit), N_Generic_Package_Declaration, N_Package_Body, N_Package_Renaming_Declaration, N_Subprogram_Body) then Write_Unit_Name (Unit_Name (Get_Cunit_Unit_Number (Withed_Unit))); Write_Str (" not yet walked!"); if Get_Cunit_Unit_Number (Withed_Unit) = Unit_Num then Write_Str (" (self-ref)"); end if; Write_Eol; pragma Assert (False); end if; end if; end Assert_Done; procedure Assert_Withed_Units_Done is new Walk_Withs (Assert_Done); begin if Debug_Unit_Walk then Write_Unit_Info (Unit_Num, Item, Withs => True); end if; -- Main unit should come last, except in the case where we -- skipped System_Aux_Id, in which case we missed the things it -- depends on, and in the case of parent bodies if present. pragma Assert (not Done (Main_Unit) or else Present (System_Aux_Id) or else Nkind (Item) = N_Package_Body); -- We shouldn't do the same thing twice pragma Assert (not Done (Unit_Num)); -- Everything we depend upon should already be done pragma Debug (Assert_Withed_Units_Done (CU, Include_Limited => False)); end; else -- Must be Standard, which has no entry in the units table pragma Assert (Item = Stand.Standard_Package_Node); if Debug_Unit_Walk then Write_Line ("Standard"); end if; end if; Action (Item); end Do_Action; -------------------- -- Do_Withed_Unit -- -------------------- procedure Do_Withed_Unit (Withed_Unit : Node_Id) is begin Do_Unit_And_Dependents (Withed_Unit, Unit (Withed_Unit)); -- If the unit in the with_clause is a generic instance, the clause -- now denotes the instance body. Traverse the corresponding spec -- because there may be no other dependence that will force the -- traversal of its own context. if Nkind (Unit (Withed_Unit)) = N_Package_Body and then Is_Generic_Instance (Defining_Entity (Unit (Library_Unit (Withed_Unit)))) then Do_Withed_Unit (Library_Unit (Withed_Unit)); end if; end Do_Withed_Unit; ---------------------------- -- Do_Unit_And_Dependents -- ---------------------------- procedure Do_Unit_And_Dependents (CU : Node_Id; Item : Node_Id) is Unit_Num : constant Unit_Number_Type := Get_Cunit_Unit_Number (CU); Child : Node_Id; Body_U : Unit_Number_Type; Parent_CU : Node_Id; procedure Do_Withed_Units is new Walk_Withs (Do_Withed_Unit); begin if not Seen (Unit_Num) then -- Process the with clauses Do_Withed_Units (CU, Include_Limited => False); -- Process the unit if it is a spec or the main unit, if it -- has no previous spec or we have done all other units. if not Nkind_In (Item, N_Package_Body, N_Subprogram_Body) or else Acts_As_Spec (CU) then if CU = Cunit (Main_Unit) and then not Do_Main then Seen (Unit_Num) := False; else Seen (Unit_Num) := True; if CU = Library_Unit (Main_CU) then Process_Bodies_In_Context (CU); -- If main is a child unit, examine parent unit contexts -- to see if they include instantiated units. Also, if -- the parent itself is an instance, process its body -- because it may contain subprograms that are called -- in the main unit. if Is_Child_Unit (Cunit_Entity (Main_Unit)) then Child := Cunit_Entity (Main_Unit); while Is_Child_Unit (Child) loop Parent_CU := Cunit (Get_Cunit_Entity_Unit_Number (Scope (Child))); Process_Bodies_In_Context (Parent_CU); if Nkind (Unit (Parent_CU)) = N_Package_Body and then Nkind (Original_Node (Unit (Parent_CU))) = N_Package_Instantiation and then not Seen (Get_Cunit_Unit_Number (Parent_CU)) then Body_U := Get_Cunit_Unit_Number (Parent_CU); Seen (Body_U) := True; Do_Action (Parent_CU, Unit (Parent_CU)); Done (Body_U) := True; end if; Child := Scope (Child); end loop; end if; end if; Do_Action (CU, Item); Done (Unit_Num) := True; end if; end if; end if; end Do_Unit_And_Dependents; ------------------------------- -- Process_Bodies_In_Context -- ------------------------------- procedure Process_Bodies_In_Context (Comp : Node_Id) is Body_CU : Node_Id; Body_U : Unit_Number_Type; Clause : Node_Id; Spec : Node_Id; procedure Do_Withed_Units is new Walk_Withs (Do_Withed_Unit); -- Start of processing for Process_Bodies_In_Context begin Clause := First (Context_Items (Comp)); while Present (Clause) loop if Nkind (Clause) = N_With_Clause then Spec := Library_Unit (Clause); Body_CU := Library_Unit (Spec); -- If we are processing the spec of the main unit, load bodies -- only if the with_clause indicates that it forced the loading -- of the body for a generic instantiation. Note that bodies of -- parents that are instances have been loaded already. if Present (Body_CU) and then Body_CU /= Cunit (Main_Unit) and then Nkind (Unit (Body_CU)) /= N_Subprogram_Body and then (Nkind (Unit (Comp)) /= N_Package_Declaration or else Present (Withed_Body (Clause))) then Body_U := Get_Cunit_Unit_Number (Body_CU); if not Seen (Body_U) and then not Depends_On_Main (Body_CU) then Seen (Body_U) := True; Do_Withed_Units (Body_CU, Include_Limited => False); Do_Action (Body_CU, Unit (Body_CU)); Done (Body_U) := True; end if; end if; end if; Next (Clause); end loop; end Process_Bodies_In_Context; -- Local Declarations Cur : Elmt_Id; -- Start of processing for Walk_Library_Items begin if Debug_Unit_Walk then Write_Line ("Walk_Library_Items:"); Indent; end if; -- Do Standard first, then walk the Comp_Unit_List Do_Action (Empty, Standard_Package_Node); -- First place the context of all instance bodies on the corresponding -- spec, because it may be needed to analyze the code at the place of -- the instantiation. Cur := First_Elmt (Comp_Unit_List); while Present (Cur) loop declare CU : constant Node_Id := Node (Cur); N : constant Node_Id := Unit (CU); begin if Nkind (N) = N_Package_Body and then Is_Generic_Instance (Defining_Entity (N)) then Append_List (Context_Items (CU), Context_Items (Library_Unit (CU))); end if; Next_Elmt (Cur); end; end loop; -- Now traverse compilation units (specs) in order Cur := First_Elmt (Comp_Unit_List); while Present (Cur) loop declare CU : constant Node_Id := Node (Cur); N : constant Node_Id := Unit (CU); Par : Entity_Id; begin pragma Assert (Nkind (CU) = N_Compilation_Unit); case Nkind (N) is -- If it is a subprogram body, process it if it has no -- separate spec. -- If it's a package body, ignore it, unless it is a body -- created for an instance that is the main unit. In the case -- of subprograms, the body is the wrapper package. In case of -- a package, the original file carries the body, and the spec -- appears as a later entry in the units list. -- Otherwise bodies appear in the list only because of inlining -- or instantiations, and they are processed only if relevant. -- The flag Withed_Body on a context clause indicates that a -- unit contains an instantiation that may be needed later, -- and therefore the body that contains the generic body (and -- its context) must be traversed immediately after the -- corresponding spec (see Do_Unit_And_Dependents). -- The main unit itself is processed separately after all other -- specs, and relevant bodies are examined in Process_Main. when N_Subprogram_Body => if Acts_As_Spec (N) then Do_Unit_And_Dependents (CU, N); end if; when N_Package_Body => if CU = Main_CU and then Nkind (Original_Node (Unit (Main_CU))) in N_Generic_Instantiation and then Present (Library_Unit (Main_CU)) then Do_Unit_And_Dependents (Library_Unit (Main_CU), Unit (Library_Unit (Main_CU))); end if; -- It is a spec, process it, and the units it depends on, -- unless it is a descendant of the main unit. This can happen -- when the body of a parent depends on some other descendant. when N_Null_Statement => -- Ignore an ignored ghost unit pragma Assert (Is_Ignored_Ghost_Node (Original_Node (N))); null; when others => Par := Scope (Defining_Entity (Unit (CU))); if Is_Child_Unit (Defining_Entity (Unit (CU))) then while Present (Par) and then Par /= Standard_Standard and then Par /= Cunit_Entity (Main_Unit) loop Par := Scope (Par); end loop; end if; if Par /= Cunit_Entity (Main_Unit) then Do_Unit_And_Dependents (CU, N); end if; end case; end; Next_Elmt (Cur); end loop; -- Now process package bodies on which main depends, followed by bodies -- of parents, if present, and finally main itself. if not Done (Main_Unit) then Do_Main := True; Process_Main : declare Parent_CU : Node_Id; Body_CU : Node_Id; Body_U : Unit_Number_Type; Child : Entity_Id; function Is_Subunit_Of_Main (U : Node_Id) return Boolean; -- If the main unit has subunits, their context may include -- bodies that are needed in the body of main. We must examine -- the context of the subunits, which are otherwise not made -- explicit in the main unit. ------------------------ -- Is_Subunit_Of_Main -- ------------------------ function Is_Subunit_Of_Main (U : Node_Id) return Boolean is Lib : Node_Id; begin if No (U) then return False; else Lib := Library_Unit (U); return Nkind (Unit (U)) = N_Subunit and then (Lib = Cunit (Main_Unit) or else Is_Subunit_Of_Main (Lib)); end if; end Is_Subunit_Of_Main; -- Start of processing for Process_Main begin Process_Bodies_In_Context (Main_CU); for Unit_Num in Done'Range loop if Is_Subunit_Of_Main (Cunit (Unit_Num)) then Process_Bodies_In_Context (Cunit (Unit_Num)); end if; end loop; -- If the main unit is a child unit, parent bodies may be present -- because they export instances or inlined subprograms. Check for -- presence of these, which are not present in context clauses. -- Note that if the parents are instances, their bodies have been -- processed before the main spec, because they may be needed -- therein, so the following loop only affects non-instances. if Is_Child_Unit (Cunit_Entity (Main_Unit)) then Child := Cunit_Entity (Main_Unit); while Is_Child_Unit (Child) loop Parent_CU := Cunit (Get_Cunit_Entity_Unit_Number (Scope (Child))); Body_CU := Library_Unit (Parent_CU); if Present (Body_CU) and then not Seen (Get_Cunit_Unit_Number (Body_CU)) and then not Depends_On_Main (Body_CU) then Body_U := Get_Cunit_Unit_Number (Body_CU); Seen (Body_U) := True; Do_Action (Body_CU, Unit (Body_CU)); Done (Body_U) := True; end if; Child := Scope (Child); end loop; end if; Do_Action (Main_CU, Unit (Main_CU)); Done (Main_Unit) := True; end Process_Main; end if; if Debug_Unit_Walk then if Done /= (Done'Range => True) then Write_Eol; Write_Line ("Ignored units:"); Indent; for Unit_Num in Done'Range loop if not Done (Unit_Num) then Write_Unit_Info (Unit_Num, Unit (Cunit (Unit_Num)), Withs => True); end if; end loop; Outdent; end if; end if; pragma Assert (Done (Main_Unit)); if Debug_Unit_Walk then Outdent; Write_Line ("end Walk_Library_Items."); end if; end Walk_Library_Items; ---------------- -- Walk_Withs -- ---------------- procedure Walk_Withs (CU : Node_Id; Include_Limited : Boolean) is pragma Assert (Nkind (CU) = N_Compilation_Unit); pragma Assert (Nkind (Unit (CU)) /= N_Subunit); procedure Walk_Immediate is new Walk_Withs_Immediate (Action); begin -- First walk the withs immediately on the library item Walk_Immediate (CU, Include_Limited); -- For a body, we must also check for any subunits which belong to it -- and which have context clauses of their own, since these with'ed -- units are part of its own dependencies. if Nkind (Unit (CU)) in N_Unit_Body then for S in Main_Unit .. Last_Unit loop -- We are only interested in subunits. For preproc. data and def. -- files, Cunit is Empty, so we need to test that first. if Cunit (S) /= Empty and then Nkind (Unit (Cunit (S))) = N_Subunit then declare Pnode : Node_Id; begin Pnode := Library_Unit (Cunit (S)); -- In -gnatc mode, the errors in the subunits will not have -- been recorded, but the analysis of the subunit may have -- failed, so just quit. if No (Pnode) then exit; end if; -- Find ultimate parent of the subunit while Nkind (Unit (Pnode)) = N_Subunit loop Pnode := Library_Unit (Pnode); end loop; -- See if it belongs to current unit, and if so, include its -- with_clauses. Do not process main unit prematurely. if Pnode = CU and then CU /= Cunit (Main_Unit) then Walk_Immediate (Cunit (S), Include_Limited); end if; end; end if; end loop; end if; end Walk_Withs; -------------------------- -- Walk_Withs_Immediate -- -------------------------- procedure Walk_Withs_Immediate (CU : Node_Id; Include_Limited : Boolean) is pragma Assert (Nkind (CU) = N_Compilation_Unit); Context_Item : Node_Id; Lib_Unit : Node_Id; Body_CU : Node_Id; begin Context_Item := First (Context_Items (CU)); while Present (Context_Item) loop if Nkind (Context_Item) = N_With_Clause and then (Include_Limited or else not Limited_Present (Context_Item)) then Lib_Unit := Library_Unit (Context_Item); Action (Lib_Unit); -- If the context item indicates that a package body is needed -- because of an instantiation in CU, traverse the body now, even -- if CU is not related to the main unit. If the generic itself -- appears in a package body, the context item is this body, and -- it already appears in the traversal order, so we only need to -- examine the case of a context item being a package declaration. if Present (Withed_Body (Context_Item)) and then Nkind (Unit (Lib_Unit)) = N_Package_Declaration and then Present (Corresponding_Body (Unit (Lib_Unit))) then Body_CU := Parent (Unit_Declaration_Node (Corresponding_Body (Unit (Lib_Unit)))); -- A body may have an implicit with on its own spec, in which -- case we must ignore this context item to prevent looping. if Unit (CU) /= Unit (Body_CU) then Action (Body_CU); end if; end if; end if; Context_Item := Next (Context_Item); end loop; end Walk_Withs_Immediate; end Sem;