CombinedText
stringlengths
4
3.42M
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Unknown_Discriminant_Parts is function Create (Left_Bracket_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Box_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Right_Bracket_Token : not null Program.Lexical_Elements .Lexical_Element_Access) return Unknown_Discriminant_Part is begin return Result : Unknown_Discriminant_Part := (Left_Bracket_Token => Left_Bracket_Token, Box_Token => Box_Token, Right_Bracket_Token => Right_Bracket_Token, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Unknown_Discriminant_Part is begin return Result : Implicit_Unknown_Discriminant_Part := (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 Left_Bracket_Token (Self : Unknown_Discriminant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Left_Bracket_Token; end Left_Bracket_Token; overriding function Box_Token (Self : Unknown_Discriminant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Box_Token; end Box_Token; overriding function Right_Bracket_Token (Self : Unknown_Discriminant_Part) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Right_Bracket_Token; end Right_Bracket_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Unknown_Discriminant_Part) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Unknown_Discriminant_Part) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Unknown_Discriminant_Part) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : in out Base_Unknown_Discriminant_Part'Class) is begin null; end Initialize; overriding function Is_Unknown_Discriminant_Part (Self : Base_Unknown_Discriminant_Part) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Unknown_Discriminant_Part; overriding function Is_Definition (Self : Base_Unknown_Discriminant_Part) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition; overriding procedure Visit (Self : not null access Base_Unknown_Discriminant_Part; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Unknown_Discriminant_Part (Self); end Visit; overriding function To_Unknown_Discriminant_Part_Text (Self : in out Unknown_Discriminant_Part) return Program.Elements.Unknown_Discriminant_Parts .Unknown_Discriminant_Part_Text_Access is begin return Self'Unchecked_Access; end To_Unknown_Discriminant_Part_Text; overriding function To_Unknown_Discriminant_Part_Text (Self : in out Implicit_Unknown_Discriminant_Part) return Program.Elements.Unknown_Discriminant_Parts .Unknown_Discriminant_Part_Text_Access is pragma Unreferenced (Self); begin return null; end To_Unknown_Discriminant_Part_Text; end Program.Nodes.Unknown_Discriminant_Parts;
-- { dg-do compile } -- { dg-options "-O" } with Ada.Strings; with Ada.Strings.Fixed; procedure String_Slice2 is package ASF renames Ada.Strings.Fixed; Delete_String : String(1..10); Source_String2 : String(1..12) := "abcdefghijkl"; begin Delete_String := Source_String2(1..10); ASF.Delete(Source => Delete_String, From => 6, Through => Delete_String'Last, Justify => Ada.Strings.Left, Pad => 'x'); end;
package body numbers is procedure inc (p_i : in out integer) is begin p_i := p_i + 1; end inc; procedure dec (p_i : in out integer) is begin p_i := p_i - 1; end dec; procedure inc (p_i : in out word) is begin p_i := p_i + 1; end inc; procedure dec (p_i : in out word) is begin p_i := p_i - 1; end dec; procedure inc (p_i : in out byte) is begin p_i := p_i + 1; end inc; procedure dec (p_i : in out byte) is begin p_i := p_i - 1; end dec; procedure incd (p_i : in out byte) is begin p_i := p_i + 2; end incd; procedure incd (p_i : in out word) is begin p_i := p_i + 2; end incd; function incd (p_i : word) return word is begin return p_i + 2; end incd; procedure decd (p_i : in out word) is begin p_i := p_i - 2; end decd; function swpb (w : word) return word is begin return sr(w, 8) or sl(w, 8); end swpb; procedure swpb (w : in out word) is begin w := swpb(w); end swpb; function words_add (a, b : word) return word is begin return a + b; end words_add; function words_sub (a, b : word) return word is begin return a - b; end words_sub; function words_mul (a, b : word) return word is begin return a * b; end words_mul; function words_div (a, b : word) return word is begin return a / b; end words_div; function words_pow (a, b : word) return word is begin return a ** natural(b); end words_pow; function words_mod (a, b : word) return word is begin return a mod b; end words_mod; function words_or (a, b : word) return word is begin return a or b; end words_or; function words_and (a, b : word) return word is begin return a and b; end words_and; function words_xor (a, b : word) return word is begin return a xor b; end words_xor; function words_sl (a, b : word) return word is begin return sl(a, natural(b)); end words_sl; function words_sr (a, b : word) return word is begin return sr(a, natural(b)); end words_sr; function word_to_integer (w : word) return integer is use type interfaces.unsigned_32; begin return uint32_to_integer( (4294934528 * interfaces.unsigned_32(sr(w, 15))) or interfaces.unsigned_32(w)); end word_to_integer; function validate_word (str : string) return boolean is begin void(value(str)); return true; exception when constraint_error => return false; end validate_word; function value (str : string) return word is t_i : integer; begin if str(str'first) = '-' then t_i := integer'value(str); if t_i < -32768 then raise constraint_error; end if; return integer_to_word(t_i); elsif str'length > 2 and then str(str'first..(str'first + 1)) = "0x" then return word'value("16#" & str((str'first + 2)..str'last) & '#'); else return word'value(str); end if; end value; procedure void (w : word) is begin null; end void; function to_positive (b : boolean; v : positive := 1) return positive is begin if b then return v; end if; return positive'first; end to_positive; function to_natural (b : boolean; v : natural := 1) return natural is begin if b then return v; end if; return natural'first; end to_natural; function to_word (b : boolean; v : word := 1) return word is begin if b then return v; end if; return word'first; end to_word; function get_max_image_length (base : positive; val : word := word'last) return positive is begin if val = 0 then return 1; end if; return positive(long_float'floor(word_func.log(x => long_float(val), base => long_float(base))) + 1.0); end get_max_image_length; function image (w : word; base : positive; fix_size : boolean := true) return string is pragma assertion_policy (CHECK); pragma assert ( base in ada.text_io.number_base'range, string'("base " & base'img & " not in range " & ada.text_io.number_base'first'img & ".." & ada.text_io.number_base'last'img)); base_img_len : constant positive := base'img'length; str : string(1..get_max_image_length(base, w) + base_img_len + 1) := (others => '*'); begin natural_io.put(str, natural(w), base); if fix_size then return ada.strings.fixed.tail(str((str'first + base_img_len)..(str'last - 1)), get_max_image_length(base, word'last), '0'); end if; return str((str'first + base_img_len)..(str'last - 1)); end image; function hex (w : word; fix_size : boolean := true) return string is begin return "0x" & image(w, 16, fix_size); end hex; function bin (w : word; fix_size : boolean := true) return string is begin return "0b" & image(w, 2, fix_size); end bin; function odd (w : word) return boolean is begin return (w and 1) = 1; end odd; function even (w : word) return boolean is begin return (w and 1) = 0; end even; end numbers;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . S T R I N G _ O P S _ C O N C A T _ 4 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-1998, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.String_Ops_Concat_4 is ------------------ -- Str_Concat_4 -- ------------------ function Str_Concat_4 (S1, S2, S3, S4 : String) return String is begin if S1'Length <= 0 then return S2 & S3 & S4; else declare L12 : constant Natural := S1'Length + S2'Length; L13 : constant Natural := L12 + S3'Length; L14 : constant Natural := L13 + S4'Length; R : String (S1'First .. S1'First + L14 - 1); begin R (S1'First .. S1'Last) := S1; R (S1'Last + 1 .. S1'First + L12 - 1) := S2; R (S1'First + L12 .. S1'First + L13 - 1) := S3; R (S1'First + L13 .. R'Last) := S4; return R; end; end if; end Str_Concat_4; end System.String_Ops_Concat_4;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.UNBOUNDED.EQUAL_CASE_INSENSITIVE -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Strings.Unbounded.Aux; with Ada.Strings.Equal_Case_Insensitive; function Ada.Strings.Unbounded.Equal_Case_Insensitive (Left, Right : Unbounded.Unbounded_String) return Boolean is SL, SR : Aux.Big_String_Access; LL, LR : Natural; begin Aux.Get_String (Left, SL, LL); Aux.Get_String (Right, SR, LR); return Ada.Strings.Equal_Case_Insensitive (Left => SL (1 .. LL), Right => SR (1 .. LR)); end Ada.Strings.Unbounded.Equal_Case_Insensitive;
------------------------------------------------------------------------------ -- Copyright (C) 2020 by Heisenbug Ltd. (gh+spat@heisenbug.eu) -- -- This work is free. You can redistribute it and/or modify it under the -- terms of the Do What The Fuck You Want To Public License, Version 2, -- as published by Sam Hocevar. See the LICENSE file for more details. ------------------------------------------------------------------------------ pragma License (Unrestricted); ------------------------------------------------------------------------------ -- -- SPARK Proof Analysis Tool -- -- S.P.A.T. - Names of recognized fields in JSON data. -- ------------------------------------------------------------------------------ package SPAT.Field_Names is Assumptions : constant UTF8_String := "assumptions"; Check_Tree : constant UTF8_String := "check_tree"; Column : constant UTF8_String := "col"; Entity : constant UTF8_String := "entity"; File : constant UTF8_String := "file"; Flow : constant UTF8_String := "flow"; Flow_Analysis : constant UTF8_String := "flow analysis"; Line : constant UTF8_String := "line"; Max_Steps : constant UTF8_String := "max_steps"; Name : constant UTF8_String := "name"; Proof : constant UTF8_String := "proof"; Proof_Attempts : constant UTF8_String := "proof_attempts"; Result : constant UTF8_String := "result"; Rule : constant UTF8_String := "rule"; Severity : constant UTF8_String := "severity"; Sloc : constant UTF8_String := "sloc"; Spark : constant UTF8_String := "spark"; Stats : constant UTF8_String := "stats"; Steps : constant UTF8_String := "steps"; Suppressed : constant UTF8_String := "suppressed"; Time : constant UTF8_String := "time"; Timings : constant UTF8_String := "timings"; Transformations : constant UTF8_String := "transformations"; Trivial_True : constant UTF8_String := "trivial_true"; -- GNAT_CE_2019 Translation_Of_Compilation_Unit : constant UTF8_String := "translation of compilation unit"; -- GNAT_CE_2020 GNAT_Why3_Prefixed : constant UTF8_String := "gnatwhy3."; -- Not really a single field name, but a collection of sub-fields containing -- timing information. Session_Map : constant UTF8_String := "session_map"; end SPAT.Field_Names;
package ACO.Utils.DS is -- Some helper data structures, none requiring heap allocations. -- Mostly inspired, and in parts stolen, from Booch Components (20160321) pragma Preelaborate; end ACO.Utils.DS;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 5 9 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-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. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 59 package System.Pack_59 is pragma Preelaborate; Bits : constant := 59; type Bits_59 is mod 2 ** Bits; for Bits_59'Size use Bits; -- In all subprograms below, Rev_SSO is set True if the array has the -- non-default scalar storage order. function Get_59 (Arr : System.Address; N : Natural; Rev_SSO : Boolean) return Bits_59 with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_59 (Arr : System.Address; N : Natural; E : Bits_59; Rev_SSO : Boolean) with Inline; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. end System.Pack_59;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- ADA.NUMERICS.GENERIC_COMPLEX_ARRAYS -- -- -- -- B o d y -- -- -- -- Copyright (C) 2006-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. -- -- -- -- 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 System.Generic_Array_Operations; use System.Generic_Array_Operations; package body Ada.Numerics.Generic_Complex_Arrays is -- Operations that are defined in terms of operations on the type Real, -- such as addition, subtraction and scaling, are computed in the canonical -- way looping over all elements. package Ops renames System.Generic_Array_Operations; subtype Real is Real_Arrays.Real; -- Work around visibility bug ??? function Is_Non_Zero (X : Complex) return Boolean is (X /= (0.0, 0.0)); -- Needed by Back_Substitute procedure Back_Substitute is new Ops.Back_Substitute (Scalar => Complex, Matrix => Complex_Matrix, Is_Non_Zero => Is_Non_Zero); procedure Forward_Eliminate is new Ops.Forward_Eliminate (Scalar => Complex, Real => Real'Base, Matrix => Complex_Matrix, Zero => (0.0, 0.0), One => (1.0, 0.0)); procedure Transpose is new Ops.Transpose (Scalar => Complex, Matrix => Complex_Matrix); -- Helper function that raises a Constraint_Error is the argument is -- not a square matrix, and otherwise returns its length. function Length is new Square_Matrix_Length (Complex, Complex_Matrix); -- Instant a generic square root implementation here, in order to avoid -- instantiating a complete copy of Generic_Elementary_Functions. -- Speed of the square root is not a big concern here. function Sqrt is new Ops.Sqrt (Real'Base); -- Instantiating the following subprograms directly would lead to -- name clashes, so use a local package. package Instantiations is --------- -- "*" -- --------- function "*" is new Vector_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "*"); function "*" is new Vector_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "*"); function "*" is new Scalar_Vector_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "*"); function "*" is new Scalar_Vector_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "*"); function "*" is new Inner_Product (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Real_Vector, Zero => (0.0, 0.0)); function "*" is new Inner_Product (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Real_Vector, Right_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Inner_Product (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Outer_Product (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Complex_Vector, Matrix => Complex_Matrix); function "*" is new Outer_Product (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Real_Vector, Right_Vector => Complex_Vector, Matrix => Complex_Matrix); function "*" is new Outer_Product (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Real_Vector, Matrix => Complex_Matrix); function "*" is new Matrix_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "*"); function "*" is new Matrix_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "*"); function "*" is new Scalar_Matrix_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "*"); function "*" is new Scalar_Matrix_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "*"); function "*" is new Matrix_Vector_Product (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Matrix => Real_Matrix, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Matrix_Vector_Product (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Matrix => Complex_Matrix, Right_Vector => Real_Vector, Result_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Matrix_Vector_Product (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Matrix => Complex_Matrix, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Vector_Matrix_Product (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Real_Vector, Matrix => Complex_Matrix, Result_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Vector_Matrix_Product (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Matrix => Real_Matrix, Result_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Vector_Matrix_Product (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Matrix => Complex_Matrix, Result_Vector => Complex_Vector, Zero => (0.0, 0.0)); function "*" is new Matrix_Matrix_Product (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Zero => (0.0, 0.0)); function "*" is new Matrix_Matrix_Product (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Real_Matrix, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Zero => (0.0, 0.0)); function "*" is new Matrix_Matrix_Product (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Right_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Zero => (0.0, 0.0)); --------- -- "+" -- --------- function "+" is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Complex, X_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "+"); function "+" is new Vector_Vector_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "+"); function "+" is new Vector_Vector_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Real_Vector, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "+"); function "+" is new Vector_Vector_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Real_Vector, Result_Vector => Complex_Vector, Operation => "+"); function "+" is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Complex, X_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "+"); function "+" is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "+"); function "+" is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Real_Matrix, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "+"); function "+" is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Right_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Operation => "+"); --------- -- "-" -- --------- function "-" is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Complex, X_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "-"); function "-" is new Vector_Vector_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "-"); function "-" is new Vector_Vector_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Real_Vector, Right_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "-"); function "-" is new Vector_Vector_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Right_Vector => Real_Vector, Result_Vector => Complex_Vector, Operation => "-"); function "-" is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Complex, X_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "-"); function "-" is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "-"); function "-" is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Real_Matrix, Right_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "-"); function "-" is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Right_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Operation => "-"); --------- -- "/" -- --------- function "/" is new Vector_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "/"); function "/" is new Vector_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => "/"); function "/" is new Matrix_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Complex, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "/"); function "/" is new Matrix_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => "/"); ----------- -- "abs" -- ----------- function "abs" is new L2_Norm (X_Scalar => Complex, Result_Real => Real'Base, X_Vector => Complex_Vector); -------------- -- Argument -- -------------- function Argument is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Vector => Complex_Vector, Result_Vector => Real_Vector, Operation => Argument); function Argument is new Vector_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Real'Base, Left_Vector => Complex_Vector, Result_Vector => Real_Vector, Operation => Argument); function Argument is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Matrix => Complex_Matrix, Result_Matrix => Real_Matrix, Operation => Argument); function Argument is new Matrix_Scalar_Elementwise_Operation (Left_Scalar => Complex, Right_Scalar => Real'Base, Result_Scalar => Real'Base, Left_Matrix => Complex_Matrix, Result_Matrix => Real_Matrix, Operation => Argument); ---------------------------- -- Compose_From_Cartesian -- ---------------------------- function Compose_From_Cartesian is new Vector_Elementwise_Operation (X_Scalar => Real'Base, Result_Scalar => Complex, X_Vector => Real_Vector, Result_Vector => Complex_Vector, Operation => Compose_From_Cartesian); function Compose_From_Cartesian is new Vector_Vector_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Real_Vector, Right_Vector => Real_Vector, Result_Vector => Complex_Vector, Operation => Compose_From_Cartesian); function Compose_From_Cartesian is new Matrix_Elementwise_Operation (X_Scalar => Real'Base, Result_Scalar => Complex, X_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Operation => Compose_From_Cartesian); function Compose_From_Cartesian is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Real_Matrix, Right_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Operation => Compose_From_Cartesian); ------------------------ -- Compose_From_Polar -- ------------------------ function Compose_From_Polar is new Vector_Vector_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Vector => Real_Vector, Right_Vector => Real_Vector, Result_Vector => Complex_Vector, Operation => Compose_From_Polar); function Compose_From_Polar is new Vector_Vector_Scalar_Elementwise_Operation (X_Scalar => Real'Base, Y_Scalar => Real'Base, Z_Scalar => Real'Base, Result_Scalar => Complex, X_Vector => Real_Vector, Y_Vector => Real_Vector, Result_Vector => Complex_Vector, Operation => Compose_From_Polar); function Compose_From_Polar is new Matrix_Matrix_Elementwise_Operation (Left_Scalar => Real'Base, Right_Scalar => Real'Base, Result_Scalar => Complex, Left_Matrix => Real_Matrix, Right_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Operation => Compose_From_Polar); function Compose_From_Polar is new Matrix_Matrix_Scalar_Elementwise_Operation (X_Scalar => Real'Base, Y_Scalar => Real'Base, Z_Scalar => Real'Base, Result_Scalar => Complex, X_Matrix => Real_Matrix, Y_Matrix => Real_Matrix, Result_Matrix => Complex_Matrix, Operation => Compose_From_Polar); --------------- -- Conjugate -- --------------- function Conjugate is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Complex, X_Vector => Complex_Vector, Result_Vector => Complex_Vector, Operation => Conjugate); function Conjugate is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Complex, X_Matrix => Complex_Matrix, Result_Matrix => Complex_Matrix, Operation => Conjugate); -------- -- Im -- -------- function Im is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Vector => Complex_Vector, Result_Vector => Real_Vector, Operation => Im); function Im is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Matrix => Complex_Matrix, Result_Matrix => Real_Matrix, Operation => Im); ------------- -- Modulus -- ------------- function Modulus is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Vector => Complex_Vector, Result_Vector => Real_Vector, Operation => Modulus); function Modulus is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Matrix => Complex_Matrix, Result_Matrix => Real_Matrix, Operation => Modulus); -------- -- Re -- -------- function Re is new Vector_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Vector => Complex_Vector, Result_Vector => Real_Vector, Operation => Re); function Re is new Matrix_Elementwise_Operation (X_Scalar => Complex, Result_Scalar => Real'Base, X_Matrix => Complex_Matrix, Result_Matrix => Real_Matrix, Operation => Re); ------------ -- Set_Im -- ------------ procedure Set_Im is new Update_Vector_With_Vector (X_Scalar => Complex, Y_Scalar => Real'Base, X_Vector => Complex_Vector, Y_Vector => Real_Vector, Update => Set_Im); procedure Set_Im is new Update_Matrix_With_Matrix (X_Scalar => Complex, Y_Scalar => Real'Base, X_Matrix => Complex_Matrix, Y_Matrix => Real_Matrix, Update => Set_Im); ------------ -- Set_Re -- ------------ procedure Set_Re is new Update_Vector_With_Vector (X_Scalar => Complex, Y_Scalar => Real'Base, X_Vector => Complex_Vector, Y_Vector => Real_Vector, Update => Set_Re); procedure Set_Re is new Update_Matrix_With_Matrix (X_Scalar => Complex, Y_Scalar => Real'Base, X_Matrix => Complex_Matrix, Y_Matrix => Real_Matrix, Update => Set_Re); ----------- -- Solve -- ----------- function Solve is new Matrix_Vector_Solution (Complex, (0.0, 0.0), Complex_Vector, Complex_Matrix); function Solve is new Matrix_Matrix_Solution (Complex, (0.0, 0.0), Complex_Matrix); ----------------- -- Unit_Matrix -- ----------------- function Unit_Matrix is new System.Generic_Array_Operations.Unit_Matrix (Scalar => Complex, Matrix => Complex_Matrix, Zero => (0.0, 0.0), One => (1.0, 0.0)); function Unit_Vector is new System.Generic_Array_Operations.Unit_Vector (Scalar => Complex, Vector => Complex_Vector, Zero => (0.0, 0.0), One => (1.0, 0.0)); end Instantiations; --------- -- "*" -- --------- function "*" (Left : Complex_Vector; Right : Complex_Vector) return Complex renames Instantiations."*"; function "*" (Left : Real_Vector; Right : Complex_Vector) return Complex renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Real_Vector) return Complex renames Instantiations."*"; function "*" (Left : Complex; Right : Complex_Vector) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Complex) return Complex_Vector renames Instantiations."*"; function "*" (Left : Real'Base; Right : Complex_Vector) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Real'Base) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex_Matrix; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Complex_Vector) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Complex_Matrix) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex_Matrix; Right : Complex_Vector) return Complex_Vector renames Instantiations."*"; function "*" (Left : Real_Matrix; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Complex_Matrix; Right : Real_Matrix) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Real_Vector; Right : Complex_Vector) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Real_Vector) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Real_Vector; Right : Complex_Matrix) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex_Vector; Right : Real_Matrix) return Complex_Vector renames Instantiations."*"; function "*" (Left : Real_Matrix; Right : Complex_Vector) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex_Matrix; Right : Real_Vector) return Complex_Vector renames Instantiations."*"; function "*" (Left : Complex; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Complex_Matrix; Right : Complex) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Real'Base; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."*"; function "*" (Left : Complex_Matrix; Right : Real'Base) return Complex_Matrix renames Instantiations."*"; --------- -- "+" -- --------- function "+" (Right : Complex_Vector) return Complex_Vector renames Instantiations."+"; function "+" (Left : Complex_Vector; Right : Complex_Vector) return Complex_Vector renames Instantiations."+"; function "+" (Left : Real_Vector; Right : Complex_Vector) return Complex_Vector renames Instantiations."+"; function "+" (Left : Complex_Vector; Right : Real_Vector) return Complex_Vector renames Instantiations."+"; function "+" (Right : Complex_Matrix) return Complex_Matrix renames Instantiations."+"; function "+" (Left : Complex_Matrix; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."+"; function "+" (Left : Real_Matrix; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."+"; function "+" (Left : Complex_Matrix; Right : Real_Matrix) return Complex_Matrix renames Instantiations."+"; --------- -- "-" -- --------- function "-" (Right : Complex_Vector) return Complex_Vector renames Instantiations."-"; function "-" (Left : Complex_Vector; Right : Complex_Vector) return Complex_Vector renames Instantiations."-"; function "-" (Left : Real_Vector; Right : Complex_Vector) return Complex_Vector renames Instantiations."-"; function "-" (Left : Complex_Vector; Right : Real_Vector) return Complex_Vector renames Instantiations."-"; function "-" (Right : Complex_Matrix) return Complex_Matrix renames Instantiations."-"; function "-" (Left : Complex_Matrix; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."-"; function "-" (Left : Real_Matrix; Right : Complex_Matrix) return Complex_Matrix renames Instantiations."-"; function "-" (Left : Complex_Matrix; Right : Real_Matrix) return Complex_Matrix renames Instantiations."-"; --------- -- "/" -- --------- function "/" (Left : Complex_Vector; Right : Complex) return Complex_Vector renames Instantiations."/"; function "/" (Left : Complex_Vector; Right : Real'Base) return Complex_Vector renames Instantiations."/"; function "/" (Left : Complex_Matrix; Right : Complex) return Complex_Matrix renames Instantiations."/"; function "/" (Left : Complex_Matrix; Right : Real'Base) return Complex_Matrix renames Instantiations."/"; ----------- -- "abs" -- ----------- function "abs" (Right : Complex_Vector) return Real'Base renames Instantiations."abs"; -------------- -- Argument -- -------------- function Argument (X : Complex_Vector) return Real_Vector renames Instantiations.Argument; function Argument (X : Complex_Vector; Cycle : Real'Base) return Real_Vector renames Instantiations.Argument; function Argument (X : Complex_Matrix) return Real_Matrix renames Instantiations.Argument; function Argument (X : Complex_Matrix; Cycle : Real'Base) return Real_Matrix renames Instantiations.Argument; ---------------------------- -- Compose_From_Cartesian -- ---------------------------- function Compose_From_Cartesian (Re : Real_Vector) return Complex_Vector renames Instantiations.Compose_From_Cartesian; function Compose_From_Cartesian (Re : Real_Vector; Im : Real_Vector) return Complex_Vector renames Instantiations.Compose_From_Cartesian; function Compose_From_Cartesian (Re : Real_Matrix) return Complex_Matrix renames Instantiations.Compose_From_Cartesian; function Compose_From_Cartesian (Re : Real_Matrix; Im : Real_Matrix) return Complex_Matrix renames Instantiations.Compose_From_Cartesian; ------------------------ -- Compose_From_Polar -- ------------------------ function Compose_From_Polar (Modulus : Real_Vector; Argument : Real_Vector) return Complex_Vector renames Instantiations.Compose_From_Polar; function Compose_From_Polar (Modulus : Real_Vector; Argument : Real_Vector; Cycle : Real'Base) return Complex_Vector renames Instantiations.Compose_From_Polar; function Compose_From_Polar (Modulus : Real_Matrix; Argument : Real_Matrix) return Complex_Matrix renames Instantiations.Compose_From_Polar; function Compose_From_Polar (Modulus : Real_Matrix; Argument : Real_Matrix; Cycle : Real'Base) return Complex_Matrix renames Instantiations.Compose_From_Polar; --------------- -- Conjugate -- --------------- function Conjugate (X : Complex_Vector) return Complex_Vector renames Instantiations.Conjugate; function Conjugate (X : Complex_Matrix) return Complex_Matrix renames Instantiations.Conjugate; ----------------- -- Determinant -- ----------------- function Determinant (A : Complex_Matrix) return Complex is M : Complex_Matrix := A; B : Complex_Matrix (A'Range (1), 1 .. 0); R : Complex; begin Forward_Eliminate (M, B, R); return R; end Determinant; ----------------- -- Eigensystem -- ----------------- procedure Eigensystem (A : Complex_Matrix; Values : out Real_Vector; Vectors : out Complex_Matrix) is N : constant Natural := Length (A); -- For a Hermitian matrix C, we convert the eigenvalue problem to a -- real symmetric one: if C = A + i * B, then the (N, N) complex -- eigenvalue problem: -- (A + i * B) * (u + i * v) = Lambda * (u + i * v) -- -- is equivalent to the (2 * N, 2 * N) real eigenvalue problem: -- [ A, B ] [ u ] = Lambda * [ u ] -- [ -B, A ] [ v ] [ v ] -- -- Note that the (2 * N, 2 * N) matrix above is symmetric, as -- Transpose (A) = A and Transpose (B) = -B if C is Hermitian. -- We solve this eigensystem using the real-valued algorithms. The final -- result will have every eigenvalue twice, so in the sorted output we -- just pick every second value, with associated eigenvector u + i * v. M : Real_Matrix (1 .. 2 * N, 1 .. 2 * N); Vals : Real_Vector (1 .. 2 * N); Vecs : Real_Matrix (1 .. 2 * N, 1 .. 2 * N); begin for J in 1 .. N loop for K in 1 .. N loop declare C : constant Complex := (A (A'First (1) + (J - 1), A'First (2) + (K - 1))); begin M (J, K) := Re (C); M (J + N, K + N) := Re (C); M (J + N, K) := Im (C); M (J, K + N) := -Im (C); end; end loop; end loop; Eigensystem (M, Vals, Vecs); for J in 1 .. N loop declare Col : constant Integer := Values'First + (J - 1); begin Values (Col) := Vals (2 * J); for K in 1 .. N loop declare Row : constant Integer := Vectors'First (2) + (K - 1); begin Vectors (Row, Col) := (Vecs (J * 2, Col), Vecs (J * 2, Col + N)); end; end loop; end; end loop; end Eigensystem; ----------------- -- Eigenvalues -- ----------------- function Eigenvalues (A : Complex_Matrix) return Real_Vector is -- See Eigensystem for a description of the algorithm N : constant Natural := Length (A); R : Real_Vector (A'Range (1)); M : Real_Matrix (1 .. 2 * N, 1 .. 2 * N); Vals : Real_Vector (1 .. 2 * N); begin for J in 1 .. N loop for K in 1 .. N loop declare C : constant Complex := (A (A'First (1) + (J - 1), A'First (2) + (K - 1))); begin M (J, K) := Re (C); M (J + N, K + N) := Re (C); M (J + N, K) := Im (C); M (J, K + N) := -Im (C); end; end loop; end loop; Vals := Eigenvalues (M); for J in 1 .. N loop R (A'First (1) + (J - 1)) := Vals (2 * J); end loop; return R; end Eigenvalues; -------- -- Im -- -------- function Im (X : Complex_Vector) return Real_Vector renames Instantiations.Im; function Im (X : Complex_Matrix) return Real_Matrix renames Instantiations.Im; ------------- -- Inverse -- ------------- function Inverse (A : Complex_Matrix) return Complex_Matrix is (Solve (A, Unit_Matrix (Length (A)))); ------------- -- Modulus -- ------------- function Modulus (X : Complex_Vector) return Real_Vector renames Instantiations.Modulus; function Modulus (X : Complex_Matrix) return Real_Matrix renames Instantiations.Modulus; -------- -- Re -- -------- function Re (X : Complex_Vector) return Real_Vector renames Instantiations.Re; function Re (X : Complex_Matrix) return Real_Matrix renames Instantiations.Re; ------------ -- Set_Im -- ------------ procedure Set_Im (X : in out Complex_Matrix; Im : Real_Matrix) renames Instantiations.Set_Im; procedure Set_Im (X : in out Complex_Vector; Im : Real_Vector) renames Instantiations.Set_Im; ------------ -- Set_Re -- ------------ procedure Set_Re (X : in out Complex_Matrix; Re : Real_Matrix) renames Instantiations.Set_Re; procedure Set_Re (X : in out Complex_Vector; Re : Real_Vector) renames Instantiations.Set_Re; ----------- -- Solve -- ----------- function Solve (A : Complex_Matrix; X : Complex_Vector) return Complex_Vector renames Instantiations.Solve; function Solve (A : Complex_Matrix; X : Complex_Matrix) return Complex_Matrix renames Instantiations.Solve; --------------- -- Transpose -- --------------- function Transpose (X : Complex_Matrix) return Complex_Matrix is R : Complex_Matrix (X'Range (2), X'Range (1)); begin Transpose (X, R); return R; end Transpose; ----------------- -- Unit_Matrix -- ----------------- function Unit_Matrix (Order : Positive; First_1 : Integer := 1; First_2 : Integer := 1) return Complex_Matrix renames Instantiations.Unit_Matrix; ----------------- -- Unit_Vector -- ----------------- function Unit_Vector (Index : Integer; Order : Positive; First : Integer := 1) return Complex_Vector renames Instantiations.Unit_Vector; end Ada.Numerics.Generic_Complex_Arrays;
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_glx_set_client_info_2arb_request_t is -- Item -- type Item is record major_opcode : aliased Interfaces.Unsigned_8; minor_opcode : aliased Interfaces.Unsigned_8; length : aliased Interfaces.Unsigned_16; major_version : aliased Interfaces.Unsigned_32; minor_version : aliased Interfaces.Unsigned_32; num_versions : aliased Interfaces.Unsigned_32; gl_str_len : aliased Interfaces.Unsigned_32; glx_str_len : aliased Interfaces.Unsigned_32; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb .xcb_glx_set_client_info_2arb_request_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_set_client_info_2arb_request_t.Item, Element_Array => xcb.xcb_glx_set_client_info_2arb_request_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb .xcb_glx_set_client_info_2arb_request_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_set_client_info_2arb_request_t.Pointer, Element_Array => xcb.xcb_glx_set_client_info_2arb_request_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_glx_set_client_info_2arb_request_t;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T V S N -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2015, 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 spec holds version information for the GNAT tools. -- It is updated whenever the release number is changed. package Gnatvsn is Gnat_Static_Version_String : constant String := "GNU Ada"; -- Static string identifying this version, that can be used as an argument -- to e.g. pragma Ident. function Gnat_Version_String return String; -- Version output when GNAT (compiler), or its related tools, including -- GNATBIND, GNATCHOP, GNATFIND, GNATLINK, GNATMAKE, GNATXREF, are run -- (with appropriate verbose option switch set). type Gnat_Build_Type is (FSF, GPL); -- See Build_Type below for the meaning of these values. Build_Type : constant Gnat_Build_Type := FSF; -- Kind of GNAT build: -- -- FSF -- GNAT FSF version. This version of GNAT is part of a Free Software -- Foundation release of the GNU Compiler Collection (GCC). The bug -- box generated by Comperr gives information on how to report bugs -- and list the "no warranty" information. -- -- GPL -- GNAT GPL Edition. This is a special version of GNAT, released by -- Ada Core Technologies and intended for academic users, and free -- software developers. The bug box generated by the package Comperr -- gives appropriate bug submission instructions that do not reference -- customer number etc. function Gnat_Free_Software return String; -- Text to be displayed by the different GNAT tools when switch --version -- is used. This text depends on the GNAT build type. function Copyright_Holder return String; -- Return the name of the Copyright holder to be displayed by the different -- GNAT tools when switch --version is used. Ver_Len_Max : constant := 256; -- Longest possible length for Gnat_Version_String in this or any -- other version of GNAT. This is used by the binder to establish -- space to store any possible version string value for checks. This -- value should never be decreased in the future, but it would be -- OK to increase it if absolutely necessary. If it is increased, -- be sure to increase GNAT.Compiler.Version.Ver_Len_Max as well. Ver_Prefix : constant String := "GNAT Version: "; -- Prefix generated by binder. If it is changed, be sure to change -- GNAT.Compiler_Version.Ver_Prefix as well. Library_Version : constant String := "5"; -- Library version. This value must be updated when the compiler -- version number Gnat_Static_Version_String is updated. -- -- Note: Makefile.in uses the library version string to construct the -- soname value. Verbose_Library_Version : constant String := "GNAT Lib v" & Library_Version; -- Version string stored in e.g. ALI files Current_Year : constant String := "2015"; -- Used in printing copyright messages end Gnatvsn;
package Lto16_Pkg is function F return Float; end Lto16_Pkg;
with gel.Forge, gel.Window.setup, gel.Applet.gui_world, gel.World, gel.Camera, gel.Sprite, ada.Calendar; pragma Unreferenced (gel.Window.setup); procedure launch_add_rid_sprite_Test -- -- drops a ball onto a box terrain. -- -- is use ada.Calendar; the_Applet : constant gel.Applet.gui_world.view := gel.forge.new_gui_Applet ("Add/Rid Sprite Test", 500, 500); the_Box : constant gel.Sprite.view := gel.forge.new_box_Sprite (the_Applet.gui_World, mass => 0.0); the_Balls : gel.Sprite.views (1 .. 1) := (others => gel.forge.new_ball_Sprite (the_Applet.gui_World, mass => 1.0)); next_render_Time : ada.calendar.Time; begin the_Applet.gui_Camera.Site_is ((0.0, 5.0, 15.0)); -- Position the camera the_Applet.enable_simple_Dolly (1); -- Enable user camera control via keyboards the_Applet.enable_Mouse (detect_Motion => False); -- Enable mouse events. the_Applet.gui_World.add (the_Box); -- Add the ground box. the_Box.Site_is ((0.0, 0.0, 0.0)); for Each in the_Balls'range loop the_Applet.gui_World.add (the_Balls (Each)); -- Add ball. the_Balls (Each).Site_is ((0.0, 10.0, 0.0)); end loop; for Each in 1 .. 100 loop the_Applet.gui_World.evolve; -- Evolve the world. the_Applet.freshen; -- Handle any new events and update the screen. end loop; for Each in the_Balls'range loop the_Applet.gui_World.rid (the_Balls (Each)); -- Rid ball. gel.Sprite.free (the_Balls (Each)); end loop; next_render_Time := ada.Calendar.clock; while the_Applet.is_open loop the_Applet.gui_World.evolve; -- Evolve the world. the_Applet.freshen; -- Handle any new events and update the screen. next_render_Time := next_render_Time + gel.World.evolve_Period; delay until next_render_Time; end loop; the_Applet.destroy; end launch_add_rid_sprite_Test;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Delta_Constraints is function Create (Delta_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Delta_Expression : not null Program.Elements.Expressions .Expression_Access; Range_Token : Program.Lexical_Elements.Lexical_Element_Access; Real_Range_Constraint : Program.Elements.Constraints.Constraint_Access) return Delta_Constraint is begin return Result : Delta_Constraint := (Delta_Token => Delta_Token, Delta_Expression => Delta_Expression, Range_Token => Range_Token, Real_Range_Constraint => Real_Range_Constraint, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Delta_Expression : not null Program.Elements.Expressions .Expression_Access; Real_Range_Constraint : Program.Elements.Constraints.Constraint_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Delta_Constraint is begin return Result : Implicit_Delta_Constraint := (Delta_Expression => Delta_Expression, Real_Range_Constraint => Real_Range_Constraint, 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 Delta_Expression (Self : Base_Delta_Constraint) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Delta_Expression; end Delta_Expression; overriding function Real_Range_Constraint (Self : Base_Delta_Constraint) return Program.Elements.Constraints.Constraint_Access is begin return Self.Real_Range_Constraint; end Real_Range_Constraint; overriding function Delta_Token (Self : Delta_Constraint) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Delta_Token; end Delta_Token; overriding function Range_Token (Self : Delta_Constraint) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Range_Token; end Range_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Delta_Constraint) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Delta_Constraint) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Delta_Constraint) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : in out Base_Delta_Constraint'Class) is begin Set_Enclosing_Element (Self.Delta_Expression, Self'Unchecked_Access); if Self.Real_Range_Constraint.Assigned then Set_Enclosing_Element (Self.Real_Range_Constraint, Self'Unchecked_Access); end if; null; end Initialize; overriding function Is_Delta_Constraint (Self : Base_Delta_Constraint) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Delta_Constraint; overriding function Is_Constraint (Self : Base_Delta_Constraint) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Constraint; overriding function Is_Definition (Self : Base_Delta_Constraint) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition; overriding procedure Visit (Self : not null access Base_Delta_Constraint; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Delta_Constraint (Self); end Visit; overriding function To_Delta_Constraint_Text (Self : in out Delta_Constraint) return Program.Elements.Delta_Constraints.Delta_Constraint_Text_Access is begin return Self'Unchecked_Access; end To_Delta_Constraint_Text; overriding function To_Delta_Constraint_Text (Self : in out Implicit_Delta_Constraint) return Program.Elements.Delta_Constraints.Delta_Constraint_Text_Access is pragma Unreferenced (Self); begin return null; end To_Delta_Constraint_Text; end Program.Nodes.Delta_Constraints;
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- package body Keccak.Generic_Hash is ------------ -- Init -- ------------ procedure Init (Ctx : out Context) is begin Hash_Sponge.Init (Ctx.Sponge_Ctx, Capacity, Permutation_Initial_Value); Ctx.Update_Complete := False; end Init; -------------- -- Update -- -------------- procedure Update (Ctx : in out Context; Message : in Byte_Array; Bit_Length : in Natural) is Num_Bytes : constant Natural := (Bit_Length + 7) / 8; begin pragma Assert (Num_Bytes <= Message'Length); if Num_Bytes > 0 then if Bit_Length mod 8 = 0 then Hash_Sponge.Absorb (Ctx.Sponge_Ctx, Message (Message'First .. Message'First + (Num_Bytes - 1)), Bit_Length); else -- Last invocation of Update; append suffix now Hash_Sponge.Absorb_With_Suffix (Ctx.Sponge_Ctx, Message (Message'First .. Message'First + (Num_Bytes - 1)), Bit_Length, Suffix, Suffix_Size); Ctx.Update_Complete := True; end if; end if; end Update; -------------- -- Update -- -------------- procedure Update (Ctx : in out Context; Message : in Byte_Array) is Max_Chunk_Len : constant := (Natural'Last / 8) - 1; Remaining : Natural := Message'Length; Offset : Natural := 0; begin while Remaining >= Max_Chunk_Len loop pragma Loop_Variant (Decreases => Remaining); pragma Loop_Invariant (Remaining + Offset = Message'Length and State_Of (Ctx) = Updating); Update (Ctx, Message (Message'First + Offset .. Message'First + Offset + (Max_Chunk_Len - 1)), Max_Chunk_Len * 8); Remaining := Remaining - Max_Chunk_Len; Offset := Offset + Max_Chunk_Len; end loop; if Remaining > 0 then pragma Assert_And_Cut (Remaining < Natural'Last / 8 and Offset + Remaining = Message'Length and State_Of (Ctx) = Updating); Update (Ctx, Message (Message'First + Offset .. Message'Last), Remaining * 8); pragma Assert (State_Of (Ctx) = Updating); end if; end Update; ------------- -- Final -- ------------- procedure Final (Ctx : in out Context; Digest : out Digest_Type) is Empty : constant Keccak.Types.Byte_Array (0 .. -1) := (others => 0); begin if State_Of (Ctx) = Updating then -- Need to add the suffix bits Hash_Sponge.Absorb_With_Suffix (Ctx.Sponge_Ctx, Empty, 0, Suffix, Suffix_Size); end if; Hash_Sponge.Squeeze (Ctx.Sponge_Ctx, Digest); end Final; end Keccak.Generic_Hash;
-- SPDX-FileCopyrightText: 2020-2021 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Nodes.Proxy_Associations; package body Program.Nodes.Proxy_Calls is ----------------- -- Called_Name -- ----------------- overriding function Called_Name (Self : Proxy_Call) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Called_Name; end Called_Name; ------------------------------------- -- Can_Be_Parenthesized_Expression -- ------------------------------------- function Can_Be_Parenthesized_Expression (Self : Proxy_Call'Class) return Boolean is begin for J in Self.Elements.Each_Element loop declare Item : constant Program.Elements.Record_Component_Associations .Record_Component_Association_Access := J.Element.To_Record_Component_Association; begin if Item.Choices.Length /= 0 or else not Item.Component_Value.Assigned or else J.Index > 1 then return False; end if; end; end loop; return Self.Elements.Length = 1; end Can_Be_Parenthesized_Expression; ---------------- -- Components -- ---------------- overriding function Components (Self : Proxy_Call) return Program.Elements.Record_Component_Associations .Record_Component_Association_Vector_Access is begin return Self.This.Components'Unchecked_Access; end Components; ------------ -- Create -- ------------ function Create (Called_Name : Program.Elements.Expressions.Expression_Access; Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access; Parameters : Program.Element_Vectors.Element_Vector_Access; Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access) return Proxy_Call is begin pragma Warnings (Off, "others choice is redundant"); -- gpl 2019 return Self : aliased Proxy_Call := (This => <>, Current => A_Record_Aggregate, Called_Name => Called_Name, Left_Bracket_Token => Left_Bracket_Token, Elements => Parameters, Components => <>, Parameters => <>, Discr => <>, Ranges => <>, Right_Bracket_Token => Right_Bracket_Token, Semicolon_Token => null, Enclosing_Element => null, Text => <>) do if Called_Name.Assigned then Set_Enclosing_Element (Self.Called_Name, Self'Unchecked_Access); end if; for Item in Self.Elements.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; end return; end Create; --------------- -- Delimiter -- --------------- overriding function Delimiter (Self : Base_Vector; Index : Positive) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Parent.Elements.Delimiter (Index); end Delimiter; ------------------- -- Discriminants -- ------------------- overriding function Discriminants (Self : Proxy_Call) return not null Program.Elements.Discriminant_Associations .Discriminant_Association_Vector_Access is begin return Self.This.Discr'Unchecked_Access; end Discriminants; ------------- -- Element -- ------------- overriding function Element (Self : Record_Component_Association_Vector; Index : Positive) return not null Program.Elements.Element_Access is begin return Self.Parent.Elements.Element (Index); end Element; ------------- -- Element -- ------------- overriding function Element (Self : Parameter_Vector; Index : Positive) return not null Program.Elements.Element_Access is begin return Self.Parent.Elements.Element (Index); end Element; ------------- -- Element -- ------------- overriding function Element (Self : Discriminant_Association_Vector; Index : Positive) return not null Program.Elements.Element_Access is begin return Self.Parent.Elements.Element (Index); end Element; ------------- -- Element -- ------------- overriding function Element (Self : Discrete_Range_Vector; Index : Positive) return not null Program.Elements.Element_Access is Result : not null Program.Elements.Element_Access := Self.Parent.Elements.Element (Index); begin if Result.Is_Discrete_Simple_Expression_Range then Result := Program.Nodes.Proxy_Associations.Proxy_Association_Access (Result).Choices.Element (1); end if; return Result; end Element; ---------------- -- Get_Length -- ---------------- overriding function Get_Length (Self : Base_Vector) return Positive is begin return Self.Parent.Elements.Get_Length; end Get_Length; ----------------------- -- Is_Call_Statement -- ----------------------- overriding function Is_Call_Statement (Self : Proxy_Call) return Boolean is begin return Self.Current = A_Call_Statement; end Is_Call_Statement; ------------------- -- Is_Constraint -- ------------------- overriding function Is_Constraint (Self : Proxy_Call) return Boolean is begin return Self.Current in A_Discriminant_Constraint | An_Index_Constraint; end Is_Constraint; ------------------- -- Is_Definition -- ------------------- overriding function Is_Definition (Self : Proxy_Call) return Boolean is begin return Self.Current in A_Discriminant_Constraint | An_Index_Constraint; end Is_Definition; -------------------------------- -- Is_Discriminant_Constraint -- -------------------------------- overriding function Is_Discriminant_Constraint (Self : Proxy_Call) return Boolean is begin return Self.Current = A_Discriminant_Constraint; end Is_Discriminant_Constraint; ------------------- -- Is_Expression -- ------------------- overriding function Is_Expression (Self : Proxy_Call) return Boolean is begin return Self.Current in A_Record_Aggregate | A_Function_Call; end Is_Expression; ---------------------- -- Is_Function_Call -- ---------------------- overriding function Is_Function_Call (Self : Proxy_Call) return Boolean is begin return Self.Current = A_Function_Call; end Is_Function_Call; ------------------------- -- Is_Index_Constraint -- ------------------------- overriding function Is_Index_Constraint (Self : Proxy_Call) return Boolean is begin return Self.Current = An_Index_Constraint; end Is_Index_Constraint; ------------------------- -- Is_Record_Aggregate -- ------------------------- overriding function Is_Record_Aggregate (Self : Proxy_Call) return Boolean is begin return Self.Current = A_Record_Aggregate; end Is_Record_Aggregate; ------------------ -- Is_Statement -- ------------------ overriding function Is_Statement (Self : Proxy_Call) return Boolean is begin return Self.Current = A_Call_Statement; end Is_Statement; ------------------------ -- Left_Bracket_Token -- ------------------------ overriding function Left_Bracket_Token (Self : Proxy_Call) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Left_Bracket_Token; end Left_Bracket_Token; ------------------------ -- Left_Bracket_Token -- ------------------------ overriding function Left_Bracket_Token (Self : Proxy_Call_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Parent.Left_Bracket_Token; end Left_Bracket_Token; ---------------- -- Parameters -- ---------------- overriding function Parameters (Self : Proxy_Call) return Program.Elements.Parameter_Associations .Parameter_Association_Vector_Access is begin return Self.This.Parameters'Unchecked_Access; end Parameters; ------------ -- Prefix -- ------------ overriding function Prefix (Self : Proxy_Call) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Called_Name; end Prefix; ------------ -- Ranges -- ------------ overriding function Ranges (Self : Proxy_Call) return not null Program.Elements.Discrete_Ranges .Discrete_Range_Vector_Access is begin return Self.This.Ranges'Unchecked_Access; end Ranges; ------------------------- -- Right_Bracket_Token -- ------------------------- overriding function Right_Bracket_Token (Self : Proxy_Call) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Right_Bracket_Token; end Right_Bracket_Token; ------------------------- -- Right_Bracket_Token -- ------------------------- overriding function Right_Bracket_Token (Self : Proxy_Call_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Parent.Right_Bracket_Token; end Right_Bracket_Token; --------------------- -- Semicolon_Token -- --------------------- overriding function Semicolon_Token (Self : Proxy_Call) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Semicolon_Token; end Semicolon_Token; ---------------------------- -- To_Call_Statement_Text -- ---------------------------- overriding function To_Call_Statement_Text (Self : in out Proxy_Call) return Program.Elements.Call_Statements.Call_Statement_Text_Access is begin return Self'Unchecked_Access; end To_Call_Statement_Text; ------------------------------------- -- To_Discriminant_Constraint_Text -- ------------------------------------- overriding function To_Discriminant_Constraint_Text (Self : in out Proxy_Call) return Program.Elements.Discriminant_Constraints .Discriminant_Constraint_Text_Access is begin return Self.Text'Unchecked_Access; end To_Discriminant_Constraint_Text; --------------------------- -- To_Function_Call_Text -- --------------------------- overriding function To_Function_Call_Text (Self : in out Proxy_Call) return Program.Elements.Function_Calls.Function_Call_Text_Access is begin return Self'Unchecked_Access; end To_Function_Call_Text; ------------------------------ -- To_Index_Constraint_Text -- ------------------------------ overriding function To_Index_Constraint_Text (Self : in out Proxy_Call) return Program.Elements.Index_Constraints.Index_Constraint_Text_Access is begin return Self.Text'Unchecked_Access; end To_Index_Constraint_Text; ------------------------------ -- To_Record_Aggregate_Text -- ------------------------------ overriding function To_Record_Aggregate_Text (Self : in out Proxy_Call) return Program.Elements.Record_Aggregates.Record_Aggregate_Text_Access is begin return Self.Text'Unchecked_Access; end To_Record_Aggregate_Text; ------------------------------------- -- Turn_To_Discriminant_Constraint -- ------------------------------------- procedure Turn_To_Discriminant_Constraint (Self : in out Proxy_Call'Class; Mark : out Program.Elements.Expressions.Expression_Access) is begin Self.Current := A_Discriminant_Constraint; Mark := Self.Called_Name; for Item in Self.Elements.Each_Element loop Program.Nodes.Proxy_Associations.Proxy_Association_Access (Item.Element).Turn_To_Discriminant_Association; end loop; end Turn_To_Discriminant_Constraint; --------------------------- -- Turn_To_Function_Call -- --------------------------- procedure Turn_To_Function_Call (Self : in out Proxy_Call'Class; Called_Name : not null Program.Elements.Expressions.Expression_Access) is begin Self.Current := A_Function_Call; Self.Called_Name := Called_Name; for Item in Self.Elements.Each_Element loop Program.Nodes.Proxy_Associations.Proxy_Association_Access (Item.Element).Turn_To_Parameter; end loop; end Turn_To_Function_Call; ------------------------------ -- Turn_To_Index_Constraint -- ------------------------------ procedure Turn_To_Index_Constraint (Self : in out Proxy_Call'Class) is begin Self.Current := An_Index_Constraint; for Item in Self.Elements.Each_Element loop Program.Nodes.Proxy_Associations.Proxy_Association_Access (Item.Element).Turn_To_Discrete_Range; end loop; end Turn_To_Index_Constraint; -------------------------------------- -- Turn_To_Parenthesized_Expression -- -------------------------------------- procedure Turn_To_Parenthesized_Expression (Self : in out Proxy_Call'Class) is begin raise Program_Error; end Turn_To_Parenthesized_Expression; ---------------------------- -- Turn_To_Procedure_Call -- ---------------------------- procedure Turn_To_Procedure_Call (Self : in out Proxy_Call'Class; Semicolon_Token : Program.Lexical_Elements.Lexical_Element_Access) is begin Self.Current := A_Call_Statement; Self.Semicolon_Token := Semicolon_Token; end Turn_To_Procedure_Call; ----------- -- Visit -- ----------- overriding procedure Visit (Self : not null access Proxy_Call; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin case Self.Current is when A_Call_Statement => Visitor.Call_Statement (Self); when A_Function_Call => Visitor.Function_Call (Self); when A_Discriminant_Constraint => Visitor.Discriminant_Constraint (Self); when An_Index_Constraint => Visitor.Index_Constraint (Self); when A_Record_Aggregate => Visitor.Record_Aggregate (Self); end case; end Visit; end Program.Nodes.Proxy_Calls;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A value pin is an input pin that provides a value by evaluating a value -- specification. ------------------------------------------------------------------------------ with AMF.UML.Input_Pins; limited with AMF.UML.Value_Specifications; package AMF.UML.Value_Pins is pragma Preelaborate; type UML_Value_Pin is limited interface and AMF.UML.Input_Pins.UML_Input_Pin; type UML_Value_Pin_Access is access all UML_Value_Pin'Class; for UML_Value_Pin_Access'Storage_Size use 0; not overriding function Get_Value (Self : not null access constant UML_Value_Pin) return AMF.UML.Value_Specifications.UML_Value_Specification_Access is abstract; -- Getter of ValuePin::value. -- -- Value that the pin will provide. not overriding procedure Set_Value (Self : not null access UML_Value_Pin; To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is abstract; -- Setter of ValuePin::value. -- -- Value that the pin will provide. end AMF.UML.Value_Pins;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . P A C K _ 4 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Handling of packed arrays with Component_Size = 42 package System.Pack_42 is pragma Preelaborate; Bits : constant := 42; type Bits_42 is mod 2 ** Bits; for Bits_42'Size use Bits; function Get_42 (Arr : System.Address; N : Natural) return Bits_42; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. procedure Set_42 (Arr : System.Address; N : Natural; E : Bits_42); -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. function GetU_42 (Arr : System.Address; N : Natural) return Bits_42; -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is extracted and returned. This version -- is used when Arr may represent an unaligned address. procedure SetU_42 (Arr : System.Address; N : Natural; E : Bits_42); -- Arr is the address of the packed array, N is the zero-based -- subscript. This element is set to the given value. This version -- is used when Arr may represent an unaligned address end System.Pack_42;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Element_Vectors; with Program.Lexical_Elements; with Program.Elements.Identifiers; with Program.Elements.Protected_Definitions; with Program.Element_Visitors; package Program.Nodes.Protected_Definitions is pragma Preelaborate; type Protected_Definition is new Program.Nodes.Node and Program.Elements.Protected_Definitions.Protected_Definition and Program.Elements.Protected_Definitions.Protected_Definition_Text with private; function Create (Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; End_Name : Program.Elements.Identifiers.Identifier_Access) return Protected_Definition; type Implicit_Protected_Definition is new Program.Nodes.Node and Program.Elements.Protected_Definitions.Protected_Definition with private; function Create (Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Name : Program.Elements.Identifiers.Identifier_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Protected_Definition with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Protected_Definition is abstract new Program.Nodes.Node and Program.Elements.Protected_Definitions.Protected_Definition with record Visible_Declarations : Program.Element_Vectors.Element_Vector_Access; Private_Declarations : Program.Element_Vectors.Element_Vector_Access; End_Name : Program.Elements.Identifiers.Identifier_Access; end record; procedure Initialize (Self : in out Base_Protected_Definition'Class); overriding procedure Visit (Self : not null access Base_Protected_Definition; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Visible_Declarations (Self : Base_Protected_Definition) return Program.Element_Vectors.Element_Vector_Access; overriding function Private_Declarations (Self : Base_Protected_Definition) return Program.Element_Vectors.Element_Vector_Access; overriding function End_Name (Self : Base_Protected_Definition) return Program.Elements.Identifiers.Identifier_Access; overriding function Is_Protected_Definition (Self : Base_Protected_Definition) return Boolean; overriding function Is_Definition (Self : Base_Protected_Definition) return Boolean; type Protected_Definition is new Base_Protected_Definition and Program.Elements.Protected_Definitions.Protected_Definition_Text with record Private_Token : not null Program.Lexical_Elements .Lexical_Element_Access; End_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Protected_Definition_Text (Self : in out Protected_Definition) return Program.Elements.Protected_Definitions .Protected_Definition_Text_Access; overriding function Private_Token (Self : Protected_Definition) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function End_Token (Self : Protected_Definition) return not null Program.Lexical_Elements.Lexical_Element_Access; type Implicit_Protected_Definition is new Base_Protected_Definition with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; end record; overriding function To_Protected_Definition_Text (Self : in out Implicit_Protected_Definition) return Program.Elements.Protected_Definitions .Protected_Definition_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Protected_Definition) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Protected_Definition) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Protected_Definition) return Boolean; end Program.Nodes.Protected_Definitions;
-- ----------------------------------------------------------------------------- -- Copyright (C) 2003-2019 Stichting Mapcode Foundation (http://www.mapcode.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.Characters.Handling; with Mapcode_Utils.Str_Tools, Mapcode_Utils.Bits; use Mapcode_Utils; with Mapcodes.Languages; with Ndata; package body Mapcodes is subtype Lint is Long_Long_Integer; -- All functions returning a Integer return a natural or Error Error : constant Integer := -1; -- All functions returning a string may return Undefined, on error Undefined : constant String := ""; subtype Country_Range is Positive range Countries.Territories_Def'Range; function Iso3166Alpha_Of (Index : Natural) return String is begin if Index + 1 <= Country_Range'Last then return Countries.Territories_Def(Index + 1).Code.Image; else return Undefined; end if; end Iso3166Alpha_Of; Aliases : constant String := "2UK=2UT,2CG=2CT,1GU=GUM,1UM=UMI,1VI=VIR,1AS=ASM,1MP=MNP,4CX=CXR,4CC=CCK," & "4NF=NFK,4HM=HMD,COL=5CL,5ME=5MX,MEX=5MX,5AG=AGU,5BC=BCN,5BS=BCS,5CM=CAM," & "5CS=CHP,5CH=CHH,5CO=COA,5DF=DIF,5DG=DUR,5GT=GUA,5GR=GRO,5HG=HID,5JA=JAL," & "5MI=MIC,5MO=MOR,5NA=NAY,5NL=NLE,5OA=OAX,5PB=PUE,5QE=QUE,5QR=ROO,5SL=SLP," & "5SI=SIN,5SO=SON,5TB=TAB,5TL=TLA,5VE=VER,5YU=YUC,5ZA=ZAC,811=8BJ,812=8TJ," & "813=8HE,814=8SX,815=8NM,821=8LN,822=8JL,823=8HL,831=8SH,832=8JS,833=8ZJ," & "834=8AH,835=8FJ,836=8JX,837=8SD,841=8HA,842=8HB,843=8HN,844=8GD,845=8GX," & "846=8HI,850=8CQ,851=8SC,852=8GZ,853=8YN,854=8XZ,861=8SN,862=8GS,863=8QH," & "864=8NX,865=8XJ,871=TWN,891=HKG,892=MAC,8TW=TWN,8HK=HKG,8MC=MAC,BEL=7BE," & "KIR=7KI,PRI=7PO,CHE=7CH,KHM=7KM,PER=7PM,TAM=7TT,0US=USA,0AU=AUS,0RU=RUS," & "0CN=CHN,TAA=SHN,ASC=SHN,DGA=IOT,WAK=MHL,JTN=UMI,MID=1HI,1PR=PRI,5TM=TAM," & "TAM=TAM,2OD=2OR,"; Usa_From : constant := 343; Usa_Upto : constant := 393; Ccode_Usa : constant := 410; Ind_From : constant := 271; Ind_Upto : constant := 306; Ccode_Ind : constant := 407; Can_From : constant := 394; Can_Upto : constant := 406; Ccode_Can : constant := 495; Aus_From : constant := 307; Aus_Upto : constant := 315; Ccode_Aus : constant := 408; Mex_From : constant := 233; Mex_Upto : constant := 264; Ccode_Mex : constant := 411; Bra_From : constant := 316; Bra_Upto : constant := 342; Ccode_Bra : constant := 409; Chn_From : constant := 497; Chn_Upto : constant := 527; Ccode_Chn : constant := 528; Rus_From : constant := 412; Rus_Upto : constant := 494; Ccode_Rus : constant := 496; Ccode_Earth : constant := 532; -- Parent territories Parent_Length : constant := 8; subtype String3 is String (1 .. 3); Parents3 : constant array (1 .. Parent_Length) of String3 := ("USA", "IND", "CAN", "AUS", "MEX", "BRA", "RUS", "CHN"); subtype String2 is String (1 .. 2); Parents2 : constant array (1 .. Parent_Length) of String2 := ("US", "IN", "CA", "AU", "MX", "BR", "RU", "CN"); -- Returns 2-letter parent country abbreviation (disam in range 1..8) function Parent_Name2 (Disam : Positive) return String is (Parents2 (Disam)); -- Given a parent country abbreviation, return disam (in range 1-8) or -- Error function Parent_Letter (Territory_Alpha_Code : String) return Integer is Srch : constant String := Str_Tools.Upper_Str (Territory_Alpha_Code); begin if Srch'Length = 2 then for I in Parents2'Range loop if Srch = Parents2(I) then return I; end if; end loop; elsif Srch'Length = 3 then for I in Parents3'Range loop if Srch = Parents3(I) then return I; end if; end loop; end if; return Error; end Parent_Letter; function Image (I : Integer) return String is Str : constant String := I'Img; begin return (if Str(Str'First) /= ' ' then Str else Str (Integer'Succ(Str'First) .. Str'Last)); end Image; -- Returns alias of ISO abbreviation (if any), or empty function Alias2Iso (Territory_Alpha_Code : String) return String is -- Look for "DigitCrit=" function Match (Crit, Within : String) return Natural is Occ : Positive := 1; I : Natural; begin loop I := Str_Tools.Locate (Within, Crit, Occurence => Occ); exit when I = 0; if I > 1 and then Within(I - 1) >= '0' and then Within(I - 1) <= '9' then return I - 1; end if; Occ := Occ + 1; end loop; return 0; end Match; Index : Natural; begin Index := (if Territory_Alpha_Code'Length = 2 then Match (Territory_Alpha_Code & "=", Aliases) else Str_Tools.Locate (Aliases, Territory_Alpha_Code & "=")); if Index /= 0 then return Aliases (Index + 4 .. Index + 6); else return Undefined; end if; end Alias2Iso; -- Given ISO code, return Territory_Number or Error function Find_Iso (Territory_Alpha_Code : String) return Integer is begin for I in Country_Range loop if Countries.Territories_Def(I).Code.Image = Territory_Alpha_Code then return I - 1; end if; end loop; return Error; end Find_Iso; -- Given ISO code, return territoryNumber or Error function Iso2Ccode (Alpha_Code : String; Context : in String) return Integer is function Is_Digit (Char : Character) return Boolean is (Char >= '0' and then Char <= '9'); function Is_Digits (Str : String) return Boolean is begin for I in Str'Range loop if not Is_Digit (Str(I)) then return False; end if; end loop; return Str /= ""; end Is_Digits; N, Sep : Natural; P, Tmpp : Integer; Result, Index : Integer; Isoa : As_U.Asu_Us; Code2Search, Context2Search : As_U.Asu_Us; Hyphenated : As_U.Asu_Us; use all type As_U.Asu_Us; begin if Alpha_Code = Undefined then return Error; end if; P := Parent_Letter (Context); if P = Error and then Context /= "" and then Context /= "AAA" then return Error; end if; Sep := Str_Tools.Locate (Alpha_Code, "-"); Code2Search := Tus (Str_Tools.Upper_Str (Alpha_Code)); if P /= Error and then Sep /= 0 then -- Cannot provide a context together with territory-subdivision return Error; end if; -- Optims: direct number or code if P = Error and then Sep = 0 then -- Direct territory number if Is_Digits (Code2Search.Image) then N := Natural'Value (Code2Search.Image); if N <= Ccode_Earth then return N; end if; end if; -- Check if a simple territory if Code2Search.Length = 3 then Index := Find_Iso (Code2Search.Image); if Index /= Error then return Index; end if; end if; -- Find unique occurence of subdivision in ANY context if Code2Search.Length >= 2 then Hyphenated := Tus ("-") & Code2Search; Result := Error; for I in Country_Range loop Index := Str_Tools.Locate (Countries.Territories_Def(I).Code.Image, Hyphenated.Image); if Index > 0 and then Index = Countries.Territories_Def(I).Code.Length - Hyphenated.Length + 1 then -- iso3166alpha ends by Hyphenated if Result /= Error then -- Not unique return Error; else Result := I - 1; end if; end if; end loop; if Result /= Error then return Result; end if; end if; end if; -- Set Context and Code for search if Context /= "" then -- Context provided Context2Search.Set (Context); elsif Sep /= 0 then -- Code contains a prefix Context2Search := Code2Search.Uslice (1, Sep - 1); Code2Search.Delete (1, Sep); P := Parent_Letter (Context2Search.Image); if P = Error and then Context2Search.Image /= "AAA" then return Error; end if; end if; -- Sanity check if Code2Search.Length /= 2 and then Code2Search.Length /= 3 then return Error; end if; -- Optim: search this prefix and code if P /= Error then Index := Find_Iso (Parent_Name2 (P) & "-" & Code2Search.Image); if Index /= Error then return Index; end if; end if; -- Resolve alias if P /= Error then -- Alias for a subdivision with context Isoa := Tus (Alias2Iso (Image (P) & Code2Search.Image)); end if; if Isoa.Is_Null and then Code2Search.Length = 3 then -- Alias for a territory or subdivision without context Isoa := Tus (Alias2Iso (Code2Search.Image)); end if; if Isoa.Is_Null then Index := Error; else if Is_Digit (Isoa.Element (1)) then -- Alias is a subdivision Code2Search := Isoa.Uslice (2, Isoa.Length); Tmpp := Integer'Value (Isoa.Slice (1, 1)); if P /= Error and then Tmpp /= P then -- Cannot change territory through aliasing return Error; end if; P := Tmpp; Index := Find_Iso (Parent_Name2 (P) & "-" & Code2Search.Image); else -- Alias is a subdivision or territory Code2Search := Isoa; -- Search for a territory Index := Find_Iso (Code2Search.Image); if Index = Error and then P /= Error then -- Search for a subdivision Index := Find_Iso (Parent_Name2 (P) & "-" & Code2Search.Image); end if; end if; end if; -- Return valid result if Index /= Error then return Index; end if; if P /= Error then -- With a context, the search shall have succeded return Error; end if; -- All else failed, try non-disambiguated alphacode Isoa := Tus (Alias2Iso (Code2Search.Image)); if not Isoa.Is_Null then if Is_Digit (Isoa.Element (1)) then -- Starts with digit Code2Search := Tus (Parent_Name2 (Natural'Value (Isoa.Slice (1, 1))) & "-" & Isoa.Slice (2, Isoa.Length)); else Code2Search := Isoa; end if; return Iso2Ccode (Code2Search.Image, Context); end if; return Error; end Iso2Ccode; -- Image of a territory (index starting at 0 for VAT) function Get_Territory_Number (Territory : Territories) return String is (Image (Integer (Territory))); -- Given an alphacode (such As_US-AL), returns the territory number -- or Error. -- A context_Territory number helps to interpret ambiguous (abbreviated) -- AlphaCodes, such as "AL" function Get_Territory (Territory_Code : String; Context : in String := "") return Territories is Num : Integer; begin Num := Iso2Ccode (Territory_Code, Context); if Num = Error then raise Unknown_Territory; end if; return Territories (Num); end Get_Territory; -- Return full name of territory function Get_Territory_Fullname (Territory: in Territories) return String is Name : As_U.Asu_Us; Index : Natural; begin Name := Countries.Territories_Def(Positive (Territory) + 1).Name; Index := Str_Tools.Locate (Name.Image, " ("); if Index > 0 then return Name.Slice (1, Index - 1); else return Name.Image; end if; end Get_Territory_Fullname; -- Return the AlphaCode (usually an ISO 3166 code) of a territory -- Format: Local (often ambiguous), International (full and unambiguous, -- DEFAULT), or Shortest function Get_Territory_Alpha_Code ( Territory : Territories; Format : Territory_Formats := International) return String is Full : constant String := Iso3166Alpha_Of (Natural (Territory)); Iso : As_U.Asu_Us; Hyphen, Index : Natural; Short : As_U.Asu_Us; Count : Natural; begin Hyphen := Str_Tools.Locate (Full, "-"); if Format = International or else Hyphen = 0 then -- Format full or no hyphen return Full; end if; Short := As_U.Tus (Full(Hyphen + 1 .. Full'Last)); if Format = Local then -- Format local return Short.Image; end if; -- Shortest possible -- Keep parent if it has aliases or if territory occurs multiple times Count := 0; if Str_Tools.Locate (Aliases, Short.Image & "=") > 0 then Count := 2; else for I in Country_Range loop Iso := As_U.Tus (Iso3166Alpha_Of (I)); Index := Str_Tools.Locate (Iso.Image, "-" & Short.Image); if Index > 0 and then Index + Short.Length = Iso.Length then Count := Count + 1; exit when Count = 2; end if; end loop; end if; return (if Count = 1 then Short.Image else Full); end Get_Territory_Alpha_Code; -- Return parent country of subdivision or error (if territory is not a -- subdivision) function Get_Parent (Territory : Territories) return Integer is begin return (case Territory is when Usa_From .. Usa_Upto => Ccode_Usa, when Ind_From .. Ind_Upto => Ccode_Ind, when Can_From .. Can_Upto => Ccode_Can, when Aus_From .. Aus_Upto => Ccode_Aus, when Mex_From .. Mex_Upto => Ccode_Mex, when Bra_From .. Bra_Upto => Ccode_Bra, when Rus_From .. Rus_Upto => Ccode_Rus, when Chn_From .. Chn_Upto => Ccode_Chn, when others => Error); end Get_Parent; function Get_Parent_Of (Territory : Territories) return Territories is Code : constant Integer := Get_Parent (Territory); begin if Code = Error then raise Not_A_Subdivision; else return Territories (Code); end if; end Get_Parent_Of; -- Return True if Territory is a state function Is_Subdivision (Territory : Territories) return Boolean is (Get_Parent (Territory) /= Error); -- Return True if Territory is a country that has states function Has_Subdivision (Territory : Territories) return Boolean is Code : constant String := Get_Territory_Alpha_Code (Territory); begin for Parent of Parents3 loop if Code = Parent then return True; end if; end loop; return False; end Has_Subdivision; -- Given a subdivision, return the array of subdivisions with same name -- with various parents function Get_Subdivisions_With (Subdivision : String) return Territories_Array is Upper_Subd : constant String := Str_Tools.Upper_Str (Subdivision); Ccodes : array (1 .. Parent_Length) of Integer; Nb_Ok : Natural := 0; begin -- Count and store valid combinations of a Parent and this subdivision for I in Parents2'Range loop Ccodes(I) := Iso2Ccode (Upper_Subd, Parents2(I)); if Ccodes(I) /= Error then Nb_Ok := Nb_Ok + 1; end if; end loop; -- Return array of valid combinations return Result : Territories_Array (1 .. Nb_Ok) do Nb_Ok := 0; for Ccode of Ccodes loop if Ccode /= Error then Nb_Ok := Nb_Ok + 1; Result(Nb_Ok) := Territories (Ccode); end if; end loop; end return; end Get_Subdivisions_With; -- Low-level routines for data access type Min_Max_Rec is record Minx, Miny, Maxx, Maxy : Lint; end record; function Data_First_Record (Territory_Number : Natural) return Integer is begin return Ndata.Data_Start(Territory_Number + 1); exception when others => return Error; end Data_First_Record; function Data_Last_Record (Territory_Number : Natural) return Integer is begin return Ndata.Data_Start(Territory_Number + 2) - 1; exception when others => return Error; end Data_Last_Record; function Min_Max_Setup (I : Natural) return Min_Max_Rec is Short_Maxy : constant array (Positive range <>) of Natural := (0, 122309, 27539, 27449, 149759, 2681190, 60119, 62099, 491040, 86489); D : Natural; begin D := Ndata.Data_Maxy(I + 1); if D < Short_Maxy'Last then D := Short_Maxy(D + 1); end if; return (Minx => Lint (Ndata.Data_Minx(I + 1)), Miny => Lint (Ndata.Data_Miny(I + 1)), Maxx => Lint (Ndata.Data_Minx(I + 1) + Ndata.Data_Maxx(I + 1)), Maxy => Lint (Ndata.Data_Miny(I + 1) + D)); end Min_Max_Setup; Xdivider19 : constant array (Positive range <>) of Natural := ( 360, 360, 360, 360, 360, 360, 361, 361, 361, 361, -- 5.2429 degrees 362, 362, 362, 363, 363, 363, 364, 364, 365, 366, -- 10.4858 degrees 366, 367, 367, 368, 369, 370, 370, 371, 372, 373, -- 15.7286 degrees 374, 375, 376, 377, 378, 379, 380, 382, 383, 384, -- 20.9715 degrees 386, 387, 388, 390, 391, 393, 394, 396, 398, 399, -- 26.2144 degrees 401, 403, 405, 407, 409, 411, 413, 415, 417, 420, -- 31.4573 degrees 422, 424, 427, 429, 432, 435, 437, 440, 443, 446, -- 36.7002 degrees 449, 452, 455, 459, 462, 465, 469, 473, 476, 480, -- 41.9430 degrees 484, 488, 492, 496, 501, 505, 510, 515, 520, 525, -- 47.1859 degrees 530, 535, 540, 546, 552, 558, 564, 570, 577, 583, -- 52.4288 degrees 590, 598, 605, 612, 620, 628, 637, 645, 654, 664, -- 57.6717 degrees 673, 683, 693, 704, 715, 726, 738, 751, 763, 777, -- 62.9146 degrees 791, 805, 820, 836, 852, 869, 887, 906, 925, 946, -- 68.1574 degrees -- 73.4003 degrees 968, 990, 1014, 1039, 1066, 1094, 1123, 1154, 1187, 1223, -- 78.6432 degrees 1260, 1300, 1343, 1389, 1438, 1490, 1547, 1609, 1676, 1749, -- 83.8861 degrees 1828, 1916, 2012, 2118, 2237, 2370, 2521, 2691, 2887, 3114, -- 89.1290 degrees 3380, 3696, 4077, 4547, 5139, 5910, 6952, 8443, 10747, 14784, 23681, 59485); Nc : constant array (Positive range <>) of Natural := ( 1, 31, 961, 29791, 923521, 28629151, 887503681); X_Side : constant array (Positive range <>) of Natural := ( 0, 5, 31, 168, 961, 168 * 31, 29791, 165869, 923521, 5141947, 28629151); Y_Side : constant array (Positive range <>) of Natural := ( 0, 6, 31, 176, 961, 176 * 31, 29791, 165869, 923521, 5141947, 28629151); Decode_Char : constant array (Positive range <>) of Integer := ( -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, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, -2, 10, 11, 12, -3, 13, 14, 15, 1, 16, 17, 18, 19, 20, 0, 21, 22, 23, 24, 25, -4, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, -1, -2, 10, 11, 12, -3, 13, 14, 15, 1, 16, 17, 18, 19, 20, 0, 21, 22, 23, 24, 25, -4, 26, 27, 28, 29, 30, -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); Encode_Char : constant array (Positive range <>) of Character := ( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', 'A', 'E', 'U'); function Decode_A_Char (C : Natural) return Integer is (Decode_Char(C + 1)); function Encode_A_Char (C : Natural) return Character is (Encode_Char(C + 1)); -- Given a minimum and maximum latitude, returns a relative stretch factor -- (in 360th) for the longitud function Xdivider4 (Miny, Maxy : Lint) return Natural is use Bits; begin if Miny >= 0 then return Xdivider19(Integer (Shr (Miny, 19)) + 1); end if; if Maxy >= 0 then return Xdivider19(1); end if; return Xdivider19(Integer (Shr (-Maxy, 19)) + 1); end Xdivider4; type Coord_Rec is record X, Y : Lint; end record; type Frac_Rec is record Fraclon, Fraclat : Integer; Coord32 : Coord_Rec; end record; -- Return True if x in range (all values in millionths) function Is_In_Range_X (X, Minx, Maxx : Lint) return Boolean is Lx : Lint; begin if Minx <= X and then X < Maxx then return True; end if; Lx := X; if Lx < Minx then Lx := Lx + 360000000; else Lx := Lx - 360000000; end if; return Minx <= Lx and then Lx < Maxx; end Is_In_Range_X; -- Return True if coordinate inside rectangle (all values in millionths) function Fits_Inside (Coord : Coord_Rec; Min_Max : Min_Max_Rec) return Boolean is (Min_Max.Miny <= Coord.Y and then Coord.Y < Min_Max.Maxy and then Is_In_Range_X (Coord.X, Min_Max.Minx, Min_Max.Maxx)); -- Mapcodezone type Mapcode_Zone_Rec is record Fminx, Fmaxx, Fminy, Fmaxy : Lint := 0; end record; -- Empty Mapcode_Zone Mz_Empty : constant Mapcode_Zone_Rec := (others => <>); function Mz_Is_Empty (Zone : Mapcode_Zone_Rec) return Boolean is (Zone.Fmaxx <= Zone.Fminx or else Zone.Fmaxy <= Zone.Fminy); -- Construct MapcodeZone based on coordinate and deltas (in Fractions) function Mz_Set_From_Fractions (Y, X, Ydelta, Xdelta : Lint) return Mapcode_Zone_Rec is (if Ydelta < 0 then (Fminx => X, Fmaxx => X + Xdelta, Fminy => Y + 1 + Ydelta, -- y+yDelta can NOT be represented Fmaxy => Y + 1) -- y CAN be represented else (Fminx => X, Fmaxx => X + Xdelta, Fminy => Y, Fmaxy => Y + Ydelta)); function Mz_Mid_Point_Fractions (Zone : Mapcode_Zone_Rec) return Coord_Rec is ( (Y => (Zone.Fminy + Zone.Fmaxy) / 2, X => (Zone.Fminx + Zone.Fmaxx) / 2)); function Convert_Fractions_To_Coord32 (P : Coord_Rec) return Coord_Rec is ( (Y => P.Y / 810000, X => P.X / 3240000) ); function Wrap (P : Coord_Rec) return Coord_Rec is Res : Coord_Rec := P; begin if Res.X >= 180 * 3240000 * 1000000 then Res.X := Res.X - 360 * 3240000 * 1000000; end if; if Res.X < -180 * 3240000 * 1000000 then Res.X := Res.X + 360 * 3240000 * 1000000; end if; return Res; end Wrap; function Round (Val, Max : Real) return Real is Epsilon : constant Real := 0.0000005; begin if Val < 0.0 then if Val < -Max and then Val >= -Max - Epsilon then return -Max; end if; else if Val > Max and then Val <= Max + Epsilon then return Max; end if; end if; return Val; end Round; function Convert_Fractions_To_Degrees (P : Coord_Rec) return Coordinate is begin return (Lat => Round (Real (P.Y) / 810000.0 / 1000000.0, 90.0), Lon => Round (Real (P.X) / 3240000.0 / 1000000.0, 180.0) ); end Convert_Fractions_To_Degrees; function Mz_Restrict_Zone_To (Zone : Mapcode_Zone_Rec; Mm : Min_Max_Rec) return Mapcode_Zone_Rec is Z : Mapcode_Zone_Rec := Zone; Miny : constant Lint := Mm.Miny * 810000; Maxy : constant Lint := Mm.Maxy * 810000; Minx : Lint; Maxx : Lint; begin if Z.Fminy < Miny then Z.Fminy := Miny; end if; if Z.Fmaxy > Maxy then Z.Fmaxy := Maxy; end if; if Z.Fminy < Z.Fmaxy then Minx := Mm.Minx * 3240000; Maxx := Mm.Maxx * 3240000; if Maxx < 0 and then Z.Fminx > 0 then Minx := Minx + 360000000 * 3240000; Maxx := Maxx + 360000000 * 3240000; elsif Minx > 1 and then Z.Fmaxx < 0 then Minx := Minx - 360000000 * 3240000; Maxx := Maxx - 360000000 * 3240000; end if; if Z.Fminx < Minx then Z.Fminx := Minx; end if; if Z.Fmaxx > Maxx then Z.Fmaxx := Maxx; end if; end if; return Z; end Mz_Restrict_Zone_To; -- High-precision extension routines function Max_Mapcode_Precision return Natural is (8); -- PRIVATE lowest-level data access function Header_Letter (I : Natural) return String is Flags : constant Integer := Ndata.Data_Flags(I + 1); use Bits; begin if (Shr (Flags, 7) and 3) = 1 then return Encode_Char((Shr (Flags, 11) and 31) + 1) & ""; end if; return ""; end Header_Letter; function Smart_Div (I : Natural) return Integer is (Ndata.Data_Special1(I + 1)); function Is_Restricted (I : Natural) return Boolean is use Bits; begin return (Ndata.Data_Flags(I + 1) and 512) /= 0; end Is_Restricted; function Is_Nameless (I : Natural) return Boolean is use Bits; begin return (Ndata.Data_Flags(I + 1) and 64) /= 0; end Is_Nameless; function Is_Auto_Header (I : Natural) return Boolean is use Bits; begin return (Ndata.Data_Flags(I + 1) and Shl (8, 5)) /= 0; end Is_Auto_Header; function Codex_Len (I : Natural) return Integer is use Bits; Flags : constant Integer := Ndata.Data_Flags (I + 1) and 31; begin return Flags / 5 + Flags rem 5 + 1; end Codex_Len; function Co_Dex (I : Natural) return Integer is use Bits; Flags : constant Integer := Ndata.Data_Flags (I + 1) and 31; begin return 10 * (Flags / 5) + Flags rem 5 + 1; end Co_Dex; function Is_Special_Shape (I : Natural) return Boolean is use Bits; begin return (Ndata.Data_Flags(I + 1) and 1024) /= 0; end Is_Special_Shape; -- 1=pipe 2=plus 3=star function Rec_Type (I : Natural) return Integer is use Bits; begin return Shr (Ndata.Data_Flags(I + 1), 7) and 3; end Rec_Type; function First_Nameless_Record (Index : Natural; First_Code : Natural) return Natural is I : Integer := Index; Codex : constant Natural := Co_Dex (I); begin while I >= First_Code and then Co_Dex (I) = Codex and then Is_Nameless (I) loop I := I - 1; end loop; return I + 1; end First_Nameless_Record; function Count_Nameless_Records (Index : Natural; First_Code : Natural) return Natural is I : constant Natural := First_Nameless_Record (Index, First_Code); E : Natural := Index; Codex : constant Natural := Co_Dex (I); begin while Co_Dex(E) = Codex loop E := E + 1; end loop; return E - I; end Count_Nameless_Records; -- Return Lint immediately smaller than Real function Floor (X : Real) return Lint is Int : Lint; begin Int := Lint(X); if Real(Int) > X then Int := Int - 1; end if; return Int; end Floor; function Get_Encode_Rec(Lat, Lon : in Real) return Frac_Rec is Ilat : Real := Lat; Ilon : Real := Lon; D : Real; Fraclat, Fraclon : Lint; Lat32, Lon32 : Lint; begin if Ilat < -90.0 then Ilat := -90.0; elsif Ilat > 90.0 then Ilat := 90.0; end if; Ilat := Ilat + 90.0; -- Ilat now [0..180] Ilat := Ilat * 810000000000.0; Fraclat := Floor (Ilat + 0.1); D := Real (Fraclat) / 810000.0; Lat32 := Floor (D); Fraclat := Fraclat - Lat32 * 810000; Lat32 := Lat32 - 90000000; Ilon := Ilon - 360.0 * Real (Floor (Ilon / 360.0)); -- Lon now in [0..360> Ilon := Ilon * 3240000000000.0; Fraclon := Floor (Ilon + 0.1); D := Real (Fraclon) / 3240000.0; Lon32 := Floor (D); Fraclon := Fraclon - Lon32 * 3240000; if Lon32 >= 180000000 then Lon32 := Lon32 - 360000000; end if; return (Coord32 => (Y => Lat32, X => Lon32), Fraclat => Integer (Fraclat), Fraclon => Integer (Fraclon) ); end Get_Encode_Rec; function Encode_Base31 (Value : Lint; Nrchars : Natural) return String is Result : As_U.Asu_Us; Lv : Lint := Value; Ln : Natural := Nrchars; use type As_U.Asu_Us; begin while Ln > 0 loop Ln := Ln - 1; Result := Encode_Char(Integer (Lv rem 31) + 1) & Result; Lv := Lv / 31; end loop; return Result.Image; end Encode_Base31; -- Lowest level encode/decode routines function Decode_Base31 (Str : String) return Integer is Value : Integer := 0; C : Natural; begin for I in Str'Range loop C := Character'Pos (Str(I)); if C = 46 then -- Dot! return Value; end if; if Decode_Char(C + 1) < 0 then return Error; end if; Value := Value * 31 + Decode_Char(C + 1); end loop; return Value; end Decode_Base31; function Encode_Triple (Difx, Dify : Lint) return String is Rx, Ry, Cx, Cy : Lint; begin if Dify < 4 * 34 then Rx := Difx / 28; Ry := Dify / 34; Cx := Difx rem 28; Cy := Dify rem 34; return Encode_Char(Integer (Rx + 6 * Ry + 1)) & Encode_Base31 (Cx * 34 + Cy, 2); else Rx := Difx / 24; Cx := Difx rem 24; return Encode_Char(Integer (Rx + 25)) & Encode_Base31 (Cx * 40 + (Dify - 136), 2); end if; end Encode_Triple; function Decode_Triple (Input : String) return Coord_Rec is Triplex, Tripley : Integer; C1 : constant Character := Input(Input'First); I1 : constant Integer := Decode_Char(Character'Pos(C1) + 1); X : constant Integer := Decode_Base31 (Input(Positive'Succ(Input'First) .. Input'Last)); begin if I1 < 24 then Triplex := (I1 rem 6) * 28 + X / 34; Tripley := (I1 / 6) * 34 + X rem 34; else Tripley := X rem 40 + 136; Triplex := X / 40 + 24 * (I1 - 24); end if; return (Y => Lint (Tripley), X => Lint (Triplex)); end Decode_Triple; function Encode_Six_Wide (X, Y, Width, Height : in Integer) return Integer is D : Integer := 6; Col : Integer := X / 6; Maxcol : constant Integer := (Width - 4) / 6; begin if Col >= Maxcol then Col := Maxcol; D := Width - Maxcol * 6; end if; return Height * 6 * Col + (Height - 1 - Y) * D + X - Col * 6; end Encode_Six_Wide; function Decode_Six_Wide (V, Width, Height : in Integer) return Coord_Rec is D : Integer := 6; Col : Integer := V / (Height * 6); Maxcol : constant Integer := (Width - 4) / 6; W, X6, Y6 : Integer; begin if Col >= Maxcol then Col := Maxcol; D := Width - Maxcol * 6; end if; W := V - Col * Height * 6; X6 := Col * 6 + W rem D; Y6 := Height - 1 - W / D; return (Y => Lint (Y6), X => Lint (X6)); end Decode_Six_Wide; function Encode_Extension ( Input : String; Enc : Frac_Rec; Extrax4, Extray, Dividerx4, Dividery : Lint; Extradigits, Ydirection : Integer) return String is Factorx, Factory, Valx, Valy : Lint; Gx, Gy, Column1, Column2, Row1, Row2 : Integer; Digit : Integer := Extradigits; Result : As_U.Asu_Us; begin if Extradigits = 0 then return Input; end if; if Digit > Max_Mapcode_Precision then Digit := Max_Mapcode_Precision; end if; Result := As_U.Tus (Input); -- The following are all perfect integers -- 810000 = 30^4 Factorx := 810000 * Dividerx4; Factory := 810000 * Dividery; Valx := 810000 * Extrax4 + Lint (Enc.Fraclon); Valy := 810000 * Extray + Lint (Enc.Fraclat) * Lint (Ydirection); -- Protect against floating point errors if Valx < 0 then Valx := 0; elsif Valx >= Factorx then Valx := Factorx - 1; end if; if Valy < 0 then Valy := 0; elsif Valy >= Factory then Valy := Factory - 1; end if; Result.Append ('-'); loop Factorx := Factorx / 30; Gx := Integer (Valx / Factorx); Factory := Factory / 30; Gy := Integer (Valy / Factory); Column1 := Gx / 6; Row1 := Gy / 5; Result.Append (Encode_Char(Row1 * 5 + Column1 + 1)); Digit := Digit - 1; exit when Digit = 0; Column2 := Gx rem 6; Row2 := Gy rem 5; Result.Append (Encode_Char(Row2 * 6 + Column2 + 1)); Digit := Digit - 1; exit when Digit = 0; Valx := Valx - Factorx * Lint (Gx); Valy := Valy - Factory * Lint (Gy); end loop; return Result.Image; end Encode_Extension; -- Returns (possibly empty) MapcodeZone function Decode_Extension ( Extension_Chars : String; Coord32 : Coord_Rec; Dividerx4, Dividery, Lon_Offset4, Extremelatmicrodeg, Maxlonmicrodeg : Lint) return Mapcode_Zone_Rec is Processor : Lint := 1; Lon32, Lat32 : Lint := 0; Odd : Boolean := False; Idx : Positive; Column1, Row1, Column2, Row2 : Lint; C1, C2 : Character; N1, N2 : Integer; Ldivx4, Ldivy : Lint; Lon4, Lat1: Lint; Mapcode_Zone : Mapcode_Zone_Rec; begin if Extension_Chars'Length > 8 then -- Too many digits return Mz_Empty; end if; Idx := Extension_Chars'First; while Idx <= Extension_Chars'Length loop C1 := Extension_Chars(Idx); N1 := Decode_Char(Character'Pos(C1) + 1); Idx := Idx + 1; if N1 < 0 or else N1 = 30 then return Mz_Empty; end if; Row1 := Lint (N1 / 5); Column1 := Lint (N1 rem 5); if Idx <= Extension_Chars'Length then C2 := Extension_Chars(Idx); N2 := Decode_Char(Character'Pos(C2) + 1); Idx := Idx + 1; if N2 < 0 or else N2 = 30 then return Mz_Empty; end if; Row2 := Lint (N2 / 6); Column2 := Lint (N2 rem 6); else Row2 := 0; Column2 := 0; Odd := True; end if; Processor := Processor * 30; Lon32 := Lon32 * 30 + Column1 * 6 + Column2; Lat32 := Lat32 * 30 + Row1 * 5 + Row2; end loop; Ldivx4 := Dividerx4; Ldivy := Dividery; while Processor < 810000 loop Ldivx4 := Ldivx4 * 30; Ldivy := Ldivy * 30; Processor := Processor * 30; end loop; Lon4 := Coord32.X * 3240000 + Lon32 * Ldivx4 + Lon_Offset4 * 810000; Lat1 := Coord32.Y * 810000 + Lat32 * Ldivy; if Odd then Mapcode_Zone := Mz_Set_From_Fractions (Lat1, Lon4, 5 * Ldivy, 6 * Ldivx4); else Mapcode_Zone := Mz_Set_From_Fractions (Lat1, Lon4, Ldivy, Ldivx4); end if; -- FORCE_RECODE: restrict the coordinate range to the extremes that were -- provided if Mapcode_Zone.Fmaxx > Maxlonmicrodeg * 3240000 then Mapcode_Zone.Fmaxx := Maxlonmicrodeg * 3240000; end if; if Ldivy >= 0 then if Mapcode_Zone.Fmaxy > Extremelatmicrodeg * 810000 then Mapcode_Zone.Fmaxy := Extremelatmicrodeg * 810000; end if; else if Mapcode_Zone.Fminy < Extremelatmicrodeg * 810000 then Mapcode_Zone.Fminy := Extremelatmicrodeg * 810000; end if; end if; return Mapcode_Zone; end Decode_Extension; -- Add vowels to prevent a mapcode r from being all-digit function Aeu_Pack (R : As_U.Asu_Us; Short : Boolean) return String is Dotpos : Natural := 0; Result : As_U.Asu_Us := R; Rlen : Natural := Result.Length; Rest : As_U.Asu_Us; V : Integer; use type As_U.Asu_Us; begin for D in 1 .. Rlen loop if Result.Element (D) < '0' or else Result.Element (D) > '9' then -- Not digit? if Result.Element (D) = '.' and then Dotpos = 0 then -- First dot? Dotpos := D; elsif R.Element (D) = '-' then Rest := Result.Uslice (D, Result.Length); Result := Result.Uslice (1, D - 1); Rlen := D - 1; exit; else return Result.Image; end if; end if; end loop; -- Does Result have a dot, AND at least 2 chars before and after the dot? if Dotpos >= 3 and then Rlen - 2 >= Dotpos then if Short then -- v1.50 new way: use only A V := (Character'Pos(Result.Element (1)) - 48) * 100 + (Character'Pos(Result.Element (Rlen - 1)) - 48) * 10 + Character'Pos(Result.Element (Rlen)) - 48; Result := 'A' & Result.Uslice (2, Rlen - 2) & Encode_Char(V / 32 + 1) & Encode_Char(V rem 32 + 1); else -- Old way: use A, E and U */ V := (Character'Pos(Result.Element(Rlen - 1)) - 48) * 10 + Character'Pos(Result.Element(Rlen)) - 48; Result := Result.Uslice(1, Rlen - 2) & Encode_Char(V / 34 + 32) & Encode_Char(V rem 34 + 1); end if; end if; Result.Append (Rest); return Result.Image; end Aeu_Pack; -- Remove vowels from mapcode str into an all-digit mapcode -- (Assumes str is already uppercase!) function Aeu_Unpack (Str : String) return String is Voweled, Has_Letters : Boolean := False; Lastpos : constant Natural := Str'Length; Result : As_U.Asu_Us := As_U.Tus (Str); Dotpos : Natural := Result.Locate ("."); V, V1, V2 : Integer; S : String (1 .. 4); C : Character; use type As_U.Asu_Us; begin if Dotpos < 3 or else Lastpos < Dotpos + 2 then -- No dot, or less than 2 letters before dot, or less than 2 letters -- after dot return Str; end if; if Result.Element(1) = 'A' then -- V1.50 V1 := Decode_Char(Character'Pos(Result.Element(Lastpos)) + 1); if V1 < 0 then V1 := 31; end if; V2 := Decode_Char(Character'Pos(Result.Element(Lastpos - 1)) + 1); if V2 < 0 then V2 := 31; end if; S := Image (1000 + V1 + 32 * V2); Result := S(2) & Result.Uslice(2, Lastpos - 2) & S(3 .. 4); Voweled := True; elsif Result.Element(1) = 'U' then Result.Delete (1, 1); Dotpos := Dotpos - 1; Voweled := True; else C := Result.Element(Lastpos - 1); V := Character'Pos(C); if C = 'A' then V := 0; elsif C = 'E'then V := 34; elsif C = 'U' then V := 68; else V := -1; end if; if V >= 0 then C := Result.Element (Lastpos); if C = 'A' then V := V + 31; elsif C = 'E' then V := V + 32; elsif C = 'U' then V := V + 33; else V1 := Decode_Char(Character'Pos(Result.Element(Lastpos)) + 1); if V1 < 0 then return Undefined; end if; V := V + V1; end if; if V >= 100 then return Undefined; end if; Voweled := True; Result := Result.Uslice (1, Lastpos - 2) & Encode_Char(V / 10 + 1) & Encode_Char(V rem 10 + 1); end if; end if; if Dotpos < 3 or else Dotpos > 6 then return Undefined; end if; for I in 1 .. Lastpos loop if I /= Dotpos then V := Decode_Char(Character'Pos(Result.Element(I)) + 1); if V < 0 then -- Bad char! return Undefined; elsif V > 9 then Has_Letters := True; end if; end if; end loop; if Voweled and then Has_Letters then return Undefined; end if; if not Voweled and then not Has_Letters then return Undefined; end if; return Result.Image; end Aeu_Unpack; -- Mid-level encode/decode function Encode_Nameless (Enc : Frac_Rec; M : Natural; First_Code : Natural; Extra_Digits : Integer) return String is A : constant Natural := Count_Nameless_Records (M, First_Code); P : constant Natural := 31 / A; R : constant Natural := 31 rem A; Codex : constant Natural := Co_Dex (M); Codexlen : constant Natural := Codex_Len(M); X : Integer; Storage_Offset, Base_Power, Base_Power_A : Lint; begin if A < 1 then return Undefined; end if; X := M - First_Nameless_Record (M, First_Code); if Codex /= 21 and then A <= 31 then Storage_Offset := Lint (X * P + (if X < R then X else R)) * 961 * 961; elsif Codex /= 21 and then A < 62 then if X < 62 - A then Storage_Offset := Lint (X) * (961 * 961); else Storage_Offset := Lint (62 - A + (X - 62 + A) / 2) * 961 * 961; if (X + A) rem 2 = 1 then Storage_Offset := Storage_Offset + 16 * 961 * 31; end if; end if; else Base_Power := (if Codex = 21 then 961 * 961 else 961 * 961 * 31); Base_Power_A := Base_Power / Lint (A); if A = 62 then Base_Power_A := Base_Power_A + 1; else Base_Power_A := 961 * (Base_Power_A / 961); end if; Storage_Offset := Lint (X) * Base_Power_A; end if; declare Mm : constant Min_Max_Rec := Min_Max_Setup (M); Side : Integer := Smart_Div (M); Org_Side : constant Integer := Side; X_Side : Integer := Side; -- Note that xDivider4 is 4 times too large Dividerx4 : constant Lint := Lint (Xdivider4 (Mm.Miny, Mm.Maxy)); Xfracture : constant Lint := Lint (Enc.Fraclon) / 810000; -- Dx is in millionths Dx : constant Lint := (4 * (Enc.Coord32.X - Mm.Minx) + Xfracture) / Dividerx4; -- Extrax4 is in quarter-millionths Extrax4 : constant Lint := (Enc.Coord32.X - Mm.Minx) * 4 - Dx * Dividerx4; Dividery : constant Lint := 90; Dy : Lint := (Mm.Maxy - Enc.Coord32.Y) / Dividery; Extray : Lint := (Mm.Maxy - Enc.Coord32.Y) rem Dividery; V : Lint; Result : As_U.Asu_Us; use type As_U.Asu_Us; begin if Extray = 0 and then Enc.Fraclat > 0 then Dy := Dy - 1; Extray := Extray + Dividery; end if; V := Storage_Offset; if Is_Special_Shape (M) then X_Side := X_Side * Side; Side := Integer (1 + (Mm.Maxy - Mm.Miny) / 90); X_Side := X_Side / Side; V := V + Lint (Encode_Six_Wide (Integer (Dx), Side - 1 - Integer(Dy), X_Side, Side)); else V := V + (Dx * Lint (Side) + Dy); end if; Result := As_U.Tus (Encode_Base31 (V, Codexlen + 1)); if Codexlen = 3 then Result := Result.Uslice (1, 2) & '.' & Result.Uslice (3, Result.Length); elsif Codexlen = 4 then if Codex = 22 and then Org_Side = 961 and then not Is_Special_Shape (M) then Result := As_U.Tus (Result.Element (1) & Result.Element (2) & Result.Element (4) & '.' & Result.Element (3) & Result.Element (5)); elsif Codex = 13 then Result := Result.Uslice (1, 2) & '.' & Result.Uslice (3, Result.Length); else Result := Result.Uslice (1, 3) & '.' & Result.Uslice (4, Result.Length); end if; end if; return Encode_Extension (Result.Image, Enc, Extrax4, Extray, Dividerx4, Dividery, Extra_Digits, -1); end; end Encode_Nameless; function Decode_Nameless (Input : String; Extension_Chars : String; M : Natural; First_Index : Natural) return Mapcode_Zone_Rec is Codex : constant Natural := Co_Dex (M); Result : As_U.Asu_Us; A : constant Natural := Count_Nameless_Records (M, First_Index); F : constant Natural := First_Nameless_Record (M, First_Index); P : constant Natural := 31 / A; R : constant Natural := 31 rem A; X, V, Offset : Integer; Swap_Letters : Boolean := False; Base_Power, Base_Power_A : Integer; use type As_U.Asu_Us; begin Result := As_U.Tus (Input); if Codex = 22 then Result := Result.Uslice (1, 3) & Result.Uslice (5, Result.Length); else Result := Result.Uslice (1, 2) & Result.Uslice (4, Result.Length); end if; if Codex /= 21 and then A <= 31 then Offset := Decode_Char(Character'Pos (Result.Element(1)) + 1); if Offset < R * (P + 1) then X := Offset / (P + 1); else Swap_Letters := P = 1 and then Codex = 22; X := R + (Offset - R * (P + 1)) / P; end if; elsif Codex /= 21 and then A < 62 then X := Decode_Char(Character'Pos (Result.Element(1)) + 1); if X < 62 - A then Swap_Letters := Codex = 22; else X := X + X - (62 - A); end if; else -- codex = 21 or else A >= 62 Base_Power := (if Codex = 21 then 961 * 961 else 961 * 961 * 31); Base_Power_A := Base_Power / A; if A = 62 then Base_Power_A := Base_Power_A + 1; else Base_Power_A := 961 * (Base_Power_A / 961); end if; -- Decode V := Decode_Base31 (Result.Image); X := V / Base_Power_A; V := V rem Base_Power_A; end if; if Swap_Letters then if not Is_Special_Shape (M + X) then Result := As_U.Tus (Result.Element (1) & Result.Element (2) & Result.Element (4) & Result.Element (3) & Result.Element (5)); end if; end if; if Codex /= 21 and then A <= 31 then V := Decode_Base31 (Result.Image); if X > 0 then V := V - (X * P + (if X < R then X else R)) * (961 * 961); end if; elsif Codex /= 21 and then A < 62 then V := Decode_Base31 (Result.Slice (2, Result.Length)); if X >= 62 - A then if V >= 16 * 961 * 31 then V := V - 16 * 961 * 31; X := X + 1; end if; end if; end if; if X > A then -- past end! return Mz_Empty; end if; declare Lm : constant Natural := F + X; Mm : constant Min_Max_Rec := Min_Max_Setup (Lm); Side : Integer := Smart_Div (Lm); X_Side : Integer := Side; D : Coord_Rec; Dividerx4 : constant Lint := Lint (Xdivider4 (Mm.Miny, Mm.Maxy)); Dividery : constant Lint := 90; Corner : Coord_Rec; begin X_Side := Side; if Is_Special_Shape(Lm) then X_Side := X_Side * Side; Side := Integer (1 + (Mm.Maxy - Mm.Miny) / 90); X_Side := X_Side / Side; D := Decode_Six_Wide(V, X_Side, Side); D.Y := Lint (Side) - 1 - D.Y; else D.X := Lint (V / Side); D.Y := Lint (V rem Side); end if; if D.X >= Lint (X_Side) then -- Out-of-range! return Mz_Empty; end if; Corner := ( Y => Mm.Maxy - D.Y * Dividery, X => Mm.Minx + (D.X * Dividerx4) / 4); return Decode_Extension(Extension_Chars, Corner, Dividerx4, -Dividery, (D.X * Dividerx4) rem 4, Mm.Miny, Mm.Maxx); end; end Decode_Nameless; function Encode_Auto_Header (Enc : Frac_Rec; M : Natural; Extradigits : in Natural) return String is Codex : constant Integer := Co_Dex(M); Codexlen : constant Integer := Codex_Len (M); First_Index : Integer := M; I : Integer; Mm : Min_Max_Rec; H : Lint; Xdiv : Natural; W : Lint; Product : Lint; Good_Rounder : Lint; Storage_Start : Lint := 0; Dividerx, Dividery, Vx, Vy, Extrax, Extray, Spx, Spy, Value : Lint; Mapc : As_U.Asu_Us; use Bits; begin while Is_Auto_Header (First_Index - 1) and then Co_Dex (First_Index - 1) = Codex loop First_Index := First_Index - 1; end loop; I := First_Index; while Co_Dex (I) = Codex loop Mm := Min_Max_Setup (I); H := (Mm.Maxy - Mm.Miny + 89) / 90; Xdiv := Xdivider4 (Mm.Miny, Mm.Maxy); W := ((Mm.Maxx - Mm.Minx) * 4 + Lint (Xdiv) - 1) / Lint (Xdiv); H := 176 * ((H + 176 - 1) / 176); W := 168 * ((W + 168 - 1) / 168); Product := (W / 168) * (H / 176) * 961 * 31; if Rec_Type (I) = 2 then -- *+ Good_Rounder := (if Codex >= 23 then 961 * 961 * 31 else 961 * 961); Product := (Storage_Start + Product + Good_Rounder - 1) / Good_Rounder * Good_Rounder - Storage_Start; end if; if I = M and then Fits_Inside (Enc.Coord32, Mm) then Dividerx := (Mm.Maxx - Mm.Minx + W - 1) / W; Vx := (Enc.Coord32.X - Mm.Minx) / Dividerx; Extrax := (Enc.Coord32.X - Mm.Minx) rem Dividerx; Dividery := (Mm.Maxy - Mm.Miny + H - 1) / H; Vy := (Mm.Maxy - Enc.Coord32.Y) / Dividery; Extray := (Mm.Maxy - Enc.Coord32.Y) rem Dividery; Spx := Vx rem 168; Vx := Vx / 168; Value := Vx * (H / 176); if Extray = 0 and then Enc.Fraclat > 0 then Vy := Vy - 1; Extray := Extray + Dividery; end if; Spy := Vy rem 176; Vy := Vy / 176; Value := Value + Vy; Mapc := As_U.Tus ( Encode_Base31 (Storage_Start / (961 * 31) + Value, Codexlen - 2) & "." & Encode_Triple (Spx, Spy)); return Encode_Extension (Mapc.Image, Enc, Shl (Extrax, 2), Extray, Shl( Dividerx, 2), Dividery, Extradigits, -1); end if; Storage_Start := Storage_Start + Product; I := I + 1; end loop; return Undefined; end Encode_Auto_Header; function Decode_Auto_Header (Input : String; Extension_Chars : String; M : Natural) return Mapcode_Zone_Rec is Storage_Start : Lint := 0; Codex : constant Integer := Co_Dex(M); -- Decode (before dot) Value : Lint := Lint (Decode_Base31 (Input)); Triple : Coord_Rec; Lm : Natural; Mm : Min_Max_Rec; H : Lint; Xdiv : Lint; W : Lint; Product : Lint; Good_Rounder : Lint; Dividerx, Dividery, Vx, Vy : Lint; Corner : Coord_Rec; use Bits; begin Value := Value * (961 * 31); -- Decode bottom Triple := Decode_Triple (Input (Input'Last - 2 .. Input'Last)); Lm := M; while Co_Dex (Lm) = Codex and then Rec_Type (Lm) > 1 loop Mm := Min_Max_Setup (Lm); H := (Mm.Maxy - Mm.Miny + 89) / 90; Xdiv := Lint (Xdivider4 (Mm.Miny, Mm.Maxy)); W := ((Mm.Maxx - Mm.Minx) * 4 + (Xdiv - 1)) / Xdiv; H := 176 * ((H + 176 - 1) / 176); W := 168 * ((W + 168 - 1) / 168); Product := (W / 168) * (H / 176) * 961 * 31; if Rec_Type (Lm) = 2 then Good_Rounder := (if Codex >= 23 then 961 * 961 * 31 else 961 * 961); Product := ((Storage_Start + Product + Good_Rounder - 1) / Good_Rounder) * Good_Rounder - Storage_Start; end if; if Value >= Storage_Start and then Value < Storage_Start + Product then -- Code belongs here? Dividerx := (Mm.Maxx - Mm.Minx + W - 1) / W; Dividery := (Mm.Maxy - Mm.Miny + H - 1) / H; Value := Value - Storage_Start; Value := Value / (961 * 31); Vx := Triple.X + 168 * (Value / (H / 176)); Vy := Triple.Y + 176 * (Value rem (H / 176)); Corner := ( -- In microdegrees Y => Mm.Maxy - Vy * Dividery, X => Mm.Minx + Vx * Dividerx); if Corner.Y /= Mm.Maxy and then not Fits_Inside (Corner, Mm) then return Mz_Empty; end if; return Decode_Extension (Extension_Chars, Corner, Shl (Dividerx, 2), -Dividery, 0, Mm.Miny, Mm.Maxx); -- autoheader end if; Storage_Start := Storage_Start + Product; Lm := Lm + 1; end loop; return Mz_Empty; end Decode_Auto_Header; function Encode_Grid (Enc : Frac_Rec; M : Natural; Mm : Min_Max_Rec; Headerletter : in String; Extradigits : in Natural) return String is Orgcodex : constant Integer := Co_Dex(M); Codex : Integer := Orgcodex; Prefixlength, Postfixlength : Integer; Divx, Divy : Integer; Xgridsize, Ygridsize, X, Relx, Rely : Lint; V : Integer; Result, Postfix : As_U.Asu_Us; Dividery, Dividerx : Lint; Difx, Dify, Extrax, Extray : Lint; use Bits; use type As_U.Asu_Us; begin if Codex = 21 then Codex := 22; end if; if Codex = 14 then Codex := 23; end if; Prefixlength := Codex / 10; Postfixlength := Codex rem 10; Divy := Smart_Div(M); if Divy = 1 then Divx := X_Side(Prefixlength + 1); Divy := Y_Side(Prefixlength + 1); else Divx := Nc(Prefixlength + 1) / Divy; end if; Ygridsize := (Mm.Maxy - Mm.Miny + Lint (Divy) - 1) / Lint (Divy); Rely := Enc.Coord32.Y - Mm.Miny; Rely := Rely / Ygridsize; Xgridsize := (Mm.Maxx - Mm.Minx + Lint (Divx) - 1) / Lint (Divx); X := Enc.Coord32.X; Relx := X - Mm.Minx; if Relx < 0 then X := X + 360000000; Relx := Relx + 360000000; elsif Relx >= 360000000 then X := X - 360000000; Relx := Relx - 360000000; end if; -- 1.32 fix FIJI edge case if Relx < 0 then return ""; end if; Relx := Relx / Xgridsize; if Relx >= Lint (Divx) then return ""; end if; if Divx /= Divy and then Prefixlength > 2 then -- D = 6 V := Encode_Six_Wide (Integer (Relx), Integer (Rely), Divx, Divy); else V := Integer (Relx) * Divy + (Divy - 1 - Integer (Rely)); end if; Result := As_U.Tus (Encode_Base31 (Lint (V), Prefixlength)); if Prefixlength = 4 and then Divx = 961 and then Divy = 961 then Result := As_U.Tus (Result.Element(1) & Result.Element(3) & Result.Element(2) & Result.Element(4)); end if; Rely := Mm.Miny + Rely * Ygridsize; Relx := Mm.Minx + Relx * Xgridsize; Dividery := (Ygridsize + Lint (Y_Side(Postfixlength + 1)) - 1) / Lint (Y_Side(Postfixlength + 1)); Dividerx := (Xgridsize + Lint (X_Side(Postfixlength + 1)) - 1) / Lint (X_Side(Postfixlength + 1)); Result.Append ("."); -- Encoderelative Difx := X - Relx; Dify := Enc.Coord32.Y - Rely; Extrax := Difx rem Dividerx; Extray := Dify rem Dividery; Difx := Difx / Dividerx; Dify := Dify / Dividery; Dify := Lint (Y_Side(Postfixlength + 1)) - 1 - Dify; if Postfixlength = 3 then Result.Append (Encode_Triple (Difx, Dify)); else Postfix := As_U.Tus (Encode_Base31 ( Difx * Lint (Y_Side(Postfixlength + 1)) + Dify, Postfixlength)); if Postfixlength = 4 then Postfix := As_U.Tus (Postfix.Element(1) & Postfix.Element(3) & Postfix.Element(2) & Postfix.Element(4)); end if; Result.Append (Postfix); end if; if Orgcodex = 14 then Result := Result.Element(1) & '.' & Result.Element(2) & Result.Uslice (4, Result.Length); end if; return Encode_Extension (Headerletter & Result.Image, Enc, Shl (Extrax, 2), Extray, Shl (Dividerx, 2), Dividery, Extradigits, 1); end Encode_Grid; function Decode_Grid (Input, Extension_Chars : String; M : Natural) return Mapcode_Zone_Rec is Linput : As_U.Asu_Us := As_U.Tus (Input); Prefixlength, Postfixlength : Natural; Divx, Divy : Integer; V : Integer; Rel : Coord_Rec; Mm : Min_Max_Rec; Xgridsize, Ygridsize : Lint; Xp, Yp, Dividerx, Dividery : Lint; Rest : As_U.Asu_Us; Dif : Coord_Rec; Corner : Coord_Rec; Decodemaxx, Decodemaxy : Lint; use Bits; use type As_U.Asu_Us; begin Prefixlength := Linput.Locate (".") - 1; Postfixlength := Linput.Length - 1 - Prefixlength; if Prefixlength = 1 and then Postfixlength = 4 then Prefixlength := Prefixlength + 1; Postfixlength:= Postfixlength - 1; Linput := Linput.Element(1) & Linput.Element(3) & '.' & Linput.Uslice (4, Linput.Length); end if; Divy := Smart_Div(M); if Divy = 1 then Divx := X_Side(Prefixlength + 1); Divy := Y_Side(Prefixlength + 1); else Divx := Nc(Prefixlength + 1) / Divy; end if; if Prefixlength = 4 and then Divx = 961 and then Divy = 961 then Linput := Linput.Element(1) & Linput.Element(3) & Linput.Element(2) & Linput.Uslice (4, Linput.Length); end if; V := Decode_Base31 (Linput.Image); if Divx /= Divy and then Prefixlength > 2 then -- D = 6 Rel := Decode_Six_Wide (V, Divx, Divy); else Rel.X := Lint (V / Divy); Rel.Y := Lint (Divy - 1 - V rem Divy); end if; Mm := Min_Max_Setup (M); Ygridsize := (Mm.Maxy - Mm.Miny + Lint (Divy) - 1) / Lint (Divy); Xgridsize := (Mm.Maxx - Mm.Minx + Lint (Divx) - 1) / Lint (Divx); Rel.Y := Mm.Miny + Rel.Y * Ygridsize; Rel.X := Mm.Minx + Rel.X * Xgridsize; Xp := Lint (X_Side(Postfixlength + 1)); Dividerx := (Xgridsize + Xp - 1) / Xp; Yp := Lint (Y_Side(Postfixlength + 1)); Dividery := (Ygridsize + Yp - 1) / Yp; Rest := Linput.Uslice(Prefixlength + 2, Linput.Length); if Postfixlength = 3 then Dif := Decode_Triple (Rest.Image); else if Postfixlength = 4 then Rest := As_U.Tus (Rest.Element (1) & Rest.Element(3) & Rest.Element(2) & Rest.Element(4)); end if; V := Decode_Base31 (Rest.Image); Dif.X := Lint (V) / Yp; Dif.Y := Lint (V) rem Yp; end if; Dif.Y := Yp - 1 - Dif.Y; Corner := (Y => Rel.Y + Dif.Y * Dividery, X => Rel.X + Dif.X * Dividerx); if not Fits_Inside (Corner, Mm) then return Mz_Empty; end if; Decodemaxx := (if Rel.X + Xgridsize < Mm.Maxx then Rel.X + Xgridsize else Mm.Maxx); Decodemaxy := (if Rel.Y + Ygridsize < Mm.Maxy then Rel.Y + Ygridsize else Mm.Maxy); return Decode_Extension (Extension_Chars, Corner, Shl (Dividerx, 2), Dividery, 0, Decodemaxy, Decodemaxx); end Decode_Grid; -- Mapcoder engine Max_Nr_Of_Mapcode_Results : constant := 22; function Mapcoder_Engine (Enc : Frac_Rec; Tn : in Integer; Get_Shortest : Boolean; State_Override : Integer; Extra_Digits : Integer) return Mapcode_Infos is Results : Mapcode_Infos (1 .. Max_Nr_Of_Mapcode_Results); Nb_Results : Natural := 0; From_Territory : Integer := 0; Upto_Territory : Integer := Ccode_Earth; Original_Length : Natural; From, Upto : Integer; Store_Code : Integer; Mc_Info : Mapcode_Info; Go_On : Boolean; -- Scan a range of territories procedure Scan (Territory_Number : Integer) is Mm : Min_Max_Rec; R : As_U.Asu_Us; use type As_U.Asu_Us; begin for I in From .. Upto loop -- Exlude 54 and 55 if Co_Dex(I) < 54 then Mm := Min_Max_Setup (I); if Fits_Inside (Enc.Coord32, Mm) then if Is_Nameless (I) then R := As_U.Tus (Encode_Nameless (Enc, I, From, Extra_Digits)); elsif Rec_Type(I) > 1 then R := As_U.Tus (Encode_Auto_Header (Enc, I, Extra_Digits)); elsif I = Upto and then Get_Parent (Territories (Territory_Number)) >= 0 then declare More_Results : constant Mapcode_Infos := Mapcoder_Engine (Enc, Get_Parent (Territories (Territory_Number)), Get_Shortest, Territory_Number, Extra_Digits); T : constant Natural := Nb_Results; N : constant Natural := More_Results'Length; begin if N > 0 then Nb_Results := Nb_Results + N; if Nb_Results > Max_Nr_Of_Mapcode_Results then Nb_Results := Max_Nr_Of_Mapcode_Results; end if; Results (T + 1 .. Nb_Results) := More_Results; end if; R.Set_Null; end; else if Is_Restricted (I) and then Nb_Results = Original_Length then -- Restricted, and no shorter mapcodes exist: -- do not generate mapcodes R.Set_Null; else R := As_U.Tus (Encode_Grid (Enc, I, Mm, Header_Letter(I), Extra_Digits)); end if; end if; if R.Length > 4 then R := As_U.Tus (Aeu_Pack (R, False)); Store_Code := Territory_Number; if State_Override >= 0 then Store_Code := State_Override; end if; Mc_Info.Mapcode := R; Mc_Info.Territory_Alpha_Code := As_U.Tus (Get_Territory_Alpha_Code (Territories (Store_Code))); Mc_Info.Full_Mapcode := (if Store_Code = Ccode_Earth then As_U.Asu_Null else Mc_Info.Territory_Alpha_Code & " ") & R; Mc_Info.Territory := Territories (Store_Code); Nb_Results := Nb_Results + 1; Results (Nb_Results) := Mc_Info; exit when Get_Shortest; end if; end if; end if; end loop; end Scan; begin if Tn in From_Territory .. Upto_Territory then From_Territory := Tn; Upto_Territory := Tn; end if; for Territory_Number in From_Territory .. Upto_Territory loop Go_On := True; Original_Length := Nb_Results; From := Data_First_Record (Territory_Number); if Ndata.Data_Flags(From + 1) = 0 then Go_On := False; end if; if Go_On then Upto := Data_Last_Record (Territory_Number); if Territory_Number /= Ccode_Earth and then not Fits_Inside (Enc.Coord32, Min_Max_Setup (Upto)) then Go_On := False; end if; end if; if Go_On then Scan (Territory_Number); end if; end loop; return Results (1 .. Nb_Results); end Mapcoder_Engine; function Master_Decode (Mapcode : String; Territory_Number : Natural) return Coordinate is Map_Code : As_U.Asu_Us := As_U.Tus (Mapcode); Extensionchars : As_U.Asu_Us; Minpos : constant Natural := Map_Code.Locate ("-"); Mclen : Positive; Number : Natural; Parent : Integer; From, Upto : Integer; Prefixlength, Postfixlength, Incodex : Integer; Zone : Mapcode_Zone_Rec; Codex : Integer; Nr_Zone_Overlaps : Natural; Coord32 : Coord_Rec; Zfound, Z : Mapcode_Zone_Rec; procedure Try_Smaller (M : in Integer) is begin for J in From .. M - 1 loop -- Try all smaller rectangles j if not Is_Restricted (J) then Z := Mz_Restrict_Zone_To (Zone, Min_Max_Setup (J)); if not Mz_Is_Empty (Z) then Nr_Zone_Overlaps := Nr_Zone_Overlaps + 1; if Nr_Zone_Overlaps = 1 then -- First fit! remember... Zfound := Z; else -- More than one hit, give up exit; end if; end if; end if; end loop; end Try_Smaller; begin if Minpos > 1 then Extensionchars := Map_Code.Uslice (Minpos + 1, Map_Code.Length); Map_Code := Map_Code.Uslice (1, Minpos - 1); end if; Map_Code := As_U.Tus (Aeu_Unpack (Map_Code.Image)); if Map_Code.Is_Null then -- Failed to decode! raise Decode_Error; end if; Mclen := Map_Code.Length; Number := Territory_Number; if Mclen >= 10 then Number := Ccode_Earth; end if; -- Long codes in states are handled by the country Parent := Get_Parent (Territories (Number)); if Parent >= 0 then if Mclen >= 9 or else (Mclen >= 8 and then (Parent = Ccode_Ind or else Parent = Ccode_Mex)) then Number := Parent; end if; end if; From := Data_First_Record (Number); if From < 0 or else Ndata.Data_Flags(From + 1) = 0 then raise Decode_Error; end if; Upto := Data_Last_Record (Number); Prefixlength := Map_Code.Locate (".") - 1; Postfixlength := Mclen - 1 - Prefixlength; Incodex := Prefixlength * 10 + Postfixlength; Zone := Mz_Empty; for M in From .. Upto loop Codex := Co_Dex (M); if Rec_Type (M) = 0 and then not Is_Nameless(M) and then (Incodex = Codex or else (Incodex = 22 and then Codex = 21)) then Zone := Decode_Grid (Map_Code.Image, Extensionchars.Image, M); -- First of all, make sure the zone fits the country Zone := Mz_Restrict_Zone_To (Zone, Min_Max_Setup (Upto)); if not Mz_Is_Empty (Zone) and then Is_Restricted (M) then Nr_Zone_Overlaps := 0; -- Get midpoint in microdegrees Coord32 := Convert_Fractions_To_Coord32 ( Mz_Mid_Point_Fractions (Zone)); for J in reverse M - 1 .. From loop -- Look in previous rects if not Is_Restricted (J) then if Fits_Inside (Coord32, Min_Max_Setup (J)) then Nr_Zone_Overlaps := Nr_Zone_Overlaps + 1; exit; end if; end if; end loop; if Nr_Zone_Overlaps = 0 then -- See if mapcode zone OVERLAPS any sub-area... Try_Smaller (M); if Nr_Zone_Overlaps = 1 then -- Intersected exactly ONE sub-area? -- Use the intersection found... Zone := Zfound; end if; end if; if Nr_Zone_Overlaps = 0 then Zone := Mz_Empty; end if; end if; exit; elsif Rec_Type(M) = 1 and then Codex + 10 = Incodex and then Header_Letter(M)'Length = 1 and then Header_Letter(M)(1) = Map_Code.Element (1) then Zone := Decode_Grid (Map_Code.Slice(2, Map_Code.Length), Extensionchars.Image, M); exit; elsif Is_Nameless (M) and then ((Codex = 21 and then Incodex = 22) or else (Codex = 22 and then Incodex = 32) or else (Codex = 13 and then Incodex = 23)) then Zone := Decode_Nameless (Map_Code.Image, Extensionchars.Image, M, From); exit; elsif Rec_Type(M) > 1 and then Postfixlength = 3 and then Codex_Len(M) = Prefixlength + 2 then Zone := Decode_Auto_Header (Map_Code.Image, Extensionchars.Image, M); exit; end if; end loop; Zone := Mz_Restrict_Zone_To (Zone, Min_Max_Setup (Upto)); if Mz_Is_Empty(Zone) then raise Decode_Error; end if; return Convert_Fractions_To_Degrees (Wrap (Mz_Mid_Point_Fractions (Zone))); end Master_Decode; -- Legacy interface function Encode (Coord : Coordinate; Territory_Code : String := ""; Shortest : Boolean := False; Precision : Precisions := 0; Sort : Boolean := False) return Mapcode_Infos is Result : Mapcode_Infos := Mapcoder_Engine ( Enc => Get_Encode_Rec (Coord.Lat, Coord.Lon), Tn => (if Territory_Code = "" then Error else Integer (Get_Territory (Territory_Code))), Get_Shortest => Shortest, State_Override => -1, Extra_Digits => Precision); -- First and last index of the mapcodes, of the same territory, -- producing the shortest mapcode First, Last : Natural := 0; Len : Positive := Positive'Last; use type As_U.Asu_Us; begin if not Sort then return Result; end if; -- Search shortest mapcode (First) and the last mapcode for the -- same territory as First for I in Result'Range loop if Result(I).Mapcode.Length < Len then First := I; Len := Result(I).Mapcode.Length; end if; if Result(I).Territory_Alpha_Code = Result(First).Territory_Alpha_Code then Last := I; end if; end loop; -- Move First .. Last at beginning of list if First /= Result'First then declare Slice : constant Mapcode_Infos := Result(First .. Last); begin Result(Last-First+2 .. Last) := Result(Result'First .. First-1); Result(Result'First .. Result'First+Last-First) := Slice; end; end if; return Result; end Encode; function Decode (Mapcode, Context : String) return Coordinate is Contextterritorynumber : Integer; begin -- Raise Decode error if Mapcode or Context is not in Roman declare Lm, Lc : Mapcodes.Languages.Language_List; use type Mapcodes.Languages.Language_List; begin Lm := Mapcodes.Languages.Get_Language ( Ada.Characters.Handling.To_Wide_String (Mapcode)); if Context /= "" then Lc := Mapcodes.Languages.Get_Language ( Ada.Characters.Handling.To_Wide_String (Context)); else Lc := Mapcodes.Languages.Default_Language; end if; if Lm /= Mapcodes.Languages.Default_Language or else Lc /= Mapcodes.Languages.Default_Language then raise Decode_Error; end if; exception when Mapcodes.Languages.Invalid_Text => raise Decode_Error; end; -- Set context number if Context = Undefined then Contextterritorynumber := Ccode_Earth; else Contextterritorynumber := Integer (Get_Territory (Context)); end if; -- Decode return Master_Decode (Mapcode, Contextterritorynumber); end Decode; end Mapcodes;
-- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com) -- // -- // This software is provided 'as-is', without any express or implied warranty. -- // In no event will the authors be held liable for any damages arising from the use of this software. -- // -- // Permission is granted to anyone to use this software for any purpose, -- // including commercial applications, and to alter it and redistribute it freely, -- // subject to the following restrictions: -- // -- // 1. The origin of this software must not be misrepresented; -- // you must not claim that you wrote the original software. -- // If you use this software in a product, an acknowledgment -- // in the product documentation would be appreciated but is not required. -- // -- // 2. Altered source versions must be plainly marked as such, -- // and must not be misrepresented as being the original software. -- // -- // 3. This notice may not be removed or altered from any source distribution. -- // -- //////////////////////////////////////////////////////////// -- //////////////////////////////////////////////////////////// -- // Headers -- //////////////////////////////////////////////////////////// with Sf.Config; with Sf.Graphics.BlendMode; with Sf.Graphics.Color; with Sf.Graphics.Rect; with Sf.Graphics.Types; package Sf.Graphics.String is use Sf.Config; use Sf.Graphics.BlendMode; use Sf.Graphics.Color; use Sf.Graphics.Rect; use Sf.Graphics.Types; -- //////////////////////////////////////////////////////////// -- /// sfString styles -- //////////////////////////////////////////////////////////// subtype sfStringStyle is sfUint32; sfStringRegular : constant sfStringStyle := 0; sfStringBold : constant sfStringStyle := 1; sfStringItalic : constant sfStringStyle := 2; sfStringUnderlined : constant sfStringStyle := 4; -- //////////////////////////////////////////////////////////// -- /// Create a new string -- /// -- /// \return A new sfString object, or NULL if it failed -- /// -- //////////////////////////////////////////////////////////// function sfString_Create return sfString_Ptr; -- //////////////////////////////////////////////////////////// -- /// Destroy an existing string -- /// -- /// \param String : String to delete -- /// -- //////////////////////////////////////////////////////////// procedure sfString_Destroy (Str : sfString_Ptr); -- //////////////////////////////////////////////////////////// -- /// Set the X position of a string -- /// -- /// \param String : String to modify -- /// \param X : New X coordinate -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetX (Str : sfString_Ptr; X : Float); -- //////////////////////////////////////////////////////////// -- /// Set the Y position of a string -- /// -- /// \param String : String to modify -- /// \param Y : New Y coordinate -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetY (Str : sfString_Ptr; Y : Float); -- //////////////////////////////////////////////////////////// -- /// Set the position of a string -- /// -- /// \param String : String to modify -- /// \param Left : New left coordinate -- /// \param Top : New top coordinate -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetPosition (Str : sfString_Ptr; Left, Top : Float); -- //////////////////////////////////////////////////////////// -- /// Set the horizontal scale of a string -- /// -- /// \param String : String to modify -- /// \param Scale : New scale (must be strictly positive) -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetScaleX (Str : sfString_Ptr; Scale : Float); -- //////////////////////////////////////////////////////////// -- /// Set the vertical scale of a string -- /// -- /// \param String : String to modify -- /// \param Scale : New scale (must be strictly positive) -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetScaleY (Str : sfString_Ptr; Scale : Float); -- //////////////////////////////////////////////////////////// -- /// Set the scale of a string -- /// -- /// \param String : String to modify -- /// \param ScaleX : New horizontal scale (must be strictly positive) -- /// \param ScaleY : New vertical scale (must be strictly positive) -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetScale (Str : sfString_Ptr; ScaleX, ScaleY : Float); -- //////////////////////////////////////////////////////////// -- /// Set the orientation of a string -- /// -- /// \param String : String to modify -- /// \param Rotation : Angle of rotation, in degrees -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetRotation (Str : sfString_Ptr; Rotation : Float); -- //////////////////////////////////////////////////////////// -- /// Set the center of a string, in coordinates -- /// relative to its left-top corner -- /// -- /// \param String : String to modify -- /// \param X : X coordinate of the center -- /// \param Y : Y coordinate of the center -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetCenter (Str : sfString_Ptr; X, Y : Float); -- //////////////////////////////////////////////////////////// -- /// Set the color of a string -- /// -- /// \param String : String to modify -- /// \param Color : New color -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetColor (Str : sfString_Ptr; Color : sfColor); -- //////////////////////////////////////////////////////////// -- /// Set the blending mode for a string -- /// -- /// \param String : String to modify -- /// \param Mode : New blending mode -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetBlendMode (Str : sfString_Ptr; Mode : sfBlendMode); -- //////////////////////////////////////////////////////////// -- /// Get the X position of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current X position -- /// -- //////////////////////////////////////////////////////////// function sfString_GetX (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the top Y of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current Y position -- /// -- //////////////////////////////////////////////////////////// function sfString_GetY (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the horizontal scale of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current X scale factor (always positive) -- /// -- //////////////////////////////////////////////////////////// function sfString_GetScaleX (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the vertical scale of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current Y scale factor (always positive) -- /// -- //////////////////////////////////////////////////////////// function sfString_GetScaleY (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the orientation of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current rotation, in degrees -- /// -- //////////////////////////////////////////////////////////// function sfString_GetRotation (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the X position of the center a string -- /// -- /// \param String : String to read -- /// -- /// \return Current X center position -- /// -- //////////////////////////////////////////////////////////// function sfString_GetCenterX (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the top Y of the center of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current Y center position -- /// -- //////////////////////////////////////////////////////////// function sfString_GetCenterY (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the color of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current color -- /// -- //////////////////////////////////////////////////////////// function sfString_GetColor (Str : sfString_Ptr) return sfColor; -- //////////////////////////////////////////////////////////// -- /// Get the current blending mode of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current blending mode -- /// -- //////////////////////////////////////////////////////////// function sfString_GetBlendMode (Str : sfString_Ptr) return sfBlendMode; -- //////////////////////////////////////////////////////////// -- /// Move a string -- /// -- /// \param String : String to modify -- /// \param OffsetX : Offset on the X axis -- /// \param OffsetY : Offset on the Y axis -- /// -- //////////////////////////////////////////////////////////// procedure sfString_Move (Str : sfString_Ptr; OffsetX, OffsetY : Float); -- //////////////////////////////////////////////////////////// -- /// Scale a string -- /// -- /// \param String : String to modify -- /// \param FactorX : Horizontal scaling factor (must be strictly positive) -- /// \param FactorY : Vertical scaling factor (must be strictly positive) -- /// -- //////////////////////////////////////////////////////////// procedure sfString_Scale (Str : sfString_Ptr; FactorX, FactorY : Float); -- //////////////////////////////////////////////////////////// -- /// Rotate a string -- /// -- /// \param String : String to modify -- /// \param Angle : Angle of rotation, in degrees -- /// -- //////////////////////////////////////////////////////////// procedure sfString_Rotate (Str : sfString_Ptr; Angle : Float); -- //////////////////////////////////////////////////////////// -- /// Transform a point from global coordinates into the string's local coordinates -- /// (ie it applies the inverse of object's center, translation, rotation and scale to the point) -- /// -- /// \param String : String object -- /// \param PointX : X coordinate of the point to transform -- /// \param PointY : Y coordinate of the point to transform -- /// \param X : Value to fill with the X coordinate of the converted point -- /// \param Y : Value to fill with the y coordinate of the converted point -- /// -- //////////////////////////////////////////////////////////// procedure sfString_TransformToLocal (Str : sfString_Ptr; PointX, PointY : Float; X, Y : access Float); -- //////////////////////////////////////////////////////////// -- /// Transform a point from the string's local coordinates into global coordinates -- /// (ie it applies the object's center, translation, rotation and scale to the point) -- /// -- /// \param String : String object -- /// \param PointX : X coordinate of the point to transform -- /// \param PointY : Y coordinate of the point to transform -- /// \param X : Value to fill with the X coordinate of the converted point -- /// \param Y : Value to fill with the y coordinate of the converted point -- /// -- //////////////////////////////////////////////////////////// procedure sfString_TransformToGlobal (Str : sfString_Ptr; PointX, PointY : Float; X, Y : access Float); -- //////////////////////////////////////////////////////////// -- /// Set the text of a string (from a multibyte string) -- /// -- /// \param String : String to modify -- /// \param Text : New text -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetText (Str : sfString_Ptr; Text : Standard.String); -- //////////////////////////////////////////////////////////// -- /// Set the text of a string (from a unicode string) -- /// -- /// \param String : String to modify -- /// \param Text : New text -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetUnicodeText (Str : sfString_Ptr; Text : sfUint32_Ptr); -- //////////////////////////////////////////////////////////// -- /// Set the font of a string -- /// -- /// \param String : String to modify -- /// \param Font : Font to use -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetFont (Str : sfString_Ptr; Font : sfFont_Ptr); -- //////////////////////////////////////////////////////////// -- /// Set the size of a string -- /// -- /// \param String : String to modify -- /// \param Size : New size, in pixels -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetSize (Str : sfString_Ptr; Size : Float); -- //////////////////////////////////////////////////////////// -- /// Set the style of a string -- /// -- /// \param String : String to modify -- /// \param Size : New style (see sfStringStyle enum) -- /// -- //////////////////////////////////////////////////////////// procedure sfString_SetStyle (Str : sfString_Ptr; Style : sfStringStyle); -- //////////////////////////////////////////////////////////// -- /// Get the text of a string (returns a unicode string) -- /// -- /// \param String : String to read -- /// -- /// \return Text as UTF-32 -- /// -- //////////////////////////////////////////////////////////// function sfString_GetUnicodeText (Str : sfString_Ptr) return sfUint32_Ptr; -- //////////////////////////////////////////////////////////// -- /// Get the text of a string (returns an ANSI string) -- /// -- /// \param String : String to read -- /// -- /// \return Text an a locale-dependant ANSI string -- /// -- //////////////////////////////////////////////////////////// function sfString_GetText (Str : sfString_Ptr) return Standard.String; -- //////////////////////////////////////////////////////////// -- /// Get the font used by a string -- /// -- /// \param String : String to read -- /// -- /// \return Pointer to the font -- /// -- //////////////////////////////////////////////////////////// function sfString_GetFont (Str : sfString_Ptr) return sfFont_Ptr; -- //////////////////////////////////////////////////////////// -- /// Get the size of the characters of a string -- /// -- /// \param String : String to read -- /// -- /// \return Size of the characters -- /// -- //////////////////////////////////////////////////////////// function sfString_GetSize (Str : sfString_Ptr) return Float; -- //////////////////////////////////////////////////////////// -- /// Get the style of a string -- /// -- /// \param String : String to read -- /// -- /// \return Current string style (see sfStringStyle enum) -- /// -- //////////////////////////////////////////////////////////// function sfString_GetStyle (Str : sfString_Ptr) return sfStringStyle; -- //////////////////////////////////////////////////////////// -- /// Return the visual position of the Index-th character of the string, -- /// in coordinates relative to the string -- /// (note : translation, center, rotation and scale are not applied) -- /// -- /// \param String : String to read -- /// \param Index : Index of the character -- /// \param X : Value to fill with the X coordinate of the position -- /// \param Y : Value to fill with the y coordinate of the position -- /// -- //////////////////////////////////////////////////////////// procedure sfString_GetCharacterPos (Str : sfString_Ptr; Index : sfSize_t; X, Y : access Float); -- //////////////////////////////////////////////////////////// -- /// Get the bounding rectangle of a string on screen -- /// -- /// \param String : String to read -- /// -- /// \return Rectangle contaning the string in screen coordinates -- /// -- //////////////////////////////////////////////////////////// function sfString_GetRect (Str : sfString_Ptr) return sfFloatRect; private pragma Import (C, sfString_Create, "sfString_Create"); pragma Import (C, sfString_Destroy, "sfString_Destroy"); pragma Import (C, sfString_SetX, "sfString_SetX"); pragma Import (C, sfString_SetY, "sfString_SetY"); pragma Import (C, sfString_SetPosition, "sfString_SetPosition"); pragma Import (C, sfString_SetScaleX, "sfString_SetScaleX"); pragma Import (C, sfString_SetScaleY, "sfString_SetScaleY"); pragma Import (C, sfString_SetScale, "sfString_SetScale"); pragma Import (C, sfString_SetRotation, "sfString_SetRotation"); pragma Import (C, sfString_SetCenter, "sfString_SetCenter"); pragma Import (C, sfString_SetColor, "sfString_SetColor"); pragma Import (C, sfString_SetBlendMode, "sfString_SetBlendMode"); pragma Import (C, sfString_GetX, "sfString_GetX"); pragma Import (C, sfString_GetY, "sfString_GetY"); pragma Import (C, sfString_GetScaleX, "sfString_GetScaleX"); pragma Import (C, sfString_GetScaleY, "sfString_GetScaleY"); pragma Import (C, sfString_GetRotation, "sfString_GetRotation"); pragma Import (C, sfString_GetCenterX, "sfString_GetCenterX"); pragma Import (C, sfString_GetCenterY, "sfString_GetCenterY"); pragma Import (C, sfString_GetColor, "sfString_GetColor"); pragma Import (C, sfString_GetBlendMode, "sfString_GetBlendMode"); pragma Import (C, sfString_Move, "sfString_Move"); pragma Import (C, sfString_Scale, "sfString_Scale"); pragma Import (C, sfString_Rotate, "sfString_Rotate"); pragma Import (C, sfString_TransformToLocal, "sfString_TransformToLocal"); pragma Import (C, sfString_TransformToGlobal, "sfString_TransformToGlobal"); pragma Import (C, sfString_SetUnicodeText, "sfString_SetUnicodeText"); pragma Import (C, sfString_SetFont, "sfString_SetFont"); pragma Import (C, sfString_SetSize, "sfString_SetSize"); pragma Import (C, sfString_SetStyle, "sfString_SetStyle"); pragma Import (C, sfString_GetUnicodeText, "sfString_GetUnicodeText"); pragma Import (C, sfString_GetFont, "sfString_GetFont"); pragma Import (C, sfString_GetSize, "sfString_GetSize"); pragma Import (C, sfString_GetStyle, "sfString_GetStyle"); pragma Import (C, sfString_GetCharacterPos, "sfString_GetCharacterPos"); pragma Import (C, sfString_GetRect, "sfString_GetRect"); end Sf.Graphics.String;
with Ada.Directories, Ada.Direct_IO, Ada.Text_IO; procedure Whole_File is File_Name : String := "whole_file.adb"; File_Size : Natural := Natural (Ada.Directories.Size (File_Name)); subtype File_String is String (1 .. File_Size); package File_String_IO is new Ada.Direct_IO (File_String); File : File_String_IO.File_Type; Contents : File_String; begin File_String_IO.Open (File, Mode => File_String_IO.In_File, Name => File_Name); File_String_IO.Read (File, Item => Contents); File_String_IO.Close (File); Ada.Text_IO.Put (Contents); end Whole_File;
package openGL.Renderer -- -- Provides a base class for all renderers. -- is type Item is abstract tagged limited private; type View is access all Item'Class; -- Attributes -- procedure Background_is (Self : in out Item; Now : in openGL.lucid_Color); procedure Background_is (Self : in out Item; Now : in openGL.Color; Opacity : in unit_Interval := 1.0); -- Operations -- procedure clear_Frame (Self : in Item); private type Item is abstract tagged limited record Background : openGL.lucid_Color; end record; end openGL.Renderer;
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- Core -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package body User_Queries is protected body Query_Manager is ------------------ -- Query_Active -- ------------------ function Query_Active return Boolean is (Active); ----------------- -- Start_Query -- ----------------- entry Start_Query when not Active is begin Active := True; Stage := Open; end Start_Query; --------------- -- End_Query -- --------------- procedure End_Query is begin Active := False; end End_Query; ---------------- -- Post_Query -- ---------------- procedure Post_Query (Prompt : in String; Default : in String; Response_Size: in Positive) is use UBS; begin if not Active or else Stage /= Open then raise Program_Error; end if; P_Buffer := To_Unbounded_String (Prompt); D_Buffer := To_Unbounded_String (Default); R_Buffer := Response_Size * ' '; Stage := Pending; end Post_Query; ------------------- -- Wait_Response -- ------------------- entry Wait_Response (Response: out String; Last : out Natural) when Stage = Closed is use UBS; begin if Response'Length < UBS.Length (R_Buffer) then raise Program_Error; end if; Last := Response'First + Length (R_Buffer) - 1; Response(Response'First .. Last) := To_String (R_Buffer); Stage := Open; end Wait_Response; ------------------- -- Query_Pending -- ------------------- function Query_Pending return Boolean is (Stage = Pending); ---------------- -- Take_Query -- ---------------- procedure Take_Query (Driver: not null access procedure (Prompt : in String; Default : in String; Response: out String; Last : out Natural)) is use UBS; Response: String (1 .. Length (R_Buffer)); Last : Natural; begin if Stage /= Pending then raise Program_Error with "Call to Take_Query when no query is pending."; end if; Driver (Prompt => To_String (P_Buffer), Default => To_String (D_Buffer), Response => Response, Last => Last); R_Buffer := To_Unbounded_String (Response (1..Last)); Stage := Closed; end Take_Query; end Query_Manager; end User_Queries;
package body Constant2_Pkg2 is function F1 return Boolean is begin return False; end; function F2 return Boolean is begin return False; end; end Constant2_Pkg2;
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_copy_colormap_and_free_request_t is -- Item -- type Item is record major_opcode : aliased Interfaces.Unsigned_8; pad0 : aliased Interfaces.Unsigned_8; length : aliased Interfaces.Unsigned_16; mid : aliased xcb.xcb_colormap_t; src_cmap : aliased xcb.xcb_colormap_t; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_copy_colormap_and_free_request_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_copy_colormap_and_free_request_t.Item, Element_Array => xcb.xcb_copy_colormap_and_free_request_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_copy_colormap_and_free_request_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_copy_colormap_and_free_request_t.Pointer, Element_Array => xcb.xcb_copy_colormap_and_free_request_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_copy_colormap_and_free_request_t;
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with AdaBase.Statement.Base; with AdaBase.Logger.Facility; package AdaBase.Interfaces.Driver is type iDriver is interface; package ASB renames AdaBase.Statement.Base; package ALF renames AdaBase.Logger.Facility; procedure disconnect (driver : out iDriver) is null; procedure commit (driver : iDriver) is null; procedure rollback (driver : iDriver) is null; -- Only common traits are in interface. There might also be -- driver-specific traits, but those are found in driver specifications function trait_autocommit (driver : iDriver) return Boolean is abstract; function trait_column_case (driver : iDriver) return Case_Modes is abstract; function trait_error_mode (driver : iDriver) return Error_Modes is abstract; function trait_connected (driver : iDriver) return Boolean is abstract; function trait_max_blob_size (driver : iDriver) return BLOB_Maximum is abstract; function trait_driver (driver : iDriver) return String is abstract; function trait_client_info (driver : iDriver) return String is abstract; function trait_client_version (driver : iDriver) return String is abstract; function trait_server_info (driver : iDriver) return String is abstract; function trait_server_version (driver : iDriver) return String is abstract; function trait_character_set (driver : iDriver) return String is abstract; procedure set_trait_autocommit (driver : iDriver; trait : Boolean) is null; procedure set_trait_column_case (driver : iDriver; trait : Case_Modes) is null; procedure set_trait_error_mode (driver : iDriver; trait : Error_Modes) is null; procedure set_trait_max_blob_size (driver : iDriver; trait : BLOB_Maximum) is null; procedure set_trait_character_set (driver : iDriver; trait : String) is null; function trait_multiquery_enabled (driver : iDriver) return Boolean is abstract; procedure set_trait_multiquery_enabled (driver : iDriver; trait : Boolean) is null; function last_insert_id (driver : iDriver) return Trax_ID is abstract; function last_sql_state (driver : iDriver) return SQL_State is abstract; function last_driver_code (driver : iDriver) return Driver_Codes is abstract; function last_driver_message (driver : iDriver) return String is abstract; function execute (driver : iDriver; sql : String) return Affected_Rows is abstract; procedure command_standard_logger (driver : iDriver; device : ALF.TLogger; action : ALF.TAction) is null; procedure set_logger_filename (driver : iDriver; filename : String) is null; procedure detach_custom_logger (driver : iDriver) is null; procedure attach_custom_logger (driver : iDriver; logger_access : ALF.AL.BaseClass_Logger_access) is null; ------------------------------------------------------------------------ -- QUERIES -- ------------------------------------------------------------------------ procedure query_clear_table (driver : iDriver; table : String) is abstract; procedure query_drop_table (driver : iDriver; tables : String; when_exists : Boolean := False; cascade : Boolean := False) is abstract; -- This query functions returning statements were intended to part of the -- interface, but the return type also must be an interface (iStatement) -- and I can't see how to accomplish that. For now, remove them from the -- interface requirements and just implement them on each specific driver. -- -- function query (driver : iDriver; -- sql : String) -- return ASB.basic_statement is abstract; -- -- function query_select (driver : iDriver; -- distinct : Boolean := False; -- tables : String; -- columns : String; -- conditions : String := blankstring; -- groupby : String := blankstring; -- having : String := blankstring; -- order : String := blankstring; -- null_sort : NullPriority := native; -- limit : TraxID := 0; -- offset : TraxID := 0) -- return ASB.basic_statement is abstract; -- -- function prepare (same as query) return statement -- function prepare_select (same as query_select) return statement -- function call_stored_procedure (procedure name) return statement ------------------------------------------------------------------------ -- CONNECTIONS -- ------------------------------------------------------------------------ -- These are guaranteed to work (at least one of the them, but the -- individual driver could define a driver-specific version as well. -- Checked "trait_connected" to determine if connection was successful procedure basic_connect (driver : out iDriver; database : String; username : String := blankstring; password : String := blankstring; socket : String := blankstring) is null; procedure basic_connect (driver : out iDriver; database : String; username : String := blankstring; password : String := blankstring; hostname : String := blankstring; port : Posix_Port) is null; end AdaBase.Interfaces.Driver;
with Ada.Characters.Handling, Ada.Strings.Fixed; package body ARM_Format.Data is -- -- Ada reference manual formatter (ARM_Form). -- -- This package contains various data used by the input file parser. -- -- --------------------------------------- -- Copyright 2011, 2012 AXE Consultants. All rights reserved. -- P.O. Box 1512, Madison WI 53701 -- E-Mail: randy@rrsoftware.com -- -- ARM_Form is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License version 3 -- as published by the Free Software Foundation. -- -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS" -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL. -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL, -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -- DAMAGES. -- -- A copy of the GNU General Public License is available in the file -- gpl-3-0.txt in the standard distribution of the ARM_Form tool. -- Otherwise, see <http://www.gnu.org/licenses/>. -- -- If the GPLv3 license is not satisfactory for your needs, a commercial -- use license is available for this tool. Contact Randy at AXE Consultants -- for more information. -- -- --------------------------------------- -- -- Edit History: -- -- 8/ 8/11 - RLB - Split from base package, mainly to reduce the -- size of that package. -- - RLB - Added aspect index commands. -- 10/18/11 - RLB - Changed to GPLv3 license. -- 10/19/11 - RLB - Added AspectDefn command. -- 10/20/11 - RLB - Added DeletedPragmaSyn command. -- 10/26/11 - RLB - Added versioned break commands. -- 3/27/12 - RLB - Added more versioned break commands. -- 12/17/12 - RLB - Added Ada 2012 AARM headings. function Command (Name : in ARM_Input.Command_Name_Type) return Command_Type is -- Return the command value for a particular command name: Canonical_Name : constant String := Ada.Characters.Handling.To_Lower (Ada.Strings.Fixed.Trim (Name, Ada.Strings.Right)); begin if Canonical_Name = "begin" then return Text_Begin; elsif Canonical_Name = "end" then return Text_End; elsif Canonical_Name = "redundant" then return Redundant; elsif Canonical_Name = "comment" then return Comment; elsif Canonical_Name = "noprefix" then return No_Prefix; elsif Canonical_Name = "noparanum" then return No_Para_Num; elsif Canonical_Name = "keepnext" then return Keep_with_Next; elsif Canonical_Name = "leading" then return Leading; elsif Canonical_Name = "trailing" then return Trailing; elsif Canonical_Name = "+" then -- Can't happen directly, but can happen through stacking. return Up; elsif Canonical_Name = "-" then -- Can't happen directly, but can happen through stacking. return Down; elsif Canonical_Name = "thinline" then return Thin_Line; elsif Canonical_Name = "thickline" then return Thick_Line; elsif Canonical_Name = "tabclear" then return Tab_Clear; elsif Canonical_Name = "tabset" then return Tab_Set; elsif Canonical_Name = "table" then return Table; elsif Canonical_Name = "picturealone" then return Picture_Alone; elsif Canonical_Name = "pictureinline" then return Picture_Inline; elsif Canonical_Name = "last" then return Table_Last; elsif Canonical_Name = "part" then return Part; elsif Canonical_Name = "newpage" then return New_Page; elsif Canonical_Name = "rmnewpage" then return RM_New_Page; elsif Canonical_Name = "softpage" then return Soft_Page; elsif Canonical_Name = "newcolumn" then return New_Column; elsif Canonical_Name = "newpagever" then return New_Page_for_Version; elsif Canonical_Name = "rmnewpagever" then return RM_New_Page_for_Version; elsif Canonical_Name = "notisormnewpagever" then return Not_Iso_RM_New_Page_for_Version; elsif Canonical_Name = "isoonlyrmnewpagever" then return Iso_Only_RM_New_Page_for_Version; elsif Canonical_Name = "newcolumnver" then return New_Column_for_Version; elsif Canonical_Name = "b" or else Canonical_Name = "bold" then return Bold; elsif Canonical_Name = "i" or else Canonical_Name = "italics" then return Italic; elsif Canonical_Name = "r" or else Canonical_Name = "roman" then return Roman; elsif Canonical_Name = "s" or else Canonical_Name = "swiss" then return Swiss; elsif Canonical_Name = "f" or else Canonical_Name = "fixed" then return Fixed; elsif Canonical_Name = "ri" then return Roman_Italic; elsif Canonical_Name = "shrink" then return Shrink; elsif Canonical_Name = "grow" then return Grow; elsif Canonical_Name = "black" then return Black; elsif Canonical_Name = "red" then return Red; elsif Canonical_Name = "green" then return Green; elsif Canonical_Name = "blue" then return Blue; elsif Canonical_Name = "key" then return Keyword; elsif Canonical_Name = "nt" then return Non_Terminal; elsif Canonical_Name = "ntf" then return Non_Terminal_Format; elsif Canonical_Name = "exam" then return Example_Text; elsif Canonical_Name = "examcom" then return Example_Comment; elsif Canonical_Name = "indexlist" then return Index_List; elsif Canonical_Name = "defn" then return Defn; elsif Canonical_Name = "defn2" then return Defn2; elsif Canonical_Name = "rootdefn" then return RootDefn; elsif Canonical_Name = "rootdefn2" then return RootDefn2; elsif Canonical_Name = "pdefn" then return PDefn; elsif Canonical_Name = "pdefn2" then return PDefn2; elsif Canonical_Name = "indexsee" then return Index_See; elsif Canonical_Name = "indexseealso" then return Index_See_Also; elsif Canonical_Name = "seeother" then return See_Other; elsif Canonical_Name = "seealso" then return See_Also; elsif Canonical_Name = "rootlibunit" then return Index_Root_Unit; elsif Canonical_Name = "childunit" then return Index_Child_Unit; elsif Canonical_Name = "subchildunit" then return Index_Subprogram_Child_Unit; elsif Canonical_Name = "adatypedefn" then return Index_Type; elsif Canonical_Name = "adasubtypedefn" then return Index_Subtype; elsif Canonical_Name = "adasubdefn" then return Index_Subprogram; elsif Canonical_Name = "adaexcdefn" then return Index_Exception; elsif Canonical_Name = "adaobjdefn" then return Index_Object; elsif Canonical_Name = "adapackdefn" then return Index_Package; elsif Canonical_Name = "adadefn" then return Index_Other; elsif Canonical_Name = "indexcheck" then return Index_Check; elsif Canonical_Name = "attr" then return Index_Attr; elsif Canonical_Name = "prag" then return Index_Pragma; elsif Canonical_Name = "aspectdefn" then return Index_Aspect; elsif Canonical_Name = "syn" then return Syntax_Rule; elsif Canonical_Name = "syn2" then return Syntax_Term; elsif Canonical_Name = "synf" then return Syntax_Term_Undefined; elsif Canonical_Name = "syni" then return Syntax_Prefix; elsif Canonical_Name = "syntaxsummary" then return Syntax_Summary; elsif Canonical_Name = "syntaxxref" then return Syntax_Xref; elsif Canonical_Name = "addedsyn" then return Added_Syntax_Rule; elsif Canonical_Name = "deletedsyn" then return Deleted_Syntax_Rule; elsif Canonical_Name = "toglossary" then return To_Glossary; elsif Canonical_Name = "toglossaryalso" then return To_Glossary_Also; elsif Canonical_Name = "chgtoglossary" then return Change_To_Glossary; elsif Canonical_Name = "chgtoglossaryalso" then return Change_To_Glossary_Also; elsif Canonical_Name = "glossarylist" then return Glossary_List; elsif Canonical_Name = "prefixtype" then return Prefix_Type; elsif Canonical_Name = "chgprefixtype" then return Change_Prefix_Type; elsif Canonical_Name = "endprefixtype" then return Reset_Prefix_Type; elsif Canonical_Name = "attribute" then return Attribute; elsif Canonical_Name = "attributeleading" then return Attribute_Leading; elsif Canonical_Name = "chgattribute" then return Change_Attribute; elsif Canonical_Name = "attributelist" then return Attribute_List; elsif Canonical_Name = "pragmasyn" then return Pragma_Syntax; elsif Canonical_Name = "pragmalist" then return Pragma_List; elsif Canonical_Name = "addedpragmasyn" then return Added_Pragma_Syntax; elsif Canonical_Name = "deletedpragmasyn" then return Deleted_Pragma_Syntax; elsif Canonical_Name = "impldef" then return Implementation_Defined; elsif Canonical_Name = "chgimpldef" then return Change_Implementation_Defined; elsif Canonical_Name = "impldeflist" then return Implementation_Defined_List; elsif Canonical_Name = "chgimpladvice" then return Change_Implementation_Advice; elsif Canonical_Name = "addedimpladvicelist" then return Added_Implementation_Advice_List; elsif Canonical_Name = "chgdocreq" then return Change_Documentation_Requirement; elsif Canonical_Name = "addeddocreqlist" then return Added_Documentation_Requirements_List; elsif Canonical_Name = "chgaspectdesc" then return Change_Aspect_Description; elsif Canonical_Name = "addedaspectlist" then return Added_Aspect_Description_List; elsif Canonical_Name = "packagelist" then return Package_List; elsif Canonical_Name = "typelist" then return Type_List; elsif Canonical_Name = "subprogramlist" then return Subprogram_List; elsif Canonical_Name = "exceptionlist" then return Exception_List; elsif Canonical_Name = "objectlist" then return Object_List; elsif Canonical_Name = "labeledsection" then return Labeled_Section; elsif Canonical_Name = "labeledsectionnobreak" then return Labeled_Section_No_Break; elsif Canonical_Name = "labeledclause" then return Labeled_Clause; elsif Canonical_Name = "labeledsubclause" then return Labeled_Subclause; elsif Canonical_Name = "labeledsubsubclause" then return Labeled_Subsubclause; elsif Canonical_Name = "labeledannex" then return Labeled_Annex; elsif Canonical_Name = "labeledinformativeannex" then return Labeled_Informative_Annex; elsif Canonical_Name = "labelednormativeannex" then return Labeled_Normative_Annex; elsif Canonical_Name = "unnumberedsection" then return Unnumbered_Section; elsif Canonical_Name = "labeledrevisedannex" then return Labeled_Revised_Annex; elsif Canonical_Name = "labeledrevisedinformativeannex" then return Labeled_Revised_Informative_Annex; elsif Canonical_Name = "labeledrevisednormativeannex" then return Labeled_Revised_Normative_Annex; elsif Canonical_Name = "labeledaddedannex" then return Labeled_Added_Annex; elsif Canonical_Name = "labeledaddedinformativeannex" then return Labeled_Added_Informative_Annex; elsif Canonical_Name = "labeledaddednormativeannex" then return Labeled_Added_Normative_Annex; elsif Canonical_Name = "labeledrevisedsection" then return Labeled_Revised_Section; elsif Canonical_Name = "labeledrevisedclause" then return Labeled_Revised_Clause; elsif Canonical_Name = "labeledrevisedsubclause" then return Labeled_Revised_Subclause; elsif Canonical_Name = "labeledrevisedsubsubclause" then return Labeled_Revised_Subsubclause; elsif Canonical_Name = "labeledaddedsection" then return Labeled_Added_Section; elsif Canonical_Name = "labeledaddedclause" then return Labeled_Added_Clause; elsif Canonical_Name = "labeledaddedsubclause" then return Labeled_Added_Subclause; elsif Canonical_Name = "labeledaddedsubsubclause" then return Labeled_Added_Subsubclause; elsif Canonical_Name = "labeleddeletedclause" then return Labeled_Deleted_Clause; elsif Canonical_Name = "labeleddeletedsubclause" then return Labeled_Deleted_Subclause; elsif Canonical_Name = "labeleddeletedsubsubclause" then return Labeled_Deleted_Subsubclause; elsif Canonical_Name = "subheading" then return Subheading; elsif Canonical_Name = "addedsubheading" then return Added_Subheading; elsif Canonical_Name = "heading" then return Heading; elsif Canonical_Name = "center" then return Center; elsif Canonical_Name = "right" then return Right; elsif Canonical_Name = "prefacesection" then return Preface_Section; elsif Canonical_Name = "refsec" then return Ref_Section; elsif Canonical_Name = "refsecnum" then return Ref_Section_Number; elsif Canonical_Name = "refsecbynum" then return Ref_Section_By_Number; elsif Canonical_Name = "locallink" then return Local_Link; elsif Canonical_Name = "localtarget" then return Local_Target; elsif Canonical_Name = "urllink" then return URL_Link; elsif Canonical_Name = "ailink" then return AI_Link; elsif Canonical_Name = "chg" then return Change; elsif Canonical_Name = "chgadded" then return Change_Added; elsif Canonical_Name = "chgdeleted" then return Change_Deleted; elsif Canonical_Name = "chgref" then return Change_Reference; elsif Canonical_Name = "chgnote" then return Change_Note; elsif Canonical_Name = "introname" then return Intro_Name; elsif Canonical_Name = "syntaxname" then return Syntax_Name; elsif Canonical_Name = "resolutionname" then return Resolution_Name; elsif Canonical_Name = "legalityname" then return Legality_Name; elsif Canonical_Name = "staticsemname" then return Static_Name; elsif Canonical_Name = "linktimename" then return Link_Name; elsif Canonical_Name = "runtimename" then return Run_Name; elsif Canonical_Name = "boundedname" then return Bounded_Name; elsif Canonical_Name = "erronname" then return Erroneous_Name; elsif Canonical_Name = "implreqname" then return Req_Name; elsif Canonical_Name = "docreqname" then return Doc_Name; elsif Canonical_Name = "metricsname" then return Metrics_Name; elsif Canonical_Name = "implpermname" then return Permission_Name; elsif Canonical_Name = "impladvicename" then return Advice_Name; elsif Canonical_Name = "notesname" then return Notes_Name; elsif Canonical_Name = "singlenotename" then return Single_Note_Name; elsif Canonical_Name = "examplesname" then return Examples_Name; elsif Canonical_Name = "metarulesname" then return Meta_Name; elsif Canonical_Name = "inconsistent83name" then return Inconsistent83_Name; elsif Canonical_Name = "incompatible83name" then return Incompatible83_Name; elsif Canonical_Name = "extend83name" then return Extend83_Name; elsif Canonical_Name = "diffword83name" then return Wording83_Name; elsif Canonical_Name = "inconsistent95name" then return Inconsistent95_Name; elsif Canonical_Name = "incompatible95name" then return Incompatible95_Name; elsif Canonical_Name = "extend95name" then return Extend95_Name; elsif Canonical_Name = "diffword95name" then return Wording95_Name; elsif Canonical_Name = "inconsistent2005name" then return Inconsistent2005_Name; elsif Canonical_Name = "incompatible2005name" then return Incompatible2005_Name; elsif Canonical_Name = "extend2005name" then return Extend2005_Name; elsif Canonical_Name = "diffword2005name" then return Wording2005_Name; elsif Canonical_Name = "inconsistent2012name" then return Inconsistent2012_Name; elsif Canonical_Name = "incompatible2012name" then return Incompatible2012_Name; elsif Canonical_Name = "extend2012name" then return Extend2012_Name; elsif Canonical_Name = "diffword2012name" then return Wording2012_Name; elsif Canonical_Name = "syntaxtitle" then return Syntax_Title; elsif Canonical_Name = "resolutiontitle" then return Resolution_Title; elsif Canonical_Name = "legalitytitle" then return Legality_Title; elsif Canonical_Name = "staticsemtitle" then return Static_Title; elsif Canonical_Name = "linktimetitle" then return Link_Title; elsif Canonical_Name = "runtimetitle" then return Run_Title; elsif Canonical_Name = "boundedtitle" then return Bounded_Title; elsif Canonical_Name = "errontitle" then return Erroneous_Title; elsif Canonical_Name = "implreqtitle" then return Req_Title; elsif Canonical_Name = "docreqtitle" then return Doc_Title; elsif Canonical_Name = "metricstitle" then return Metrics_Title; elsif Canonical_Name = "implpermtitle" then return Permission_Title; elsif Canonical_Name = "impladvicetitle" then return Advice_Title; elsif Canonical_Name = "notestitle" then return Notes_Title; elsif Canonical_Name = "singlenotetitle" then return Single_Note_Title; elsif Canonical_Name = "examplestitle" then return Examples_Title; elsif Canonical_Name = "metarulestitle" then return Meta_Title; elsif Canonical_Name = "inconsistent83title" then return Inconsistent83_Title; elsif Canonical_Name = "incompatible83title" then return Incompatible83_Title; elsif Canonical_Name = "extend83title" then return Extend83_Title; elsif Canonical_Name = "diffword83title" then return Wording83_Title; elsif Canonical_Name = "inconsistent95title" then return Inconsistent95_Title; elsif Canonical_Name = "incompatible95title" then return Incompatible95_Title; elsif Canonical_Name = "extend95title" then return Extend95_Title; elsif Canonical_Name = "diffword95title" then return Wording95_Title; elsif Canonical_Name = "inconsistent2005title" then return Inconsistent2005_Title; elsif Canonical_Name = "incompatible2005title" then return Incompatible2005_Title; elsif Canonical_Name = "extend2005title" then return Extend2005_Title; elsif Canonical_Name = "diffword2005title" then return Wording2005_Title; elsif Canonical_Name = "inconsistent2012title" then return Inconsistent2012_Title; elsif Canonical_Name = "incompatible2012title" then return Incompatible2012_Title; elsif Canonical_Name = "extend2012title" then return Extend2012_Title; elsif Canonical_Name = "diffword2012title" then return Wording2012_Title; elsif Canonical_Name = "em" then return EM_Dash; elsif Canonical_Name = "en" then return EN_Dash; elsif Canonical_Name = "lt" then return LT; elsif Canonical_Name = "leq" then return LE; elsif Canonical_Name = "gt" then return GT; elsif Canonical_Name = "geq" then return GE; elsif Canonical_Name = "neq" then return NE; elsif Canonical_Name = "pi" then return PI; elsif Canonical_Name = "times" then return Times; elsif Canonical_Name = "porm" then return PorM; elsif Canonical_Name = "singlequote" then return Single_Quote; elsif Canonical_Name = "latin1" then return LATIN_1; elsif Canonical_Name = "unicode" then return Unicode; elsif Canonical_Name = "ceiling" then return Ceiling; elsif Canonical_Name = "floor" then return Floor; elsif Canonical_Name = "abs" then return Absolute; elsif Canonical_Name = "log" then return Log; elsif Canonical_Name = "thin" then return Thin_Space; elsif Canonical_Name = "lquote" then return Left_Quote; elsif Canonical_Name = "lquotes" then return Left_Quote_Pair; elsif Canonical_Name = "ldquote" then return Left_Double_Quote; elsif Canonical_Name = "rquote" then return Right_Quote; elsif Canonical_Name = "rquotes" then return Right_Quote_Pair; elsif Canonical_Name = "rdquote" then return Right_Double_Quote; elsif Canonical_Name = "smldotlessi" then return Small_Dotless_I; elsif Canonical_Name = "capdottedi" then return Capital_Dotted_I; else return Unknown; end if; end Command; end ARM_Format.Data;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . E X E C U T I O N _ T I M E -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.Task_Identification; with Ada.Real_Time; package Ada.Execution_Time with SPARK_Mode is type CPU_Time is private; CPU_Time_First : constant CPU_Time; CPU_Time_Last : constant CPU_Time; CPU_Time_Unit : constant := Ada.Real_Time.Time_Unit; CPU_Tick : constant Ada.Real_Time.Time_Span; use type Ada.Task_Identification.Task_Id; function Clock (T : Ada.Task_Identification.Task_Id := Ada.Task_Identification.Current_Task) return CPU_Time with Volatile_Function, Global => Ada.Real_Time.Clock_Time, Pre => T /= Ada.Task_Identification.Null_Task_Id; function "+" (Left : CPU_Time; Right : Ada.Real_Time.Time_Span) return CPU_Time with Global => null; function "+" (Left : Ada.Real_Time.Time_Span; Right : CPU_Time) return CPU_Time with Global => null; function "-" (Left : CPU_Time; Right : Ada.Real_Time.Time_Span) return CPU_Time with Global => null; function "-" (Left : CPU_Time; Right : CPU_Time) return Ada.Real_Time.Time_Span; function "<" (Left, Right : CPU_Time) return Boolean with Global => null; function "<=" (Left, Right : CPU_Time) return Boolean with Global => null; function ">" (Left, Right : CPU_Time) return Boolean with Global => null; function ">=" (Left, Right : CPU_Time) return Boolean with Global => null; procedure Split (T : CPU_Time; SC : out Ada.Real_Time.Seconds_Count; TS : out Ada.Real_Time.Time_Span) with Global => null; function Time_Of (SC : Ada.Real_Time.Seconds_Count; TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero) return CPU_Time with Global => null; Interrupt_Clocks_Supported : constant Boolean := True; Separate_Interrupt_Clocks_Supported : constant Boolean := True; function Clock_For_Interrupts return CPU_Time with Volatile_Function, Global => Ada.Real_Time.Clock_Time, Pre => Interrupt_Clocks_Supported; private pragma SPARK_Mode (Off); type CPU_Time is new Ada.Real_Time.Time; CPU_Time_First : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_First); CPU_Time_Last : constant CPU_Time := CPU_Time (Ada.Real_Time.Time_Last); CPU_Tick : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Tick; pragma Import (Intrinsic, "<"); pragma Import (Intrinsic, "<="); pragma Import (Intrinsic, ">"); pragma Import (Intrinsic, ">="); end Ada.Execution_Time;
----------------------------------------------------------------------- -- awa-setup -- Setup and installation -- Copyright (C) 2016, 2017 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- -- == Setup Application == -- The <tt>AWA.Setup</tt> package implements a simple setup application -- that allows to configure the database, the Google and Facebook application -- identifiers and some other configuration parameters. It is intended to -- help in the installation process of any AWA-based application. -- -- It defines a specific web application that is installed in the web container -- for the duration of the setup. The setup application takes control over all -- the web requests during the lifetime of the installation. As soon as the -- installation is finished, the normal application is configured and installed -- in the web container and the user is automatically redirected to it. -- -- @include awa-setup-applications.ads package AWA.Setup is pragma Pure; end AWA.Setup;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-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 Ada.Unchecked_Deallocation; package body Matreshka.Internals.XML.Attributes is procedure Free is new Ada.Unchecked_Deallocation (Attribute_Array, Attribute_Array_Access); ----------- -- Clear -- ----------- procedure Clear (Self : in out Attribute_Set) is begin for J in Self.Attributes'First .. Self.Last loop Matreshka.Internals.Strings.Dereference (Self.Attributes (J).Value); end loop; Self.Last := 0; end Clear; -------------- -- Finalize -- -------------- procedure Finalize (Self : in out Attribute_Set) is begin Clear (Self); Free (Self.Attributes); end Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out Attribute_Set) is begin Self.Attributes := new Attribute_Array (1 .. 16); Self.Last := 0; end Initialize; ------------ -- Insert -- ------------ procedure Insert (Self : in out Attribute_Set; Qualified_Name : Symbol_Identifier; Value : not null Matreshka.Internals.Strings.Shared_String_Access; Type_Name : Symbol_Identifier; Is_Specified : Boolean; Inserted : out Boolean) is begin for J in Self.Attributes'First .. Self.Last loop if Self.Attributes (J).Qualified_Name = Qualified_Name then Inserted := False; return; end if; end loop; Matreshka.Internals.Strings.Reference (Value); Inserted := True; Self.Last := Self.Last + 1; if Self.Last > Self.Attributes'Last then declare Old : Attribute_Array_Access := Self.Attributes; begin Self.Attributes := new Attribute_Array (1 .. Old'Last + 16); Self.Attributes (Old'Range) := Old.all; Free (Old); end; end if; Self.Attributes (Self.Last) := (Namespace_URI => No_Symbol, Qualified_Name => Qualified_Name, Value => Value, Type_Name => Type_Name, Is_Declared => False, Is_Specified => Is_Specified); end Insert; ----------------- -- Is_Declared -- ----------------- function Is_Declared (Self : Attribute_Set; Index : Positive) return Boolean is begin return Self.Attributes (Index).Is_Declared; end Is_Declared; ------------------ -- Is_Specified -- ------------------ function Is_Specified (Self : Attribute_Set; Index : Positive) return Boolean is begin return Self.Attributes (Index).Is_Specified; end Is_Specified; ------------ -- Length -- ------------ function Length (Self : Attribute_Set) return Natural is begin return Self.Last; end Length; ------------------- -- Namespace_URI -- ------------------- function Namespace_URI (Self : Attribute_Set; Index : Positive) return Symbol_Identifier is begin return Self.Attributes (Index).Namespace_URI; end Namespace_URI; -------------------- -- Qualified_Name -- -------------------- function Qualified_Name (Self : Attribute_Set; Index : Positive) return Symbol_Identifier is begin return Self.Attributes (Index).Qualified_Name; end Qualified_Name; --------------------- -- Set_Is_Declared -- --------------------- procedure Set_Is_Declared (Self : in out Attribute_Set; Index : Positive) is begin Self.Attributes (Index).Is_Declared := True; end Set_Is_Declared; ----------------------- -- Set_Namespace_URI -- ----------------------- procedure Set_Namespace_URI (Self : Attribute_Set; Index : Positive; Namespace_URI : Symbol_Identifier) is begin Self.Attributes (Index).Namespace_URI := Namespace_URI; end Set_Namespace_URI; --------------- -- Type_Name -- --------------- function Type_Name (Self : Attribute_Set; Index : Positive) return Symbol_Identifier is begin return Self.Attributes (Index).Type_Name; end Type_Name; ----------- -- Value -- ----------- function Value (Self : Attribute_Set; Index : Positive) return not null Matreshka.Internals.Strings.Shared_String_Access is begin return Self.Attributes (Index).Value; end Value; end Matreshka.Internals.XML.Attributes;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P R J . P R O C -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- -- This package is used to convert a project file tree (see prj-tree.ads) to -- project file data structures (see prj.ads), taking into account -- the environment (external references). with Prj.Tree; use Prj.Tree; package Prj.Proc is procedure Process (Project : out Project_Id; From_Project_Node : Project_Node_Id; Report_Error : Put_Line_Access); -- Process a project file tree into project file data structures. -- If Report_Error is null, use the standard error reporting mechanism -- (Errout). Otherwise, report errors using Report_Error. end Prj.Proc;
-- { dg-do run } with Init7; use Init7; with Text_IO; use Text_IO; with Dump; procedure R7 is function Get_Elem (R : R1) return Integer is Tmp : R1 := R; begin return Tmp.N.C1; end; procedure Set_Elem (R : access R1; I : Integer) is Tmp : R1 := R.all; begin Tmp.N.C1 := I; R.all := Tmp; end; function Get_Elem (R : R2) return Integer is Tmp : R2 := R; begin return Tmp.N.C1; end; procedure Set_Elem (R : access R2; I : Integer) is Tmp : R2 := R.all; begin Tmp.N.C1 := I; R.all := Tmp; end; A1 : aliased R1 := My_R1; A2 : aliased R2 := My_R2; begin Put ("A1 :"); Dump (A1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A1 : 78 56 34 12 12 00 ab 00 34 00 cd 00 56 00 ef 00.*\n" } Put ("A2 :"); Dump (A2'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "A2 : 12 34 56 78 00 ab 00 12 00 cd 00 34 00 ef 00 56.*\n" } if Get_Elem (A1) /= 16#AB0012# then raise Program_Error; end if; Set_Elem (A1'Access, 16#CD0034#); if Get_Elem (A1) /= 16#CD0034# then raise Program_Error; end if; if Get_Elem (A2) /= 16#AB0012# then raise Program_Error; end if; Set_Elem (A2'Access, 16#CD0034#); if Get_Elem (A2) /= 16#CD0034# then raise Program_Error; end if; end;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- 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$ ------------------------------------------------------------------------------ package body Matreshka.DOM_Character_Datas is ------------------ -- Constructors -- ------------------ package body Constructors is ---------------- -- Initialize -- ---------------- procedure Initialize (Self : not null access Character_Data_Node'Class; Document : not null Matreshka.DOM_Nodes.Document_Access; Data : League.Strings.Universal_String) is begin Matreshka.DOM_Nodes.Constructors.Initialize (Self, Document); Self.Data := Data; end Initialize; end Constructors; -------------- -- Get_Data -- -------------- overriding function Get_Data (Self : not null access constant Character_Data_Node) return League.Strings.Universal_String is begin return Self.Data; end Get_Data; ------------------ -- Replace_Data -- ------------------ overriding procedure Replace_Data (Self : not null access Character_Data_Node; Offset : Positive; Count : Natural; Arg : League.Strings.Universal_String) is begin if Offset <= Self.Data.Length then -- Position of first character of the replaced slice is inside -- string. Position of last character of replaced slice can't be -- greater than length of the string. Self.Data.Replace (Offset, Natural'Min (Offset + Count - 1, Self.Data.Length), Arg); elsif Offset = Self.Data.Length + 1 then -- Position of first character points to first position after -- position of last character of the string. Specified new data need -- to be appended to the string. Self.Data.Append (Arg); else -- Position of the first character points outside of current data, -- DOM_INDEX_SIZE_ERR need to be raised. Self.Raise_Index_Size_Error; end if; end Replace_Data; -------------- -- Set_Data -- -------------- overriding procedure Set_Data (Self : not null access Character_Data_Node; New_Value : League.Strings.Universal_String) is begin Self.Data := New_Value; end Set_Data; end Matreshka.DOM_Character_Datas;
pragma Style_Checks (Off); -- This spec has been automatically generated from STM32G474xx.svd pragma Restrictions (No_Elaboration_Code); with HAL; with System; package STM32_SVD.STK is pragma Preelaborate; --------------- -- Registers -- --------------- -- SysTick control and status register type CTRL_Register is record -- Counter enable ENABLE : Boolean := False; -- SysTick exception request enable TICKINT : Boolean := False; -- Clock source selection CLKSOURCE : Boolean := False; -- unspecified Reserved_3_15 : HAL.UInt13 := 16#0#; -- COUNTFLAG COUNTFLAG : Boolean := False; -- unspecified Reserved_17_31 : HAL.UInt15 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CTRL_Register use record ENABLE at 0 range 0 .. 0; TICKINT at 0 range 1 .. 1; CLKSOURCE at 0 range 2 .. 2; Reserved_3_15 at 0 range 3 .. 15; COUNTFLAG at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; subtype LOAD_RELOAD_Field is HAL.UInt24; -- SysTick reload value register type LOAD_Register is record -- RELOAD value RELOAD : LOAD_RELOAD_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for LOAD_Register use record RELOAD at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype VAL_CURRENT_Field is HAL.UInt24; -- SysTick current value register type VAL_Register is record -- Current counter value CURRENT : VAL_CURRENT_Field := 16#0#; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for VAL_Register use record CURRENT at 0 range 0 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype CALIB_TENMS_Field is HAL.UInt24; -- SysTick calibration value register type CALIB_Register is record -- Calibration value TENMS : CALIB_TENMS_Field := 16#0#; -- unspecified Reserved_24_29 : HAL.UInt6 := 16#0#; -- SKEW flag: Indicates whether the TENMS value is exact SKEW : Boolean := False; -- NOREF flag. Reads as zero NOREF : Boolean := False; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CALIB_Register use record TENMS at 0 range 0 .. 23; Reserved_24_29 at 0 range 24 .. 29; SKEW at 0 range 30 .. 30; NOREF at 0 range 31 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- SysTick timer type STK_Peripheral is record -- SysTick control and status register CTRL : aliased CTRL_Register; -- SysTick reload value register LOAD : aliased LOAD_Register; -- SysTick current value register VAL : aliased VAL_Register; -- SysTick calibration value register CALIB : aliased CALIB_Register; end record with Volatile; for STK_Peripheral use record CTRL at 16#0# range 0 .. 31; LOAD at 16#4# range 0 .. 31; VAL at 16#8# range 0 .. 31; CALIB at 16#C# range 0 .. 31; end record; -- SysTick timer STK_Periph : aliased STK_Peripheral with Import, Address => STK_Base; end STM32_SVD.STK;
-- This spec has been automatically generated from STM32F7x9.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.SYSCFG is pragma Preelaborate; --------------- -- Registers -- --------------- subtype MEMRM_MEM_MODE_Field is HAL.UInt3; subtype MEMRM_SWP_FMC_Field is HAL.UInt2; -- memory remap register type MEMRM_Register is record -- Memory mapping selection MEM_MODE : MEMRM_MEM_MODE_Field := 16#0#; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; -- Flash bank mode selection FB_MODE : Boolean := False; -- unspecified Reserved_9_9 : HAL.Bit := 16#0#; -- FMC memory mapping swap SWP_FMC : MEMRM_SWP_FMC_Field := 16#0#; -- unspecified Reserved_12_31 : HAL.UInt20 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MEMRM_Register use record MEM_MODE at 0 range 0 .. 2; Reserved_3_7 at 0 range 3 .. 7; FB_MODE at 0 range 8 .. 8; Reserved_9_9 at 0 range 9 .. 9; SWP_FMC at 0 range 10 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; -- peripheral mode configuration register type PMC_Register is record -- unspecified Reserved_0_15 : HAL.UInt16 := 16#0#; -- ADC1DC2 ADC1DC2 : Boolean := False; -- ADC2DC2 ADC2DC2 : Boolean := False; -- ADC3DC2 ADC3DC2 : Boolean := False; -- unspecified Reserved_19_22 : HAL.UInt4 := 16#0#; -- Ethernet PHY interface selection MII_RMII_SEL : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PMC_Register use record Reserved_0_15 at 0 range 0 .. 15; ADC1DC2 at 0 range 16 .. 16; ADC2DC2 at 0 range 17 .. 17; ADC3DC2 at 0 range 18 .. 18; Reserved_19_22 at 0 range 19 .. 22; MII_RMII_SEL at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- EXTICR1_EXTI array element subtype EXTICR1_EXTI_Element is HAL.UInt4; -- EXTICR1_EXTI array type EXTICR1_EXTI_Field_Array is array (0 .. 3) of EXTICR1_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR1_EXTI type EXTICR1_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.UInt16; when True => -- EXTI as an array Arr : EXTICR1_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR1_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 1 type EXTICR1_Register is record -- EXTI x configuration (x = 0 to 3) EXTI : EXTICR1_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR1_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- EXTICR2_EXTI array element subtype EXTICR2_EXTI_Element is HAL.UInt4; -- EXTICR2_EXTI array type EXTICR2_EXTI_Field_Array is array (4 .. 7) of EXTICR2_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR2_EXTI type EXTICR2_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.UInt16; when True => -- EXTI as an array Arr : EXTICR2_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR2_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 2 type EXTICR2_Register is record -- EXTI x configuration (x = 4 to 7) EXTI : EXTICR2_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR2_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- EXTICR3_EXTI array element subtype EXTICR3_EXTI_Element is HAL.UInt4; -- EXTICR3_EXTI array type EXTICR3_EXTI_Field_Array is array (8 .. 11) of EXTICR3_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR3_EXTI type EXTICR3_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.UInt16; when True => -- EXTI as an array Arr : EXTICR3_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR3_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 3 type EXTICR3_Register is record -- EXTI x configuration (x = 8 to 11) EXTI : EXTICR3_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR3_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- EXTICR4_EXTI array element subtype EXTICR4_EXTI_Element is HAL.UInt4; -- EXTICR4_EXTI array type EXTICR4_EXTI_Field_Array is array (12 .. 15) of EXTICR4_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR4_EXTI type EXTICR4_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.UInt16; when True => -- EXTI as an array Arr : EXTICR4_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR4_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 4 type EXTICR4_Register is record -- EXTI x configuration (x = 12 to 15) EXTI : EXTICR4_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR4_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -- Compensation cell control register type CMPCR_Register is record -- Read-only. Compensation cell power-down CMP_PD : Boolean; -- unspecified Reserved_1_7 : HAL.UInt7; -- Read-only. READY READY : Boolean; -- unspecified Reserved_9_31 : HAL.UInt23; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CMPCR_Register use record CMP_PD at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; READY at 0 range 8 .. 8; Reserved_9_31 at 0 range 9 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- System configuration controller type SYSCFG_Peripheral is record -- memory remap register MEMRM : aliased MEMRM_Register; -- peripheral mode configuration register PMC : aliased PMC_Register; -- external interrupt configuration register 1 EXTICR1 : aliased EXTICR1_Register; -- external interrupt configuration register 2 EXTICR2 : aliased EXTICR2_Register; -- external interrupt configuration register 3 EXTICR3 : aliased EXTICR3_Register; -- external interrupt configuration register 4 EXTICR4 : aliased EXTICR4_Register; -- Compensation cell control register CMPCR : aliased CMPCR_Register; end record with Volatile; for SYSCFG_Peripheral use record MEMRM at 16#0# range 0 .. 31; PMC at 16#4# range 0 .. 31; EXTICR1 at 16#8# range 0 .. 31; EXTICR2 at 16#C# range 0 .. 31; EXTICR3 at 16#10# range 0 .. 31; EXTICR4 at 16#14# range 0 .. 31; CMPCR at 16#20# range 0 .. 31; end record; -- System configuration controller SYSCFG_Periph : aliased SYSCFG_Peripheral with Import, Address => System'To_Address (16#40013800#); end STM32_SVD.SYSCFG;
<?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>dct_1d2</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>src</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>src</originalName> <rtlName/> <coreName>RAM</coreName> </Obj> <bitwidth>16</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>64</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>tmp_6</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <direction>0</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>dst</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>dst</originalName> <rtlName/> <coreName>RAM</coreName> </Obj> <bitwidth>16</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>64</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>tmp_61</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <direction>0</direction> <if_type>0</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>98</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_5"> <Value> <Obj> <type>0</type> <id>13</id> <name>tmp_61_read</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>121</item> <item>122</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>14</id> <name>tmp_6_read</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>123</item> <item>124</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>15</id> <name>tmp_15</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_15_fu_288_p3</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>126</item> <item>127</item> <item>129</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>16</id> <name>tmp_21_cast</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_21_cast_fu_296_p1</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>130</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>17</id> <name>tmp_16</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_16_fu_300_p3</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>131</item> <item>132</item> <item>133</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>18</id> <name>tmp_17</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</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>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_17_fu_308_p1</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>134</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>19</id> <name>src_addr</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>135</item> <item>137</item> <item>138</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>20</id> <name>tmp_18</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_18_fu_313_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>139</item> <item>141</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>21</id> <name>tmp_19</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_19_fu_319_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>143</item> <item>145</item> <item>146</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>22</id> <name>src_addr_1</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>147</item> <item>148</item> <item>149</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>23</id> <name>tmp_20</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_20_fu_328_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>150</item> <item>152</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>24</id> <name>tmp_21</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_21_fu_334_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>153</item> <item>154</item> <item>155</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>25</id> <name>src_addr_2</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>156</item> <item>157</item> <item>158</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>26</id> <name>tmp_22</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_22_fu_343_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>159</item> <item>161</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>27</id> <name>tmp_23</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_23_fu_349_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>162</item> <item>163</item> <item>164</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>28</id> <name>src_addr_3</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>165</item> <item>166</item> <item>167</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>29</id> <name>tmp_24</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_24_fu_358_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>168</item> <item>170</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>30</id> <name>tmp_25</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_25_fu_364_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>171</item> <item>172</item> <item>173</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>31</id> <name>src_addr_4</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>174</item> <item>175</item> <item>176</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>32</id> <name>tmp_26</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_26_fu_373_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>177</item> <item>179</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>33</id> <name>tmp_27</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_27_fu_379_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>180</item> <item>181</item> <item>182</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>34</id> <name>src_addr_5</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>183</item> <item>184</item> <item>185</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>35</id> <name>tmp_28</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_28_fu_388_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>186</item> <item>188</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>36</id> <name>tmp_29</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_29_fu_394_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>189</item> <item>190</item> <item>191</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>37</id> <name>src_addr_6</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>192</item> <item>193</item> <item>194</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>38</id> <name>tmp_30</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>tmp_30_fu_403_p2</rtlName> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>195</item> <item>197</item> </oprand_edges> <opcode>or</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>39</id> <name>tmp_31</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_31_fu_409_p3</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>198</item> <item>199</item> <item>200</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>40</id> <name>src_addr_7</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>201</item> <item>202</item> <item>203</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>41</id> <name/> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>204</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>43</id> <name>k</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>k</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>206</item> <item>207</item> <item>208</item> <item>209</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>44</id> <name>tmp</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_fu_418_p2</rtlName> <coreName/> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>210</item> <item>212</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>45</id> <name>k_1</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName>k</originalName> <rtlName>k_1_fu_424_p2</rtlName> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>213</item> <item>215</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/> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>216</item> <item>217</item> <item>218</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>52</id> <name>tmp_s</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_s_fu_430_p1</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>219</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>53</id> <name>tmp_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_cast_fu_436_p1</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>220</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>54</id> <name>tmp_32</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_32_fu_440_p2</rtlName> <coreName/> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>221</item> <item>222</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>55</id> <name>tmp_38_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_38_cast_fu_524_p1</rtlName> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>223</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>56</id> <name>dst_addr</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>224</item> <item>225</item> <item>226</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>57</id> <name>dct_coeff_table_0_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>227</item> <item>228</item> <item>229</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_44"> <Value> <Obj> <type>0</type> <id>58</id> <name>dct_coeff_table_0_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>14</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>230</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>59</id> <name>coeff_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>grp_fu_540_p10</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>231</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_46"> <Value> <Obj> <type>0</type> <id>60</id> <name>src_load</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>232</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_47"> <Value> <Obj> <type>0</type> <id>61</id> <name>tmp_16_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>233</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_48"> <Value> <Obj> <type>0</type> <id>62</id> <name>tmp_14</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16kbM_U3</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>234</item> <item>235</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_49"> <Value> <Obj> <type>0</type> <id>63</id> <name>dct_coeff_table_1_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>236</item> <item>237</item> <item>238</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_50"> <Value> <Obj> <type>0</type> <id>64</id> <name>dct_coeff_table_1_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>239</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_51"> <Value> <Obj> <type>0</type> <id>65</id> <name>coeff_1_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>240</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_52"> <Value> <Obj> <type>0</type> <id>66</id> <name>src_load_1</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>241</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_53"> <Value> <Obj> <type>0</type> <id>67</id> <name>tmp_17_1_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>242</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_54"> <Value> <Obj> <type>0</type> <id>68</id> <name>tmp_18_1</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mul_mul_16s_1jbC_U1</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>243</item> <item>244</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_55"> <Value> <Obj> <type>0</type> <id>69</id> <name>dct_coeff_table_2_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>245</item> <item>246</item> <item>247</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_56"> <Value> <Obj> <type>0</type> <id>70</id> <name>dct_coeff_table_2_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>248</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_57"> <Value> <Obj> <type>0</type> <id>71</id> <name>coeff_2_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>249</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_58"> <Value> <Obj> <type>0</type> <id>72</id> <name>src_load_2</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>250</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_59"> <Value> <Obj> <type>0</type> <id>73</id> <name>tmp_17_2_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>251</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_60"> <Value> <Obj> <type>0</type> <id>74</id> <name>tmp_18_2</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16lbW_U5</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>252</item> <item>253</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_61"> <Value> <Obj> <type>0</type> <id>75</id> <name>dct_coeff_table_3_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>254</item> <item>255</item> <item>256</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_62"> <Value> <Obj> <type>0</type> <id>76</id> <name>dct_coeff_table_3_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>257</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_63"> <Value> <Obj> <type>0</type> <id>77</id> <name>coeff_3_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>258</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_64"> <Value> <Obj> <type>0</type> <id>78</id> <name>src_load_3</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>259</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_65"> <Value> <Obj> <type>0</type> <id>79</id> <name>tmp_17_3_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>260</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_66"> <Value> <Obj> <type>0</type> <id>80</id> <name>tmp_18_3</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mul_mul_16s_1jbC_U2</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>261</item> <item>262</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_67"> <Value> <Obj> <type>0</type> <id>81</id> <name>dct_coeff_table_4_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>263</item> <item>264</item> <item>265</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_68"> <Value> <Obj> <type>0</type> <id>82</id> <name>dct_coeff_table_4_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>266</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_69"> <Value> <Obj> <type>0</type> <id>83</id> <name>coeff_4_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>267</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_70"> <Value> <Obj> <type>0</type> <id>84</id> <name>src_load_4</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>268</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_71"> <Value> <Obj> <type>0</type> <id>85</id> <name>tmp_17_4_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>269</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_72"> <Value> <Obj> <type>0</type> <id>86</id> <name>tmp_18_4</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16lbW_U6</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>270</item> <item>271</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_73"> <Value> <Obj> <type>0</type> <id>87</id> <name>dct_coeff_table_5_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>272</item> <item>273</item> <item>274</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_74"> <Value> <Obj> <type>0</type> <id>88</id> <name>dct_coeff_table_5_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>275</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_75"> <Value> <Obj> <type>0</type> <id>89</id> <name>coeff_5_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>276</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_76"> <Value> <Obj> <type>0</type> <id>90</id> <name>src_load_5</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>277</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_77"> <Value> <Obj> <type>0</type> <id>91</id> <name>tmp_17_5_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>278</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_78"> <Value> <Obj> <type>0</type> <id>92</id> <name>tmp_18_5</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mul_mul_16s_1jbC_U4</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>279</item> <item>280</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_79"> <Value> <Obj> <type>0</type> <id>93</id> <name>dct_coeff_table_6_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>281</item> <item>282</item> <item>283</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_80"> <Value> <Obj> <type>0</type> <id>94</id> <name>dct_coeff_table_6_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>284</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_81"> <Value> <Obj> <type>0</type> <id>95</id> <name>coeff_6_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>285</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_82"> <Value> <Obj> <type>0</type> <id>96</id> <name>src_load_6</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>286</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_83"> <Value> <Obj> <type>0</type> <id>97</id> <name>tmp_17_6_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>287</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_84"> <Value> <Obj> <type>0</type> <id>98</id> <name>tmp_18_6</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16lbW_U7</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>288</item> <item>289</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_85"> <Value> <Obj> <type>0</type> <id>99</id> <name>dct_coeff_table_7_ad</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>290</item> <item>291</item> <item>292</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_86"> <Value> <Obj> <type>0</type> <id>100</id> <name>dct_coeff_table_7_lo</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>16</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>16</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>15</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>293</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_87"> <Value> <Obj> <type>0</type> <id>101</id> <name>coeff_7_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>294</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_88"> <Value> <Obj> <type>0</type> <id>102</id> <name>src_load_7</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>295</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_89"> <Value> <Obj> <type>0</type> <id>103</id> <name>tmp_17_7_cast</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>296</item> </oprand_edges> <opcode>sext</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_90"> <Value> <Obj> <type>0</type> <id>104</id> <name>tmp_18_7</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>17</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>17</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16mb6_U8</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>297</item> <item>298</item> </oprand_edges> <opcode>mul</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_91"> <Value> <Obj> <type>0</type> <id>105</id> <name>tmp2</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16kbM_U3</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>299</item> <item>300</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_92"> <Value> <Obj> <type>0</type> <id>106</id> <name>tmp3</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16lbW_U5</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>301</item> <item>302</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_93"> <Value> <Obj> <type>0</type> <id>107</id> <name>tmp1</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp1_fu_487_p2</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>303</item> <item>304</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_94"> <Value> <Obj> <type>0</type> <id>108</id> <name>tmp5</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16lbW_U6</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>305</item> <item>306</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_95"> <Value> <Obj> <type>0</type> <id>109</id> <name>tmp7</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16mb6_U8</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>307</item> <item>309</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_96"> <Value> <Obj> <type>0</type> <id>110</id> <name>tmp6</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>dct_mac_muladd_16lbW_U7</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>310</item> <item>311</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_97"> <Value> <Obj> <type>0</type> <id>111</id> <name>tmp4</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp4_fu_505_p2</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>312</item> <item>313</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_98"> <Value> <Obj> <type>0</type> <id>112</id> <name>tmp_11</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_11_fu_509_p2</rtlName> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>314</item> <item>315</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_99"> <Value> <Obj> <type>0</type> <id>113</id> <name>tmp_13</name> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>tmp_13_reg_768</rtlName> <coreName/> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>317</item> <item>318</item> <item>320</item> <item>322</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_100"> <Value> <Obj> <type>0</type> <id>114</id> <name/> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>19</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>19</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>323</item> <item>324</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_101"> <Value> <Obj> <type>0</type> <id>116</id> <name/> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>13</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>13</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>325</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_102"> <Value> <Obj> <type>0</type> <id>118</id> <name/> <fileName>dct.c</fileName> <fileDirectory>..</fileDirectory> <lineNumber>21</lineNumber> <contextFuncName>dct_1d</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.c</first> <second>dct_1d</second> </first> <second>21</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>16</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_103"> <Value> <Obj> <type>2</type> <id>128</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>3</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_104"> <Value> <Obj> <type>2</type> <id>136</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_105"> <Value> <Obj> <type>2</type> <id>140</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_106"> <Value> <Obj> <type>2</type> <id>144</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>57</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_107"> <Value> <Obj> <type>2</type> <id>151</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>2</content> </item> <item class_id_reference="16" object_id="_108"> <Value> <Obj> <type>2</type> <id>160</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>3</content> </item> <item class_id_reference="16" object_id="_109"> <Value> <Obj> <type>2</type> <id>169</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>4</content> </item> <item class_id_reference="16" object_id="_110"> <Value> <Obj> <type>2</type> <id>178</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>5</content> </item> <item class_id_reference="16" object_id="_111"> <Value> <Obj> <type>2</type> <id>187</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>6</content> </item> <item class_id_reference="16" object_id="_112"> <Value> <Obj> <type>2</type> <id>196</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>7</bitwidth> </Value> <const_type>0</const_type> <content>7</content> </item> <item class_id_reference="16" object_id="_113"> <Value> <Obj> <type>2</type> <id>205</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_114"> <Value> <Obj> <type>2</type> <id>211</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>8</content> </item> <item class_id_reference="16" object_id="_115"> <Value> <Obj> <type>2</type> <id>214</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>4</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_116"> <Value> <Obj> <type>2</type> <id>308</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>29</bitwidth> </Value> <const_type>0</const_type> <content>4096</content> </item> <item class_id_reference="16" object_id="_117"> <Value> <Obj> <type>2</type> <id>319</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>13</content> </item> <item class_id_reference="16" object_id="_118"> <Value> <Obj> <type>2</type> <id>321</id> <name>empty</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <bitwidth>32</bitwidth> </Value> <const_type>0</const_type> <content>28</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="_119"> <Obj> <type>3</type> <id>42</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>29</count> <item_version>0</item_version> <item>13</item> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</item> <item>27</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> </node_objs> </item> <item class_id_reference="18" object_id="_120"> <Obj> <type>3</type> <id>47</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>4</count> <item_version>0</item_version> <item>43</item> <item>44</item> <item>45</item> <item>46</item> </node_objs> </item> <item class_id_reference="18" object_id="_121"> <Obj> <type>3</type> <id>117</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>64</count> <item_version>0</item_version> <item>52</item> <item>53</item> <item>54</item> <item>55</item> <item>56</item> <item>57</item> <item>58</item> <item>59</item> <item>60</item> <item>61</item> <item>62</item> <item>63</item> <item>64</item> <item>65</item> <item>66</item> <item>67</item> <item>68</item> <item>69</item> <item>70</item> <item>71</item> <item>72</item> <item>73</item> <item>74</item> <item>75</item> <item>76</item> <item>77</item> <item>78</item> <item>79</item> <item>80</item> <item>81</item> <item>82</item> <item>83</item> <item>84</item> <item>85</item> <item>86</item> <item>87</item> <item>88</item> <item>89</item> <item>90</item> <item>91</item> <item>92</item> <item>93</item> <item>94</item> <item>95</item> <item>96</item> <item>97</item> <item>98</item> <item>99</item> <item>100</item> <item>101</item> <item>102</item> <item>103</item> <item>104</item> <item>105</item> <item>106</item> <item>107</item> <item>108</item> <item>109</item> <item>110</item> <item>111</item> <item>112</item> <item>113</item> <item>114</item> <item>116</item> </node_objs> </item> <item class_id_reference="18" object_id="_122"> <Obj> <type>3</type> <id>119</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>1</count> <item_version>0</item_version> <item>118</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>178</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_123"> <id>122</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>13</sink_obj> </item> <item class_id_reference="20" object_id="_124"> <id>124</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_125"> <id>127</id> <edge_type>1</edge_type> <source_obj>13</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_126"> <id>129</id> <edge_type>1</edge_type> <source_obj>128</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_127"> <id>130</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_128"> <id>132</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>17</sink_obj> </item> <item class_id_reference="20" object_id="_129"> <id>133</id> <edge_type>1</edge_type> <source_obj>128</source_obj> <sink_obj>17</sink_obj> </item> <item class_id_reference="20" object_id="_130"> <id>134</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> </item> <item class_id_reference="20" object_id="_131"> <id>135</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_132"> <id>137</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_133"> <id>138</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_134"> <id>139</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_135"> <id>141</id> <edge_type>1</edge_type> <source_obj>140</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_136"> <id>145</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_137"> <id>146</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_138"> <id>147</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_139"> <id>148</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_140"> <id>149</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_141"> <id>150</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_142"> <id>152</id> <edge_type>1</edge_type> <source_obj>151</source_obj> <sink_obj>23</sink_obj> </item> <item class_id_reference="20" object_id="_143"> <id>154</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_144"> <id>155</id> <edge_type>1</edge_type> <source_obj>23</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_145"> <id>156</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_146"> <id>157</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_147"> <id>158</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_148"> <id>159</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_149"> <id>161</id> <edge_type>1</edge_type> <source_obj>160</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_150"> <id>163</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_151"> <id>164</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>27</sink_obj> </item> <item class_id_reference="20" object_id="_152"> <id>165</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_153"> <id>166</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_154"> <id>167</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>28</sink_obj> </item> <item class_id_reference="20" object_id="_155"> <id>168</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_156"> <id>170</id> <edge_type>1</edge_type> <source_obj>169</source_obj> <sink_obj>29</sink_obj> </item> <item class_id_reference="20" object_id="_157"> <id>172</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_158"> <id>173</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_159"> <id>174</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_160"> <id>175</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_161"> <id>176</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_162"> <id>177</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_163"> <id>179</id> <edge_type>1</edge_type> <source_obj>178</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_164"> <id>181</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_165"> <id>182</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_166"> <id>183</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_167"> <id>184</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_168"> <id>185</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_169"> <id>186</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_170"> <id>188</id> <edge_type>1</edge_type> <source_obj>187</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_171"> <id>190</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_172"> <id>191</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_173"> <id>192</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_174"> <id>193</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_175"> <id>194</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_176"> <id>195</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_177"> <id>197</id> <edge_type>1</edge_type> <source_obj>196</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_178"> <id>199</id> <edge_type>1</edge_type> <source_obj>144</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_179"> <id>200</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_180"> <id>201</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_181"> <id>202</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_182"> <id>203</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_183"> <id>204</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_184"> <id>206</id> <edge_type>1</edge_type> <source_obj>205</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_185"> <id>207</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_186"> <id>208</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_187"> <id>209</id> <edge_type>2</edge_type> <source_obj>117</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_188"> <id>210</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_189"> <id>212</id> <edge_type>1</edge_type> <source_obj>211</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_190"> <id>213</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_191"> <id>215</id> <edge_type>1</edge_type> <source_obj>214</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_192"> <id>216</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_193"> <id>217</id> <edge_type>2</edge_type> <source_obj>117</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_194"> <id>218</id> <edge_type>2</edge_type> <source_obj>119</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_195"> <id>219</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_196"> <id>220</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_197"> <id>221</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_198"> <id>222</id> <edge_type>1</edge_type> <source_obj>53</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_199"> <id>223</id> <edge_type>1</edge_type> <source_obj>54</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_200"> <id>224</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_201"> <id>225</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_202"> <id>226</id> <edge_type>1</edge_type> <source_obj>55</source_obj> <sink_obj>56</sink_obj> </item> <item class_id_reference="20" object_id="_203"> <id>227</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_204"> <id>228</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_205"> <id>229</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_206"> <id>230</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_207"> <id>231</id> <edge_type>1</edge_type> <source_obj>58</source_obj> <sink_obj>59</sink_obj> </item> <item class_id_reference="20" object_id="_208"> <id>232</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_209"> <id>233</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>61</sink_obj> </item> <item class_id_reference="20" object_id="_210"> <id>234</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>62</sink_obj> </item> <item class_id_reference="20" object_id="_211"> <id>235</id> <edge_type>1</edge_type> <source_obj>59</source_obj> <sink_obj>62</sink_obj> </item> <item class_id_reference="20" object_id="_212"> <id>236</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>63</sink_obj> </item> <item class_id_reference="20" object_id="_213"> <id>237</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>63</sink_obj> </item> <item class_id_reference="20" object_id="_214"> <id>238</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>63</sink_obj> </item> <item class_id_reference="20" object_id="_215"> <id>239</id> <edge_type>1</edge_type> <source_obj>63</source_obj> <sink_obj>64</sink_obj> </item> <item class_id_reference="20" object_id="_216"> <id>240</id> <edge_type>1</edge_type> <source_obj>64</source_obj> <sink_obj>65</sink_obj> </item> <item class_id_reference="20" object_id="_217"> <id>241</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>66</sink_obj> </item> <item class_id_reference="20" object_id="_218"> <id>242</id> <edge_type>1</edge_type> <source_obj>66</source_obj> <sink_obj>67</sink_obj> </item> <item class_id_reference="20" object_id="_219"> <id>243</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>68</sink_obj> </item> <item class_id_reference="20" object_id="_220"> <id>244</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>68</sink_obj> </item> <item class_id_reference="20" object_id="_221"> <id>245</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>69</sink_obj> </item> <item class_id_reference="20" object_id="_222"> <id>246</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>69</sink_obj> </item> <item class_id_reference="20" object_id="_223"> <id>247</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>69</sink_obj> </item> <item class_id_reference="20" object_id="_224"> <id>248</id> <edge_type>1</edge_type> <source_obj>69</source_obj> <sink_obj>70</sink_obj> </item> <item class_id_reference="20" object_id="_225"> <id>249</id> <edge_type>1</edge_type> <source_obj>70</source_obj> <sink_obj>71</sink_obj> </item> <item class_id_reference="20" object_id="_226"> <id>250</id> <edge_type>1</edge_type> <source_obj>25</source_obj> <sink_obj>72</sink_obj> </item> <item class_id_reference="20" object_id="_227"> <id>251</id> <edge_type>1</edge_type> <source_obj>72</source_obj> <sink_obj>73</sink_obj> </item> <item class_id_reference="20" object_id="_228"> <id>252</id> <edge_type>1</edge_type> <source_obj>73</source_obj> <sink_obj>74</sink_obj> </item> <item class_id_reference="20" object_id="_229"> <id>253</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>74</sink_obj> </item> <item class_id_reference="20" object_id="_230"> <id>254</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>75</sink_obj> </item> <item class_id_reference="20" object_id="_231"> <id>255</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>75</sink_obj> </item> <item class_id_reference="20" object_id="_232"> <id>256</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>75</sink_obj> </item> <item class_id_reference="20" object_id="_233"> <id>257</id> <edge_type>1</edge_type> <source_obj>75</source_obj> <sink_obj>76</sink_obj> </item> <item class_id_reference="20" object_id="_234"> <id>258</id> <edge_type>1</edge_type> <source_obj>76</source_obj> <sink_obj>77</sink_obj> </item> <item class_id_reference="20" object_id="_235"> <id>259</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>78</sink_obj> </item> <item class_id_reference="20" object_id="_236"> <id>260</id> <edge_type>1</edge_type> <source_obj>78</source_obj> <sink_obj>79</sink_obj> </item> <item class_id_reference="20" object_id="_237"> <id>261</id> <edge_type>1</edge_type> <source_obj>79</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_238"> <id>262</id> <edge_type>1</edge_type> <source_obj>77</source_obj> <sink_obj>80</sink_obj> </item> <item class_id_reference="20" object_id="_239"> <id>263</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>81</sink_obj> </item> <item class_id_reference="20" object_id="_240"> <id>264</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>81</sink_obj> </item> <item class_id_reference="20" object_id="_241"> <id>265</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>81</sink_obj> </item> <item class_id_reference="20" object_id="_242"> <id>266</id> <edge_type>1</edge_type> <source_obj>81</source_obj> <sink_obj>82</sink_obj> </item> <item class_id_reference="20" object_id="_243"> <id>267</id> <edge_type>1</edge_type> <source_obj>82</source_obj> <sink_obj>83</sink_obj> </item> <item class_id_reference="20" object_id="_244"> <id>268</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>84</sink_obj> </item> <item class_id_reference="20" object_id="_245"> <id>269</id> <edge_type>1</edge_type> <source_obj>84</source_obj> <sink_obj>85</sink_obj> </item> <item class_id_reference="20" object_id="_246"> <id>270</id> <edge_type>1</edge_type> <source_obj>85</source_obj> <sink_obj>86</sink_obj> </item> <item class_id_reference="20" object_id="_247"> <id>271</id> <edge_type>1</edge_type> <source_obj>83</source_obj> <sink_obj>86</sink_obj> </item> <item class_id_reference="20" object_id="_248"> <id>272</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>87</sink_obj> </item> <item class_id_reference="20" object_id="_249"> <id>273</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>87</sink_obj> </item> <item class_id_reference="20" object_id="_250"> <id>274</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>87</sink_obj> </item> <item class_id_reference="20" object_id="_251"> <id>275</id> <edge_type>1</edge_type> <source_obj>87</source_obj> <sink_obj>88</sink_obj> </item> <item class_id_reference="20" object_id="_252"> <id>276</id> <edge_type>1</edge_type> <source_obj>88</source_obj> <sink_obj>89</sink_obj> </item> <item class_id_reference="20" object_id="_253"> <id>277</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>90</sink_obj> </item> <item class_id_reference="20" object_id="_254"> <id>278</id> <edge_type>1</edge_type> <source_obj>90</source_obj> <sink_obj>91</sink_obj> </item> <item class_id_reference="20" object_id="_255"> <id>279</id> <edge_type>1</edge_type> <source_obj>91</source_obj> <sink_obj>92</sink_obj> </item> <item class_id_reference="20" object_id="_256"> <id>280</id> <edge_type>1</edge_type> <source_obj>89</source_obj> <sink_obj>92</sink_obj> </item> <item class_id_reference="20" object_id="_257"> <id>281</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>93</sink_obj> </item> <item class_id_reference="20" object_id="_258"> <id>282</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>93</sink_obj> </item> <item class_id_reference="20" object_id="_259"> <id>283</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>93</sink_obj> </item> <item class_id_reference="20" object_id="_260"> <id>284</id> <edge_type>1</edge_type> <source_obj>93</source_obj> <sink_obj>94</sink_obj> </item> <item class_id_reference="20" object_id="_261"> <id>285</id> <edge_type>1</edge_type> <source_obj>94</source_obj> <sink_obj>95</sink_obj> </item> <item class_id_reference="20" object_id="_262"> <id>286</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>96</sink_obj> </item> <item class_id_reference="20" object_id="_263"> <id>287</id> <edge_type>1</edge_type> <source_obj>96</source_obj> <sink_obj>97</sink_obj> </item> <item class_id_reference="20" object_id="_264"> <id>288</id> <edge_type>1</edge_type> <source_obj>97</source_obj> <sink_obj>98</sink_obj> </item> <item class_id_reference="20" object_id="_265"> <id>289</id> <edge_type>1</edge_type> <source_obj>95</source_obj> <sink_obj>98</sink_obj> </item> <item class_id_reference="20" object_id="_266"> <id>290</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>99</sink_obj> </item> <item class_id_reference="20" object_id="_267"> <id>291</id> <edge_type>1</edge_type> <source_obj>136</source_obj> <sink_obj>99</sink_obj> </item> <item class_id_reference="20" object_id="_268"> <id>292</id> <edge_type>1</edge_type> <source_obj>52</source_obj> <sink_obj>99</sink_obj> </item> <item class_id_reference="20" object_id="_269"> <id>293</id> <edge_type>1</edge_type> <source_obj>99</source_obj> <sink_obj>100</sink_obj> </item> <item class_id_reference="20" object_id="_270"> <id>294</id> <edge_type>1</edge_type> <source_obj>100</source_obj> <sink_obj>101</sink_obj> </item> <item class_id_reference="20" object_id="_271"> <id>295</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>102</sink_obj> </item> <item class_id_reference="20" object_id="_272"> <id>296</id> <edge_type>1</edge_type> <source_obj>102</source_obj> <sink_obj>103</sink_obj> </item> <item class_id_reference="20" object_id="_273"> <id>297</id> <edge_type>1</edge_type> <source_obj>103</source_obj> <sink_obj>104</sink_obj> </item> <item class_id_reference="20" object_id="_274"> <id>298</id> <edge_type>1</edge_type> <source_obj>101</source_obj> <sink_obj>104</sink_obj> </item> <item class_id_reference="20" object_id="_275"> <id>299</id> <edge_type>1</edge_type> <source_obj>68</source_obj> <sink_obj>105</sink_obj> </item> <item class_id_reference="20" object_id="_276"> <id>300</id> <edge_type>1</edge_type> <source_obj>62</source_obj> <sink_obj>105</sink_obj> </item> <item class_id_reference="20" object_id="_277"> <id>301</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>106</sink_obj> </item> <item class_id_reference="20" object_id="_278"> <id>302</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>106</sink_obj> </item> <item class_id_reference="20" object_id="_279"> <id>303</id> <edge_type>1</edge_type> <source_obj>105</source_obj> <sink_obj>107</sink_obj> </item> <item class_id_reference="20" object_id="_280"> <id>304</id> <edge_type>1</edge_type> <source_obj>106</source_obj> <sink_obj>107</sink_obj> </item> <item class_id_reference="20" object_id="_281"> <id>305</id> <edge_type>1</edge_type> <source_obj>92</source_obj> <sink_obj>108</sink_obj> </item> <item class_id_reference="20" object_id="_282"> <id>306</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>108</sink_obj> </item> <item class_id_reference="20" object_id="_283"> <id>307</id> <edge_type>1</edge_type> <source_obj>104</source_obj> <sink_obj>109</sink_obj> </item> <item class_id_reference="20" object_id="_284"> <id>309</id> <edge_type>1</edge_type> <source_obj>308</source_obj> <sink_obj>109</sink_obj> </item> <item class_id_reference="20" object_id="_285"> <id>310</id> <edge_type>1</edge_type> <source_obj>98</source_obj> <sink_obj>110</sink_obj> </item> <item class_id_reference="20" object_id="_286"> <id>311</id> <edge_type>1</edge_type> <source_obj>109</source_obj> <sink_obj>110</sink_obj> </item> <item class_id_reference="20" object_id="_287"> <id>312</id> <edge_type>1</edge_type> <source_obj>108</source_obj> <sink_obj>111</sink_obj> </item> <item class_id_reference="20" object_id="_288"> <id>313</id> <edge_type>1</edge_type> <source_obj>110</source_obj> <sink_obj>111</sink_obj> </item> <item class_id_reference="20" object_id="_289"> <id>314</id> <edge_type>1</edge_type> <source_obj>107</source_obj> <sink_obj>112</sink_obj> </item> <item class_id_reference="20" object_id="_290"> <id>315</id> <edge_type>1</edge_type> <source_obj>111</source_obj> <sink_obj>112</sink_obj> </item> <item class_id_reference="20" object_id="_291"> <id>318</id> <edge_type>1</edge_type> <source_obj>112</source_obj> <sink_obj>113</sink_obj> </item> <item class_id_reference="20" object_id="_292"> <id>320</id> <edge_type>1</edge_type> <source_obj>319</source_obj> <sink_obj>113</sink_obj> </item> <item class_id_reference="20" object_id="_293"> <id>322</id> <edge_type>1</edge_type> <source_obj>321</source_obj> <sink_obj>113</sink_obj> </item> <item class_id_reference="20" object_id="_294"> <id>323</id> <edge_type>1</edge_type> <source_obj>113</source_obj> <sink_obj>114</sink_obj> </item> <item class_id_reference="20" object_id="_295"> <id>324</id> <edge_type>1</edge_type> <source_obj>56</source_obj> <sink_obj>114</sink_obj> </item> <item class_id_reference="20" object_id="_296"> <id>325</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>116</sink_obj> </item> <item class_id_reference="20" object_id="_297"> <id>354</id> <edge_type>2</edge_type> <source_obj>42</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_298"> <id>355</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>119</sink_obj> </item> <item class_id_reference="20" object_id="_299"> <id>356</id> <edge_type>2</edge_type> <source_obj>47</source_obj> <sink_obj>117</sink_obj> </item> <item class_id_reference="20" object_id="_300"> <id>357</id> <edge_type>2</edge_type> <source_obj>117</source_obj> <sink_obj>47</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="_301"> <mId>1</mId> <mTag>dct_1d2</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>37</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_302"> <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>42</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_303"> <mId>3</mId> <mTag>DCT_Outer_Loop</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>47</item> <item>117</item> </basic_blocks> <mII>4</mII> <mDepth>8</mDepth> <mMinTripCount>8</mMinTripCount> <mMaxTripCount>8</mMaxTripCount> <mMinLatency>35</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> <item class_id_reference="22" object_id="_304"> <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>119</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"/> </item> </cdfg_regions> <fsm class_id="24" tracking_level="1" version="0" object_id="_305"> <states class_id="25" tracking_level="0" version="0"> <count>10</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_306"> <id>1</id> <operations class_id="27" tracking_level="0" version="0"> <count>29</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_307"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_308"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_309"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_310"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_311"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_312"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_313"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_314"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_315"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_316"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_317"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_318"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_319"> <id>25</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_320"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_321"> <id>27</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_322"> <id>28</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_323"> <id>29</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_324"> <id>30</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_325"> <id>31</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_326"> <id>32</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_327"> <id>33</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_328"> <id>34</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_329"> <id>35</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_330"> <id>36</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_331"> <id>37</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_332"> <id>38</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_333"> <id>39</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_334"> <id>40</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_335"> <id>41</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_336"> <id>2</id> <operations> <count>13</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_337"> <id>43</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_338"> <id>44</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_339"> <id>45</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_340"> <id>46</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_341"> <id>52</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_342"> <id>53</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_343"> <id>54</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_344"> <id>63</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_345"> <id>64</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_346"> <id>66</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_347"> <id>75</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_348"> <id>76</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_349"> <id>78</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_350"> <id>3</id> <operations> <count>18</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_351"> <id>57</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_352"> <id>58</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_353"> <id>60</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_354"> <id>64</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_355"> <id>66</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_356"> <id>69</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_357"> <id>70</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_358"> <id>76</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_359"> <id>78</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_360"> <id>81</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_361"> <id>82</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_362"> <id>87</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_363"> <id>88</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_364"> <id>90</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_365"> <id>93</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_366"> <id>94</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_367"> <id>99</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_368"> <id>100</id> <stage>2</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_369"> <id>4</id> <operations> <count>16</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_370"> <id>58</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_371"> <id>60</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_372"> <id>65</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_373"> <id>67</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_374"> <id>68</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_375"> <id>70</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_376"> <id>72</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_377"> <id>77</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_378"> <id>79</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_379"> <id>80</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_380"> <id>82</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_381"> <id>84</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_382"> <id>88</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_383"> <id>90</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_384"> <id>94</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_385"> <id>100</id> <stage>1</stage> <latency>2</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_386"> <id>5</id> <operations> <count>11</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_387"> <id>59</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_388"> <id>61</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_389"> <id>62</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_390"> <id>72</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_391"> <id>84</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_392"> <id>89</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_393"> <id>91</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_394"> <id>92</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_395"> <id>96</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_396"> <id>102</id> <stage>2</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_397"> <id>105</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_398"> <id>6</id> <operations> <count>11</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_399"> <id>71</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_400"> <id>73</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_401"> <id>74</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_402"> <id>83</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_403"> <id>85</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_404"> <id>86</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_405"> <id>96</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_406"> <id>102</id> <stage>1</stage> <latency>2</latency> </item> <item class_id_reference="28" object_id="_407"> <id>106</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_408"> <id>107</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_409"> <id>108</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_410"> <id>7</id> <operations> <count>8</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_411"> <id>95</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_412"> <id>97</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_413"> <id>98</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_414"> <id>101</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_415"> <id>103</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_416"> <id>104</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_417"> <id>109</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_418"> <id>110</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_419"> <id>8</id> <operations> <count>3</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_420"> <id>111</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_421"> <id>112</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_422"> <id>113</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_423"> <id>9</id> <operations> <count>9</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_424"> <id>48</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_425"> <id>49</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_426"> <id>50</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_427"> <id>51</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_428"> <id>55</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_429"> <id>56</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_430"> <id>114</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_431"> <id>115</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="28" object_id="_432"> <id>116</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="26" object_id="_433"> <id>10</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_434"> <id>118</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="29" tracking_level="0" version="0"> <count>10</count> <item_version>0</item_version> <item class_id="30" tracking_level="1" version="0" object_id="_435"> <inState>1</inState> <outState>2</outState> <condition class_id="31" tracking_level="0" version="0"> <id>18</id> <sop class_id="32" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_436"> <inState>3</inState> <outState>4</outState> <condition> <id>32</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_437"> <inState>4</inState> <outState>5</outState> <condition> <id>33</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_438"> <inState>5</inState> <outState>6</outState> <condition> <id>34</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_439"> <inState>6</inState> <outState>7</outState> <condition> <id>35</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_440"> <inState>7</inState> <outState>8</outState> <condition> <id>36</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_441"> <inState>8</inState> <outState>9</outState> <condition> <id>37</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_442"> <inState>9</inState> <outState>2</outState> <condition> <id>38</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_443"> <inState>2</inState> <outState>10</outState> <condition> <id>31</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item class_id="34" tracking_level="0" version="0"> <first class_id="35" tracking_level="0" version="0"> <first>44</first> <second>0</second> </first> <second>0</second> </item> </item> </sop> </condition> </item> <item class_id_reference="30" object_id="_444"> <inState>2</inState> <outState>3</outState> <condition> <id>39</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>1</count> <item_version>0</item_version> <item> <first> <first>44</first> <second>0</second> </first> <second>1</second> </item> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="36" tracking_level="1" version="0" object_id="_445"> <dp_component_resource class_id="37" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_resource> <dp_expression_resource> <count>15</count> <item_version>0</item_version> <item class_id="38" tracking_level="0" version="0"> <first>ap_enable_pp0 ( xor ) </first> <second class_id="39" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="40" tracking_level="0" version="0"> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>2</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter1 ( xor ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>1</second> </item> <item> <first>(1P1)</first> <second>2</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>k_1_fu_424_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>4</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>13</second> </item> </second> </item> <item> <first>tmp1_fu_487_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>29</second> </item> <item> <first>(1P1)</first> <second>29</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>36</second> </item> </second> </item> <item> <first>tmp4_fu_505_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>29</second> </item> <item> <first>(1P1)</first> <second>29</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>29</second> </item> </second> </item> <item> <first>tmp_11_fu_509_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>29</second> </item> <item> <first>(1P1)</first> <second>29</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>29</second> </item> </second> </item> <item> <first>tmp_18_fu_313_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>1</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_20_fu_328_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>2</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_22_fu_343_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>2</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_24_fu_358_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>3</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_26_fu_373_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>3</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_28_fu_388_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>3</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_30_fu_403_p2 ( or ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>7</second> </item> <item> <first>(1P1)</first> <second>3</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>7</second> </item> </second> </item> <item> <first>tmp_32_fu_440_p2 ( + ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>8</second> </item> <item> <first>(1P1)</first> <second>8</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>15</second> </item> </second> </item> <item> <first>tmp_fu_418_p2 ( icmp ) </first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0P0)</first> <second>4</second> </item> <item> <first>(1P1)</first> <second>5</second> </item> <item> <first>FF</first> <second>0</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> </dp_expression_resource> <dp_fifo_resource> <count>0</count> <item_version>0</item_version> </dp_fifo_resource> <dp_memory_resource> <count>8</count> <item_version>0</item_version> <item> <first>dct_coeff_table_0_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>14</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>112</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>14</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_1_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_2_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_3_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_4_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_5_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_6_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> <item> <first>dct_coeff_table_7_U</first> <second> <count>7</count> <item_version>0</item_version> <item> <first>(0Words)</first> <second>8</second> </item> <item> <first>(1Bits)</first> <second>15</second> </item> <item> <first>(2Banks)</first> <second>1</second> </item> <item> <first>(3W*Bits*Banks)</first> <second>120</second> </item> <item> <first>BRAM</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> <item> <first>LUT</first> <second>2</second> </item> </second> </item> </dp_memory_resource> <dp_multiplexer_resource> <count>6</count> <item_version>0</item_version> <item> <first>ap_NS_fsm</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>7</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>7</second> </item> <item> <first>LUT</first> <second>38</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>3</second> </item> <item> <first>(1Bits)</first> <second>1</second> </item> <item> <first>(2Count)</first> <second>3</second> </item> <item> <first>LUT</first> <second>15</second> </item> </second> </item> <item> <first>k_phi_fu_273_p4</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>4</second> </item> <item> <first>(2Count)</first> <second>8</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>k_reg_269</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>2</second> </item> <item> <first>(1Bits)</first> <second>4</second> </item> <item> <first>(2Count)</first> <second>8</second> </item> <item> <first>LUT</first> <second>9</second> </item> </second> </item> <item> <first>src_address0</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>5</second> </item> <item> <first>(1Bits)</first> <second>6</second> </item> <item> <first>(2Count)</first> <second>30</second> </item> <item> <first>LUT</first> <second>27</second> </item> </second> </item> <item> <first>src_address1</first> <second> <count>4</count> <item_version>0</item_version> <item> <first>(0Size)</first> <second>5</second> </item> <item> <first>(1Bits)</first> <second>6</second> </item> <item> <first>(2Count)</first> <second>30</second> </item> <item> <first>LUT</first> <second>27</second> </item> </second> </item> </dp_multiplexer_resource> <dp_register_resource> <count>37</count> <item_version>0</item_version> <item> <first>ap_CS_fsm</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>6</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter0</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_enable_reg_pp0_iter1</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>ap_reg_pp0_iter1_tmp_32_reg_648</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>8</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>8</second> </item> </second> </item> <item> <first>ap_reg_pp0_iter1_tmp_reg_629</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>dct_coeff_table_0_lo_reg_703</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>14</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>14</second> </item> </second> </item> <item> <first>dct_coeff_table_1_lo_reg_668</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>dct_coeff_table_2_lo_reg_713</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>dct_coeff_table_3_lo_reg_678</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>dct_coeff_table_4_lo_reg_723</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>dct_coeff_table_5_lo_reg_728</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>dct_coeff_table_6_lo_reg_733</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>dct_coeff_table_7_lo_reg_738</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>15</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>15</second> </item> </second> </item> <item> <first>k_1_reg_633</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>4</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>4</second> </item> </second> </item> <item> <first>k_reg_269</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>4</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>4</second> </item> </second> </item> <item> <first>reg_280</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>16</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>16</second> </item> </second> </item> <item> <first>reg_284</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>16</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>16</second> </item> </second> </item> <item> <first>src_addr_1_reg_594</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_2_reg_599</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_3_reg_604</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_4_reg_609</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_5_reg_614</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_6_reg_619</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_7_reg_624</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>src_addr_reg_589</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>6</second> </item> <item> <first>(Consts)</first> <second>3</second> </item> <item> <first>FF</first> <second>3</second> </item> </second> </item> <item> <first>tmp1_reg_753</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp2_reg_748</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp5_reg_758</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp6_reg_763</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp_13_reg_768</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>16</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>16</second> </item> </second> </item> <item> <first>tmp_18_1_reg_708</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp_18_3_reg_718</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp_18_5_reg_743</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>29</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>29</second> </item> </second> </item> <item> <first>tmp_21_cast_reg_584</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>8</second> </item> <item> <first>(Consts)</first> <second>4</second> </item> <item> <first>FF</first> <second>4</second> </item> </second> </item> <item> <first>tmp_32_reg_648</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>8</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>8</second> </item> </second> </item> <item> <first>tmp_reg_629</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>1</second> </item> <item> <first>(Consts)</first> <second>0</second> </item> <item> <first>FF</first> <second>1</second> </item> </second> </item> <item> <first>tmp_s_reg_638</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>(Bits)</first> <second>64</second> </item> <item> <first>(Consts)</first> <second>60</second> </item> <item> <first>FF</first> <second>4</second> </item> </second> </item> </dp_register_resource> <dp_component_map class_id="41" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_component_map> <dp_expression_map> <count>13</count> <item_version>0</item_version> <item class_id="42" tracking_level="0" version="0"> <first>k_1_fu_424_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>tmp1_fu_487_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>tmp4_fu_505_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>111</item> </second> </item> <item> <first>tmp_11_fu_509_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>112</item> </second> </item> <item> <first>tmp_18_fu_313_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>tmp_20_fu_328_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>tmp_22_fu_343_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>tmp_24_fu_358_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>tmp_26_fu_373_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>tmp_28_fu_388_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>tmp_30_fu_403_p2 ( or ) </first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>tmp_32_fu_440_p2 ( + ) </first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>tmp_fu_418_p2 ( icmp ) </first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> </dp_expression_map> <dp_fifo_map> <count>0</count> <item_version>0</item_version> </dp_fifo_map> <dp_memory_map> <count>8</count> <item_version>0</item_version> <item> <first>dct_coeff_table_0_U</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>dct_coeff_table_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>dct_coeff_table_2_U</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>dct_coeff_table_3_U</first> <second> <count>1</count> <item_version>0</item_version> <item>66</item> </second> </item> <item> <first>dct_coeff_table_4_U</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>dct_coeff_table_5_U</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>dct_coeff_table_6_U</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>dct_coeff_table_7_U</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> </dp_memory_map> </res> <node_label_latency class_id="43" tracking_level="0" version="0"> <count>98</count> <item_version>0</item_version> <item class_id="44" tracking_level="0" version="0"> <first>13</first> <second class_id="45" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>20</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>34</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>53</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>54</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>55</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>56</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>58</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>59</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>60</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>61</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>62</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>63</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>64</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>65</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>66</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>67</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>68</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>69</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>70</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>71</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>72</first> <second> <first>3</first> <second>1</second> </second> </item> <item> <first>73</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>74</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>75</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>76</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>77</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>78</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>79</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>80</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>81</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>82</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>83</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>84</first> <second> <first>3</first> <second>1</second> </second> </item> <item> <first>85</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>86</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>87</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>88</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>89</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>90</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>91</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>92</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>93</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>94</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>95</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>96</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>97</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>98</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>99</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>100</first> <second> <first>2</first> <second>1</second> </second> </item> <item> <first>101</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>102</first> <second> <first>4</first> <second>1</second> </second> </item> <item> <first>103</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>104</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>105</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>106</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>107</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>108</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>109</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>110</first> <second> <first>6</first> <second>0</second> </second> </item> <item> <first>111</first> <second> <first>7</first> <second>0</second> </second> </item> <item> <first>112</first> <second> <first>7</first> <second>0</second> </second> </item> <item> <first>113</first> <second> <first>7</first> <second>0</second> </second> </item> <item> <first>114</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>116</first> <second> <first>8</first> <second>0</second> </second> </item> <item> <first>118</first> <second> <first>2</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="46" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="47" tracking_level="0" version="0"> <first>42</first> <second class_id="48" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>117</first> <second> <first>1</first> <second>8</second> </second> </item> <item> <first>119</first> <second> <first>2</first> <second>2</second> </second> </item> </bblk_ent_exit> <regions class_id="49" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="50" tracking_level="1" version="0" object_id="_446"> <region_name>DCT_Outer_Loop</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>47</item> <item>117</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>4</interval> <pipe_depth>8</pipe_depth> </item> </regions> <dp_fu_nodes class_id="51" tracking_level="0" version="0"> <count>82</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>86</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>92</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> <item> <first>98</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>105</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>112</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>119</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>126</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>133</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>140</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>147</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>154</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>161</first> <second> <count>2</count> <item_version>0</item_version> <item>64</item> <item>64</item> </second> </item> <item> <first>166</first> <second> <count>16</count> <item_version>0</item_version> <item>66</item> <item>66</item> <item>78</item> <item>78</item> <item>60</item> <item>60</item> <item>90</item> <item>90</item> <item>72</item> <item>72</item> <item>84</item> <item>84</item> <item>96</item> <item>96</item> <item>102</item> <item>102</item> </second> </item> <item> <first>170</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>177</first> <second> <count>2</count> <item_version>0</item_version> <item>76</item> <item>76</item> </second> </item> <item> <first>185</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>192</first> <second> <count>2</count> <item_version>0</item_version> <item>58</item> <item>58</item> </second> </item> <item> <first>197</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>204</first> <second> <count>2</count> <item_version>0</item_version> <item>70</item> <item>70</item> </second> </item> <item> <first>209</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>216</first> <second> <count>2</count> <item_version>0</item_version> <item>82</item> <item>82</item> </second> </item> <item> <first>221</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>228</first> <second> <count>2</count> <item_version>0</item_version> <item>88</item> <item>88</item> </second> </item> <item> <first>233</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>240</first> <second> <count>2</count> <item_version>0</item_version> <item>94</item> <item>94</item> </second> </item> <item> <first>245</first> <second> <count>1</count> <item_version>0</item_version> <item>99</item> </second> </item> <item> <first>252</first> <second> <count>2</count> <item_version>0</item_version> <item>100</item> <item>100</item> </second> </item> <item> <first>257</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>264</first> <second> <count>1</count> <item_version>0</item_version> <item>114</item> </second> </item> <item> <first>273</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>288</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>296</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>300</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>308</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>313</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>319</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>328</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>334</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>343</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>349</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>358</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>364</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>373</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>379</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>388</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>394</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>403</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>409</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>418</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>424</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>430</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>436</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>440</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>445</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>448</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>452</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>455</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>459</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>462</first> <second> <count>1</count> <item_version>0</item_version> <item>61</item> </second> </item> <item> <first>466</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> <item> <first>469</first> <second> <count>1</count> <item_version>0</item_version> <item>91</item> </second> </item> <item> <first>473</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>476</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>480</first> <second> <count>1</count> <item_version>0</item_version> <item>83</item> </second> </item> <item> <first>483</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>487</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>491</first> <second> <count>1</count> <item_version>0</item_version> <item>95</item> </second> </item> <item> <first>494</first> <second> <count>1</count> <item_version>0</item_version> <item>97</item> </second> </item> <item> <first>498</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>501</first> <second> <count>1</count> <item_version>0</item_version> <item>103</item> </second> </item> <item> <first>505</first> <second> <count>1</count> <item_version>0</item_version> <item>111</item> </second> </item> <item> <first>509</first> <second> <count>1</count> <item_version>0</item_version> <item>112</item> </second> </item> <item> <first>514</first> <second> <count>1</count> <item_version>0</item_version> <item>113</item> </second> </item> <item> <first>524</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>528</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>534</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>540</first> <second> <count>2</count> <item_version>0</item_version> <item>62</item> <item>105</item> </second> </item> <item> <first>547</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>553</first> <second> <count>2</count> <item_version>0</item_version> <item>74</item> <item>106</item> </second> </item> <item> <first>561</first> <second> <count>2</count> <item_version>0</item_version> <item>86</item> <item>108</item> </second> </item> <item> <first>568</first> <second> <count>2</count> <item_version>0</item_version> <item>98</item> <item>110</item> </second> </item> <item> <first>575</first> <second> <count>2</count> <item_version>0</item_version> <item>104</item> <item>109</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="54" tracking_level="0" version="0"> <count>70</count> <item_version>0</item_version> <item class_id="55" tracking_level="0" version="0"> <first>coeff_1_cast_fu_445</first> <second> <count>1</count> <item_version>0</item_version> <item>65</item> </second> </item> <item> <first>coeff_2_cast_fu_473</first> <second> <count>1</count> <item_version>0</item_version> <item>71</item> </second> </item> <item> <first>coeff_3_cast_fu_452</first> <second> <count>1</count> <item_version>0</item_version> <item>77</item> </second> </item> <item> <first>coeff_4_cast_fu_480</first> <second> <count>1</count> <item_version>0</item_version> <item>83</item> </second> </item> <item> <first>coeff_5_cast_fu_466</first> <second> <count>1</count> <item_version>0</item_version> <item>89</item> </second> </item> <item> <first>coeff_6_cast_fu_491</first> <second> <count>1</count> <item_version>0</item_version> <item>95</item> </second> </item> <item> <first>coeff_7_cast_fu_498</first> <second> <count>1</count> <item_version>0</item_version> <item>101</item> </second> </item> <item> <first>coeff_cast_fu_459</first> <second> <count>1</count> <item_version>0</item_version> <item>59</item> </second> </item> <item> <first>dct_coeff_table_0_ad_gep_fu_185</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>dct_coeff_table_1_ad_gep_fu_154</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>dct_coeff_table_2_ad_gep_fu_197</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>dct_coeff_table_3_ad_gep_fu_170</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>dct_coeff_table_4_ad_gep_fu_209</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>dct_coeff_table_5_ad_gep_fu_221</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>dct_coeff_table_6_ad_gep_fu_233</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>dct_coeff_table_7_ad_gep_fu_245</first> <second> <count>1</count> <item_version>0</item_version> <item>99</item> </second> </item> <item> <first>dst_addr_gep_fu_257</first> <second> <count>1</count> <item_version>0</item_version> <item>56</item> </second> </item> <item> <first>grp_fu_540</first> <second> <count>2</count> <item_version>0</item_version> <item>62</item> <item>105</item> </second> </item> <item> <first>grp_fu_553</first> <second> <count>2</count> <item_version>0</item_version> <item>74</item> <item>106</item> </second> </item> <item> <first>grp_fu_561</first> <second> <count>2</count> <item_version>0</item_version> <item>86</item> <item>108</item> </second> </item> <item> <first>grp_fu_568</first> <second> <count>2</count> <item_version>0</item_version> <item>98</item> <item>110</item> </second> </item> <item> <first>grp_fu_575</first> <second> <count>2</count> <item_version>0</item_version> <item>104</item> <item>109</item> </second> </item> <item> <first>k_1_fu_424</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>k_phi_fu_273</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>src_addr_1_gep_fu_105</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>src_addr_2_gep_fu_112</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>src_addr_3_gep_fu_119</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>src_addr_4_gep_fu_126</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>src_addr_5_gep_fu_133</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>src_addr_6_gep_fu_140</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>src_addr_7_gep_fu_147</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>src_addr_gep_fu_98</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>tmp1_fu_487</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>tmp4_fu_505</first> <second> <count>1</count> <item_version>0</item_version> <item>111</item> </second> </item> <item> <first>tmp_11_fu_509</first> <second> <count>1</count> <item_version>0</item_version> <item>112</item> </second> </item> <item> <first>tmp_13_fu_514</first> <second> <count>1</count> <item_version>0</item_version> <item>113</item> </second> </item> <item> <first>tmp_15_fu_288</first> <second> <count>1</count> <item_version>0</item_version> <item>15</item> </second> </item> <item> <first>tmp_16_cast_fu_462</first> <second> <count>1</count> <item_version>0</item_version> <item>61</item> </second> </item> <item> <first>tmp_16_fu_300</first> <second> <count>1</count> <item_version>0</item_version> <item>17</item> </second> </item> <item> <first>tmp_17_1_cast_fu_448</first> <second> <count>1</count> <item_version>0</item_version> <item>67</item> </second> </item> <item> <first>tmp_17_2_cast_fu_476</first> <second> <count>1</count> <item_version>0</item_version> <item>73</item> </second> </item> <item> <first>tmp_17_3_cast_fu_455</first> <second> <count>1</count> <item_version>0</item_version> <item>79</item> </second> </item> <item> <first>tmp_17_4_cast_fu_483</first> <second> <count>1</count> <item_version>0</item_version> <item>85</item> </second> </item> <item> <first>tmp_17_5_cast_fu_469</first> <second> <count>1</count> <item_version>0</item_version> <item>91</item> </second> </item> <item> <first>tmp_17_6_cast_fu_494</first> <second> <count>1</count> <item_version>0</item_version> <item>97</item> </second> </item> <item> <first>tmp_17_7_cast_fu_501</first> <second> <count>1</count> <item_version>0</item_version> <item>103</item> </second> </item> <item> <first>tmp_17_fu_308</first> <second> <count>1</count> <item_version>0</item_version> <item>18</item> </second> </item> <item> <first>tmp_18_1_fu_528</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>tmp_18_3_fu_534</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>tmp_18_5_fu_547</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>tmp_18_fu_313</first> <second> <count>1</count> <item_version>0</item_version> <item>20</item> </second> </item> <item> <first>tmp_19_fu_319</first> <second> <count>1</count> <item_version>0</item_version> <item>21</item> </second> </item> <item> <first>tmp_20_fu_328</first> <second> <count>1</count> <item_version>0</item_version> <item>23</item> </second> </item> <item> <first>tmp_21_cast_fu_296</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>tmp_21_fu_334</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>tmp_22_fu_343</first> <second> <count>1</count> <item_version>0</item_version> <item>26</item> </second> </item> <item> <first>tmp_23_fu_349</first> <second> <count>1</count> <item_version>0</item_version> <item>27</item> </second> </item> <item> <first>tmp_24_fu_358</first> <second> <count>1</count> <item_version>0</item_version> <item>29</item> </second> </item> <item> <first>tmp_25_fu_364</first> <second> <count>1</count> <item_version>0</item_version> <item>30</item> </second> </item> <item> <first>tmp_26_fu_373</first> <second> <count>1</count> <item_version>0</item_version> <item>32</item> </second> </item> <item> <first>tmp_27_fu_379</first> <second> <count>1</count> <item_version>0</item_version> <item>33</item> </second> </item> <item> <first>tmp_28_fu_388</first> <second> <count>1</count> <item_version>0</item_version> <item>35</item> </second> </item> <item> <first>tmp_29_fu_394</first> <second> <count>1</count> <item_version>0</item_version> <item>36</item> </second> </item> <item> <first>tmp_30_fu_403</first> <second> <count>1</count> <item_version>0</item_version> <item>38</item> </second> </item> <item> <first>tmp_31_fu_409</first> <second> <count>1</count> <item_version>0</item_version> <item>39</item> </second> </item> <item> <first>tmp_32_fu_440</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>tmp_38_cast_fu_524</first> <second> <count>1</count> <item_version>0</item_version> <item>55</item> </second> </item> <item> <first>tmp_cast_fu_436</first> <second> <count>1</count> <item_version>0</item_version> <item>53</item> </second> </item> <item> <first>tmp_fu_418</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>tmp_s_fu_430</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_module> <dp_fu_nodes_io> <count>2</count> <item_version>0</item_version> <item> <first>tmp_61_read_read_fu_86</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> <item> <first>tmp_6_read_read_fu_92</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> </dp_fu_nodes_io> <return_ports> <count>0</count> <item_version>0</item_version> </return_ports> <dp_mem_port_nodes class_id="56" tracking_level="0" version="0"> <count>11</count> <item_version>0</item_version> <item class_id="57" tracking_level="0" version="0"> <first class_id="58" tracking_level="0" version="0"> <first>dct_coeff_table_0</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>58</item> <item>58</item> </second> </item> <item> <first> <first>dct_coeff_table_1</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>64</item> <item>64</item> </second> </item> <item> <first> <first>dct_coeff_table_2</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>70</item> <item>70</item> </second> </item> <item> <first> <first>dct_coeff_table_3</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>76</item> <item>76</item> </second> </item> <item> <first> <first>dct_coeff_table_4</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>82</item> <item>82</item> </second> </item> <item> <first> <first>dct_coeff_table_5</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>88</item> <item>88</item> </second> </item> <item> <first> <first>dct_coeff_table_6</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>94</item> <item>94</item> </second> </item> <item> <first> <first>dct_coeff_table_7</first> <second>0</second> </first> <second> <count>2</count> <item_version>0</item_version> <item>100</item> <item>100</item> </second> </item> <item> <first> <first>dst</first> <second>0</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>114</item> </second> </item> <item> <first> <first>src</first> <second>0</second> </first> <second> <count>8</count> <item_version>0</item_version> <item>66</item> <item>66</item> <item>60</item> <item>60</item> <item>72</item> <item>72</item> <item>96</item> <item>96</item> </second> </item> <item> <first> <first>src</first> <second>1</second> </first> <second> <count>8</count> <item_version>0</item_version> <item>78</item> <item>78</item> <item>90</item> <item>90</item> <item>84</item> <item>84</item> <item>102</item> <item>102</item> </second> </item> </dp_mem_port_nodes> <dp_reg_nodes> <count>40</count> <item_version>0</item_version> <item> <first>269</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>280</first> <second> <count>4</count> <item_version>0</item_version> <item>66</item> <item>60</item> <item>72</item> <item>96</item> </second> </item> <item> <first>284</first> <second> <count>4</count> <item_version>0</item_version> <item>78</item> <item>90</item> <item>84</item> <item>102</item> </second> </item> <item> <first>584</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>589</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>594</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>599</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>604</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>609</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>614</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>619</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>624</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>629</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>633</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>638</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> <item> <first>648</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>653</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>658</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>663</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>668</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>673</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>678</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>683</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>688</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>693</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>698</first> <second> <count>1</count> <item_version>0</item_version> <item>99</item> </second> </item> <item> <first>703</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>708</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>713</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>718</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>723</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>728</first> <second> <count>1</count> <item_version>0</item_version> <item>88</item> </second> </item> <item> <first>733</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> <item> <first>738</first> <second> <count>1</count> <item_version>0</item_version> <item>100</item> </second> </item> <item> <first>743</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>748</first> <second> <count>1</count> <item_version>0</item_version> <item>105</item> </second> </item> <item> <first>753</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>758</first> <second> <count>1</count> <item_version>0</item_version> <item>108</item> </second> </item> <item> <first>763</first> <second> <count>1</count> <item_version>0</item_version> <item>110</item> </second> </item> <item> <first>768</first> <second> <count>1</count> <item_version>0</item_version> <item>113</item> </second> </item> </dp_reg_nodes> <dp_regname_nodes> <count>40</count> <item_version>0</item_version> <item> <first>dct_coeff_table_0_ad_reg_663</first> <second> <count>1</count> <item_version>0</item_version> <item>57</item> </second> </item> <item> <first>dct_coeff_table_0_lo_reg_703</first> <second> <count>1</count> <item_version>0</item_version> <item>58</item> </second> </item> <item> <first>dct_coeff_table_1_ad_reg_653</first> <second> <count>1</count> <item_version>0</item_version> <item>63</item> </second> </item> <item> <first>dct_coeff_table_1_lo_reg_668</first> <second> <count>1</count> <item_version>0</item_version> <item>64</item> </second> </item> <item> <first>dct_coeff_table_2_ad_reg_673</first> <second> <count>1</count> <item_version>0</item_version> <item>69</item> </second> </item> <item> <first>dct_coeff_table_2_lo_reg_713</first> <second> <count>1</count> <item_version>0</item_version> <item>70</item> </second> </item> <item> <first>dct_coeff_table_3_ad_reg_658</first> <second> <count>1</count> <item_version>0</item_version> <item>75</item> </second> </item> <item> <first>dct_coeff_table_3_lo_reg_678</first> <second> <count>1</count> <item_version>0</item_version> <item>76</item> </second> </item> <item> <first>dct_coeff_table_4_ad_reg_683</first> <second> <count>1</count> <item_version>0</item_version> <item>81</item> </second> </item> <item> <first>dct_coeff_table_4_lo_reg_723</first> <second> <count>1</count> <item_version>0</item_version> <item>82</item> </second> </item> <item> <first>dct_coeff_table_5_ad_reg_688</first> <second> <count>1</count> <item_version>0</item_version> <item>87</item> </second> </item> <item> <first>dct_coeff_table_5_lo_reg_728</first> <second> <count>1</count> <item_version>0</item_version> <item>88</item> </second> </item> <item> <first>dct_coeff_table_6_ad_reg_693</first> <second> <count>1</count> <item_version>0</item_version> <item>93</item> </second> </item> <item> <first>dct_coeff_table_6_lo_reg_733</first> <second> <count>1</count> <item_version>0</item_version> <item>94</item> </second> </item> <item> <first>dct_coeff_table_7_ad_reg_698</first> <second> <count>1</count> <item_version>0</item_version> <item>99</item> </second> </item> <item> <first>dct_coeff_table_7_lo_reg_738</first> <second> <count>1</count> <item_version>0</item_version> <item>100</item> </second> </item> <item> <first>k_1_reg_633</first> <second> <count>1</count> <item_version>0</item_version> <item>45</item> </second> </item> <item> <first>k_reg_269</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> <item> <first>reg_280</first> <second> <count>4</count> <item_version>0</item_version> <item>66</item> <item>60</item> <item>72</item> <item>96</item> </second> </item> <item> <first>reg_284</first> <second> <count>4</count> <item_version>0</item_version> <item>78</item> <item>90</item> <item>84</item> <item>102</item> </second> </item> <item> <first>src_addr_1_reg_594</first> <second> <count>1</count> <item_version>0</item_version> <item>22</item> </second> </item> <item> <first>src_addr_2_reg_599</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> <item> <first>src_addr_3_reg_604</first> <second> <count>1</count> <item_version>0</item_version> <item>28</item> </second> </item> <item> <first>src_addr_4_reg_609</first> <second> <count>1</count> <item_version>0</item_version> <item>31</item> </second> </item> <item> <first>src_addr_5_reg_614</first> <second> <count>1</count> <item_version>0</item_version> <item>34</item> </second> </item> <item> <first>src_addr_6_reg_619</first> <second> <count>1</count> <item_version>0</item_version> <item>37</item> </second> </item> <item> <first>src_addr_7_reg_624</first> <second> <count>1</count> <item_version>0</item_version> <item>40</item> </second> </item> <item> <first>src_addr_reg_589</first> <second> <count>1</count> <item_version>0</item_version> <item>19</item> </second> </item> <item> <first>tmp1_reg_753</first> <second> <count>1</count> <item_version>0</item_version> <item>107</item> </second> </item> <item> <first>tmp2_reg_748</first> <second> <count>1</count> <item_version>0</item_version> <item>105</item> </second> </item> <item> <first>tmp5_reg_758</first> <second> <count>1</count> <item_version>0</item_version> <item>108</item> </second> </item> <item> <first>tmp6_reg_763</first> <second> <count>1</count> <item_version>0</item_version> <item>110</item> </second> </item> <item> <first>tmp_13_reg_768</first> <second> <count>1</count> <item_version>0</item_version> <item>113</item> </second> </item> <item> <first>tmp_18_1_reg_708</first> <second> <count>1</count> <item_version>0</item_version> <item>68</item> </second> </item> <item> <first>tmp_18_3_reg_718</first> <second> <count>1</count> <item_version>0</item_version> <item>80</item> </second> </item> <item> <first>tmp_18_5_reg_743</first> <second> <count>1</count> <item_version>0</item_version> <item>92</item> </second> </item> <item> <first>tmp_21_cast_reg_584</first> <second> <count>1</count> <item_version>0</item_version> <item>16</item> </second> </item> <item> <first>tmp_32_reg_648</first> <second> <count>1</count> <item_version>0</item_version> <item>54</item> </second> </item> <item> <first>tmp_reg_629</first> <second> <count>1</count> <item_version>0</item_version> <item>44</item> </second> </item> <item> <first>tmp_s_reg_638</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> </dp_regname_nodes> <dp_reg_phi> <count>1</count> <item_version>0</item_version> <item> <first>269</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> </dp_reg_phi> <dp_regname_phi> <count>1</count> <item_version>0</item_version> <item> <first>k_reg_269</first> <second> <count>1</count> <item_version>0</item_version> <item>43</item> </second> </item> </dp_regname_phi> <dp_port_io_nodes class_id="59" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>dst(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>store</first> <second> <count>1</count> <item_version>0</item_version> <item>114</item> </second> </item> </second> </item> <item> <first>src(p0)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>load</first> <second> <count>8</count> <item_version>0</item_version> <item>66</item> <item>66</item> <item>60</item> <item>60</item> <item>72</item> <item>72</item> <item>96</item> <item>96</item> </second> </item> </second> </item> <item> <first>src(p1)</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>load</first> <second> <count>8</count> <item_version>0</item_version> <item>78</item> <item>78</item> <item>90</item> <item>90</item> <item>84</item> <item>84</item> <item>102</item> <item>102</item> </second> </item> </second> </item> <item> <first>tmp_6</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>14</item> </second> </item> </second> </item> <item> <first>tmp_61</first> <second> <count>1</count> <item_version>0</item_version> <item> <first>read</first> <second> <count>1</count> <item_version>0</item_version> <item>13</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="61" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="62" tracking_level="0" version="0"> <first>1</first> <second>RAM</second> </item> <item> <first>3</first> <second>RAM</second> </item> </port2core> <node2core> <count>0</count> <item_version>0</item_version> </node2core> </syndb> </boost_serialization>
with Program.Parsers.Nodes; use Program.Parsers.Nodes; pragma Style_Checks ("N"); procedure Program.Parsers.On_Reduce_2001 (Self : access Parse_Context; Prod : Anagram.Grammars.Production_Index; Nodes : in out Program.Parsers.Nodes.Node_Array) is begin case Prod is when 2001 => null; when 2002 => null; when 2003 => null; when 2004 => null; when 2005 => null; when 2006 => declare List : Node := Nodes (1); begin Self.Factory.Append_Protected_Operation_Item (List, Nodes (2)); Nodes (1) := List; end; when 2007 => declare List : Node := Self. Factory.Protected_Operation_Item_Sequence; begin Self.Factory.Append_Protected_Operation_Item (List, Nodes (1)); Nodes (1) := List; end; when 2008 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11)); when 2009 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (7), Nodes (8)); when 2010 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), (Self.Factory.Aspect_Specification_Sequence), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10)); when 2011 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), (Self.Factory.Aspect_Specification_Sequence), Nodes (5), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (6), Nodes (7)); when 2012 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10)); when 2013 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, Nodes (4), Nodes (5), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (6), Nodes (7)); when 2014 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, (Self.Factory.Aspect_Specification_Sequence), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9)); when 2015 => Nodes (1) := Self.Factory.Protected_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, (Self.Factory.Aspect_Specification_Sequence), Nodes (4), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (5), Nodes (6)); when 2016 => Nodes (1) := Self.Factory.Qualified_Expression (Nodes (1), Nodes (2), No_Token, Nodes (3), No_Token); when 2017 => Nodes (1) := Self.Factory.Quantified_Expression (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); when 2018 => Nodes (1) := Self.Factory.Quantified_Expression (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); when 2019 => null; when 2020 => null; when 2021 => Nodes (1) := Self.Factory.Raise_Statement (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); when 2022 => Nodes (1) := Self.Factory.Raise_Statement (Nodes (1), Nodes (2), No_Token, None, Nodes (3)); when 2023 => Nodes (1) := Self.Factory.Raise_Statement (Nodes (1), None, No_Token, None, Nodes (2)); when 2024 => Nodes (1) := Self.Factory.Range_Attribute_Reference (Nodes (1)); when 2025 => Nodes (1) := Self.Factory.Simple_Expression_Range (Nodes (1), Nodes (2), Nodes (3)); when 2026 => Nodes (1) := Self.Factory.Attribute_Reference (Nodes (1), Nodes (2), Self.Factory.Identifier (Nodes (3)), Nodes (5)); when 2027 => Nodes (1) := Self.Factory.Attribute_Reference (Nodes (1), Nodes (2), Self.Factory.Identifier (Nodes (3)), None); when 2028 => Nodes (1) := Nodes (2); when 2029 => Nodes (1) := Self.Factory.Real_Range_Specification (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2030 => Nodes (1) := Self.Factory.To_Aggregate_Or_Expression (Nodes (1)); when 2031 => Nodes (1) := Self.Factory.Association (Nodes (1), Nodes (2), Nodes (3)); when 2032 => Nodes (1) := Self.Factory.Association ((Self.Factory.Discrete_Choice_Sequence), No_Token, Nodes (1)); when 2033 => declare Box : constant Node := Self.Factory.Box (Nodes (3)); begin Nodes (1) := Self.Factory.Association (Nodes (1), Nodes (2), Box); end; when 2034 => declare List : Node := Self.Factory.Discrete_Choice_Sequence; begin Self.Factory.Prepend_Discrete_Choice (List, Nodes (1)); Nodes (1) := Self.Factory.Association (List, No_Token, None); end; when 2035 => declare List : Node := Nodes (2); begin Self.Factory.Prepend_Association (List, Nodes (1)); Nodes (1) := List; end; when 2036 => declare List : Node := Self.Factory.Association_Sequence; begin Self.Factory.Prepend_Association (List, Nodes (1)); Nodes (1) := List; end; when 2037 => declare List : constant Node := Self.Factory.Association_Sequence; begin Nodes (1) := List; end; when 2038 => Nodes (1) := Self.Factory. Record_Definition (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2039 => Nodes (1) := Self.Factory. Null_Record_Definition (Nodes (1), Nodes (2)); when 2040 => Nodes (1) := Self.Factory. Record_Representation_Clause (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11), Nodes (12)); when 2041 => Nodes (1) := Self.Factory. Record_Representation_Clause (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), (Self.Factory.Clause_Or_Pragma_Sequence), Nodes (9), Nodes (10), Nodes (11)); when 2042 => Nodes (1) := Self.Factory. Record_Representation_Clause (Nodes (1), Nodes (2), Nodes (3), Nodes (4), No_Token, No_Token, None, No_Token, Nodes (5), Nodes (6), Nodes (7), Nodes (8)); when 2043 => Nodes (1) := Self.Factory. Record_Representation_Clause (Nodes (1), Nodes (2), Nodes (3), Nodes (4), No_Token, No_Token, None, No_Token, (Self.Factory.Clause_Or_Pragma_Sequence), Nodes (5), Nodes (6), Nodes (7)); when 2044 => Nodes (1) := Self.Factory.Record_Type_Definition (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2045 => Nodes (1) := Self.Factory.Record_Type_Definition (Nodes (1), Nodes (2), No_Token, Nodes (3)); when 2046 => Nodes (1) := Self.Factory.Record_Type_Definition (No_Token, Nodes (1), Nodes (2), Nodes (3)); when 2047 => Nodes (1) := Self.Factory.Record_Type_Definition (No_Token, Nodes (1), No_Token, Nodes (2)); when 2048 => Nodes (1) := Self.Factory.Record_Type_Definition (No_Token, No_Token, Nodes (1), Nodes (2)); when 2049 => Nodes (1) := Self.Factory.Record_Type_Definition (No_Token, No_Token, No_Token, Nodes (1)); when 2050 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2051 => null; when 2052 => Nodes (1) := Self.Factory.Membership_Test (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2053 => Nodes (1) := Self.Factory.Membership_Test (Nodes (1), No_Token, Nodes (2), Nodes (3)); when 2054 => null; when 2055 => null; when 2056 => null; when 2057 => null; when 2058 => null; when 2059 => null; when 2060 => Nodes (1) := Self.Factory.Requeue_Statement (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); when 2061 => Nodes (1) := Self.Factory.Requeue_Statement (Nodes (1), Nodes (2), No_Token, No_Token, Nodes (3)); when 2062 => null; when 2063 => null; when 2064 => null; when 2065 => null; when 2066 => null; when 2067 => null; when 2068 => null; when 2069 => declare Item : constant Node := Self.Factory.Select_Or_Path (Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6)); List : Node := Nodes (1); begin Self.Factory.Append_Select_Or_Else_Path (List, Item); Nodes (1) := List; end; when 2070 => declare Item : constant Node := Self.Factory.Select_Or_Path (Nodes (2), No_Token, None, No_Token, Nodes (3)); List : Node := Nodes (1); begin Self.Factory.Append_Select_Or_Else_Path (List, Item); Nodes (1) := List; end; when 2071 => declare Item : constant Node := Self.Factory.Select_Or_Path (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); List : Node := Self.Factory.Select_Or_Else_Path_Sequence; begin Self.Factory.Append_Select_Or_Else_Path (List, Item); Nodes (1) := List; end; when 2072 => declare Item : constant Node := Self.Factory.Select_Or_Path (Nodes (1), No_Token, None, No_Token, Nodes (2)); List : Node := Self.Factory.Select_Or_Else_Path_Sequence; begin Self.Factory.Append_Select_Or_Else_Path (List, Item); Nodes (1) := List; end; when 2073 => Nodes (1) := Self.Factory.Selected_Component (Nodes (1), Nodes (2), Nodes (3)); when 2074 => Nodes (1) := Self.Factory.Selected_Identifier (Nodes (1), Nodes (2), Nodes (3)); when 2075 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token Nodes (2), Nodes (3), Nodes (4), Nodes (5)); Else_Item : constant Node := Self.Factory.Else_Path (Nodes (7), Nodes (8)); List : Node := Nodes (6); begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Self.Factory.Append_Select_Or_Else_Path (List, Else_Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (9), Nodes (10), Nodes (11)); end; when 2076 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token Nodes (2), Nodes (3), Nodes (4), Nodes (5)); List : Node := Nodes (6); begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (7), Nodes (8), Nodes (9)); end; when 2077 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token Nodes (2), Nodes (3), Nodes (4), Nodes (5)); Else_Item : constant Node := Self.Factory.Else_Path (Nodes (6), Nodes (7)); List : Node := Self.Factory.Select_Or_Else_Path_Sequence; begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Self.Factory.Append_Select_Or_Else_Path (List, Else_Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (8), Nodes (9), Nodes (10)); end; when 2078 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token Nodes (2), Nodes (3), Nodes (4), Nodes (5)); List : Node := Self.Factory.Select_Or_Else_Path_Sequence; begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (6), Nodes (7), Nodes (8)); end; when 2079 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token No_Token, None, No_Token, Nodes (2)); Else_Item : constant Node := Self.Factory.Else_Path (Nodes (4), Nodes (5)); List : Node := Nodes (3); begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Self.Factory.Append_Select_Or_Else_Path (List, Else_Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (6), Nodes (7), Nodes (8)); end; when 2080 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token No_Token, None, No_Token, Nodes (2)); List : Node := Nodes (3); begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (4), Nodes (5), Nodes (6)); end; when 2081 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token No_Token, None, No_Token, Nodes (2)); Else_Item : constant Node := Self.Factory.Else_Path (Nodes (3), Nodes (4)); List : Node := Self.Factory.Select_Or_Else_Path_Sequence; begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Self.Factory.Append_Select_Or_Else_Path (List, Else_Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (5), Nodes (6), Nodes (7)); end; when 2082 => declare Item : constant Node := Self.Factory.Select_Or_Path (No_Token, -- Or_Token No_Token, None, No_Token, Nodes (2)); List : Node := Self.Factory.Select_Or_Else_Path_Sequence; begin Self.Factory.Prepend_Select_Or_Else_Path (List, Item); Nodes (1) := Self.Factory.Selective_Accept (Nodes (1), List, Nodes (3), Nodes (4), Nodes (5)); end; when 2083 => null; when 2084 => Nodes (1) := Self.Factory.Character_Literal (Nodes (1)); when 2085 => null; when 2086 => declare List : Node := Nodes (2); begin Self.Factory.Prepend_Exception_Handler (List, Nodes (1)); Nodes (1) := List; end; when 2087 => declare List : Node := Self.Factory. Exception_Handler_Sequence; begin Self.Factory.Prepend_Exception_Handler (List, Nodes (1)); Nodes (1) := List; end; when 2088 => declare List : Node := Nodes (2); Dummy : constant Node := Self.Factory.Label_Decorator (Nodes (3), None); begin Self.Factory.Prepend_Statement (List, Nodes (1)); Self.Factory.Append_Statement (List, Dummy); Nodes (1) := List; end; when 2089 => declare List : Node := Nodes (2); begin Self.Factory.Prepend_Statement (List, Nodes (1)); Nodes (1) := List; end; when 2090 => declare List : Node := Self.Factory. Statement_Sequence; Dummy : constant Node := Self.Factory.Label_Decorator (Nodes (2), None); begin Self.Factory.Prepend_Statement (List, Nodes (1)); Self.Factory.Append_Statement (List, Dummy); Nodes (1) := List; end; when 2091 => declare List : Node := Self.Factory. Statement_Sequence; begin Self.Factory.Prepend_Statement (List, Nodes (1)); Nodes (1) := List; end; when 2092 => Nodes (1) := Self.Factory.Signed_Integer_Type_Definition (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2093 => Nodes (1) := Self.Factory.Numeric_Literal (Nodes (1)); when 2094 => Nodes (1) := Self.Factory.Null_Literal (Nodes (1)); when 2095 => null; when 2096 => null; when 2097 => null; when 2098 => Nodes (1) := Nodes (2); when 2099 => Nodes (1) := Nodes (2); when 2100 => Nodes (1) := Self.Factory.Infix_Call (Nodes (1), None, Nodes (2)); when 2101 => Nodes (1) := Self.Factory.Infix_Call (Nodes (1), None, Nodes (2)); when 2102 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2103 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2104 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2105 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2106 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2107 => Nodes (1) := Self.Factory.Infix_Call (Nodes (1), None, Nodes (2)); when 2108 => Nodes (1) := Self.Factory.Infix_Call (Nodes (1), None, Nodes (2)); when 2109 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2110 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2111 => Nodes (1) := Self.Factory.Infix_Call (Nodes (2), Nodes (1), Nodes (3)); when 2112 => Nodes (1) := Self.Factory.Simple_Return_Statement (Nodes (1), Nodes (2), Nodes (3)); when 2113 => Nodes (1) := Self.Factory.Simple_Return_Statement (Nodes (1), None, Nodes (2)); when 2114 => Nodes (1) := Self.Factory.Single_Protected_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9)); when 2115 => Nodes (1) := Self.Factory.Single_Protected_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (5), Nodes (6)); when 2116 => Nodes (1) := Self.Factory.Single_Protected_Declaration (Nodes (1), Nodes (2), (Self.Factory.Aspect_Specification_Sequence), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8)); when 2117 => Nodes (1) := Self.Factory.Single_Protected_Declaration (Nodes (1), Nodes (2), (Self.Factory.Aspect_Specification_Sequence), Nodes (3), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (4), Nodes (5)); when 2118 => Nodes (1) := Self.Factory.Single_Task_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9)); when 2119 => Nodes (1) := Self.Factory.Single_Task_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (5), Nodes (6)); when 2120 => Nodes (1) := Self.Factory.Single_Task_Declaration (Nodes (1), Nodes (2), Nodes (3), No_Token, No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, None, Nodes (4)); when 2121 => Nodes (1) := Self.Factory.Single_Task_Declaration (Nodes (1), Nodes (2), (Self.Factory.Aspect_Specification_Sequence), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8)); when 2122 => Nodes (1) := Self.Factory.Single_Task_Declaration (Nodes (1), Nodes (2), (Self.Factory.Aspect_Specification_Sequence), Nodes (3), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (4), Nodes (5)); when 2123 => Nodes (1) := Self.Factory.Single_Task_Declaration (Nodes (1), Nodes (2), (Self.Factory.Aspect_Specification_Sequence), No_Token, No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, None, Nodes (3)); when 2124 => Nodes (1) := Self.Factory.Label_Decorator (Nodes (1), Nodes (2)); when 2125 => null; when 2126 => declare List : Node := Nodes (1); begin Self.Factory.Append_Statement (List, Nodes (2)); Nodes (1) := List; end; when 2127 => declare List : Node := Self. Factory.Statement_Sequence; begin Self.Factory.Append_Statement (List, Nodes (1)); Nodes (1) := List; end; when 2128 => Nodes (1) := Self.Factory.Subtype_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6)); when 2129 => Nodes (1) := Self.Factory.Subtype_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), (Self.Factory.Aspect_Specification_Sequence), Nodes (5)); when 2130 => Nodes (1) := Self.Factory.To_Subtype_Indication (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2131 => Nodes (1) := Self.Factory.To_Subtype_Indication (Nodes (1), Nodes (2), Nodes (3), None); when 2132 => Nodes (1) := Self.Factory.To_Subtype_Indication (No_Token, No_Token, Nodes (1), Nodes (2)); when 2133 => Nodes (1) := Self.Factory.To_Subtype_Indication (No_Token, No_Token, Nodes (1), None); when 2134 => null; when 2135 => declare List : Node := Nodes (1); begin Self.Factory.Append_Subtype_Mark (List, Nodes (3)); Nodes (1) := List; end; when 2136 => declare List : Node := Self. Factory.Subtype_Mark_Sequence; begin Self.Factory.Append_Subtype_Mark (List, Nodes (2)); Nodes (1) := List; end; when 2137 => Nodes (1) := Self.Factory.Subunit (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6)); when 2138 => Nodes (1) := Self.Factory.Subunit ((Self.Factory.Context_Item_Sequence), Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); when 2139 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11), Nodes (12), Nodes (13)); when 2140 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11), No_Token, Nodes (12)); when 2141 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (9), Nodes (10), Nodes (11)); when 2142 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (9), No_Token, Nodes (10)); when 2143 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), (Self.Factory.Declarative_Item_Sequence), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11), Nodes (12)); when 2144 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), (Self.Factory.Declarative_Item_Sequence), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), No_Token, Nodes (11)); when 2145 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), (Self.Factory.Declarative_Item_Sequence), Nodes (6), Nodes (7), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (8), Nodes (9), Nodes (10)); when 2146 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), (Self.Factory.Declarative_Item_Sequence), Nodes (6), Nodes (7), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (8), No_Token, Nodes (9)); when 2147 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11), Nodes (12)); when 2148 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), No_Token, Nodes (11)); when 2149 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), Nodes (5), Nodes (6), Nodes (7), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (8), Nodes (9), Nodes (10)); when 2150 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), Nodes (5), Nodes (6), Nodes (7), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (8), No_Token, Nodes (9)); when 2151 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), (Self.Factory.Declarative_Item_Sequence), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11)); when 2152 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), (Self.Factory.Declarative_Item_Sequence), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), No_Token, Nodes (10)); when 2153 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), (Self.Factory.Declarative_Item_Sequence), Nodes (5), Nodes (6), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (7), Nodes (8), Nodes (9)); when 2154 => Nodes (1) := Self.Factory.Task_Body (Nodes (1), Nodes (2), Nodes (3), (Self.Factory.Aspect_Specification_Sequence), Nodes (4), (Self.Factory.Declarative_Item_Sequence), Nodes (5), Nodes (6), No_Token, (Self.Factory.Exception_Handler_Sequence), Nodes (7), No_Token, Nodes (8)); when 2155 => Nodes (1) := Self.Factory.Task_Body_Stub (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7)); when 2156 => Nodes (1) := Self.Factory.Task_Body_Stub (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), (Self.Factory.Aspect_Specification_Sequence), Nodes (6)); when 2157 => Nodes (1) := Self.Factory.Task_Definition (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5)); when 2158 => Nodes (1) := Self.Factory.Task_Definition (Nodes (1), Nodes (2), Nodes (3), Nodes (4), No_Token); when 2159 => Nodes (1) := Self.Factory.Task_Definition (Nodes (1), Nodes (2), (Self.Factory.Task_Item_Sequence), Nodes (3), Nodes (4)); when 2160 => Nodes (1) := Self.Factory.Task_Definition (Nodes (1), Nodes (2), (Self.Factory.Task_Item_Sequence), Nodes (3), No_Token); when 2161 => Nodes (1) := Self.Factory.Task_Definition (Nodes (1), No_Token, (Self.Factory.Task_Item_Sequence), Nodes (2), Nodes (3)); when 2162 => Nodes (1) := Self.Factory.Task_Definition (Nodes (1), No_Token, (Self.Factory.Task_Item_Sequence), Nodes (2), No_Token); when 2163 => Nodes (1) := Self.Factory.Task_Definition ((Self.Factory.Task_Item_Sequence), Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2164 => Nodes (1) := Self.Factory.Task_Definition ((Self.Factory.Task_Item_Sequence), Nodes (1), Nodes (2), Nodes (3), No_Token); when 2165 => Nodes (1) := Self.Factory.Task_Definition ((Self.Factory.Task_Item_Sequence), Nodes (1), (Self.Factory.Task_Item_Sequence), Nodes (2), Nodes (3)); when 2166 => Nodes (1) := Self.Factory.Task_Definition ((Self.Factory.Task_Item_Sequence), Nodes (1), (Self.Factory.Task_Item_Sequence), Nodes (2), No_Token); when 2167 => Nodes (1) := Self.Factory.Task_Definition ((Self.Factory.Task_Item_Sequence), No_Token, (Self.Factory.Task_Item_Sequence), Nodes (1), Nodes (2)); when 2168 => Nodes (1) := Self.Factory.Task_Definition ((Self.Factory.Task_Item_Sequence), No_Token, (Self.Factory.Task_Item_Sequence), Nodes (1), No_Token); when 2169 => null; when 2170 => null; when 2171 => declare List : Node := Nodes (1); begin Self.Factory.Prepend_Task_Item (List, Nodes (2)); Nodes (1) := List; end; when 2172 => declare List : Node := Self. Factory.Task_Item_Sequence; begin Self.Factory.Prepend_Task_Item (List, Nodes (1)); Nodes (1) := List; end; when 2173 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10), Nodes (11)); when 2174 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), Nodes (6), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (7), Nodes (8)); when 2175 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), Nodes (5), No_Token, No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, None, Nodes (6)); when 2176 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), (Self.Factory.Aspect_Specification_Sequence), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10)); when 2177 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), (Self.Factory.Aspect_Specification_Sequence), Nodes (5), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (6), Nodes (7)); when 2178 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), Nodes (4), (Self.Factory.Aspect_Specification_Sequence), No_Token, No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, None, Nodes (5)); when 2179 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9), Nodes (10)); when 2180 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, Nodes (4), Nodes (5), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (6), Nodes (7)); when 2181 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, Nodes (4), No_Token, No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, None, Nodes (5)); when 2182 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, (Self.Factory.Aspect_Specification_Sequence), Nodes (4), Nodes (5), Nodes (6), Nodes (7), Nodes (8), Nodes (9)); when 2183 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, (Self.Factory.Aspect_Specification_Sequence), Nodes (4), No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, Nodes (5), Nodes (6)); when 2184 => Nodes (1) := Self.Factory.Task_Type_Declaration (Nodes (1), Nodes (2), Nodes (3), None, (Self.Factory.Aspect_Specification_Sequence), No_Token, No_Token, (Self.Factory.Subtype_Mark_Sequence), No_Token, None, Nodes (4)); when 2185 => declare Item : constant Node := Self.Factory.Terminate_Alternative_Statement (Nodes (1), Nodes (2)); List : Node := Self.Factory.Statement_Sequence; begin Self.Factory.Append_Statement (List, Item); Nodes (1) := List; end; when 2186 => null; when 2187 => null; when 2188 => null; when 2189 => null; when 2190 => null; when 2191 => null; when 2192 => null; when 2193 => null; when 2194 => null; when 2195 => null; when 2196 => null; when 2197 => declare List : Node := Nodes (4); begin Self.Factory.Prepend_Subtype_Mark (List, Nodes (3)); Nodes (1) := Self.Factory. Unconstrained_Array_Definition (Nodes (1), Nodes (2), List, Nodes (5), Nodes (6), Nodes (7)); end; when 2198 => declare List : Node := Self.Factory. Subtype_Mark_Sequence; begin Self.Factory.Prepend_Subtype_Mark (List, Nodes (3)); Nodes (1) := Self.Factory. Unconstrained_Array_Definition (Nodes (1), Nodes (2), List, Nodes (4), Nodes (5), Nodes (6)); end; when 2199 => Nodes (1) := Self.Factory.Unknown_Discriminant_Part (Nodes (1), Nodes (2), Nodes (3)); when 2200 => null; when 2201 => null; when 2202 => null; when 2203 => null; when 2204 => null; when 2205 => null; when 2206 => null; when 2207 => null; when 2208 => null; when 2209 => null; when 2210 => null; when 2211 => null; when 2212 => null; when 2213 => null; when 2214 => null; when 2215 => null; when 2216 => null; when 2217 => null; when 2218 => null; when 2219 => null; when 2220 => null; when 2221 => declare List : Node := Nodes (3); begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (2)); Nodes (1) := Self.Factory.Use_Package_Clause (Nodes (1), List, Nodes (4)); end; when 2222 => declare List : Node := Self. Factory.Program_Unit_Name_Sequence; begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (2)); Nodes (1) := Self.Factory.Use_Package_Clause (Nodes (1), List, Nodes (3)); end; when 2223 => declare List : Node := Nodes (5); begin Self.Factory.Prepend_Subtype_Mark (List, Nodes (4)); Nodes (1) := Self.Factory.Use_Type_Clause (Nodes (1), Nodes (2), Nodes (3), List, Nodes (6)); end; when 2224 => declare List : Node := Self. Factory.Subtype_Mark_Sequence; begin Self.Factory.Prepend_Subtype_Mark (List, Nodes (4)); Nodes (1) := Self.Factory.Use_Type_Clause (Nodes (1), Nodes (2), Nodes (3), List, Nodes (5)); end; when 2225 => declare List : Node := Nodes (4); begin Self.Factory.Prepend_Subtype_Mark (List, Nodes (3)); Nodes (1) := Self.Factory.Use_Type_Clause (Nodes (1), No_Token, Nodes (2), List, Nodes (5)); end; when 2226 => declare List : Node := Self. Factory.Subtype_Mark_Sequence; begin Self.Factory.Prepend_Subtype_Mark (List, Nodes (3)); Nodes (1) := Self.Factory.Use_Type_Clause (Nodes (1), No_Token, Nodes (2), List, Nodes (4)); end; when 2227 => Nodes (1) := Self.Factory.Variant (Nodes (1), Nodes (2), Nodes (3), Nodes (4)); when 2228 => declare List : Node := Nodes (1); begin Self.Factory.Append_Variant (List, Nodes (2)); Nodes (1) := List; end; when 2229 => declare List : Node := Self. Factory.Variant_Sequence; begin Self.Factory.Append_Variant (List, Nodes (1)); Nodes (1) := List; end; when 2230 => declare List : Node := Nodes (5); begin Self.Factory.Prepend_Variant (List, Nodes (4)); Nodes (1) := Self.Factory.Variant_Part (Nodes (1), Nodes (2), Nodes (3), List, Nodes (6), Nodes (7), Nodes (8)); end; when 2231 => declare List : Node := Self.Factory.Variant_Sequence; begin Self.Factory.Prepend_Variant (List, Nodes (4)); Nodes (1) := Self.Factory.Variant_Part (Nodes (1), Nodes (2), Nodes (3), List, Nodes (5), Nodes (6), Nodes (7)); end; when 2232 => declare List : Node := Nodes (5); begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (4)); Nodes (1) := Self.Factory.With_Clause (Nodes (1), Nodes (2), Nodes (3), List, Nodes (6)); end; when 2233 => declare List : Node := Self. Factory.Program_Unit_Name_Sequence; begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (4)); Nodes (1) := Self.Factory.With_Clause (Nodes (1), Nodes (2), Nodes (3), List, Nodes (5)); end; when 2234 => declare List : Node := Nodes (4); begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (3)); Nodes (1) := Self.Factory.With_Clause (Nodes (1), No_Token, Nodes (2), List, Nodes (5)); end; when 2235 => declare List : Node := Self. Factory.Program_Unit_Name_Sequence; begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (3)); Nodes (1) := Self.Factory.With_Clause (Nodes (1), No_Token, Nodes (2), List, Nodes (4)); end; when 2236 => declare List : Node := Nodes (4); begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (3)); Nodes (1) := Self.Factory.With_Clause (No_Token, Nodes (1), Nodes (2), List, Nodes (5)); end; when 2237 => declare List : Node := Self. Factory.Program_Unit_Name_Sequence; begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (3)); Nodes (1) := Self.Factory.With_Clause (No_Token, Nodes (1), Nodes (2), List, Nodes (4)); end; when 2238 => declare List : Node := Nodes (3); begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (2)); Nodes (1) := Self.Factory.With_Clause (No_Token, No_Token, Nodes (1), List, Nodes (4)); end; when 2239 => declare List : Node := Self. Factory.Program_Unit_Name_Sequence; begin Self.Factory.Prepend_Program_Unit_Name (List, Nodes (2)); Nodes (1) := Self.Factory.With_Clause (No_Token, No_Token, Nodes (1), List, Nodes (3)); end; when others => raise Constraint_Error; end case; end Program.Parsers.On_Reduce_2001;
-- CC3007A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT NAMES IN A GENERIC DECLARATIONS ARE STATICALLY BOUND. -- DAT 9/18/81 -- SPS 2/7/83 WITH REPORT; USE REPORT; PROCEDURE CC3007A IS BEGIN TEST ("CC3007A", "NAMES IN GENERICS ARE STATICALLY BOUND"); DECLARE I : INTEGER := 1; EX : EXCEPTION; IA : INTEGER := I'SIZE; FUNCTION F (X : INTEGER) RETURN INTEGER; PACKAGE P IS Q : INTEGER := 1; END P; GENERIC J : IN OUT INTEGER; WITH FUNCTION FP (X : INTEGER) RETURN INTEGER IS F; PACKAGE GP IS V1 : INTEGER := F(I); V2 : INTEGER := FP(I); END GP; GENERIC TYPE T IS RANGE <> ; WITH FUNCTION F1 (X : INTEGER) RETURN INTEGER IS F; INP : IN T := T (I'SIZE); FUNCTION F1 (X : T) RETURN T; FUNCTION F1 (X : T) RETURN T IS BEGIN IF INP /= T(IA) THEN FAILED ("INCORRECT GENERIC BINDING 2"); END IF; I := I + 1; RETURN 2 * T (F1 (F (INTEGER (X) + I + P.Q))); END F1; PACKAGE BODY GP IS PACKAGE P IS Q : INTEGER := I + 1; END P; I : INTEGER := 1000; FUNCTION F IS NEW F1 (INTEGER); FUNCTION F2 IS NEW F1 (INTEGER); BEGIN P.Q := F2 (J + P.Q + V1 + 2 * V2); J := P.Q; RAISE EX; END GP; FUNCTION F (X : INTEGER) RETURN INTEGER IS BEGIN I := I + 2; RETURN X + I; END; BEGIN DECLARE I : INTEGER := 1000; EX : EXCEPTION; FUNCTION F IS NEW F1 (INTEGER); V : INTEGER := F (3); BEGIN BEGIN DECLARE PACKAGE P IS NEW GP (V); BEGIN FAILED ("EX NOT RAISED"); END; EXCEPTION WHEN EX => FAILED ("WRONG EXCEPTION RAISED"); WHEN OTHERS => IF V /= 266 THEN FAILED ("WRONG BINDING IN GENERICS"); END IF; RAISE; END; END; EXCEPTION WHEN EX => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED 2"); END; RESULT; END CC3007A;
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Discriminant_Specifications is function Create (Names : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Vector_Access; Colon_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Not_Token : Program.Lexical_Elements.Lexical_Element_Access; Null_Token : Program.Lexical_Elements.Lexical_Element_Access; Object_Subtype : not null Program.Elements.Element_Access; Assignment_Token : Program.Lexical_Elements.Lexical_Element_Access; Default_Expression : Program.Elements.Expressions.Expression_Access) return Discriminant_Specification is begin return Result : Discriminant_Specification := (Names => Names, Colon_Token => Colon_Token, Not_Token => Not_Token, Null_Token => Null_Token, Object_Subtype => Object_Subtype, Assignment_Token => Assignment_Token, Default_Expression => Default_Expression, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Names : not null Program.Elements.Defining_Identifiers .Defining_Identifier_Vector_Access; Object_Subtype : not null Program.Elements.Element_Access; Default_Expression : Program.Elements.Expressions.Expression_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Not_Null : Boolean := False) return Implicit_Discriminant_Specification is begin return Result : Implicit_Discriminant_Specification := (Names => Names, Object_Subtype => Object_Subtype, Default_Expression => Default_Expression, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Has_Not_Null => Has_Not_Null, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Names (Self : Base_Discriminant_Specification) return not null Program.Elements.Defining_Identifiers .Defining_Identifier_Vector_Access is begin return Self.Names; end Names; overriding function Object_Subtype (Self : Base_Discriminant_Specification) return not null Program.Elements.Element_Access is begin return Self.Object_Subtype; end Object_Subtype; overriding function Default_Expression (Self : Base_Discriminant_Specification) return Program.Elements.Expressions.Expression_Access is begin return Self.Default_Expression; end Default_Expression; overriding function Colon_Token (Self : Discriminant_Specification) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Colon_Token; end Colon_Token; overriding function Not_Token (Self : Discriminant_Specification) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Not_Token; end Not_Token; overriding function Null_Token (Self : Discriminant_Specification) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Null_Token; end Null_Token; overriding function Assignment_Token (Self : Discriminant_Specification) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Assignment_Token; end Assignment_Token; overriding function Has_Not_Null (Self : Discriminant_Specification) return Boolean is begin return Self.Null_Token.Assigned; end Has_Not_Null; overriding function Is_Part_Of_Implicit (Self : Implicit_Discriminant_Specification) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Discriminant_Specification) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Discriminant_Specification) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; overriding function Has_Not_Null (Self : Implicit_Discriminant_Specification) return Boolean is begin return Self.Has_Not_Null; end Has_Not_Null; procedure Initialize (Self : in out Base_Discriminant_Specification'Class) is begin for Item in Self.Names.Each_Element loop Set_Enclosing_Element (Item.Element, Self'Unchecked_Access); end loop; Set_Enclosing_Element (Self.Object_Subtype, Self'Unchecked_Access); if Self.Default_Expression.Assigned then Set_Enclosing_Element (Self.Default_Expression, Self'Unchecked_Access); end if; null; end Initialize; overriding function Is_Discriminant_Specification (Self : Base_Discriminant_Specification) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Discriminant_Specification; overriding function Is_Declaration (Self : Base_Discriminant_Specification) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Declaration; overriding procedure Visit (Self : not null access Base_Discriminant_Specification; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Discriminant_Specification (Self); end Visit; overriding function To_Discriminant_Specification_Text (Self : in out Discriminant_Specification) return Program.Elements.Discriminant_Specifications .Discriminant_Specification_Text_Access is begin return Self'Unchecked_Access; end To_Discriminant_Specification_Text; overriding function To_Discriminant_Specification_Text (Self : in out Implicit_Discriminant_Specification) return Program.Elements.Discriminant_Specifications .Discriminant_Specification_Text_Access is pragma Unreferenced (Self); begin return null; end To_Discriminant_Specification_Text; end Program.Nodes.Discriminant_Specifications;
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ I O . F L O A T _ I O -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2000 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Text_IO.Float_Aux; with System.WCh_Con; use System.WCh_Con; with System.WCh_WtS; use System.WCh_WtS; package body Ada.Wide_Text_IO.Float_IO is subtype TFT is Ada.Wide_Text_IO.File_Type; -- File type required for calls to routines in Aux package Aux renames Ada.Wide_Text_IO.Float_Aux; --------- -- Get -- --------- procedure Get (File : in File_Type; Item : out Num; Width : in Field := 0) is begin Aux.Get (TFT (File), Long_Long_Float (Item), Width); exception when Constraint_Error => raise Data_Error; end Get; procedure Get (Item : out Num; Width : in Field := 0) is begin Get (Current_Input, Item, Width); end Get; procedure Get (From : in Wide_String; Item : out Num; Last : out Positive) is S : constant String := Wide_String_To_String (From, WCEM_Upper); -- String on which we do the actual conversion. Note that the method -- used for wide character encoding is irrelevant, since if there is -- a character outside the Standard.Character range then the call to -- Aux.Gets will raise Data_Error in any case. begin Aux.Gets (S, Long_Long_Float (Item), Last); exception when Constraint_Error => raise Data_Error; end Get; --------- -- Put -- --------- procedure Put (File : in File_Type; Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is begin Aux.Put (TFT (File), Long_Long_Float (Item), Fore, Aft, Exp); end Put; procedure Put (Item : in Num; Fore : in Field := Default_Fore; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is begin Put (Current_Output, Item, Fore, Aft, Exp); end Put; procedure Put (To : out Wide_String; Item : in Num; Aft : in Field := Default_Aft; Exp : in Field := Default_Exp) is S : String (To'First .. To'Last); begin Aux.Puts (S, Long_Long_Float (Item), Aft, Exp); for J in S'Range loop To (J) := Wide_Character'Val (Character'Pos (S (J))); end loop; end Put; end Ada.Wide_Text_IO.Float_IO;
with Game; procedure Main is begin Game.Game_Loop; end Main;
----------------------------------------------------------------------- -- util-streams-pipes -- Pipe stream to or from a process -- Copyright (C) 2011, 2013, 2015, 2016, 2017, 2018, 2019 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Finalization; with Util.Processes; -- == Pipes == -- The `Util.Streams.Pipes` package defines a pipe stream to or from a process. -- It allows to launch an external program while getting the program standard output or -- providing the program standard input. The `Pipe_Stream` type represents the input or -- output stream for the external program. This is a portable interface that works on -- Unix and Windows. -- -- The process is created and launched by the `Open` operation. The pipe allows -- to read or write to the process through the `Read` and `Write` operation. -- It is very close to the *popen* operation provided by the C stdio library. -- First, create the pipe instance: -- -- with Util.Streams.Pipes; -- ... -- Pipe : aliased Util.Streams.Pipes.Pipe_Stream; -- -- The pipe instance can be associated with only one process at a time. -- The process is launched by using the `Open` command and by specifying the command -- to execute as well as the pipe redirection mode: -- -- * `READ` to read the process standard output, -- * `WRITE` to write the process standard input. -- -- For example to run the `ls -l` command and read its output, we could run it by using: -- -- Pipe.Open (Command => "ls -l", Mode => Util.Processes.READ); -- -- The `Pipe_Stream` is not buffered and a buffer can be configured easily by using the -- `Input_Buffer_Stream` type and connecting the buffer to the pipe so that it reads -- the pipe to fill the buffer. The initialization of the buffer is the following: -- -- with Util.Streams.Buffered; -- ... -- Buffer : Util.Streams.Buffered.Input_Buffer_Stream; -- ... -- Buffer.Initialize (Input => Pipe'Access, Size => 1024); -- -- And to read the process output, one can use the following: -- -- Content : Ada.Strings.Unbounded.Unbounded_String; -- ... -- Buffer.Read (Into => Content); -- -- The pipe object should be closed when reading or writing to it is finished. -- By closing the pipe, the caller will wait for the termination of the process. -- The process exit status can be obtained by using the `Get_Exit_Status` function. -- -- Pipe.Close; -- if Pipe.Get_Exit_Status /= 0 then -- Ada.Text_IO.Put_Line ("Command exited with status " -- & Integer'Image (Pipe.Get_Exit_Status)); -- end if; -- -- You will note that the `Pipe_Stream` is a limited type and thus cannot be copied. -- When leaving the scope of the `Pipe_Stream` instance, the application will wait for -- the process to terminate. -- -- Before opening the pipe, it is possible to have some control on the process that -- will be created to configure: -- -- * The shell that will be used to launch the process, -- * The process working directory, -- * Redirect the process output to a file, -- * Redirect the process error to a file, -- * Redirect the process input from a file. -- -- All these operations must be made before calling the `Open` procedure. package Util.Streams.Pipes is use Util.Processes; subtype Pipe_Mode is Util.Processes.Pipe_Mode range READ .. READ_WRITE; -- ----------------------- -- Pipe stream -- ----------------------- -- The <b>Pipe_Stream</b> is an output/input stream that reads or writes -- to or from a process. type Pipe_Stream is limited new Output_Stream and Input_Stream with private; -- Set the shell executable path to use to launch a command. The default on Unix is -- the /bin/sh command. Argument splitting is done by the /bin/sh -c command. -- When setting an empty shell command, the argument splitting is done by the -- <tt>Spawn</tt> procedure. procedure Set_Shell (Stream : in out Pipe_Stream; Shell : in String); -- Before launching the process, redirect the input stream of the process -- to the specified file. -- Raises <b>Invalid_State</b> if the process is running. procedure Set_Input_Stream (Stream : in out Pipe_Stream; File : in String); -- Set the output stream of the process. -- Raises <b>Invalid_State</b> if the process is running. procedure Set_Output_Stream (Stream : in out Pipe_Stream; File : in String; Append : in Boolean := False); -- Set the error stream of the process. -- Raises <b>Invalid_State</b> if the process is running. procedure Set_Error_Stream (Stream : in out Pipe_Stream; File : in String; Append : in Boolean := False); -- Set the working directory that the process will use once it is created. -- The directory must exist or the <b>Invalid_Directory</b> exception will be raised. procedure Set_Working_Directory (Stream : in out Pipe_Stream; Path : in String); -- Closes the given file descriptor in the child process before executing the command. procedure Add_Close (Stream : in out Pipe_Stream; Fd : in Util.Processes.File_Type); -- Open a pipe to read or write to an external process. The pipe is created and the -- command is executed with the input and output streams redirected through the pipe. procedure Open (Stream : in out Pipe_Stream; Command : in String; Mode : in Pipe_Mode := READ); -- Close the pipe and wait for the external process to terminate. overriding procedure Close (Stream : in out Pipe_Stream); -- Get the process exit status. function Get_Exit_Status (Stream : in Pipe_Stream) return Integer; -- Returns True if the process is running. function Is_Running (Stream : in Pipe_Stream) return Boolean; -- Write the buffer array to the output stream. overriding procedure Write (Stream : in out Pipe_Stream; Buffer : in Ada.Streams.Stream_Element_Array); -- Read into the buffer as many bytes as possible and return in -- <b>last</b> the position of the last byte read. overriding procedure Read (Stream : in out Pipe_Stream; Into : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); private type Pipe_Stream is limited new Ada.Finalization.Limited_Controlled and Output_Stream and Input_Stream with record Proc : Util.Processes.Process; end record; -- Flush the stream and release the buffer. overriding procedure Finalize (Object : in out Pipe_Stream); end Util.Streams.Pipes;
------------------------------------------------------------------------------ -- -- -- GNAT RUNTIME COMPONENTS -- -- -- -- A D A . I O _ E X C E P T I O N S -- -- -- -- S p e c -- -- -- -- $Revision: 2 $ -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ package Ada.IO_Exceptions is pragma Pure (IO_Exceptions); Status_Error : exception; Mode_Error : exception; Name_Error : exception; Use_Error : exception; Device_Error : exception; End_Error : exception; Data_Error : exception; Layout_Error : exception; end Ada.IO_Exceptions;
----------------------------------------------------------------------- -- gen-model -- Model for Code Generator -- Copyright (C) 2009, 2010, 2011, 2012, 2018, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Finalization; with Ada.Strings.Unbounded; with Util.Log; with Util.Beans.Basic; with Util.Beans.Objects; with Util.Beans.Objects.Maps; with DOM.Core; package Gen.Model is -- Exception raised if a name is already registered in the model. -- This exception is raised if a table, an enum is already defined. Name_Exist : exception; -- ------------------------------ -- Model Definition -- ------------------------------ type Definition is new Ada.Finalization.Limited_Controlled and Util.Beans.Basic.Readonly_Bean with private; type Definition_Access is access all Definition'Class; -- Prepare the generation of the model. procedure Prepare (O : in out Definition) is null; -- Get the object unique name. function Get_Name (From : in Definition) return String; function Name (From : in Definition) return Ada.Strings.Unbounded.Unbounded_String; -- Set the object unique name. procedure Set_Name (Def : in out Definition; Name : in String); procedure Set_Name (Def : in out Definition; Name : in Ada.Strings.Unbounded.Unbounded_String); -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. function Get_Value (From : in Definition; Name : in String) return Util.Beans.Objects.Object; -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. function Get_Attribute (From : in Definition; Name : in String) return String; -- Get the value identified by the name. -- If the name cannot be found, the method should return the Null object. function Get_Attribute (From : in Definition; Name : in String) return Ada.Strings.Unbounded.Unbounded_String; -- Set the comment associated with the element. procedure Set_Comment (Def : in out Definition; Comment : in String); -- Get the comment associated with the element. function Get_Comment (Def : in Definition) return Util.Beans.Objects.Object; -- Set the location (file and line) where the model element is defined in the XMI file. procedure Set_Location (Node : in out Definition; Location : in String); -- Get the location file and line where the model element is defined. function Get_Location (Node : in Definition) return String; -- Initialize the definition from the DOM node attributes. procedure Initialize (Def : in out Definition; Name : in Ada.Strings.Unbounded.Unbounded_String; Node : in DOM.Core.Node); -- Validate the definition by checking and reporting problems to the logger interface. procedure Validate (Def : in out Definition; Log : in out Util.Log.Logging'Class); private procedure Set_Index (Def : in out Definition; Index : in Natural); type Definition is new Ada.Finalization.Limited_Controlled and Util.Beans.Basic.Readonly_Bean with record Row_Index : Natural; Def_Name : Ada.Strings.Unbounded.Unbounded_String; Attrs : Util.Beans.Objects.Maps.Map_Bean; Comment : Util.Beans.Objects.Object; Location : Ada.Strings.Unbounded.Unbounded_String; end record; end Gen.Model;
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr> -- MIT license. Please refer to the LICENSE file. with Apsepp.Generic_Fixture; with Apsepp.Scope_Bound_Locks; use Apsepp.Scope_Bound_Locks; package Apsepp_Scope_Bound_Locks_Test_Fixture is procedure Increment_N; procedure Decrement_N; type Scope_Bound_Locks_Test_Fixture is tagged limited record Lock : aliased SB_Lock; Lock_W_CB : aliased SB_Lock (Lock_CB => Increment_N'Access, Unlock_CB => Decrement_N'Access); end record; type Scope_Bound_Locks_Test_Fixture_Access is not null access all Scope_Bound_Locks_Test_Fixture; not overriding function Allocate return Scope_Bound_Locks_Test_Fixture_Access is (new Scope_Bound_Locks_Test_Fixture'(others => <>)); not overriding procedure Reset (Obj : Scope_Bound_Locks_Test_Fixture); not overriding function N (Obj : Scope_Bound_Locks_Test_Fixture) return Integer; package Scope_Bound_Locks_T_F is new Apsepp.Generic_Fixture (Fixture_Type => Scope_Bound_Locks_Test_Fixture, Fixture_Type_Access => Scope_Bound_Locks_Test_Fixture_Access, Default_Allocator => Allocate); function Instance return Scope_Bound_Locks_Test_Fixture_Access renames Scope_Bound_Locks_T_F.Instance; end Apsepp_Scope_Bound_Locks_Test_Fixture;
-- Standard Ada library specification -- 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.Iterator_Interfaces; generic type Element_Type is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Ada.Containers.Bounded_Doubly_Linked_Lists is pragma Pure(Bounded_Doubly_Linked_Lists); pragma Remote_Types(Bounded_Doubly_Linked_Lists); type List (Capacity : Count_Type) is tagged private with Constant_Indexing => Constant_Reference, Variable_Indexing => Reference, Default_Iterator => Iterate, Iterator_Element => Element_Type; pragma Preelaborable_Initialization(List); type Cursor is private; pragma Preelaborable_Initialization(Cursor); Empty_List : constant List; No_Element : constant Cursor; function Has_Element (Position : Cursor) return Boolean; package List_Iterator_Interfaces is new Ada.Iterator_Interfaces (Cursor, Has_Element); function "=" (Left, Right : List) return Boolean; function Length (Container : List) return Count_Type; function Is_Empty (Container : List) return Boolean; procedure Clear (Container : in out List); function Element (Position : Cursor) return Element_Type; procedure Replace_Element (Container : in out List; Position : in Cursor; New_Item : in Element_Type); procedure Query_Element (Position : in Cursor; Process : not null access procedure (Element : in Element_Type)); procedure Update_Element (Container : in out List; Position : in Cursor; Process : not null access procedure (Element : in out Element_Type)); type Constant_Reference_Type (Element : not null access constant Element_Type) is private with Implicit_Dereference => Element; type Reference_Type (Element : not null access Element_Type) is private with Implicit_Dereference => Element; function Constant_Reference (Container : aliased in List; Position : in Cursor) return Constant_Reference_Type; function Reference (Container : aliased in out List; Position : in Cursor) return Reference_Type; procedure Assign (Target : in out List; Source : in List); function Copy (Source : List; Capacity : Count_Type := 0) return List; procedure Move (Target : in out List; Source : in out List); procedure Insert (Container : in out List; Before : in Cursor; New_Item : in Element_Type; Count : in Count_Type := 1); procedure Insert (Container : in out List; Before : in Cursor; New_Item : in Element_Type; Position : out Cursor; Count : in Count_Type := 1); procedure Insert (Container : in out List; Before : in Cursor; Position : out Cursor; Count : in Count_Type := 1); procedure Prepend (Container : in out List; New_Item : in Element_Type; Count : in Count_Type := 1); procedure Append (Container : in out List; New_Item : in Element_Type; Count : in Count_Type := 1); procedure Delete (Container : in out List; Position : in out Cursor; Count : in Count_Type := 1); procedure Delete_First (Container : in out List; Count : in Count_Type := 1); procedure Delete_Last (Container : in out List; Count : in Count_Type := 1); procedure Reverse_Elements (Container : in out List); procedure Swap (Container : in out List; I, J : in Cursor); procedure Swap_Links (Container : in out List; I, J : in Cursor); procedure Splice (Target : in out List; Before : in Cursor; Source : in out List); procedure Splice (Target : in out List; Before : in Cursor; Source : in out List; Position : in out Cursor); procedure Splice (Container: in out List; Before : in Cursor; Position : in Cursor); function First (Container : List) return Cursor; function First_Element (Container : List) return Element_Type; function Last (Container : List) return Cursor; function Last_Element (Container : List) return Element_Type; function Next (Position : Cursor) return Cursor; function Previous (Position : Cursor) return Cursor; procedure Next (Position : in out Cursor); procedure Previous (Position : in out Cursor); function Find (Container : List; Item : Element_Type; Position : Cursor := No_Element) return Cursor; function Reverse_Find (Container : List; Item : Element_Type; Position : Cursor := No_Element) return Cursor; function Contains (Container : List; Item : Element_Type) return Boolean; procedure Iterate (Container : in List; Process : not null access procedure (Position : in Cursor)); procedure Reverse_Iterate (Container : in List; Process : not null access procedure (Position : in Cursor)); function Iterate (Container : in List) return List_Iterator_Interfaces.Reversible_Iterator'Class; function Iterate (Container : in List; Start : in Cursor) return List_Iterator_Interfaces.Reversible_Iterator'Class; generic with function "<" (Left, Right : Element_Type) return Boolean is <>; package Generic_Sorting is function Is_Sorted (Container : List) return Boolean; procedure Sort (Container : in out List); procedure Merge (Target : in out List; Source : in out List); end Generic_Sorting; private -- not specified by the language end Ada.Containers.Bounded_Doubly_Linked_Lists;
with Ada.Streams; with C.gmp; package GMP.Z.Inside is pragma Preelaborate; function Reference (X : in out MP_Integer) return not null access C.gmp.mpz_struct; function Constant_Reference (X : MP_Integer) return not null access constant C.gmp.mpz_struct; pragma Inline (Reference); -- renamed pragma Inline (Constant_Reference); -- renamed procedure Read ( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : not null access C.gmp.mpz_struct); procedure Write ( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : not null access constant C.gmp.mpz_struct); pragma Inline (Read); -- renamed pragma Inline (Write); -- renamed private function Reference (X : in out MP_Integer) return not null access C.gmp.mpz_struct renames Controlled.Reference; function Constant_Reference (X : MP_Integer) return not null access constant C.gmp.mpz_struct renames Controlled.Constant_Reference; procedure Read ( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : not null access C.gmp.mpz_struct) renames Z.Read; procedure Write ( Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : not null access constant C.gmp.mpz_struct) renames Z.Write; end GMP.Z.Inside;
pragma License (Unrestricted); -- extended unit package Ada.Characters.ASCII.Handling is -- There are functions handling only lower-half characters in -- 16#00# .. 16#7F#. pragma Pure; function Is_Control (Item : Character) return Boolean; function Is_Graphic (Item : Character) return Boolean; function Is_Letter (Item : Character) return Boolean; function Is_Lower (Item : Character) return Boolean; function Is_Upper (Item : Character) return Boolean; function Is_Basic (Item : Character) return Boolean renames Is_Letter; function Is_Digit (Item : Character) return Boolean; function Is_Decimal_Digit (Item : Character) return Boolean renames Is_Digit; function Is_Hexadecimal_Digit (Item : Character) return Boolean; function Is_Alphanumeric (Item : Character) return Boolean; function Is_Special (Item : Character) return Boolean; pragma Inline (Is_Graphic); pragma Inline (Is_Lower); pragma Inline (Is_Upper); pragma Inline (Is_Digit); function To_Lower (Item : Character) return Character; function To_Upper (Item : Character) return Character; function To_Basic (Item : Character) return Character; -- extended function To_Case_Folding (Item : Character) return Character renames To_Lower; pragma Inline (To_Basic); function To_Lower (Item : String) return String; function To_Upper (Item : String) return String; function To_Case_Folding (Item : String) return String renames To_Lower; end Ada.Characters.ASCII.Handling;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Status -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Laurent Pautet <pautet@gnat.com> -- Modified by: Juergen Pfeifer, 1997 -- Version Control -- $Revision: 1.9 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- This package has been contributed by Laurent Pautet <pautet@gnat.com> -- -- -- with Ada.Interrupts.Names; package Status is pragma Warnings (Off); -- the next pragma exists since 3.11p pragma Unreserve_All_Interrupts; pragma Warnings (On); protected Process is procedure Stop; function Continue return Boolean; pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); private Done : Boolean := False; end Process; end Status;
pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with SDL_SDL_stdinc_h; with SDL_SDL_keyboard_h; with System; package SDL_SDL_events_h is SDL_RELEASED : constant := 0; -- ../include/SDL/SDL_events.h:47 SDL_PRESSED : constant := 1; -- ../include/SDL/SDL_events.h:48 -- arg-macro: function SDL_EVENTMASK (X) -- return 2**(X); SDL_ALLEVENTS : constant := 16#FFFFFFFF#; -- ../include/SDL/SDL_events.h:115 SDL_QUERY : constant := -1; -- ../include/SDL/SDL_events.h:334 SDL_IGNORE : constant := 0; -- ../include/SDL/SDL_events.h:335 SDL_DISABLE : constant := 0; -- ../include/SDL/SDL_events.h:336 SDL_ENABLE : constant := 1; -- ../include/SDL/SDL_events.h:337 subtype SDL_EventType is unsigned; SDL_NOEVENT : constant SDL_EventType := 0; SDL_ACTIVEEVENT : constant SDL_EventType := 1; SDL_KEYDOWN : constant SDL_EventType := 2; SDL_KEYUP : constant SDL_EventType := 3; SDL_MOUSEMOTION : constant SDL_EventType := 4; SDL_MOUSEBUTTONDOWN : constant SDL_EventType := 5; SDL_MOUSEBUTTONUP : constant SDL_EventType := 6; SDL_JOYAXISMOTION : constant SDL_EventType := 7; SDL_JOYBALLMOTION : constant SDL_EventType := 8; SDL_JOYHATMOTION : constant SDL_EventType := 9; SDL_JOYBUTTONDOWN : constant SDL_EventType := 10; SDL_JOYBUTTONUP : constant SDL_EventType := 11; SDL_QUIT : constant SDL_EventType := 12; SDL_SYSWMEVENT : constant SDL_EventType := 13; SDL_EVENT_RESERVEDA : constant SDL_EventType := 14; SDL_EVENT_RESERVEDB : constant SDL_EventType := 15; SDL_VIDEORESIZE : constant SDL_EventType := 16; SDL_VIDEOEXPOSE : constant SDL_EventType := 17; SDL_EVENT_RESERVED2 : constant SDL_EventType := 18; SDL_EVENT_RESERVED3 : constant SDL_EventType := 19; SDL_EVENT_RESERVED4 : constant SDL_EventType := 20; SDL_EVENT_RESERVED5 : constant SDL_EventType := 21; SDL_EVENT_RESERVED6 : constant SDL_EventType := 22; SDL_EVENT_RESERVED7 : constant SDL_EventType := 23; SDL_USEREVENT : constant SDL_EventType := 24; SDL_NUMEVENTS : constant SDL_EventType := 32; -- ../include/SDL/SDL_events.h:83 subtype SDL_EventMask is unsigned; SDL_ACTIVEEVENTMASK : constant SDL_EventMask := 2; SDL_KEYDOWNMASK : constant SDL_EventMask := 4; SDL_KEYUPMASK : constant SDL_EventMask := 8; SDL_KEYEVENTMASK : constant SDL_EventMask := 12; SDL_MOUSEMOTIONMASK : constant SDL_EventMask := 16; SDL_MOUSEBUTTONDOWNMASK : constant SDL_EventMask := 32; SDL_MOUSEBUTTONUPMASK : constant SDL_EventMask := 64; SDL_MOUSEEVENTMASK : constant SDL_EventMask := 112; SDL_JOYAXISMOTIONMASK : constant SDL_EventMask := 128; SDL_JOYBALLMOTIONMASK : constant SDL_EventMask := 256; SDL_JOYHATMOTIONMASK : constant SDL_EventMask := 512; SDL_JOYBUTTONDOWNMASK : constant SDL_EventMask := 1024; SDL_JOYBUTTONUPMASK : constant SDL_EventMask := 2048; SDL_JOYEVENTMASK : constant SDL_EventMask := 3968; SDL_VIDEORESIZEMASK : constant SDL_EventMask := 65536; SDL_VIDEOEXPOSEMASK : constant SDL_EventMask := 131072; SDL_QUITMASK : constant SDL_EventMask := 4096; SDL_SYSWMEVENTMASK : constant SDL_EventMask := 8192; -- ../include/SDL/SDL_events.h:114 type SDL_ActiveEvent_Rec is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:120 gain : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:121 state : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:122 end record; pragma Convention (C_Pass_By_Copy, SDL_ActiveEvent_Rec); -- ../include/SDL/SDL_events.h:119 type SDL_KeyboardEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:127 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:128 state : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:129 keysym : aliased SDL_SDL_keyboard_h.SDL_keysym; -- ../include/SDL/SDL_events.h:130 end record; pragma Convention (C_Pass_By_Copy, SDL_KeyboardEvent); -- ../include/SDL/SDL_events.h:126 type SDL_MouseMotionEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:135 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:136 state : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:137 x : aliased SDL_SDL_stdinc_h.Uint16; -- ../include/SDL/SDL_events.h:138 y : aliased SDL_SDL_stdinc_h.Uint16; -- ../include/SDL/SDL_events.h:138 xrel : aliased SDL_SDL_stdinc_h.Sint16; -- ../include/SDL/SDL_events.h:139 yrel : aliased SDL_SDL_stdinc_h.Sint16; -- ../include/SDL/SDL_events.h:140 end record; pragma Convention (C_Pass_By_Copy, SDL_MouseMotionEvent); -- ../include/SDL/SDL_events.h:134 type SDL_MouseButtonEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:145 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:146 button : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:147 state : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:148 x : aliased SDL_SDL_stdinc_h.Uint16; -- ../include/SDL/SDL_events.h:149 y : aliased SDL_SDL_stdinc_h.Uint16; -- ../include/SDL/SDL_events.h:149 end record; pragma Convention (C_Pass_By_Copy, SDL_MouseButtonEvent); -- ../include/SDL/SDL_events.h:144 type SDL_JoyAxisEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:154 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:155 axis : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:156 value : aliased SDL_SDL_stdinc_h.Sint16; -- ../include/SDL/SDL_events.h:157 end record; pragma Convention (C_Pass_By_Copy, SDL_JoyAxisEvent); -- ../include/SDL/SDL_events.h:153 type SDL_JoyBallEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:162 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:163 ball : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:164 xrel : aliased SDL_SDL_stdinc_h.Sint16; -- ../include/SDL/SDL_events.h:165 yrel : aliased SDL_SDL_stdinc_h.Sint16; -- ../include/SDL/SDL_events.h:166 end record; pragma Convention (C_Pass_By_Copy, SDL_JoyBallEvent); -- ../include/SDL/SDL_events.h:161 type SDL_JoyHatEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:171 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:172 hat : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:173 value : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:174 end record; pragma Convention (C_Pass_By_Copy, SDL_JoyHatEvent); -- ../include/SDL/SDL_events.h:170 type SDL_JoyButtonEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:184 which : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:185 button : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:186 state : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:187 end record; pragma Convention (C_Pass_By_Copy, SDL_JoyButtonEvent); -- ../include/SDL/SDL_events.h:183 type SDL_ResizeEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:195 w : aliased int; -- ../include/SDL/SDL_events.h:196 h : aliased int; -- ../include/SDL/SDL_events.h:197 end record; pragma Convention (C_Pass_By_Copy, SDL_ResizeEvent); -- ../include/SDL/SDL_events.h:194 type SDL_ExposeEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:202 end record; pragma Convention (C_Pass_By_Copy, SDL_ExposeEvent); -- ../include/SDL/SDL_events.h:201 type SDL_QuitEvent is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:207 end record; pragma Convention (C_Pass_By_Copy, SDL_QuitEvent); -- ../include/SDL/SDL_events.h:206 type SDL_UserEvent_Rec is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:212 code : aliased int; -- ../include/SDL/SDL_events.h:213 data1 : System.Address; -- ../include/SDL/SDL_events.h:214 data2 : System.Address; -- ../include/SDL/SDL_events.h:215 end record; pragma Convention (C_Pass_By_Copy, SDL_UserEvent_Rec); -- ../include/SDL/SDL_events.h:211 -- skipped empty struct SDL_SysWMmsg type SDL_SysWMEvent_Rec is record c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:222 msg : System.Address; -- ../include/SDL/SDL_events.h:223 end record; pragma Convention (C_Pass_By_Copy, SDL_SysWMEvent_Rec); -- ../include/SDL/SDL_events.h:221 type SDL_Event (discr : unsigned := 0) is record case discr is when 0 => c_type : aliased SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:228 when 1 => active : aliased SDL_ActiveEvent_Rec; -- ../include/SDL/SDL_events.h:229 when 2 => key : aliased SDL_KeyboardEvent; -- ../include/SDL/SDL_events.h:230 when 3 => motion : aliased SDL_MouseMotionEvent; -- ../include/SDL/SDL_events.h:231 when 4 => button : aliased SDL_MouseButtonEvent; -- ../include/SDL/SDL_events.h:232 when 5 => jaxis : aliased SDL_JoyAxisEvent; -- ../include/SDL/SDL_events.h:233 when 6 => jball : aliased SDL_JoyBallEvent; -- ../include/SDL/SDL_events.h:234 when 7 => jhat : aliased SDL_JoyHatEvent; -- ../include/SDL/SDL_events.h:235 when 8 => jbutton : aliased SDL_JoyButtonEvent; -- ../include/SDL/SDL_events.h:236 when 9 => resize : aliased SDL_ResizeEvent; -- ../include/SDL/SDL_events.h:237 when 10 => expose : aliased SDL_ExposeEvent; -- ../include/SDL/SDL_events.h:238 when 11 => quit : aliased SDL_QuitEvent; -- ../include/SDL/SDL_events.h:239 when 12 => user : aliased SDL_UserEvent_Rec; -- ../include/SDL/SDL_events.h:240 when others => syswm : aliased SDL_SysWMEvent_Rec; -- ../include/SDL/SDL_events.h:241 end case; end record; pragma Convention (C_Pass_By_Copy, SDL_Event); pragma Unchecked_Union (SDL_Event); -- ../include/SDL/SDL_events.h:227 procedure SDL_PumpEvents; -- ../include/SDL/SDL_events.h:251 pragma Import (C, SDL_PumpEvents, "SDL_PumpEvents"); type SDL_eventaction is (SDL_ADDEVENT, SDL_PEEKEVENT, SDL_GETEVENT); pragma Convention (C, SDL_eventaction); -- ../include/SDL/SDL_events.h:257 function SDL_PeepEvents (events : access SDL_Event; numevents : int; action : SDL_eventaction; mask : SDL_SDL_stdinc_h.Uint32) return int; -- ../include/SDL/SDL_events.h:277 pragma Import (C, SDL_PeepEvents, "SDL_PeepEvents"); function SDL_PollEvent (event : access SDL_Event) return int; -- ../include/SDL/SDL_events.h:284 pragma Import (C, SDL_PollEvent, "SDL_PollEvent"); function SDL_WaitEvent (event : access SDL_Event) return int; -- ../include/SDL/SDL_events.h:290 pragma Import (C, SDL_WaitEvent, "SDL_WaitEvent"); function SDL_PushEvent (event : access SDL_Event) return int; -- ../include/SDL/SDL_events.h:296 pragma Import (C, SDL_PushEvent, "SDL_PushEvent"); type SDL_EventFilter is access function (arg1 : System.Address) return int; pragma Convention (C, SDL_EventFilter); -- ../include/SDL/SDL_events.h:300 procedure SDL_SetEventFilter (filter : SDL_EventFilter); -- ../include/SDL/SDL_events.h:323 pragma Import (C, SDL_SetEventFilter, "SDL_SetEventFilter"); function SDL_GetEventFilter return SDL_EventFilter; -- ../include/SDL/SDL_events.h:329 pragma Import (C, SDL_GetEventFilter, "SDL_GetEventFilter"); function SDL_EventState (c_type : SDL_SDL_stdinc_h.Uint8; state : int) return SDL_SDL_stdinc_h.Uint8; -- ../include/SDL/SDL_events.h:348 pragma Import (C, SDL_EventState, "SDL_EventState"); end SDL_SDL_events_h;
-- Institution: Technische Universität München -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- -- Authors: Emanuel Regnath (emanuel.regnath@tum.de) with HIL.Devices; -- @summary -- Target-independent specification for HIL of I2C package HIL.I2C with SPARK_Mode => On is -- type Port_Type is limited interface; -- -- type Configuration_Type is null record; -- -- procedure configure(Port : Port_Type; Config : Configuration_Type) is abstract; -- subtype Data_Type is Unsigned_8_Array; type Device_Type is new HIL.Devices.Device_Type_I2C; is_Init : Boolean := False with Ghost; procedure initialize with --Pre => is_Init = False, Post => is_Init; procedure write (Device : in Device_Type; Data : in Data_Type) with Pre => is_Init; procedure read (Device : in Device_Type; Data : out Data_Type) with Pre => is_Init; procedure transfer (Device : in Device_Type; Data_TX : in Data_Type; Data_RX : out Data_Type) with Pre => is_Init; end HIL.I2C;
-- Copyright (c) 2020-2021 Bartek thindil Jasicki <thindil@laeran.pl> -- -- 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 Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Containers.Generic_Array_Sort; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with CArgv; use CArgv; with Tcl; use Tcl; with Tcl.Ada; use Tcl.Ada; with Tcl.Tk.Ada; use Tcl.Tk.Ada; with Tcl.Tk.Ada.Grid; with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets; with Tcl.Tk.Ada.Widgets.Canvas; use Tcl.Tk.Ada.Widgets.Canvas; with Tcl.Tk.Ada.Widgets.Menu; use Tcl.Tk.Ada.Widgets.Menu; with Tcl.Tk.Ada.Widgets.Text; use Tcl.Tk.Ada.Widgets.Text; with Tcl.Tk.Ada.Widgets.Toplevel.MainWindow; use Tcl.Tk.Ada.Widgets.Toplevel.MainWindow; with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton; with Tcl.Tk.Ada.Widgets.TtkEntry; use Tcl.Tk.Ada.Widgets.TtkEntry; with Tcl.Tk.Ada.Widgets.TtkEntry.TtkSpinBox; use Tcl.Tk.Ada.Widgets.TtkEntry.TtkSpinBox; with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox; use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox; with Tcl.Tk.Ada.Widgets.TtkFrame; use Tcl.Tk.Ada.Widgets.TtkFrame; with Tcl.Tk.Ada.Widgets.TtkLabel; use Tcl.Tk.Ada.Widgets.TtkLabel; with Tcl.Tk.Ada.Widgets.TtkPanedWindow; use Tcl.Tk.Ada.Widgets.TtkPanedWindow; with Tcl.Tk.Ada.Widgets.TtkScrollbar; use Tcl.Tk.Ada.Widgets.TtkScrollbar; with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo; with Config; use Config; with CoreUI; use CoreUI; with Dialogs; use Dialogs; with Items; use Items; with Maps.UI; use Maps.UI; with Table; use Table; with Utils.UI; use Utils.UI; package body Crafts.UI is -- ****iv* CUI4/CUI4.RecipesTable -- FUNCTION -- Table with info about available crafting recipes -- SOURCE RecipesTable: Table_Widget (5); -- **** -- ****iv* CUI4/CUI4.Modules_Indexes -- FUNCTION -- Indexes of the player ship modules -- SOURCE Recipes_Indexes: UnboundedString_Container.Vector; -- **** -- ****iv* CUI4/CUI4.Studies -- FUNCTION -- The list of available study recipes -- SOURCE Studies: UnboundedString_Container.Vector; -- **** -- ****iv* CUI4/CUI4.Deconstructs -- FUNCTION -- The list of available deconstruct recipes -- SOURCE Deconstructs: UnboundedString_Container.Vector; -- **** -- ****if* CUI4/CUI4.CheckTool -- FUNCTION -- Check if the player has needed tool for the crafting recipe -- PARAMETERS -- ToolNeeded - The type of tool needed for the recipe -- RESULT -- True if the tool is in the player ship cargo, otherwise False -- SOURCE function CheckTool(ToolNeeded: Unbounded_String) return Boolean is -- **** CargoIndex: Natural; Has_Tool: Boolean := True; begin if ToolNeeded /= To_Unbounded_String("None") then Has_Tool := False; Check_Tool_Loop : for I in Items_List.Iterate loop if Items_List(I).IType = ToolNeeded then CargoIndex := FindItem(Player_Ship.Cargo, Objects_Container.Key(I)); if CargoIndex > 0 then Has_Tool := True; exit Check_Tool_Loop; end if; end if; end loop Check_Tool_Loop; end if; return Has_Tool; end CheckTool; -- ****if* CUI4/CUI4.Is_Craftable -- FUNCTION -- Check if the selected recipe can be crafted (has all requirements meet) -- PARAMETERS -- Recipe - The crafting recipe to check -- CanCraft - If recipe can be crafted, then it will be True, otherwise -- False -- Has_Workplace - If there is workplace for the recipe, will be True, -- otherwise False -- Has_Tool - If there is available tool for the recipe, will be True, -- otherwise False -- Has_Materials - If there are available materials for the recipe, will be -- True, otherwise False -- OUTPUT -- Parameters CanCraft, Has_Workplace, Has_Tool and Has_Materials -- SOURCE procedure Is_Craftable (Recipe: Craft_Data; CanCraft, Has_Workplace, Has_Tool, Has_Materials: out Boolean) is -- **** CargoIndex: Natural; begin CanCraft := False; Has_Workplace := False; Find_Workshop_Loop : for Module of Player_Ship.Modules loop if Modules_List(Module.Proto_Index).MType = Recipe.Workplace and then Module.Durability > 0 then Has_Workplace := True; exit Find_Workshop_Loop; end if; end loop Find_Workshop_Loop; Has_Tool := CheckTool(Recipe.Tool); declare Materials: array (Recipe.MaterialTypes.First_Index .. Recipe.MaterialTypes.Last_Index) of Boolean := (others => False); begin Find_Materials_Loop : for K in Recipe.MaterialTypes.First_Index .. Recipe.MaterialTypes.Last_Index loop Find_Cargo_Index_Loop : for J in Items_List.Iterate loop if Items_List(J).IType = Recipe.MaterialTypes(K) then CargoIndex := FindItem(Player_Ship.Cargo, Objects_Container.Key(J)); if CargoIndex > 0 and then Player_Ship.Cargo(CargoIndex).Amount >= Recipe.MaterialAmounts(K) then Materials(K) := True; end if; end if; end loop Find_Cargo_Index_Loop; end loop Find_Materials_Loop; Has_Materials := True; Set_Can_Craft_Loop : for J in Materials'Range loop if not Materials(J) then Has_Materials := False; exit Set_Can_Craft_Loop; end if; end loop Set_Can_Craft_Loop; end; if Has_Tool and Has_Materials and Has_Workplace then CanCraft := True; end if; end Is_Craftable; -- ****if* CUI4/CUI4.Check_Study_Prerequisites -- FUNCTION -- Check if the study and decontruct recipes can be crafted -- PARAMETERS -- CanCraft - If recipe can be crafter then it will be True, otherwise -- False -- Has_Tool - If there is tool for the study and deconstruct recipes -- then True, otherwise False -- Has_Workplace - If there is workplace for study and deconstruct recipes -- then True, otherwise False -- OUTPUT -- Parameters CanCraft, Has_Tool and Has_Workplace -- SOURCE procedure Check_Study_Prerequisites (CanCraft, Has_Tool, Has_Workplace: out Boolean) is -- **** begin Has_Tool := CheckTool(Alchemy_Tools); CanCraft := False; Has_Workplace := False; Find_Alchemy_Lab_Loop : for Module of Player_Ship.Modules loop if Modules_List(Module.Proto_Index).MType = ALCHEMY_LAB and then Module.Durability > 0 then Has_Workplace := True; exit Find_Alchemy_Lab_Loop; end if; end loop Find_Alchemy_Lab_Loop; if Has_Workplace then CanCraft := True; end if; end Check_Study_Prerequisites; -- ****o* CUI4/CUI4.Show_Crafting_Command -- FUNCTION -- Show information about available crafting recipes -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ShowCrafting page recipename -- Page is the current page of recipes list to show, recipename is the -- text which will be searching in the recipes names. Can be empty, then -- show all recipes. -- SOURCE function Show_Crafting_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Crafting_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData); CraftsFrame: Ttk_Frame := Get_Widget(Main_Paned & ".craftframe", Interp); CraftsCanvas: constant Tk_Canvas := Get_Widget(CraftsFrame & ".canvas", Interp); CanCraft, Has_Tool, Has_Workplace, Has_Materials: Boolean := True; Recipe: Craft_Data; Page: constant Positive := (if Argc = 2 then Positive'Value(CArgv.Arg(Argv, 1)) else 1); Start_Row: constant Positive := ((Page - 1) * Game_Settings.Lists_Limit) + 1; Current_Row: Positive := 1; RecipeName: constant String := (if Argc = 3 then CArgv.Arg(Argv, 2) else ""); SearchEntry: constant Ttk_Entry := Get_Widget(CraftsCanvas & ".craft.sframe.search"); begin if Winfo_Get(CraftsCanvas, "exists") = "0" then Tcl_EvalFile (Get_Context, To_String(Data_Directory) & "ui" & Dir_Separator & "crafts.tcl"); Bind(CraftsFrame, "<Configure>", "{ResizeCanvas %W.canvas %w %h}"); elsif Winfo_Get(CraftsCanvas, "ismapped") = "1" and Argc = 1 then Entry_Configure(GameMenu, "Help", "-command {ShowHelp general}"); Tcl_Eval(Interp, "InvokeButton " & Close_Button); Tcl.Tk.Ada.Grid.Grid_Remove(Close_Button); return TCL_OK; end if; if RecipeName'Length = 0 then configure(SearchEntry, "-validatecommand {}"); Delete(SearchEntry, "0", "end"); configure(SearchEntry, "-validatecommand {ShowCrafting 1 %P}"); end if; Entry_Configure(GameMenu, "Help", "-command {ShowHelp crafts}"); Studies.Clear; Deconstructs.Clear; Find_Possible_Recipes_Loop : for Item of Player_Ship.Cargo loop Add_Recipes_Loop : for J in Recipes_List.Iterate loop if Recipes_List(J).ResultIndex = Item.ProtoIndex then if Known_Recipes.Find_Index(Item => Recipes_Container.Key(J)) = Positive_Container.No_Index and Studies.Find_Index(Item => Item.ProtoIndex) = Positive_Container.No_Index then Studies.Append(New_Item => Item.ProtoIndex); end if; if Recipes_List(J).MaterialAmounts(1) > 1 and Recipes_List(J).ResultAmount = 1 then Deconstructs.Append(New_Item => Item.ProtoIndex); end if; end if; end loop Add_Recipes_Loop; end loop Find_Possible_Recipes_Loop; if Recipes_Indexes.Length /= Known_Recipes.Length + Studies.Length + Deconstructs.Length then Recipes_Indexes.Clear; for I in Known_Recipes.Iterate loop Recipes_Indexes.Append(Known_Recipes(I)); end loop; for I in Studies.Iterate loop Recipes_Indexes.Append(Studies(I)); end loop; for I in Deconstructs.Iterate loop Recipes_Indexes.Append(Deconstructs(I)); end loop; end if; if RecipesTable.Row_Height = 1 then RecipesTable := CreateTable (CraftsCanvas & ".craft", (To_Unbounded_String("Name"), To_Unbounded_String("Craftable"), To_Unbounded_String("Workshop"), To_Unbounded_String("Tools"), To_Unbounded_String("Materials")), Get_Widget(CraftsFrame & ".scrolly"), "SortCrafting", "Press mouse button to sort the crafting recipes."); else ClearTable(RecipesTable); end if; Show_Recipes_Loop : for I in Recipes_Indexes.First_Index .. Recipes_Indexes.Last_Index loop exit Show_Recipes_Loop when I > Positive(Known_Recipes.Length); if RecipeName'Length > 0 and then Index (To_Lower (To_String (Items_List(Recipes_List(Recipes_Indexes(I)).ResultIndex) .Name)), To_Lower(RecipeName), 1) = 0 then goto End_Of_Loop; end if; if Current_Row < Start_Row then Current_Row := Current_Row + 1; goto End_Of_Loop; end if; Recipe := Recipes_List(Recipes_Indexes(I)); Is_Craftable (Recipe, CanCraft, Has_Workplace, Has_Tool, Has_Materials); AddButton (RecipesTable, To_String (Items_List(Recipes_List(Recipes_Indexes(I)).ResultIndex).Name), "Show available recipe's options", "ShowRecipeMenu {" & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), 1); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {" & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), CanCraft, 2); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {" & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Workplace, 3); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {" & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Tool, 4); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {" & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Materials, 5, True); exit Show_Recipes_Loop when RecipesTable.Row = Game_Settings.Lists_Limit + 1; <<End_Of_Loop>> end loop Show_Recipes_Loop; Check_Study_Prerequisites(CanCraft, Has_Tool, Has_Workplace); Set_Study_Recipes_Loop : for I in Positive(Known_Recipes.Length + 1) .. Recipes_Indexes.Last_Index loop exit Set_Study_Recipes_Loop when RecipesTable.Row = Game_Settings.Lists_Limit + 1 or I > Positive(Studies.Length); if RecipeName'Length > 0 and then Index (To_Lower ("Study " & To_String(Items_List(Recipes_Indexes(I)).Name)), To_Lower(RecipeName), 1) = 0 then goto End_Of_Study_Loop; end if; if Current_Row < Start_Row then Current_Row := Current_Row + 1; goto End_Of_Study_Loop; end if; AddButton (RecipesTable, "Study " & To_String(Items_List(Recipes_Indexes(I)).Name), "Show available recipe's options", "ShowRecipeMenu {Study " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), 1); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {Study " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), CanCraft, 2); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {Study " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Workplace, 3); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {Study " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Tool, 4, True); <<End_Of_Study_Loop>> end loop Set_Study_Recipes_Loop; Set_Deconstruct_Recipes_Loop : for I in Positive(Known_Recipes.Length + Studies.Length + 1) .. Recipes_Indexes.Last_Index loop exit Set_Deconstruct_Recipes_Loop when RecipesTable.Row = Game_Settings.Lists_Limit + 1; if RecipeName'Length > 0 and then Index (To_Lower ("Deconstruct " & To_String(Items_List(Recipes_Indexes(I)).Name)), To_Lower(RecipeName), 1) = 0 then goto End_Of_Deconstruct_Loop; end if; if Current_Row < Start_Row then Current_Row := Current_Row + 1; goto End_Of_Deconstruct_Loop; end if; AddButton (RecipesTable, "Decontruct " & To_String(Items_List(Recipes_Indexes(I)).Name), "Show available recipe's options", "ShowRecipeMenu {Deconstruct " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), 1); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {Deconstruct " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), CanCraft, 2); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {Deconstruct " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Workplace, 3); AddCheckButton (RecipesTable, "Show available recipe's options", "ShowRecipeMenu {Deconstruct " & To_String(Recipes_Indexes(I)) & "} " & Boolean'Image(CanCraft), Has_Tool, 4, True); <<End_Of_Deconstruct_Loop>> end loop Set_Deconstruct_Recipes_Loop; Tcl.Tk.Ada.Grid.Grid(Close_Button, "-row 0 -column 1"); if Page > 1 then if RecipesTable.Row < Game_Settings.Lists_Limit + 1 then AddPagination (RecipesTable, "ShowCrafting" & Positive'Image(Page - 1) & (if RecipeName'Length > 0 then " {" & RecipeName & "}" else ""), ""); else AddPagination (RecipesTable, "ShowCrafting" & Positive'Image(Page - 1) & (if RecipeName'Length > 0 then " {" & RecipeName & "}" else ""), "ShowCrafting" & Positive'Image(Page + 1) & (if RecipeName'Length > 0 then " {" & RecipeName & "}" else "")); end if; elsif RecipesTable.Row = Game_Settings.Lists_Limit + 1 then AddPagination (RecipesTable, "", "ShowCrafting" & Positive'Image(Page + 1) & (if RecipeName'Length > 0 then " {" & RecipeName & "}" else "")); end if; UpdateTable (RecipesTable, (if Focus = Widget_Image(SearchEntry) then False)); CraftsFrame.Name := New_String(Widget_Image(CraftsCanvas) & ".craft"); configure (CraftsCanvas, "-height [expr " & SashPos(Main_Paned, "0") & " - 20] -width " & cget(Main_Paned, "-width")); Tcl_Eval(Get_Context, "update"); Canvas_Create (CraftsCanvas, "window", "0 0 -anchor nw -window " & Widget_Image(CraftsFrame)); Tcl_Eval(Get_Context, "update"); configure (CraftsCanvas, "-scrollregion [list " & BBox(CraftsCanvas, "all") & "]"); Show_Screen("craftframe"); Tcl_SetResult(Interp, "1"); return TCL_OK; end Show_Crafting_Command; -- ****o* CUI4/CUI4.Show_Recipe_Menu_Command -- FUNCTION -- Show menu with available actions for the selected recipe -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ShowRecipeMenu index craftable -- Index is the index of the recipe to craft. If craftable is TRUE, -- then the recipe can be crafted, otherwise FALSE -- SOURCE function Show_Recipe_Menu_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Recipe_Menu_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Argc); RecipeMenu: Tk_Menu := Get_Widget(".recipemenu", Interp); begin if Winfo_Get(RecipeMenu, "exists") = "0" then RecipeMenu := Create(".recipemenu", "-tearoff false"); end if; Delete(RecipeMenu, "0", "end"); if CArgv.Arg(Argv, 2) = "TRUE" then Menu.Add (RecipeMenu, "command", "-label {Set crafting order} -command {ShowSetRecipe {" & CArgv.Arg(Argv, 1) & "}}"); end if; Menu.Add (RecipeMenu, "command", "-label {Show more info about the recipe} -command {ShowRecipeInfo {" & CArgv.Arg(Argv, 1) & "} " & CArgv.Arg(Argv, 2) & "}"); Tk_Popup (RecipeMenu, Winfo_Get(Get_Main_Window(Interp), "pointerx"), Winfo_Get(Get_Main_Window(Interp), "pointery")); return TCL_OK; end Show_Recipe_Menu_Command; -- ****o* CUI4/CUI4.Show_Set_Recipe_Command -- FUNCTION -- Show dialog to set the selected recipe as crafting order -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. Unused -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- SetRecipe index -- Index is the index of the recipe to craft. -- SOURCE function Show_Set_Recipe_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Set_Recipe_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Interp, Argc); MType: ModuleType; ModulesList: Unbounded_String; RecipeIndex: constant Unbounded_String := To_Unbounded_String(CArgv.Arg(Argv, 1)); RecipeLength: constant Positive := Length(RecipeIndex); RecipeType: constant String := (if RecipeLength > 6 and then Slice(RecipeIndex, 1, 5) = "Study" then "Study" elsif RecipeLength > 6 and then Slice(RecipeIndex, 1, 5) = "Decon" then "Deconstruct" else "Craft"); CraftDialog: constant Ttk_Frame := Create_Dialog (".craftdialog", (if RecipeType = "Study" then "Study " & To_String (Items_List(Unbounded_Slice(RecipeIndex, 7, RecipeLength)) .Name) elsif RecipeType = "Deconstruct" then "Deconstruct " & To_String (Items_List(Unbounded_Slice(RecipeIndex, 13, RecipeLength)) .Name) else "Craft " & To_String (Items_List(Recipes_List(RecipeIndex).ResultIndex).Name)), 275, 2); MaxAmount: constant Positive := CheckRecipe(RecipeIndex); Label: Ttk_Label := Create(CraftDialog & ".amountlabel", "-text {Amount:}"); ModulesBox: constant Ttk_ComboBox := Create(CraftDialog & ".workshop", "-state readonly"); AmountBox: constant Ttk_SpinBox := Create (CraftDialog & ".amount", "-to" & Positive'Image(MaxAmount) & " -validatecommand {ValidateSpinbox %W %P} -width 20"); Button: Ttk_Button := Create (CraftDialog & ".maxamount", "-text {max" & Positive'Image(MaxAmount) & "} -command {" & AmountBox & " set" & Positive'Image(MaxAmount) & "}"); ButtonRow: Positive := 1; begin Set(AmountBox, "1"); if RecipeType /= "Study" then if MaxAmount > 1 then Tcl.Tk.Ada.Grid.Grid(Label); Tcl.Tk.Ada.Grid.Grid(Button, "-row 1 -column 1 -padx {0 5}"); else Tcl.Tk.Ada.Grid.Grid(Label, "-columnspan 2"); end if; Tcl.Tk.Ada.Grid.Grid(AmountBox, "-columnspan 2 -padx 5"); ButtonRow := ButtonRow + 2; end if; if RecipeType in "Study" | "Deconstruct" then MType := ALCHEMY_LAB; else MType := Recipes_List(RecipeIndex).Workplace; end if; Show_Workshops_List_Loop : for Module of Player_Ship.Modules loop if Modules_List(Module.Proto_Index).MType = MType then Append(ModulesList, " {" & Module.Name & "}"); end if; end loop Show_Workshops_List_Loop; configure(ModulesBox, "-values [list" & To_String(ModulesList) & "]"); Current(ModulesBox, "0"); if RecipeType = "Craft" then Label := Create(CraftDialog & ".workshoplabel", "-text {Wokshop:}"); Tcl.Tk.Ada.Grid.Grid(Label, "-columnspan 2 -padx 5"); Tcl.Tk.Ada.Grid.Grid(ModulesBox, "-columnspan 2 -padx 5"); ButtonRow := ButtonRow + 2; end if; Button := Create (CraftDialog & ".craft", "-text {Craft} -command {SetCrafting {" & CArgv.Arg(Argv, 1) & "};CloseDialog " & CraftDialog & "}"); Tcl.Tk.Ada.Grid.Grid(Button, "-pady 5 -padx 5"); Button := Create (CraftDialog & ".cancel", "-text {Cancel} -command {CloseDialog " & CraftDialog & "}"); Tcl.Tk.Ada.Grid.Grid (Button, "-pady 5 -padx 5 -column 1 -row" & Positive'Image(ButtonRow)); Show_Dialog(CraftDialog); return TCL_OK; end Show_Set_Recipe_Command; -- ****o* CUI4/CUI4.Show_Recipe_Info_Command -- FUNCTION -- Show information about the selected recipe -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- ShowRecipeInfo index cancraft -- Index is the index of the crafting recipe to show, cancraft if TRUE -- then recipe can be crafted (show craft button) -- SOURCE function Show_Recipe_Info_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Show_Recipe_Info_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Argc); use Tiny_String; RecipeIndex: constant Unbounded_String := To_Unbounded_String(CArgv.Arg(Argv, 1)); RecipeDialog: constant Ttk_Frame := Create_Dialog(".recipedialog", "Recipe info"); WorkplaceName: Unbounded_String := Null_Unbounded_String; Recipe: Craft_Data; MAmount, CargoIndex: Natural := 0; HaveWorkplace, IsMaterial: Boolean := True; HaveTool: Boolean := False; TextLength: Positive; RecipeText: constant Tk_Text := Create (RecipeDialog & ".text", "-wrap char -height 15 -width 40", Interp); begin Tag_Configure(RecipeText, "red", "-foreground red"); if Length(RecipeIndex) > 6 and then Slice(RecipeIndex, 1, 5) = "Study" then Recipe.MaterialTypes.Append (New_Item => Items_List(Unbounded_Slice(RecipeIndex, 7, Length(RecipeIndex))) .IType); Recipe.ResultIndex := Unbounded_Slice(RecipeIndex, 7, Length(RecipeIndex)); Recipe.MaterialAmounts.Append(New_Item => 1); Recipe.ResultAmount := 0; Recipe.Workplace := ALCHEMY_LAB; Set_Study_Recipe_Loop : for ProtoRecipe of Recipes_List loop if ProtoRecipe.ResultIndex = Recipe.ResultIndex then Recipe.Skill := ProtoRecipe.Skill; Recipe.Time := ProtoRecipe.Difficulty * 15; exit Set_Study_Recipe_Loop; end if; end loop Set_Study_Recipe_Loop; Recipe.Difficulty := 1; Recipe.Tool := Alchemy_Tools; Recipe.ToolQuality := 100; elsif Length(RecipeIndex) > 12 and then Slice(RecipeIndex, 1, 11) = "Deconstruct" then Recipe.MaterialTypes.Append (New_Item => Items_List(Unbounded_Slice(RecipeIndex, 13, Length(RecipeIndex))) .IType); Recipe.ResultIndex := Unbounded_Slice(RecipeIndex, 13, Length(RecipeIndex)); Recipe.MaterialAmounts.Append(New_Item => 1); Recipe.ResultAmount := 0; Recipe.Workplace := ALCHEMY_LAB; Set_Deconstruct_Recipe_Loop : for ProtoRecipe of Recipes_List loop if ProtoRecipe.ResultIndex = Recipe.ResultIndex then Recipe.Skill := ProtoRecipe.Skill; Recipe.Time := ProtoRecipe.Difficulty * 15; Recipe.Difficulty := ProtoRecipe.Difficulty; Recipe.ResultIndex := FindProtoItem(ProtoRecipe.MaterialTypes(1)); Recipe.ResultAmount := Positive (Float'Ceiling (Float(ProtoRecipe.MaterialAmounts.Element(1)) * 0.8)); exit Set_Deconstruct_Recipe_Loop; end if; end loop Set_Deconstruct_Recipe_Loop; Recipe.Tool := Alchemy_Tools; Recipe.ToolQuality := 100; else Recipe := Recipes_List(RecipeIndex); Insert (RecipeText, "end", "{Amount:" & Integer'Image(Recipe.ResultAmount) & LF & "}"); end if; Insert(RecipeText, "end", "{Materials needed: }"); Check_Materials_Loop : for I in Recipe.MaterialTypes.First_Index .. Recipe.MaterialTypes.Last_Index loop Insert(RecipeText, "end", "{" & LF & "-}"); MAmount := 0; Find_Materials_Loop : for J in Items_List.Iterate loop IsMaterial := False; if Length(RecipeIndex) > 6 and then Slice(RecipeIndex, 1, 5) = "Study" then if Items_List(J).Name = Items_List(Recipe.ResultIndex).Name then IsMaterial := True; end if; elsif Length(RecipeIndex) > 12 and then Slice(RecipeIndex, 1, 11) = "Deconstruct" then if Objects_Container.Key(J) = Unbounded_Slice(RecipeIndex, 13, Length(RecipeIndex)) then IsMaterial := True; end if; else if Items_List(J).IType = Recipe.MaterialTypes(I) then IsMaterial := True; end if; end if; if IsMaterial then if MAmount > 0 then Insert(RecipeText, "end", "{ or}"); end if; CargoIndex := FindItem(Player_Ship.Cargo, Objects_Container.Key(J)); if CargoIndex > 0 and then Player_Ship.Cargo(CargoIndex).Amount >= Recipe.MaterialAmounts(I) then TextLength := Positive'Image(Player_Ship.Cargo(CargoIndex).Amount)' Length; Insert (RecipeText, "end", "{" & Integer'Image(Recipe.MaterialAmounts(I)) & "x" & To_String(Items_List(J).Name) & "(owned: " & Positive'Image(Player_Ship.Cargo(CargoIndex).Amount) (2 .. TextLength) & ")}"); else Insert (RecipeText, "end", "{" & Integer'Image(Recipe.MaterialAmounts(I)) & "x" & To_String(Items_List(J).Name) & "} [list red]"); end if; MAmount := MAmount + 1; end if; end loop Find_Materials_Loop; end loop Check_Materials_Loop; if Recipe.Tool /= To_Unbounded_String("None") then Insert(RecipeText, "end", "{" & LF & "Tool: }"); MAmount := 0; Check_Tool_Loop : for I in Items_List.Iterate loop HaveTool := False; if Items_List(I).IType = Recipe.Tool and then (Items_List(I).Value.Length > 0 and then Items_List(I).Value(1) <= Recipe.ToolQuality) then if MAmount > 0 then Insert(RecipeText, "end", "{ or }"); end if; CargoIndex := FindItem (Inventory => Player_Ship.Cargo, ProtoIndex => Objects_Container.Key(I), Quality => Recipe.ToolQuality); if CargoIndex > 0 then HaveTool := True; end if; Insert (RecipeText, "end", "{" & To_String(Items_List(I).Name) & "}" & (if not HaveTool then " [list red]" else "")); MAmount := MAmount + 1; end if; end loop Check_Tool_Loop; else HaveTool := True; end if; Insert(RecipeText, "end", "{" & LF & "Workplace: }"); HaveWorkplace := False; Have_Workplace_Loop : for Module of Player_Ship.Modules loop if Modules_List(Module.Proto_Index).MType = Recipe.Workplace then WorkplaceName := Module.Name; if Module.Durability > 0 then HaveWorkplace := True; exit Have_Workplace_Loop; end if; end if; end loop Have_Workplace_Loop; if WorkplaceName = Null_Unbounded_String then Find_Workshop_Name_Loop : for I in Modules_List.Iterate loop if Modules_List(I).MType = Recipe.Workplace then WorkplaceName := To_Unbounded_String (GetModuleType(BaseModules_Container.Key(I))); exit Find_Workshop_Name_Loop; end if; end loop Find_Workshop_Name_Loop; end if; Insert (RecipeText, "end", "{" & To_String(WorkplaceName) & "}" & (if not HaveWorkplace then " [list red]" else "")); Insert (RecipeText, "end", "{" & LF & "Skill: " & To_String (SkillsData_Container.Element(Skills_List, Recipe.Skill).Name) & "/" & To_String (AttributesData_Container.Element (Attributes_List, SkillsData_Container.Element(Skills_List, Recipe.Skill) .Attribute) .Name) & LF & "Time needed:" & Positive'Image(Recipe.Time) & " minutes}"); configure(RecipeText, "-state disabled"); Tcl.Tk.Ada.Grid.Grid(RecipeText, "-padx 5"); if CArgv.Arg(Argv, 2) = "TRUE" then declare ButtonBox: constant Ttk_Frame := Create(RecipeDialog & ".buttons"); Button: Ttk_Button; begin Button := Create (ButtonBox & ".craft", "-text Craft -command {ShowSetRecipe {" & CArgv.Arg(Argv, 1) & "};CloseDialog " & RecipeDialog & "}"); Tcl.Tk.Ada.Grid.Grid(Button); Button := Create (ButtonBox & ".close", "-text Close -command {CloseDialog " & RecipeDialog & "}"); Tcl.Tk.Ada.Grid.Grid(Button, "-row 0 -column 1 -padx {5 0}"); Focus(Button); Bind(Button, "<Tab>", "{focus " & ButtonBox & ".craft;break}"); Bind(Button, "<Escape>", "{" & Button & " invoke;break}"); Tcl.Tk.Ada.Grid.Grid(ButtonBox, "-pady 5"); end; else Add_Close_Button (RecipeDialog & ".close", "Close", "CloseDialog " & RecipeDialog); end if; Show_Dialog (Dialog => RecipeDialog, Relative_X => 0.2, Relative_Y => 0.1); return TCL_OK; end Show_Recipe_Info_Command; -- ****o* CUI4/CUI4.Set_Crafting_Command -- FUNCTION -- Set the selected recipe as a crafting order in the selected workshop -- PARAMETERS -- ClientData - Custom data send to the command. Unused -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. Unused -- RESULT -- This function always return TCL_OK -- COMMANDS -- SetCrafting index -- Index is the index of the crafting recipe to set -- SOURCE function Set_Crafting_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Set_Crafting_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(ClientData, Argc); RecipeIndex: Unbounded_String := To_Unbounded_String(CArgv.Arg(Argv, 1)); ModulesBox: constant Ttk_ComboBox := Get_Widget(".craftdialog.workshop"); AmountBox: constant Ttk_SpinBox := Get_Widget(".craftdialog.amount", Interp); begin if Element(RecipeIndex, 1) = '{' then RecipeIndex := Unbounded_Slice(RecipeIndex, 2, Length(RecipeIndex) - 1); end if; Set_Module_Loop : for I in Player_Ship.Modules.Iterate loop if Player_Ship.Modules(I).Name = To_Unbounded_String(Get(ModulesBox)) then SetRecipe (Modules_Container.To_Index(I), Positive'Value(Get(AmountBox)), RecipeIndex); Update_Messages; exit Set_Module_Loop; end if; end loop Set_Module_Loop; return TCL_OK; end Set_Crafting_Command; -- ****it* CUI4/CUI4.Recipes_Sort_Orders -- FUNCTION -- Sorting orders for the crafting recipes list -- OPTIONS -- NAMEASC - Sort recipes by name ascending -- NAMEDESC - Sort recipes by name descending -- CRAFTABLEASC - Sort recipes by craftable ascending -- CRAFTABLEDESC - Sort recipes by craftable descending -- WORKPLACEASC - Sort recipes by workshop state ascending -- WORKPLACEDESC - Sort recipes by workshop state descending -- TOOLSASC - Sort recipes by available tool ascending -- TOOLSDESC - Sort recipes by available tool descending -- MATERIALSASC - Sort recipes by available materials ascending -- MATERIALSDESC - Sort recipes by available materials descending -- NONE - No sorting recipes (default) -- HISTORY -- 6.5 - Added -- SOURCE type Recipes_Sort_Orders is (NAMEASC, NAMEDESC, CRAFTABLEASC, CRAFTABLEDESC, WORKPLACEASC, WORKPLACEDESC, TOOLSASC, TOOLSDESC, MATERIALSASC, MATERIALSDESC, NONE) with Default_Value => NONE; -- **** -- ****id* CUI4/CUI4.Default_Recipes_Sort_Order -- FUNCTION -- Default sorting order for the crafting recipes -- HISTORY -- 6.5 - Added -- SOURCE Default_Recipes_Sort_Order: constant Recipes_Sort_Orders := NONE; -- **** -- ****iv* CUI4/CUI4.Recipes_Sort_Order -- FUNCTION -- The current sorting order for crafting recipes list -- HISTORY -- 6.5 - Added -- SOURCE Recipes_Sort_Order: Recipes_Sort_Orders := Default_Recipes_Sort_Order; -- **** -- ****o* CUI4/CUI4.Sort_Crafting_Command -- FUNCTION -- Sort the list of crafting recipes -- PARAMETERS -- ClientData - Custom data send to the command. -- Interp - Tcl interpreter in which command was executed. -- Argc - Number of arguments passed to the command. Unused -- Argv - Values of arguments passed to the command. -- RESULT -- This function always return TCL_OK -- COMMANDS -- SortCrafting x -- X is X axis coordinate where the player clicked the mouse button -- SOURCE function Sort_Crafting_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with Convention => C; -- **** function Sort_Crafting_Command (ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int; Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is pragma Unreferenced(Argc); Column: constant Positive := Get_Column_Number(RecipesTable, Natural'Value(CArgv.Arg(Argv, 1))); type Local_Module_Data is record Name: Unbounded_String; Craftable: Boolean; Workplace: Boolean; Tool: Boolean; Materials: Boolean; Id: Unbounded_String; end record; type Recipes_Array is array(Positive range <>) of Local_Module_Data; Can_Craft, Has_Tool, Has_Materials, Has_Workplace: Boolean; function "<"(Left, Right: Local_Module_Data) return Boolean is begin if Recipes_Sort_Order = NAMEASC and then Left.Name < Right.Name then return True; end if; if Recipes_Sort_Order = NAMEDESC and then Left.Name > Right.Name then return True; end if; if Recipes_Sort_Order = CRAFTABLEASC and then Left.Craftable < Right.Craftable then return True; end if; if Recipes_Sort_Order = CRAFTABLEDESC and then Left.Craftable > Right.Craftable then return True; end if; if Recipes_Sort_Order = WORKPLACEASC and then Left.Workplace < Right.Workplace then return True; end if; if Recipes_Sort_Order = WORKPLACEDESC and then Left.Workplace > Right.Workplace then return True; end if; if Recipes_Sort_Order = TOOLSASC and then Left.Tool < Right.Tool then return True; end if; if Recipes_Sort_Order = TOOLSDESC and then Left.Tool > Right.Tool then return True; end if; if Recipes_Sort_Order = MATERIALSASC and then Left.Materials < Right.Materials then return True; end if; if Recipes_Sort_Order = MATERIALSDESC and then Left.Materials > Right.Materials then return True; end if; return False; end "<"; begin case Column is when 1 => if Recipes_Sort_Order = NAMEASC then Recipes_Sort_Order := NAMEDESC; else Recipes_Sort_Order := NAMEASC; end if; when 2 => if Recipes_Sort_Order = CRAFTABLEASC then Recipes_Sort_Order := CRAFTABLEDESC; else Recipes_Sort_Order := CRAFTABLEASC; end if; when 3 => if Recipes_Sort_Order = WORKPLACEASC then Recipes_Sort_Order := WORKPLACEDESC; else Recipes_Sort_Order := WORKPLACEASC; end if; when 4 => if Recipes_Sort_Order = TOOLSASC then Recipes_Sort_Order := TOOLSDESC; else Recipes_Sort_Order := TOOLSASC; end if; when 5 => if Recipes_Sort_Order = MATERIALSASC then Recipes_Sort_Order := MATERIALSDESC; else Recipes_Sort_Order := MATERIALSASC; end if; when others => null; end case; if Recipes_Sort_Order = NONE then return TCL_OK; end if; Sort_Known_Recipes_Block : declare Local_Recipes: Recipes_Array(1 .. Positive(Known_Recipes.Length)); procedure Sort_Recipes is new Ada.Containers.Generic_Array_Sort (Index_Type => Positive, Element_Type => Local_Module_Data, Array_Type => Recipes_Array); begin for I in Known_Recipes.Iterate loop Is_Craftable (Recipes_List(Known_Recipes(I)), Can_Craft, Has_Workplace, Has_Tool, Has_Materials); Local_Recipes(UnboundedString_Container.To_Index(I)) := (Name => Items_List(Recipes_List(Known_Recipes(I)).ResultIndex).Name, Craftable => Can_Craft, Workplace => Has_Workplace, Tool => Has_Tool, Materials => Has_Materials, Id => Known_Recipes(I)); end loop; Sort_Recipes(Local_Recipes); Recipes_Indexes.Clear; for Recipe of Local_Recipes loop Recipes_Indexes.Append(Recipe.Id); end loop; end Sort_Known_Recipes_Block; Check_Study_Prerequisites(Can_Craft, Has_Tool, Has_Workplace); Sort_Studying_Recipes_Block : declare Local_Recipes: Recipes_Array(1 .. Positive(Studies.Length)); procedure Sort_Recipes is new Ada.Containers.Generic_Array_Sort (Index_Type => Positive, Element_Type => Local_Module_Data, Array_Type => Recipes_Array); begin for I in Studies.Iterate loop Local_Recipes(UnboundedString_Container.To_Index(I)) := (Name => Items_List(Studies(I)).Name, Craftable => Can_Craft, Tool => Has_Tool, Workplace => Has_Workplace, Materials => True, Id => Studies(I)); end loop; Sort_Recipes(Local_Recipes); for Recipe of Local_Recipes loop Recipes_Indexes.Append(Recipe.Id); end loop; end Sort_Studying_Recipes_Block; Sort_Deconstruct_Recipes_Block : declare Local_Recipes: Recipes_Array(1 .. Positive(Deconstructs.Length)); procedure Sort_Recipes is new Ada.Containers.Generic_Array_Sort (Index_Type => Positive, Element_Type => Local_Module_Data, Array_Type => Recipes_Array); begin for I in Deconstructs.Iterate loop Local_Recipes(UnboundedString_Container.To_Index(I)) := (Name => Items_List(Deconstructs(I)).Name, Craftable => Can_Craft, Workplace => Has_Workplace, Tool => Has_Tool, Materials => True, Id => Deconstructs(I)); end loop; Sort_Recipes(Local_Recipes); for Recipe of Local_Recipes loop Recipes_Indexes.Append(Recipe.Id); end loop; end Sort_Deconstruct_Recipes_Block; return Show_Crafting_Command (ClientData, Interp, 2, CArgv.Empty & "ShowCrafting" & "1"); end Sort_Crafting_Command; procedure AddCommands is begin Add_Command("ShowCrafting", Show_Crafting_Command'Access); Add_Command("ShowRecipeMenu", Show_Recipe_Menu_Command'Access); Add_Command("ShowSetRecipe", Show_Set_Recipe_Command'Access); Add_Command("ShowRecipeInfo", Show_Recipe_Info_Command'Access); Add_Command("SetCrafting", Set_Crafting_Command'Access); Add_Command("SortCrafting", Sort_Crafting_Command'Access); end AddCommands; end Crafts.UI;
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo.Handler -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998-2003,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.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ 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; generic with function My_Driver (Men : Menu; K : Key_Code; Pan : Panel) return Boolean; package Sample.Menu_Demo.Handler is procedure Drive_Me (M : Menu; Lin : Line_Position; Col : Column_Position; Title : String := ""); -- Position the menu at the given point and drive it. procedure Drive_Me (M : Menu; Title : String := ""); -- Center menu and drive it. end Sample.Menu_Demo.Handler;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . W I D E _ T E X T _ I O . E N U M E R A T I O N _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-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. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Text_IO.Enumeration_Aux; package body Ada.Wide_Text_IO.Enumeration_IO is package Aux renames Ada.Wide_Text_IO.Enumeration_Aux; --------- -- Get -- --------- procedure Get (File : File_Type; Item : out Enum) is Buf : Wide_String (1 .. Enum'Width); Buflen : Natural; begin Aux.Get_Enum_Lit (File, Buf, Buflen); Item := Enum'Wide_Value (Buf (1 .. Buflen)); exception when Constraint_Error => raise Data_Error; end Get; procedure Get (Item : out Enum) is begin Get (Current_Input, Item); end Get; procedure Get (From : Wide_String; Item : out Enum; Last : out Positive) is Start : Natural; begin Aux.Scan_Enum_Lit (From, Start, Last); Item := Enum'Wide_Value (From (Start .. Last)); exception when Constraint_Error => raise Data_Error; end Get; --------- -- Put -- --------- procedure Put (File : File_Type; Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is Image : constant Wide_String := Enum'Wide_Image (Item); begin Aux.Put (File, Image, Width, Set); end Put; procedure Put (Item : Enum; Width : Field := Default_Width; Set : Type_Set := Default_Setting) is begin Put (Current_Output, Item, Width, Set); end Put; procedure Put (To : out Wide_String; Item : Enum; Set : Type_Set := Default_Setting) is Image : constant Wide_String := Enum'Wide_Image (Item); begin Aux.Puts (To, Image, Set); end Put; end Ada.Wide_Text_IO.Enumeration_IO;
------------------------------------------------------------------------------- -- package Disorderly.Random.Clock_Entropy, Random Number Initialization -- Copyright (C) 1995-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 Disorderly.Random.Clock_Entropy -- -- Clock provides a few bits of entropy to help find a unique initial seed. -- -- Calendar.Clock is used here by procedure Reset to help choose the initial -- State, S, for calls to the random number generator, Get_Random. -- -- Want Disorderly.Random to be Pure and thread-safe, but -- Package Calendar is not pure. That is why the Calendar based -- Reset is placed here, a child package of Disorderly.Random. package Disorderly.Random.Clock_Entropy is procedure Reset (S : out State); -- procedure Reset_with_Calendar initializes State S. -- It calls Calendar (along with 2 calls to the delay statement) in -- an attempt to get a unique State each time Reset is called. -- -- All we need is 1 bit of difference between the outputs of two -- successive calls to Ada.Calendar.Clock, and the two 256 bit -- states generated by the successive calls will have no apparent -- similarities. (Not remotely good enough for cryptography, but -- very useful for Monte-Carlo applications.) end Disorderly.Random.Clock_Entropy;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C H 6 -- -- -- -- 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 Checks; use Checks; with Contracts; use Contracts; with Debug; use Debug; with Einfo; use Einfo; with Errout; use Errout; with Elists; use Elists; with Exp_Aggr; use Exp_Aggr; with Exp_Atag; use Exp_Atag; with Exp_Ch2; use Exp_Ch2; with Exp_Ch3; use Exp_Ch3; with Exp_Ch7; use Exp_Ch7; with Exp_Ch9; use Exp_Ch9; with Exp_Dbug; use Exp_Dbug; with Exp_Disp; use Exp_Disp; with Exp_Dist; use Exp_Dist; with Exp_Intr; use Exp_Intr; with Exp_Pakd; use Exp_Pakd; with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Freeze; use Freeze; with Inline; use Inline; with Lib; use Lib; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; with Restrict; use Restrict; with Rident; use Rident; with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Ch6; use Sem_Ch6; with Sem_Ch8; use Sem_Ch8; with Sem_Ch12; use Sem_Ch12; with Sem_Ch13; use Sem_Ch13; with Sem_Dim; use Sem_Dim; with Sem_Disp; use Sem_Disp; with Sem_Dist; use Sem_Dist; with Sem_Eval; use Sem_Eval; with Sem_Mech; use Sem_Mech; with Sem_Res; use Sem_Res; with Sem_SCIL; use Sem_SCIL; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Snames; use Snames; with Stand; use Stand; with Targparm; use Targparm; with Tbuild; use Tbuild; with Uintp; use Uintp; with Validsw; use Validsw; package body Exp_Ch6 is ----------------------- -- Local Subprograms -- ----------------------- procedure Add_Access_Actual_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; Return_Object : Node_Id; Is_Access : Boolean := False); -- Ada 2005 (AI-318-02): Apply the Unrestricted_Access attribute to the -- object name given by Return_Object and add the attribute to the end of -- the actual parameter list associated with the build-in-place function -- call denoted by Function_Call. However, if Is_Access is True, then -- Return_Object is already an access expression, in which case it's passed -- along directly to the build-in-place function. Finally, if Return_Object -- is empty, then pass a null literal as the actual. procedure Add_Unconstrained_Actuals_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; Alloc_Form : BIP_Allocation_Form := Unspecified; Alloc_Form_Exp : Node_Id := Empty; Pool_Actual : Node_Id := Make_Null (No_Location)); -- Ada 2005 (AI-318-02): Add the actuals needed for a build-in-place -- function call that returns a caller-unknown-size result (BIP_Alloc_Form -- and BIP_Storage_Pool). If Alloc_Form_Exp is present, then use it, -- otherwise pass a literal corresponding to the Alloc_Form parameter -- (which must not be Unspecified in that case). Pool_Actual is the -- parameter to pass to BIP_Storage_Pool. procedure Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call : Node_Id; Func_Id : Entity_Id; Ptr_Typ : Entity_Id := Empty; Master_Exp : Node_Id := Empty); -- Ada 2005 (AI-318-02): If the result type of a build-in-place call needs -- finalization actions, add an actual parameter which is a pointer to the -- finalization master of the caller. If Master_Exp is not Empty, then that -- will be passed as the actual. Otherwise, if Ptr_Typ is left Empty, this -- will result in an automatic "null" value for the actual. procedure Add_Task_Actuals_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; Master_Actual : Node_Id; Chain : Node_Id := Empty); -- Ada 2005 (AI-318-02): For a build-in-place call, if the result type -- contains tasks, add two actual parameters: the master, and a pointer to -- the caller's activation chain. Master_Actual is the actual parameter -- expression to pass for the master. In most cases, this is the current -- master (_master). The two exceptions are: If the function call is the -- initialization expression for an allocator, we pass the master of the -- access type. If the function call is the initialization expression for a -- return object, we pass along the master passed in by the caller. In most -- contexts, the activation chain to pass is the local one, which is -- indicated by No (Chain). However, in an allocator, the caller passes in -- the activation Chain. Note: Master_Actual can be Empty, but only if -- there are no tasks. procedure Check_Overriding_Operation (Subp : Entity_Id); -- Subp is a dispatching operation. Check whether it may override an -- inherited private operation, in which case its DT entry is that of -- the hidden operation, not the one it may have received earlier. -- This must be done before emitting the code to set the corresponding -- DT to the address of the subprogram. The actual placement of Subp in -- the proper place in the list of primitive operations is done in -- Declare_Inherited_Private_Subprograms, which also has to deal with -- implicit operations. This duplication is unavoidable for now??? procedure Detect_Infinite_Recursion (N : Node_Id; Spec : Entity_Id); -- This procedure is called only if the subprogram body N, whose spec -- has the given entity Spec, contains a parameterless recursive call. -- It attempts to generate runtime code to detect if this a case of -- infinite recursion. -- -- The body is scanned to determine dependencies. If the only external -- dependencies are on a small set of scalar variables, then the values -- of these variables are captured on entry to the subprogram, and if -- the values are not changed for the call, we know immediately that -- we have an infinite recursion. procedure Expand_Actuals (N : in out Node_Id; Subp : Entity_Id); -- For each actual of an in-out or out parameter which is a numeric -- (view) conversion of the form T (A), where A denotes a variable, -- we insert the declaration: -- -- Temp : T[ := T (A)]; -- -- prior to the call. Then we replace the actual with a reference to Temp, -- and append the assignment: -- -- A := TypeA (Temp); -- -- after the call. Here TypeA is the actual type of variable A. For out -- parameters, the initial declaration has no expression. If A is not an -- entity name, we generate instead: -- -- Var : TypeA renames A; -- Temp : T := Var; -- omitting expression for out parameter. -- ... -- Var := TypeA (Temp); -- -- For other in-out parameters, we emit the required constraint checks -- before and/or after the call. -- -- For all parameter modes, actuals that denote components and slices of -- packed arrays are expanded into suitable temporaries. -- -- For non-scalar objects that are possibly unaligned, add call by copy -- code (copy in for IN and IN OUT, copy out for OUT and IN OUT). -- -- For OUT and IN OUT parameters, add predicate checks after the call -- based on the predicates of the actual type. -- -- The parameter N is IN OUT because in some cases, the expansion code -- rewrites the call as an expression actions with the call inside. In -- this case N is reset to point to the inside call so that the caller -- can continue processing of this call. procedure Expand_Ctrl_Function_Call (N : Node_Id); -- N is a function call which returns a controlled object. Transform the -- call into a temporary which retrieves the returned object from the -- secondary stack using 'reference. procedure Expand_Non_Function_Return (N : Node_Id); -- Expand a simple return statement found in a procedure body, entry body, -- accept statement, or an extended return statement. Note that all non- -- function returns are simple return statements. function Expand_Protected_Object_Reference (N : Node_Id; Scop : Entity_Id) return Node_Id; procedure Expand_Protected_Subprogram_Call (N : Node_Id; Subp : Entity_Id; Scop : Entity_Id); -- A call to a protected subprogram within the protected object may appear -- as a regular call. The list of actuals must be expanded to contain a -- reference to the object itself, and the call becomes a call to the -- corresponding protected subprogram. procedure Expand_Simple_Function_Return (N : Node_Id); -- Expand simple return from function. In the case where we are returning -- from a function body this is called by Expand_N_Simple_Return_Statement. function Has_Unconstrained_Access_Discriminants (Subtyp : Entity_Id) return Boolean; -- Returns True if the given subtype is unconstrained and has one or more -- access discriminants. procedure Rewrite_Function_Call_For_C (N : Node_Id); -- When generating C code, replace a call to a function that returns an -- array into the generated procedure with an additional out parameter. procedure Set_Enclosing_Sec_Stack_Return (N : Node_Id); -- N is a return statement for a function that returns its result on the -- secondary stack. This sets the Sec_Stack_Needed_For_Return flag on the -- function and all blocks and loops that the return statement is jumping -- out of. This ensures that the secondary stack is not released; otherwise -- the function result would be reclaimed before returning to the caller. ---------------------------------------------- -- Add_Access_Actual_To_Build_In_Place_Call -- ---------------------------------------------- procedure Add_Access_Actual_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; Return_Object : Node_Id; Is_Access : Boolean := False) is Loc : constant Source_Ptr := Sloc (Function_Call); Obj_Address : Node_Id; Obj_Acc_Formal : Entity_Id; begin -- Locate the implicit access parameter in the called function Obj_Acc_Formal := Build_In_Place_Formal (Function_Id, BIP_Object_Access); -- If no return object is provided, then pass null if not Present (Return_Object) then Obj_Address := Make_Null (Loc); Set_Parent (Obj_Address, Function_Call); -- If Return_Object is already an expression of an access type, then use -- it directly, since it must be an access value denoting the return -- object, and couldn't possibly be the return object itself. elsif Is_Access then Obj_Address := Return_Object; Set_Parent (Obj_Address, Function_Call); -- Apply Unrestricted_Access to caller's return object else Obj_Address := Make_Attribute_Reference (Loc, Prefix => Return_Object, Attribute_Name => Name_Unrestricted_Access); Set_Parent (Return_Object, Obj_Address); Set_Parent (Obj_Address, Function_Call); end if; Analyze_And_Resolve (Obj_Address, Etype (Obj_Acc_Formal)); -- Build the parameter association for the new actual and add it to the -- end of the function's actuals. Add_Extra_Actual_To_Call (Function_Call, Obj_Acc_Formal, Obj_Address); end Add_Access_Actual_To_Build_In_Place_Call; ------------------------------------------------------ -- Add_Unconstrained_Actuals_To_Build_In_Place_Call -- ------------------------------------------------------ procedure Add_Unconstrained_Actuals_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; Alloc_Form : BIP_Allocation_Form := Unspecified; Alloc_Form_Exp : Node_Id := Empty; Pool_Actual : Node_Id := Make_Null (No_Location)) is Loc : constant Source_Ptr := Sloc (Function_Call); Alloc_Form_Actual : Node_Id; Alloc_Form_Formal : Node_Id; Pool_Formal : Node_Id; begin -- The allocation form generally doesn't need to be passed in the case -- of a constrained result subtype, since normally the caller performs -- the allocation in that case. However this formal is still needed in -- the case where the function has a tagged result, because generally -- such functions can be called in a dispatching context and such calls -- must be handled like calls to class-wide functions. if Is_Constrained (Underlying_Type (Etype (Function_Id))) and then not Is_Tagged_Type (Underlying_Type (Etype (Function_Id))) then return; end if; -- Locate the implicit allocation form parameter in the called function. -- Maybe it would be better for each implicit formal of a build-in-place -- function to have a flag or a Uint attribute to identify it. ??? Alloc_Form_Formal := Build_In_Place_Formal (Function_Id, BIP_Alloc_Form); if Present (Alloc_Form_Exp) then pragma Assert (Alloc_Form = Unspecified); Alloc_Form_Actual := Alloc_Form_Exp; else pragma Assert (Alloc_Form /= Unspecified); Alloc_Form_Actual := Make_Integer_Literal (Loc, Intval => UI_From_Int (BIP_Allocation_Form'Pos (Alloc_Form))); end if; Analyze_And_Resolve (Alloc_Form_Actual, Etype (Alloc_Form_Formal)); -- Build the parameter association for the new actual and add it to the -- end of the function's actuals. Add_Extra_Actual_To_Call (Function_Call, Alloc_Form_Formal, Alloc_Form_Actual); -- Pass the Storage_Pool parameter. This parameter is omitted on -- ZFP as those targets do not support pools. if RTE_Available (RE_Root_Storage_Pool_Ptr) then Pool_Formal := Build_In_Place_Formal (Function_Id, BIP_Storage_Pool); Analyze_And_Resolve (Pool_Actual, Etype (Pool_Formal)); Add_Extra_Actual_To_Call (Function_Call, Pool_Formal, Pool_Actual); end if; end Add_Unconstrained_Actuals_To_Build_In_Place_Call; ----------------------------------------------------------- -- Add_Finalization_Master_Actual_To_Build_In_Place_Call -- ----------------------------------------------------------- procedure Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call : Node_Id; Func_Id : Entity_Id; Ptr_Typ : Entity_Id := Empty; Master_Exp : Node_Id := Empty) is begin if not Needs_BIP_Finalization_Master (Func_Id) then return; end if; declare Formal : constant Entity_Id := Build_In_Place_Formal (Func_Id, BIP_Finalization_Master); Loc : constant Source_Ptr := Sloc (Func_Call); Actual : Node_Id; Desig_Typ : Entity_Id; begin -- If there is a finalization master actual, such as the implicit -- finalization master of an enclosing build-in-place function, -- then this must be added as an extra actual of the call. if Present (Master_Exp) then Actual := Master_Exp; -- Case where the context does not require an actual master elsif No (Ptr_Typ) then Actual := Make_Null (Loc); else Desig_Typ := Directly_Designated_Type (Ptr_Typ); -- Check for a library-level access type whose designated type has -- supressed finalization. Such an access types lack a master. -- Pass a null actual to the callee in order to signal a missing -- master. if Is_Library_Level_Entity (Ptr_Typ) and then Finalize_Storage_Only (Desig_Typ) then Actual := Make_Null (Loc); -- Types in need of finalization actions elsif Needs_Finalization (Desig_Typ) then -- The general mechanism of creating finalization masters for -- anonymous access types is disabled by default, otherwise -- finalization masters will pop all over the place. Such types -- use context-specific masters. if Ekind (Ptr_Typ) = E_Anonymous_Access_Type and then No (Finalization_Master (Ptr_Typ)) then Build_Anonymous_Master (Ptr_Typ); end if; -- Access-to-controlled types should always have a master pragma Assert (Present (Finalization_Master (Ptr_Typ))); Actual := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Finalization_Master (Ptr_Typ), Loc), Attribute_Name => Name_Unrestricted_Access); -- Tagged types else Actual := Make_Null (Loc); end if; end if; Analyze_And_Resolve (Actual, Etype (Formal)); -- Build the parameter association for the new actual and add it to -- the end of the function's actuals. Add_Extra_Actual_To_Call (Func_Call, Formal, Actual); end; end Add_Finalization_Master_Actual_To_Build_In_Place_Call; ------------------------------ -- Add_Extra_Actual_To_Call -- ------------------------------ procedure Add_Extra_Actual_To_Call (Subprogram_Call : Node_Id; Extra_Formal : Entity_Id; Extra_Actual : Node_Id) is Loc : constant Source_Ptr := Sloc (Subprogram_Call); Param_Assoc : Node_Id; begin Param_Assoc := Make_Parameter_Association (Loc, Selector_Name => New_Occurrence_Of (Extra_Formal, Loc), Explicit_Actual_Parameter => Extra_Actual); Set_Parent (Param_Assoc, Subprogram_Call); Set_Parent (Extra_Actual, Param_Assoc); if Present (Parameter_Associations (Subprogram_Call)) then if Nkind (Last (Parameter_Associations (Subprogram_Call))) = N_Parameter_Association then -- Find last named actual, and append declare L : Node_Id; begin L := First_Actual (Subprogram_Call); while Present (L) loop if No (Next_Actual (L)) then Set_Next_Named_Actual (Parent (L), Extra_Actual); exit; end if; Next_Actual (L); end loop; end; else Set_First_Named_Actual (Subprogram_Call, Extra_Actual); end if; Append (Param_Assoc, To => Parameter_Associations (Subprogram_Call)); else Set_Parameter_Associations (Subprogram_Call, New_List (Param_Assoc)); Set_First_Named_Actual (Subprogram_Call, Extra_Actual); end if; end Add_Extra_Actual_To_Call; --------------------------------------------- -- Add_Task_Actuals_To_Build_In_Place_Call -- --------------------------------------------- procedure Add_Task_Actuals_To_Build_In_Place_Call (Function_Call : Node_Id; Function_Id : Entity_Id; Master_Actual : Node_Id; Chain : Node_Id := Empty) is Loc : constant Source_Ptr := Sloc (Function_Call); Result_Subt : constant Entity_Id := Available_View (Etype (Function_Id)); Actual : Node_Id; Chain_Actual : Node_Id; Chain_Formal : Node_Id; Master_Formal : Node_Id; begin -- No such extra parameters are needed if there are no tasks if not Has_Task (Result_Subt) then return; end if; Actual := Master_Actual; -- Use a dummy _master actual in case of No_Task_Hierarchy if Restriction_Active (No_Task_Hierarchy) then Actual := New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc); -- In the case where we use the master associated with an access type, -- the actual is an entity and requires an explicit reference. elsif Nkind (Actual) = N_Defining_Identifier then Actual := New_Occurrence_Of (Actual, Loc); end if; -- Locate the implicit master parameter in the called function Master_Formal := Build_In_Place_Formal (Function_Id, BIP_Task_Master); Analyze_And_Resolve (Actual, Etype (Master_Formal)); -- Build the parameter association for the new actual and add it to the -- end of the function's actuals. Add_Extra_Actual_To_Call (Function_Call, Master_Formal, Actual); -- Locate the implicit activation chain parameter in the called function Chain_Formal := Build_In_Place_Formal (Function_Id, BIP_Activation_Chain); -- Create the actual which is a pointer to the current activation chain if No (Chain) then Chain_Actual := Make_Attribute_Reference (Loc, Prefix => Make_Identifier (Loc, Name_uChain), Attribute_Name => Name_Unrestricted_Access); -- Allocator case; make a reference to the Chain passed in by the caller else Chain_Actual := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Chain, Loc), Attribute_Name => Name_Unrestricted_Access); end if; Analyze_And_Resolve (Chain_Actual, Etype (Chain_Formal)); -- Build the parameter association for the new actual and add it to the -- end of the function's actuals. Add_Extra_Actual_To_Call (Function_Call, Chain_Formal, Chain_Actual); end Add_Task_Actuals_To_Build_In_Place_Call; ----------------------- -- BIP_Formal_Suffix -- ----------------------- function BIP_Formal_Suffix (Kind : BIP_Formal_Kind) return String is begin case Kind is when BIP_Alloc_Form => return "BIPalloc"; when BIP_Storage_Pool => return "BIPstoragepool"; when BIP_Finalization_Master => return "BIPfinalizationmaster"; when BIP_Task_Master => return "BIPtaskmaster"; when BIP_Activation_Chain => return "BIPactivationchain"; when BIP_Object_Access => return "BIPaccess"; end case; end BIP_Formal_Suffix; --------------------------- -- Build_In_Place_Formal -- --------------------------- function Build_In_Place_Formal (Func : Entity_Id; Kind : BIP_Formal_Kind) return Entity_Id is Formal_Name : constant Name_Id := New_External_Name (Chars (Func), BIP_Formal_Suffix (Kind)); Extra_Formal : Entity_Id := Extra_Formals (Func); begin -- Maybe it would be better for each implicit formal of a build-in-place -- function to have a flag or a Uint attribute to identify it. ??? -- The return type in the function declaration may have been a limited -- view, and the extra formals for the function were not generated at -- that point. At the point of call the full view must be available and -- the extra formals can be created. if No (Extra_Formal) then Create_Extra_Formals (Func); Extra_Formal := Extra_Formals (Func); end if; loop pragma Assert (Present (Extra_Formal)); exit when Chars (Extra_Formal) = Formal_Name; Next_Formal_With_Extras (Extra_Formal); end loop; return Extra_Formal; end Build_In_Place_Formal; ------------------------------- -- Build_Procedure_Body_Form -- ------------------------------- function Build_Procedure_Body_Form (Func_Id : Entity_Id; Func_Body : Node_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (Func_Body); Proc_Decl : constant Node_Id := Next (Unit_Declaration_Node (Func_Id)); -- It is assumed that the next node following the declaration of the -- corresponding subprogram spec is the declaration of the procedure -- form. Proc_Id : constant Entity_Id := Defining_Entity (Proc_Decl); procedure Replace_Returns (Param_Id : Entity_Id; Stmts : List_Id); -- Replace each return statement found in the list Stmts with an -- assignment of the return expression to parameter Param_Id. --------------------- -- Replace_Returns -- --------------------- procedure Replace_Returns (Param_Id : Entity_Id; Stmts : List_Id) is Stmt : Node_Id; begin Stmt := First (Stmts); while Present (Stmt) loop if Nkind (Stmt) = N_Block_Statement then Replace_Returns (Param_Id, Statements (Stmt)); elsif Nkind (Stmt) = N_Case_Statement then declare Alt : Node_Id; begin Alt := First (Alternatives (Stmt)); while Present (Alt) loop Replace_Returns (Param_Id, Statements (Alt)); Next (Alt); end loop; end; elsif Nkind (Stmt) = N_Extended_Return_Statement then declare Ret_Obj : constant Entity_Id := Defining_Entity (First (Return_Object_Declarations (Stmt))); Assign : constant Node_Id := Make_Assignment_Statement (Sloc (Stmt), Name => New_Occurrence_Of (Param_Id, Loc), Expression => New_Occurrence_Of (Ret_Obj, Sloc (Stmt))); Stmts : List_Id; begin -- The extended return may just contain the declaration if Present (Handled_Statement_Sequence (Stmt)) then Stmts := Statements (Handled_Statement_Sequence (Stmt)); else Stmts := New_List; end if; Set_Assignment_OK (Name (Assign)); Rewrite (Stmt, Make_Block_Statement (Sloc (Stmt), Declarations => Return_Object_Declarations (Stmt), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Stmts))); Replace_Returns (Param_Id, Stmts); Append_To (Stmts, Assign); Append_To (Stmts, Make_Simple_Return_Statement (Loc)); end; elsif Nkind (Stmt) = N_If_Statement then Replace_Returns (Param_Id, Then_Statements (Stmt)); Replace_Returns (Param_Id, Else_Statements (Stmt)); declare Part : Node_Id; begin Part := First (Elsif_Parts (Stmt)); while Present (Part) loop Replace_Returns (Param_Id, Then_Statements (Part)); Next (Part); end loop; end; elsif Nkind (Stmt) = N_Loop_Statement then Replace_Returns (Param_Id, Statements (Stmt)); elsif Nkind (Stmt) = N_Simple_Return_Statement then -- Generate: -- Param := Expr; -- return; Rewrite (Stmt, Make_Assignment_Statement (Sloc (Stmt), Name => New_Occurrence_Of (Param_Id, Loc), Expression => Relocate_Node (Expression (Stmt)))); Insert_After (Stmt, Make_Simple_Return_Statement (Loc)); -- Skip the added return Next (Stmt); end if; Next (Stmt); end loop; end Replace_Returns; -- Local variables Stmts : List_Id; New_Body : Node_Id; -- Start of processing for Build_Procedure_Body_Form begin -- This routine replaces the original function body: -- function F (...) return Array_Typ is -- begin -- ... -- return Something; -- end F; -- with the following: -- procedure P (..., Result : out Array_Typ) is -- begin -- ... -- Result := Something; -- end P; Stmts := Statements (Handled_Statement_Sequence (Func_Body)); Replace_Returns (Last_Entity (Proc_Id), Stmts); New_Body := Make_Subprogram_Body (Loc, Specification => Copy_Subprogram_Spec (Specification (Proc_Decl)), Declarations => Declarations (Func_Body), Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Stmts)); -- If the function is a generic instance, so is the new procedure. -- Set flag accordingly so that the proper renaming declarations are -- generated. Set_Is_Generic_Instance (Proc_Id, Is_Generic_Instance (Func_Id)); return New_Body; end Build_Procedure_Body_Form; -------------------------------- -- Check_Overriding_Operation -- -------------------------------- procedure Check_Overriding_Operation (Subp : Entity_Id) is Typ : constant Entity_Id := Find_Dispatching_Type (Subp); Op_List : constant Elist_Id := Primitive_Operations (Typ); Op_Elmt : Elmt_Id; Prim_Op : Entity_Id; Par_Op : Entity_Id; begin if Is_Derived_Type (Typ) and then not Is_Private_Type (Typ) and then In_Open_Scopes (Scope (Etype (Typ))) and then Is_Base_Type (Typ) then -- Subp overrides an inherited private operation if there is an -- inherited operation with a different name than Subp (see -- Derive_Subprogram) whose Alias is a hidden subprogram with the -- same name as Subp. Op_Elmt := First_Elmt (Op_List); while Present (Op_Elmt) loop Prim_Op := Node (Op_Elmt); Par_Op := Alias (Prim_Op); if Present (Par_Op) and then not Comes_From_Source (Prim_Op) and then Chars (Prim_Op) /= Chars (Par_Op) and then Chars (Par_Op) = Chars (Subp) and then Is_Hidden (Par_Op) and then Type_Conformant (Prim_Op, Subp) then Set_DT_Position_Value (Subp, DT_Position (Prim_Op)); end if; Next_Elmt (Op_Elmt); end loop; end if; end Check_Overriding_Operation; ------------------------------- -- Detect_Infinite_Recursion -- ------------------------------- procedure Detect_Infinite_Recursion (N : Node_Id; Spec : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); Var_List : constant Elist_Id := New_Elmt_List; -- List of globals referenced by body of procedure Call_List : constant Elist_Id := New_Elmt_List; -- List of recursive calls in body of procedure Shad_List : constant Elist_Id := New_Elmt_List; -- List of entity id's for entities created to capture the value of -- referenced globals on entry to the procedure. Scop : constant Uint := Scope_Depth (Spec); -- This is used to record the scope depth of the current procedure, so -- that we can identify global references. Max_Vars : constant := 4; -- Do not test more than four global variables Count_Vars : Natural := 0; -- Count variables found so far Var : Entity_Id; Elm : Elmt_Id; Ent : Entity_Id; Call : Elmt_Id; Decl : Node_Id; Test : Node_Id; Elm1 : Elmt_Id; Elm2 : Elmt_Id; Last : Node_Id; function Process (Nod : Node_Id) return Traverse_Result; -- Function to traverse the subprogram body (using Traverse_Func) ------------- -- Process -- ------------- function Process (Nod : Node_Id) return Traverse_Result is begin -- Procedure call if Nkind (Nod) = N_Procedure_Call_Statement then -- Case of one of the detected recursive calls if Is_Entity_Name (Name (Nod)) and then Has_Recursive_Call (Entity (Name (Nod))) and then Entity (Name (Nod)) = Spec then Append_Elmt (Nod, Call_List); return Skip; -- Any other procedure call may have side effects else return Abandon; end if; -- A call to a pure function can always be ignored elsif Nkind (Nod) = N_Function_Call and then Is_Entity_Name (Name (Nod)) and then Is_Pure (Entity (Name (Nod))) then return Skip; -- Case of an identifier reference elsif Nkind (Nod) = N_Identifier then Ent := Entity (Nod); -- If no entity, then ignore the reference -- Not clear why this can happen. To investigate, remove this -- test and look at the crash that occurs here in 3401-004 ??? if No (Ent) then return Skip; -- Ignore entities with no Scope, again not clear how this -- can happen, to investigate, look at 4108-008 ??? elsif No (Scope (Ent)) then return Skip; -- Ignore the reference if not to a more global object elsif Scope_Depth (Scope (Ent)) >= Scop then return Skip; -- References to types, exceptions and constants are always OK elsif Is_Type (Ent) or else Ekind (Ent) = E_Exception or else Ekind (Ent) = E_Constant then return Skip; -- If other than a non-volatile scalar variable, we have some -- kind of global reference (e.g. to a function) that we cannot -- deal with so we forget the attempt. elsif Ekind (Ent) /= E_Variable or else not Is_Scalar_Type (Etype (Ent)) or else Treat_As_Volatile (Ent) then return Abandon; -- Otherwise we have a reference to a global scalar else -- Loop through global entities already detected Elm := First_Elmt (Var_List); loop -- If not detected before, record this new global reference if No (Elm) then Count_Vars := Count_Vars + 1; if Count_Vars <= Max_Vars then Append_Elmt (Entity (Nod), Var_List); else return Abandon; end if; exit; -- If recorded before, ignore elsif Node (Elm) = Entity (Nod) then return Skip; -- Otherwise keep looking else Next_Elmt (Elm); end if; end loop; return Skip; end if; -- For all other node kinds, recursively visit syntactic children else return OK; end if; end Process; function Traverse_Body is new Traverse_Func (Process); -- Start of processing for Detect_Infinite_Recursion begin -- Do not attempt detection in No_Implicit_Conditional mode, since we -- won't be able to generate the code to handle the recursion in any -- case. if Restriction_Active (No_Implicit_Conditionals) then return; end if; -- Otherwise do traversal and quit if we get abandon signal if Traverse_Body (N) = Abandon then return; -- We must have a call, since Has_Recursive_Call was set. If not just -- ignore (this is only an error check, so if we have a funny situation, -- due to bugs or errors, we do not want to bomb). elsif Is_Empty_Elmt_List (Call_List) then return; end if; -- Here is the case where we detect recursion at compile time -- Push our current scope for analyzing the declarations and code that -- we will insert for the checking. Push_Scope (Spec); -- This loop builds temporary variables for each of the referenced -- globals, so that at the end of the loop the list Shad_List contains -- these temporaries in one-to-one correspondence with the elements in -- Var_List. Last := Empty; Elm := First_Elmt (Var_List); while Present (Elm) loop Var := Node (Elm); Ent := Make_Temporary (Loc, 'S'); Append_Elmt (Ent, Shad_List); -- Insert a declaration for this temporary at the start of the -- declarations for the procedure. The temporaries are declared as -- constant objects initialized to the current values of the -- corresponding temporaries. Decl := Make_Object_Declaration (Loc, Defining_Identifier => Ent, Object_Definition => New_Occurrence_Of (Etype (Var), Loc), Constant_Present => True, Expression => New_Occurrence_Of (Var, Loc)); if No (Last) then Prepend (Decl, Declarations (N)); else Insert_After (Last, Decl); end if; Last := Decl; Analyze (Decl); Next_Elmt (Elm); end loop; -- Loop through calls Call := First_Elmt (Call_List); while Present (Call) loop -- Build a predicate expression of the form -- True -- and then global1 = temp1 -- and then global2 = temp2 -- ... -- This predicate determines if any of the global values -- referenced by the procedure have changed since the -- current call, if not an infinite recursion is assured. Test := New_Occurrence_Of (Standard_True, Loc); Elm1 := First_Elmt (Var_List); Elm2 := First_Elmt (Shad_List); while Present (Elm1) loop Test := Make_And_Then (Loc, Left_Opnd => Test, Right_Opnd => Make_Op_Eq (Loc, Left_Opnd => New_Occurrence_Of (Node (Elm1), Loc), Right_Opnd => New_Occurrence_Of (Node (Elm2), Loc))); Next_Elmt (Elm1); Next_Elmt (Elm2); end loop; -- Now we replace the call with the sequence -- if no-changes (see above) then -- raise Storage_Error; -- else -- original-call -- end if; Rewrite (Node (Call), Make_If_Statement (Loc, Condition => Test, Then_Statements => New_List ( Make_Raise_Storage_Error (Loc, Reason => SE_Infinite_Recursion)), Else_Statements => New_List ( Relocate_Node (Node (Call))))); Analyze (Node (Call)); Next_Elmt (Call); end loop; -- Remove temporary scope stack entry used for analysis Pop_Scope; end Detect_Infinite_Recursion; -------------------- -- Expand_Actuals -- -------------------- procedure Expand_Actuals (N : in out Node_Id; Subp : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); Actual : Node_Id; Formal : Entity_Id; N_Node : Node_Id; Post_Call : List_Id; E_Actual : Entity_Id; E_Formal : Entity_Id; procedure Add_Call_By_Copy_Code; -- For cases where the parameter must be passed by copy, this routine -- generates a temporary variable into which the actual is copied and -- then passes this as the parameter. For an OUT or IN OUT parameter, -- an assignment is also generated to copy the result back. The call -- also takes care of any constraint checks required for the type -- conversion case (on both the way in and the way out). procedure Add_Simple_Call_By_Copy_Code; -- This is similar to the above, but is used in cases where we know -- that all that is needed is to simply create a temporary and copy -- the value in and out of the temporary. procedure Check_Fortran_Logical; -- A value of type Logical that is passed through a formal parameter -- must be normalized because .TRUE. usually does not have the same -- representation as True. We assume that .FALSE. = False = 0. -- What about functions that return a logical type ??? function Is_Legal_Copy return Boolean; -- Check that an actual can be copied before generating the temporary -- to be used in the call. If the actual is of a by_reference type then -- the program is illegal (this can only happen in the presence of -- rep. clauses that force an incorrect alignment). If the formal is -- a by_reference parameter imposed by a DEC pragma, emit a warning to -- the effect that this might lead to unaligned arguments. function Make_Var (Actual : Node_Id) return Entity_Id; -- Returns an entity that refers to the given actual parameter, Actual -- (not including any type conversion). If Actual is an entity name, -- then this entity is returned unchanged, otherwise a renaming is -- created to provide an entity for the actual. procedure Reset_Packed_Prefix; -- The expansion of a packed array component reference is delayed in -- the context of a call. Now we need to complete the expansion, so we -- unmark the analyzed bits in all prefixes. --------------------------- -- Add_Call_By_Copy_Code -- --------------------------- procedure Add_Call_By_Copy_Code is Crep : Boolean; Expr : Node_Id; F_Typ : Entity_Id := Etype (Formal); Indic : Node_Id; Init : Node_Id; Temp : Entity_Id; V_Typ : Entity_Id; Var : Entity_Id; begin if not Is_Legal_Copy then return; end if; Temp := Make_Temporary (Loc, 'T', Actual); -- Handle formals whose type comes from the limited view if From_Limited_With (F_Typ) and then Has_Non_Limited_View (F_Typ) then F_Typ := Non_Limited_View (F_Typ); end if; -- Use formal type for temp, unless formal type is an unconstrained -- array, in which case we don't have to worry about bounds checks, -- and we use the actual type, since that has appropriate bounds. if Is_Array_Type (F_Typ) and then not Is_Constrained (F_Typ) then Indic := New_Occurrence_Of (Etype (Actual), Loc); else Indic := New_Occurrence_Of (F_Typ, Loc); end if; if Nkind (Actual) = N_Type_Conversion then V_Typ := Etype (Expression (Actual)); -- If the formal is an (in-)out parameter, capture the name -- of the variable in order to build the post-call assignment. Var := Make_Var (Expression (Actual)); Crep := not Same_Representation (F_Typ, Etype (Expression (Actual))); else V_Typ := Etype (Actual); Var := Make_Var (Actual); Crep := False; end if; -- Setup initialization for case of in out parameter, or an out -- parameter where the formal is an unconstrained array (in the -- latter case, we have to pass in an object with bounds). -- If this is an out parameter, the initial copy is wasteful, so as -- an optimization for the one-dimensional case we extract the -- bounds of the actual and build an uninitialized temporary of the -- right size. if Ekind (Formal) = E_In_Out_Parameter or else (Is_Array_Type (F_Typ) and then not Is_Constrained (F_Typ)) then if Nkind (Actual) = N_Type_Conversion then if Conversion_OK (Actual) then Init := OK_Convert_To (F_Typ, New_Occurrence_Of (Var, Loc)); else Init := Convert_To (F_Typ, New_Occurrence_Of (Var, Loc)); end if; elsif Ekind (Formal) = E_Out_Parameter and then Is_Array_Type (F_Typ) and then Number_Dimensions (F_Typ) = 1 and then not Has_Non_Null_Base_Init_Proc (F_Typ) then -- Actual is a one-dimensional array or slice, and the type -- requires no initialization. Create a temporary of the -- right size, but do not copy actual into it (optimization). Init := Empty; Indic := Make_Subtype_Indication (Loc, Subtype_Mark => New_Occurrence_Of (F_Typ, Loc), Constraint => Make_Index_Or_Discriminant_Constraint (Loc, Constraints => New_List ( Make_Range (Loc, Low_Bound => Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Var, Loc), Attribute_Name => Name_First), High_Bound => Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Var, Loc), Attribute_Name => Name_Last))))); else Init := New_Occurrence_Of (Var, Loc); end if; -- An initialization is created for packed conversions as -- actuals for out parameters to enable Make_Object_Declaration -- to determine the proper subtype for N_Node. Note that this -- is wasteful because the extra copying on the call side is -- not required for such out parameters. ??? elsif Ekind (Formal) = E_Out_Parameter and then Nkind (Actual) = N_Type_Conversion and then (Is_Bit_Packed_Array (F_Typ) or else Is_Bit_Packed_Array (Etype (Expression (Actual)))) then if Conversion_OK (Actual) then Init := OK_Convert_To (F_Typ, New_Occurrence_Of (Var, Loc)); else Init := Convert_To (F_Typ, New_Occurrence_Of (Var, Loc)); end if; elsif Ekind (Formal) = E_In_Parameter then -- Handle the case in which the actual is a type conversion if Nkind (Actual) = N_Type_Conversion then if Conversion_OK (Actual) then Init := OK_Convert_To (F_Typ, New_Occurrence_Of (Var, Loc)); else Init := Convert_To (F_Typ, New_Occurrence_Of (Var, Loc)); end if; else Init := New_Occurrence_Of (Var, Loc); end if; else Init := Empty; end if; N_Node := Make_Object_Declaration (Loc, Defining_Identifier => Temp, Object_Definition => Indic, Expression => Init); Set_Assignment_OK (N_Node); Insert_Action (N, N_Node); -- Now, normally the deal here is that we use the defining -- identifier created by that object declaration. There is -- one exception to this. In the change of representation case -- the above declaration will end up looking like: -- temp : type := identifier; -- And in this case we might as well use the identifier directly -- and eliminate the temporary. Note that the analysis of the -- declaration was not a waste of time in that case, since it is -- what generated the necessary change of representation code. If -- the change of representation introduced additional code, as in -- a fixed-integer conversion, the expression is not an identifier -- and must be kept. if Crep and then Present (Expression (N_Node)) and then Is_Entity_Name (Expression (N_Node)) then Temp := Entity (Expression (N_Node)); Rewrite (N_Node, Make_Null_Statement (Loc)); end if; -- For IN parameter, all we do is to replace the actual if Ekind (Formal) = E_In_Parameter then Rewrite (Actual, New_Occurrence_Of (Temp, Loc)); Analyze (Actual); -- Processing for OUT or IN OUT parameter else -- Kill current value indications for the temporary variable we -- created, since we just passed it as an OUT parameter. Kill_Current_Values (Temp); Set_Is_Known_Valid (Temp, False); -- If type conversion, use reverse conversion on exit if Nkind (Actual) = N_Type_Conversion then if Conversion_OK (Actual) then Expr := OK_Convert_To (V_Typ, New_Occurrence_Of (Temp, Loc)); else Expr := Convert_To (V_Typ, New_Occurrence_Of (Temp, Loc)); end if; else Expr := New_Occurrence_Of (Temp, Loc); end if; Rewrite (Actual, New_Occurrence_Of (Temp, Loc)); Analyze (Actual); -- If the actual is a conversion of a packed reference, it may -- already have been expanded by Remove_Side_Effects, and the -- resulting variable is a temporary which does not designate -- the proper out-parameter, which may not be addressable. In -- that case, generate an assignment to the original expression -- (before expansion of the packed reference) so that the proper -- expansion of assignment to a packed component can take place. declare Obj : Node_Id; Lhs : Node_Id; begin if Is_Renaming_Of_Object (Var) and then Nkind (Renamed_Object (Var)) = N_Selected_Component and then Nkind (Original_Node (Prefix (Renamed_Object (Var)))) = N_Indexed_Component and then Has_Non_Standard_Rep (Etype (Prefix (Renamed_Object (Var)))) then Obj := Renamed_Object (Var); Lhs := Make_Selected_Component (Loc, Prefix => New_Copy_Tree (Original_Node (Prefix (Obj))), Selector_Name => New_Copy (Selector_Name (Obj))); Reset_Analyzed_Flags (Lhs); else Lhs := New_Occurrence_Of (Var, Loc); end if; Set_Assignment_OK (Lhs); if Is_Access_Type (E_Formal) and then Is_Entity_Name (Lhs) and then Present (Effective_Extra_Accessibility (Entity (Lhs))) then -- Copyback target is an Ada 2012 stand-alone object of an -- anonymous access type. pragma Assert (Ada_Version >= Ada_2012); if Type_Access_Level (E_Formal) > Object_Access_Level (Lhs) then Append_To (Post_Call, Make_Raise_Program_Error (Loc, Reason => PE_Accessibility_Check_Failed)); end if; Append_To (Post_Call, Make_Assignment_Statement (Loc, Name => Lhs, Expression => Expr)); -- We would like to somehow suppress generation of the -- extra_accessibility assignment generated by the expansion -- of the above assignment statement. It's not a correctness -- issue because the following assignment renders it dead, -- but generating back-to-back assignments to the same -- target is undesirable. ??? Append_To (Post_Call, Make_Assignment_Statement (Loc, Name => New_Occurrence_Of ( Effective_Extra_Accessibility (Entity (Lhs)), Loc), Expression => Make_Integer_Literal (Loc, Type_Access_Level (E_Formal)))); else Append_To (Post_Call, Make_Assignment_Statement (Loc, Name => Lhs, Expression => Expr)); end if; end; end if; end Add_Call_By_Copy_Code; ---------------------------------- -- Add_Simple_Call_By_Copy_Code -- ---------------------------------- procedure Add_Simple_Call_By_Copy_Code is Decl : Node_Id; F_Typ : Entity_Id := Etype (Formal); Incod : Node_Id; Indic : Node_Id; Lhs : Node_Id; Outcod : Node_Id; Rhs : Node_Id; Temp : Entity_Id; begin if not Is_Legal_Copy then return; end if; -- Handle formals whose type comes from the limited view if From_Limited_With (F_Typ) and then Has_Non_Limited_View (F_Typ) then F_Typ := Non_Limited_View (F_Typ); end if; -- Use formal type for temp, unless formal type is an unconstrained -- array, in which case we don't have to worry about bounds checks, -- and we use the actual type, since that has appropriate bounds. if Is_Array_Type (F_Typ) and then not Is_Constrained (F_Typ) then Indic := New_Occurrence_Of (Etype (Actual), Loc); else Indic := New_Occurrence_Of (F_Typ, Loc); end if; -- Prepare to generate code Reset_Packed_Prefix; Temp := Make_Temporary (Loc, 'T', Actual); Incod := Relocate_Node (Actual); Outcod := New_Copy_Tree (Incod); -- Generate declaration of temporary variable, initializing it -- with the input parameter unless we have an OUT formal or -- this is an initialization call. -- If the formal is an out parameter with discriminants, the -- discriminants must be captured even if the rest of the object -- is in principle uninitialized, because the discriminants may -- be read by the called subprogram. if Ekind (Formal) = E_Out_Parameter then Incod := Empty; if Has_Discriminants (F_Typ) then Indic := New_Occurrence_Of (Etype (Actual), Loc); end if; elsif Inside_Init_Proc then -- Could use a comment here to match comment below ??? if Nkind (Actual) /= N_Selected_Component or else not Has_Discriminant_Dependent_Constraint (Entity (Selector_Name (Actual))) then Incod := Empty; -- Otherwise, keep the component in order to generate the proper -- actual subtype, that depends on enclosing discriminants. else null; end if; end if; Decl := Make_Object_Declaration (Loc, Defining_Identifier => Temp, Object_Definition => Indic, Expression => Incod); if Inside_Init_Proc and then No (Incod) then -- If the call is to initialize a component of a composite type, -- and the component does not depend on discriminants, use the -- actual type of the component. This is required in case the -- component is constrained, because in general the formal of the -- initialization procedure will be unconstrained. Note that if -- the component being initialized is constrained by an enclosing -- discriminant, the presence of the initialization in the -- declaration will generate an expression for the actual subtype. Set_No_Initialization (Decl); Set_Object_Definition (Decl, New_Occurrence_Of (Etype (Actual), Loc)); end if; Insert_Action (N, Decl); -- The actual is simply a reference to the temporary Rewrite (Actual, New_Occurrence_Of (Temp, Loc)); -- Generate copy out if OUT or IN OUT parameter if Ekind (Formal) /= E_In_Parameter then Lhs := Outcod; Rhs := New_Occurrence_Of (Temp, Loc); -- Deal with conversion if Nkind (Lhs) = N_Type_Conversion then Lhs := Expression (Lhs); Rhs := Convert_To (Etype (Actual), Rhs); end if; Append_To (Post_Call, Make_Assignment_Statement (Loc, Name => Lhs, Expression => Rhs)); Set_Assignment_OK (Name (Last (Post_Call))); end if; end Add_Simple_Call_By_Copy_Code; --------------------------- -- Check_Fortran_Logical -- --------------------------- procedure Check_Fortran_Logical is Logical : constant Entity_Id := Etype (Formal); Var : Entity_Id; -- Note: this is very incomplete, e.g. it does not handle arrays -- of logical values. This is really not the right approach at all???) begin if Convention (Subp) = Convention_Fortran and then Root_Type (Etype (Formal)) = Standard_Boolean and then Ekind (Formal) /= E_In_Parameter then Var := Make_Var (Actual); Append_To (Post_Call, Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Var, Loc), Expression => Unchecked_Convert_To ( Logical, Make_Op_Ne (Loc, Left_Opnd => New_Occurrence_Of (Var, Loc), Right_Opnd => Unchecked_Convert_To ( Logical, New_Occurrence_Of (Standard_False, Loc)))))); end if; end Check_Fortran_Logical; ------------------- -- Is_Legal_Copy -- ------------------- function Is_Legal_Copy return Boolean is begin -- An attempt to copy a value of such a type can only occur if -- representation clauses give the actual a misaligned address. if Is_By_Reference_Type (Etype (Formal)) then -- If the front-end does not perform full type layout, the actual -- may in fact be properly aligned but there is not enough front- -- end information to determine this. In that case gigi will emit -- an error if a copy is not legal, or generate the proper code. -- For other backends we report the error now. -- Seems wrong to be issuing an error in the expander, since it -- will be missed in -gnatc mode ??? if Frontend_Layout_On_Target then Error_Msg_N ("misaligned actual cannot be passed by reference", Actual); end if; return False; -- For users of Starlet, we assume that the specification of by- -- reference mechanism is mandatory. This may lead to unaligned -- objects but at least for DEC legacy code it is known to work. -- The warning will alert users of this code that a problem may -- be lurking. elsif Mechanism (Formal) = By_Reference and then Is_Valued_Procedure (Scope (Formal)) then Error_Msg_N ("by_reference actual may be misaligned??", Actual); return False; else return True; end if; end Is_Legal_Copy; -------------- -- Make_Var -- -------------- function Make_Var (Actual : Node_Id) return Entity_Id is Var : Entity_Id; begin if Is_Entity_Name (Actual) then return Entity (Actual); else Var := Make_Temporary (Loc, 'T', Actual); N_Node := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Var, Subtype_Mark => New_Occurrence_Of (Etype (Actual), Loc), Name => Relocate_Node (Actual)); Insert_Action (N, N_Node); return Var; end if; end Make_Var; ------------------------- -- Reset_Packed_Prefix -- ------------------------- procedure Reset_Packed_Prefix is Pfx : Node_Id := Actual; begin loop Set_Analyzed (Pfx, False); exit when not Nkind_In (Pfx, N_Selected_Component, N_Indexed_Component); Pfx := Prefix (Pfx); end loop; end Reset_Packed_Prefix; -- Start of processing for Expand_Actuals begin Post_Call := New_List; Formal := First_Formal (Subp); Actual := First_Actual (N); while Present (Formal) loop E_Formal := Etype (Formal); E_Actual := Etype (Actual); -- Handle formals whose type comes from the limited view if From_Limited_With (E_Formal) and then Has_Non_Limited_View (E_Formal) then E_Formal := Non_Limited_View (E_Formal); end if; if Is_Scalar_Type (E_Formal) or else Nkind (Actual) = N_Slice then Check_Fortran_Logical; -- RM 6.4.1 (11) elsif Ekind (Formal) /= E_Out_Parameter then -- The unusual case of the current instance of a protected type -- requires special handling. This can only occur in the context -- of a call within the body of a protected operation. if Is_Entity_Name (Actual) and then Ekind (Entity (Actual)) = E_Protected_Type and then In_Open_Scopes (Entity (Actual)) then if Scope (Subp) /= Entity (Actual) then Error_Msg_N ("operation outside protected type may not " & "call back its protected operations??", Actual); end if; Rewrite (Actual, Expand_Protected_Object_Reference (N, Entity (Actual))); end if; -- Ada 2005 (AI-318-02): If the actual parameter is a call to a -- build-in-place function, then a temporary return object needs -- to be created and access to it must be passed to the function. -- Currently we limit such functions to those with inherently -- limited result subtypes, but eventually we plan to expand the -- functions that are treated as build-in-place to include other -- composite result types. if Is_Build_In_Place_Function_Call (Actual) then Make_Build_In_Place_Call_In_Anonymous_Context (Actual); end if; Apply_Constraint_Check (Actual, E_Formal); -- Out parameter case. No constraint checks on access type -- RM 6.4.1 (13) elsif Is_Access_Type (E_Formal) then null; -- RM 6.4.1 (14) elsif Has_Discriminants (Base_Type (E_Formal)) or else Has_Non_Null_Base_Init_Proc (E_Formal) then Apply_Constraint_Check (Actual, E_Formal); -- RM 6.4.1 (15) else Apply_Constraint_Check (Actual, Base_Type (E_Formal)); end if; -- Processing for IN-OUT and OUT parameters if Ekind (Formal) /= E_In_Parameter then -- For type conversions of arrays, apply length/range checks if Is_Array_Type (E_Formal) and then Nkind (Actual) = N_Type_Conversion then if Is_Constrained (E_Formal) then Apply_Length_Check (Expression (Actual), E_Formal); else Apply_Range_Check (Expression (Actual), E_Formal); end if; end if; -- If argument is a type conversion for a type that is passed -- by copy, then we must pass the parameter by copy. if Nkind (Actual) = N_Type_Conversion and then (Is_Numeric_Type (E_Formal) or else Is_Access_Type (E_Formal) or else Is_Enumeration_Type (E_Formal) or else Is_Bit_Packed_Array (Etype (Formal)) or else Is_Bit_Packed_Array (Etype (Expression (Actual))) -- Also pass by copy if change of representation or else not Same_Representation (Etype (Formal), Etype (Expression (Actual)))) then Add_Call_By_Copy_Code; -- References to components of bit-packed arrays are expanded -- at this point, rather than at the point of analysis of the -- actuals, to handle the expansion of the assignment to -- [in] out parameters. elsif Is_Ref_To_Bit_Packed_Array (Actual) then Add_Simple_Call_By_Copy_Code; -- If a non-scalar actual is possibly bit-aligned, we need a copy -- because the back-end cannot cope with such objects. In other -- cases where alignment forces a copy, the back-end generates -- it properly. It should not be generated unconditionally in the -- front-end because it does not know precisely the alignment -- requirements of the target, and makes too conservative an -- estimate, leading to superfluous copies or spurious errors -- on by-reference parameters. elsif Nkind (Actual) = N_Selected_Component and then Component_May_Be_Bit_Aligned (Entity (Selector_Name (Actual))) and then not Represented_As_Scalar (Etype (Formal)) then Add_Simple_Call_By_Copy_Code; -- References to slices of bit-packed arrays are expanded elsif Is_Ref_To_Bit_Packed_Slice (Actual) then Add_Call_By_Copy_Code; -- References to possibly unaligned slices of arrays are expanded elsif Is_Possibly_Unaligned_Slice (Actual) then Add_Call_By_Copy_Code; -- Deal with access types where the actual subtype and the -- formal subtype are not the same, requiring a check. -- It is necessary to exclude tagged types because of "downward -- conversion" errors. elsif Is_Access_Type (E_Formal) and then not Same_Type (E_Formal, E_Actual) and then not Is_Tagged_Type (Designated_Type (E_Formal)) then Add_Call_By_Copy_Code; -- If the actual is not a scalar and is marked for volatile -- treatment, whereas the formal is not volatile, then pass -- by copy unless it is a by-reference type. -- Note: we use Is_Volatile here rather than Treat_As_Volatile, -- because this is the enforcement of a language rule that applies -- only to "real" volatile variables, not e.g. to the address -- clause overlay case. elsif Is_Entity_Name (Actual) and then Is_Volatile (Entity (Actual)) and then not Is_By_Reference_Type (E_Actual) and then not Is_Scalar_Type (Etype (Entity (Actual))) and then not Is_Volatile (E_Formal) then Add_Call_By_Copy_Code; elsif Nkind (Actual) = N_Indexed_Component and then Is_Entity_Name (Prefix (Actual)) and then Has_Volatile_Components (Entity (Prefix (Actual))) then Add_Call_By_Copy_Code; -- Add call-by-copy code for the case of scalar out parameters -- when it is not known at compile time that the subtype of the -- formal is a subrange of the subtype of the actual (or vice -- versa for in out parameters), in order to get range checks -- on such actuals. (Maybe this case should be handled earlier -- in the if statement???) elsif Is_Scalar_Type (E_Formal) and then (not In_Subrange_Of (E_Formal, E_Actual) or else (Ekind (Formal) = E_In_Out_Parameter and then not In_Subrange_Of (E_Actual, E_Formal))) then -- Perhaps the setting back to False should be done within -- Add_Call_By_Copy_Code, since it could get set on other -- cases occurring above??? if Do_Range_Check (Actual) then Set_Do_Range_Check (Actual, False); end if; Add_Call_By_Copy_Code; end if; -- RM 3.2.4 (23/3): A predicate is checked on in-out and out -- by-reference parameters on exit from the call. If the actual -- is a derived type and the operation is inherited, the body -- of the operation will not contain a call to the predicate -- function, so it must be done explicitly after the call. Ditto -- if the actual is an entity of a predicated subtype. -- The rule refers to by-reference types, but a check is needed -- for by-copy types as well. That check is subsumed by the rule -- for subtype conversion on assignment, but we can generate the -- required check now. -- Note also that Subp may be either a subprogram entity for -- direct calls, or a type entity for indirect calls, which must -- be handled separately because the name does not denote an -- overloadable entity. By_Ref_Predicate_Check : declare Aund : constant Entity_Id := Underlying_Type (E_Actual); Atyp : Entity_Id; function Is_Public_Subp return Boolean; -- Check whether the subprogram being called is a visible -- operation of the type of the actual. Used to determine -- whether an invariant check must be generated on the -- caller side. --------------------- -- Is_Public_Subp -- --------------------- function Is_Public_Subp return Boolean is Pack : constant Entity_Id := Scope (Subp); Subp_Decl : Node_Id; begin if not Is_Subprogram (Subp) then return False; -- The operation may be inherited, or a primitive of the -- root type. elsif Nkind_In (Parent (Subp), N_Private_Extension_Declaration, N_Full_Type_Declaration) then Subp_Decl := Parent (Subp); else Subp_Decl := Unit_Declaration_Node (Subp); end if; return Ekind (Pack) = E_Package and then List_Containing (Subp_Decl) = Visible_Declarations (Specification (Unit_Declaration_Node (Pack))); end Is_Public_Subp; -- Start of processing for By_Ref_Predicate_Check begin if No (Aund) then Atyp := E_Actual; else Atyp := Aund; end if; if Has_Predicates (Atyp) and then Present (Predicate_Function (Atyp)) -- Skip predicate checks for special cases and then Predicate_Tests_On_Arguments (Subp) then Append_To (Post_Call, Make_Predicate_Check (Atyp, Actual)); end if; -- We generated caller-side invariant checks in two cases: -- a) when calling an inherited operation, where there is an -- implicit view conversion of the actual to the parent type. -- b) When the conversion is explicit -- We treat these cases separately because the required -- conversion for a) is added later when expanding the call. if Has_Invariants (Etype (Actual)) and then Nkind (Parent (Subp)) = N_Private_Extension_Declaration then if Comes_From_Source (N) and then Is_Public_Subp then Append_To (Post_Call, Make_Invariant_Call (Actual)); end if; elsif Nkind (Actual) = N_Type_Conversion and then Has_Invariants (Etype (Expression (Actual))) then if Comes_From_Source (N) and then Is_Public_Subp then Append_To (Post_Call, Make_Invariant_Call (Expression (Actual))); end if; end if; end By_Ref_Predicate_Check; -- Processing for IN parameters else -- For IN parameters in the bit-packed array case, we expand an -- indexed component (the circuit in Exp_Ch4 deliberately left -- indexed components appearing as actuals untouched, so that -- the special processing above for the OUT and IN OUT cases -- could be performed. We could make the test in Exp_Ch4 more -- complex and have it detect the parameter mode, but it is -- easier simply to handle all cases here.) if Nkind (Actual) = N_Indexed_Component and then Is_Bit_Packed_Array (Etype (Prefix (Actual))) then Reset_Packed_Prefix; Expand_Packed_Element_Reference (Actual); -- If we have a reference to a bit-packed array, we copy it, since -- the actual must be byte aligned. -- Is this really necessary in all cases??? elsif Is_Ref_To_Bit_Packed_Array (Actual) then Add_Simple_Call_By_Copy_Code; -- If a non-scalar actual is possibly unaligned, we need a copy elsif Is_Possibly_Unaligned_Object (Actual) and then not Represented_As_Scalar (Etype (Formal)) then Add_Simple_Call_By_Copy_Code; -- Similarly, we have to expand slices of packed arrays here -- because the result must be byte aligned. elsif Is_Ref_To_Bit_Packed_Slice (Actual) then Add_Call_By_Copy_Code; -- Only processing remaining is to pass by copy if this is a -- reference to a possibly unaligned slice, since the caller -- expects an appropriately aligned argument. elsif Is_Possibly_Unaligned_Slice (Actual) then Add_Call_By_Copy_Code; -- An unusual case: a current instance of an enclosing task can be -- an actual, and must be replaced by a reference to self. elsif Is_Entity_Name (Actual) and then Is_Task_Type (Entity (Actual)) then if In_Open_Scopes (Entity (Actual)) then Rewrite (Actual, (Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_Self), Loc)))); Analyze (Actual); -- A task type cannot otherwise appear as an actual else raise Program_Error; end if; end if; end if; Next_Formal (Formal); Next_Actual (Actual); end loop; -- Find right place to put post call stuff if it is present if not Is_Empty_List (Post_Call) then -- Cases where the call is not a member of a statement list. -- This includes the case where the call is an actual in another -- function call or indexing, i.e. an expression context as well. if not Is_List_Member (N) or else Nkind_In (Parent (N), N_Function_Call, N_Indexed_Component) then -- In Ada 2012 the call may be a function call in an expression -- (since OUT and IN OUT parameters are now allowed for such -- calls). The write-back of (in)-out parameters is handled -- by the back-end, but the constraint checks generated when -- subtypes of formal and actual don't match must be inserted -- in the form of assignments. if Ada_Version >= Ada_2012 and then Nkind (N) = N_Function_Call then -- We used to just do handle this by climbing up parents to -- a non-statement/declaration and then simply making a call -- to Insert_Actions_After (P, Post_Call), but that doesn't -- work. If we are in the middle of an expression, e.g. the -- condition of an IF, this call would insert after the IF -- statement, which is much too late to be doing the write -- back. For example: -- if Clobber (X) then -- Put_Line (X'Img); -- else -- goto Junk -- end if; -- Now assume Clobber changes X, if we put the write back -- after the IF, the Put_Line gets the wrong value and the -- goto causes the write back to be skipped completely. -- To deal with this, we replace the call by -- do -- Tnnn : constant function-result-type := function-call; -- Post_Call actions -- in -- Tnnn; -- end; declare Tnnn : constant Entity_Id := Make_Temporary (Loc, 'T'); FRTyp : constant Entity_Id := Etype (N); Name : constant Node_Id := Relocate_Node (N); begin Prepend_To (Post_Call, Make_Object_Declaration (Loc, Defining_Identifier => Tnnn, Object_Definition => New_Occurrence_Of (FRTyp, Loc), Constant_Present => True, Expression => Name)); Rewrite (N, Make_Expression_With_Actions (Loc, Actions => Post_Call, Expression => New_Occurrence_Of (Tnnn, Loc))); -- We don't want to just blindly call Analyze_And_Resolve -- because that would cause unwanted recursion on the call. -- So for a moment set the call as analyzed to prevent that -- recursion, and get the rest analyzed properly, then reset -- the analyzed flag, so our caller can continue. Set_Analyzed (Name, True); Analyze_And_Resolve (N, FRTyp); Set_Analyzed (Name, False); -- Reset calling argument to point to function call inside -- the expression with actions so the caller can continue -- to process the call. In spite of the fact that it is -- marked Analyzed above, it may be rewritten by Remove_ -- Side_Effects if validity checks are present, so go back -- to original call. N := Original_Node (Name); end; -- If not the special Ada 2012 case of a function call, then -- we must have the triggering statement of a triggering -- alternative or an entry call alternative, and we can add -- the post call stuff to the corresponding statement list. else declare P : Node_Id; begin P := Parent (N); pragma Assert (Nkind_In (P, N_Triggering_Alternative, N_Entry_Call_Alternative)); if Is_Non_Empty_List (Statements (P)) then Insert_List_Before_And_Analyze (First (Statements (P)), Post_Call); else Set_Statements (P, Post_Call); end if; return; end; end if; -- Otherwise, normal case where N is in a statement sequence, -- just put the post-call stuff after the call statement. else Insert_Actions_After (N, Post_Call); return; end if; end if; -- The call node itself is re-analyzed in Expand_Call end Expand_Actuals; ----------------- -- Expand_Call -- ----------------- -- This procedure handles expansion of function calls and procedure call -- statements (i.e. it serves as the body for Expand_N_Function_Call and -- Expand_N_Procedure_Call_Statement). Processing for calls includes: -- Replace call to Raise_Exception by Raise_Exception_Always if possible -- Provide values of actuals for all formals in Extra_Formals list -- Replace "call" to enumeration literal function by literal itself -- Rewrite call to predefined operator as operator -- Replace actuals to in-out parameters that are numeric conversions, -- with explicit assignment to temporaries before and after the call. -- Note that the list of actuals has been filled with default expressions -- during semantic analysis of the call. Only the extra actuals required -- for the 'Constrained attribute and for accessibility checks are added -- at this point. procedure Expand_Call (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Call_Node : Node_Id := N; Extra_Actuals : List_Id := No_List; Prev : Node_Id := Empty; procedure Add_Actual_Parameter (Insert_Param : Node_Id); -- Adds one entry to the end of the actual parameter list. Used for -- default parameters and for extra actuals (for Extra_Formals). The -- argument is an N_Parameter_Association node. procedure Add_Extra_Actual (Expr : Node_Id; EF : Entity_Id); -- Adds an extra actual to the list of extra actuals. Expr is the -- expression for the value of the actual, EF is the entity for the -- extra formal. procedure Add_View_Conversion_Invariants (Formal : Entity_Id; Actual : Node_Id); -- Adds invariant checks for every intermediate type between the range -- of a view converted argument to its ancestor (from parent to child). function Inherited_From_Formal (S : Entity_Id) return Entity_Id; -- Within an instance, a type derived from an untagged formal derived -- type inherits from the original parent, not from the actual. The -- current derivation mechanism has the derived type inherit from the -- actual, which is only correct outside of the instance. If the -- subprogram is inherited, we test for this particular case through a -- convoluted tree traversal before setting the proper subprogram to be -- called. function In_Unfrozen_Instance (E : Entity_Id) return Boolean; -- Return true if E comes from an instance that is not yet frozen function Is_Direct_Deep_Call (Subp : Entity_Id) return Boolean; -- Determine if Subp denotes a non-dispatching call to a Deep routine function New_Value (From : Node_Id) return Node_Id; -- From is the original Expression. New_Value is equivalent to a call -- to Duplicate_Subexpr with an explicit dereference when From is an -- access parameter. -------------------------- -- Add_Actual_Parameter -- -------------------------- procedure Add_Actual_Parameter (Insert_Param : Node_Id) is Actual_Expr : constant Node_Id := Explicit_Actual_Parameter (Insert_Param); begin -- Case of insertion is first named actual if No (Prev) or else Nkind (Parent (Prev)) /= N_Parameter_Association then Set_Next_Named_Actual (Insert_Param, First_Named_Actual (Call_Node)); Set_First_Named_Actual (Call_Node, Actual_Expr); if No (Prev) then if No (Parameter_Associations (Call_Node)) then Set_Parameter_Associations (Call_Node, New_List); end if; Append (Insert_Param, Parameter_Associations (Call_Node)); else Insert_After (Prev, Insert_Param); end if; -- Case of insertion is not first named actual else Set_Next_Named_Actual (Insert_Param, Next_Named_Actual (Parent (Prev))); Set_Next_Named_Actual (Parent (Prev), Actual_Expr); Append (Insert_Param, Parameter_Associations (Call_Node)); end if; Prev := Actual_Expr; end Add_Actual_Parameter; ---------------------- -- Add_Extra_Actual -- ---------------------- procedure Add_Extra_Actual (Expr : Node_Id; EF : Entity_Id) is Loc : constant Source_Ptr := Sloc (Expr); begin if Extra_Actuals = No_List then Extra_Actuals := New_List; Set_Parent (Extra_Actuals, Call_Node); end if; Append_To (Extra_Actuals, Make_Parameter_Association (Loc, Selector_Name => New_Occurrence_Of (EF, Loc), Explicit_Actual_Parameter => Expr)); Analyze_And_Resolve (Expr, Etype (EF)); if Nkind (Call_Node) = N_Function_Call then Set_Is_Accessibility_Actual (Parent (Expr)); end if; end Add_Extra_Actual; ------------------------------------ -- Add_View_Conversion_Invariants -- ------------------------------------ procedure Add_View_Conversion_Invariants (Formal : Entity_Id; Actual : Node_Id) is Arg : Entity_Id; Curr_Typ : Entity_Id; Inv_Checks : List_Id; Par_Typ : Entity_Id; begin Inv_Checks := No_List; -- Extract the argument from a potentially nested set of view -- conversions. Arg := Actual; while Nkind (Arg) = N_Type_Conversion loop Arg := Expression (Arg); end loop; -- Move up the derivation chain starting with the type of the formal -- parameter down to the type of the actual object. Curr_Typ := Empty; Par_Typ := Etype (Arg); while Par_Typ /= Etype (Formal) and Par_Typ /= Curr_Typ loop Curr_Typ := Par_Typ; if Has_Invariants (Curr_Typ) and then Present (Invariant_Procedure (Curr_Typ)) then -- Verify the invariate of the current type. Generate: -- <Curr_Typ>Invariant (Curr_Typ (Arg)); Prepend_New_To (Inv_Checks, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Invariant_Procedure (Curr_Typ), Loc), Parameter_Associations => New_List ( Make_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Curr_Typ, Loc), Expression => New_Copy_Tree (Arg))))); end if; Par_Typ := Base_Type (Etype (Curr_Typ)); end loop; if not Is_Empty_List (Inv_Checks) then Insert_Actions_After (N, Inv_Checks); end if; end Add_View_Conversion_Invariants; --------------------------- -- Inherited_From_Formal -- --------------------------- function Inherited_From_Formal (S : Entity_Id) return Entity_Id is Par : Entity_Id; Gen_Par : Entity_Id; Gen_Prim : Elist_Id; Elmt : Elmt_Id; Indic : Node_Id; begin -- If the operation is inherited, it is attached to the corresponding -- type derivation. If the parent in the derivation is a generic -- actual, it is a subtype of the actual, and we have to recover the -- original derived type declaration to find the proper parent. if Nkind (Parent (S)) /= N_Full_Type_Declaration or else not Is_Derived_Type (Defining_Identifier (Parent (S))) or else Nkind (Type_Definition (Original_Node (Parent (S)))) /= N_Derived_Type_Definition or else not In_Instance then return Empty; else Indic := Subtype_Indication (Type_Definition (Original_Node (Parent (S)))); if Nkind (Indic) = N_Subtype_Indication then Par := Entity (Subtype_Mark (Indic)); else Par := Entity (Indic); end if; end if; if not Is_Generic_Actual_Type (Par) or else Is_Tagged_Type (Par) or else Nkind (Parent (Par)) /= N_Subtype_Declaration or else not In_Open_Scopes (Scope (Par)) then return Empty; else Gen_Par := Generic_Parent_Type (Parent (Par)); end if; -- If the actual has no generic parent type, the formal is not -- a formal derived type, so nothing to inherit. if No (Gen_Par) then return Empty; end if; -- If the generic parent type is still the generic type, this is a -- private formal, not a derived formal, and there are no operations -- inherited from the formal. if Nkind (Parent (Gen_Par)) = N_Formal_Type_Declaration then return Empty; end if; Gen_Prim := Collect_Primitive_Operations (Gen_Par); Elmt := First_Elmt (Gen_Prim); while Present (Elmt) loop if Chars (Node (Elmt)) = Chars (S) then declare F1 : Entity_Id; F2 : Entity_Id; begin F1 := First_Formal (S); F2 := First_Formal (Node (Elmt)); while Present (F1) and then Present (F2) loop if Etype (F1) = Etype (F2) or else Etype (F2) = Gen_Par then Next_Formal (F1); Next_Formal (F2); else Next_Elmt (Elmt); exit; -- not the right subprogram end if; return Node (Elmt); end loop; end; else Next_Elmt (Elmt); end if; end loop; raise Program_Error; end Inherited_From_Formal; -------------------------- -- In_Unfrozen_Instance -- -------------------------- function In_Unfrozen_Instance (E : Entity_Id) return Boolean is S : Entity_Id; begin S := E; while Present (S) and then S /= Standard_Standard loop if Is_Generic_Instance (S) and then Present (Freeze_Node (S)) and then not Analyzed (Freeze_Node (S)) then return True; end if; S := Scope (S); end loop; return False; end In_Unfrozen_Instance; ------------------------- -- Is_Direct_Deep_Call -- ------------------------- function Is_Direct_Deep_Call (Subp : Entity_Id) return Boolean is begin if Is_TSS (Subp, TSS_Deep_Adjust) or else Is_TSS (Subp, TSS_Deep_Finalize) or else Is_TSS (Subp, TSS_Deep_Initialize) then declare Actual : Node_Id; Formal : Node_Id; begin Actual := First (Parameter_Associations (N)); Formal := First_Formal (Subp); while Present (Actual) and then Present (Formal) loop if Nkind (Actual) = N_Identifier and then Is_Controlling_Actual (Actual) and then Etype (Actual) = Etype (Formal) then return True; end if; Next (Actual); Next_Formal (Formal); end loop; end; end if; return False; end Is_Direct_Deep_Call; --------------- -- New_Value -- --------------- function New_Value (From : Node_Id) return Node_Id is Res : constant Node_Id := Duplicate_Subexpr (From); begin if Is_Access_Type (Etype (From)) then return Make_Explicit_Dereference (Sloc (From), Prefix => Res); else return Res; end if; end New_Value; -- Local variables Remote : constant Boolean := Is_Remote_Call (Call_Node); Actual : Node_Id; Formal : Entity_Id; Orig_Subp : Entity_Id := Empty; Param_Count : Natural := 0; Parent_Formal : Entity_Id; Parent_Subp : Entity_Id; Scop : Entity_Id; Subp : Entity_Id; Prev_Orig : Node_Id; -- Original node for an actual, which may have been rewritten. If the -- actual is a function call that has been transformed from a selected -- component, the original node is unanalyzed. Otherwise, it carries -- semantic information used to generate additional actuals. CW_Interface_Formals_Present : Boolean := False; -- Start of processing for Expand_Call begin -- Expand the function or procedure call if the first actual has a -- declared dimension aspect, and the subprogram is declared in one -- of the dimension I/O packages. if Ada_Version >= Ada_2012 and then Nkind_In (Call_Node, N_Procedure_Call_Statement, N_Function_Call) and then Present (Parameter_Associations (Call_Node)) then Expand_Put_Call_With_Symbol (Call_Node); end if; -- Ignore if previous error if Nkind (Call_Node) in N_Has_Etype and then Etype (Call_Node) = Any_Type then return; end if; -- Call using access to subprogram with explicit dereference if Nkind (Name (Call_Node)) = N_Explicit_Dereference then Subp := Etype (Name (Call_Node)); Parent_Subp := Empty; -- Case of call to simple entry, where the Name is a selected component -- whose prefix is the task, and whose selector name is the entry name elsif Nkind (Name (Call_Node)) = N_Selected_Component then Subp := Entity (Selector_Name (Name (Call_Node))); Parent_Subp := Empty; -- Case of call to member of entry family, where Name is an indexed -- component, with the prefix being a selected component giving the -- task and entry family name, and the index being the entry index. elsif Nkind (Name (Call_Node)) = N_Indexed_Component then Subp := Entity (Selector_Name (Prefix (Name (Call_Node)))); Parent_Subp := Empty; -- Normal case else Subp := Entity (Name (Call_Node)); Parent_Subp := Alias (Subp); -- Replace call to Raise_Exception by call to Raise_Exception_Always -- if we can tell that the first parameter cannot possibly be null. -- This improves efficiency by avoiding a run-time test. -- We do not do this if Raise_Exception_Always does not exist, which -- can happen in configurable run time profiles which provide only a -- Raise_Exception. if Is_RTE (Subp, RE_Raise_Exception) and then RTE_Available (RE_Raise_Exception_Always) then declare FA : constant Node_Id := Original_Node (First_Actual (Call_Node)); begin -- The case we catch is where the first argument is obtained -- using the Identity attribute (which must always be -- non-null). if Nkind (FA) = N_Attribute_Reference and then Attribute_Name (FA) = Name_Identity then Subp := RTE (RE_Raise_Exception_Always); Set_Name (Call_Node, New_Occurrence_Of (Subp, Loc)); end if; end; end if; if Ekind (Subp) = E_Entry then Parent_Subp := Empty; end if; end if; -- Ada 2005 (AI-345): We have a procedure call as a triggering -- alternative in an asynchronous select or as an entry call in -- a conditional or timed select. Check whether the procedure call -- is a renaming of an entry and rewrite it as an entry call. if Ada_Version >= Ada_2005 and then Nkind (Call_Node) = N_Procedure_Call_Statement and then ((Nkind (Parent (Call_Node)) = N_Triggering_Alternative and then Triggering_Statement (Parent (Call_Node)) = Call_Node) or else (Nkind (Parent (Call_Node)) = N_Entry_Call_Alternative and then Entry_Call_Statement (Parent (Call_Node)) = Call_Node)) then declare Ren_Decl : Node_Id; Ren_Root : Entity_Id := Subp; begin -- This may be a chain of renamings, find the root if Present (Alias (Ren_Root)) then Ren_Root := Alias (Ren_Root); end if; if Present (Original_Node (Parent (Parent (Ren_Root)))) then Ren_Decl := Original_Node (Parent (Parent (Ren_Root))); if Nkind (Ren_Decl) = N_Subprogram_Renaming_Declaration then Rewrite (Call_Node, Make_Entry_Call_Statement (Loc, Name => New_Copy_Tree (Name (Ren_Decl)), Parameter_Associations => New_Copy_List_Tree (Parameter_Associations (Call_Node)))); return; end if; end if; end; end if; -- When generating C code, transform a function call that returns a -- constrained array type into procedure form. if Modify_Tree_For_C and then Nkind (Call_Node) = N_Function_Call and then Is_Entity_Name (Name (Call_Node)) and then Rewritten_For_C (Ultimate_Alias (Entity (Name (Call_Node)))) then -- For internally generated calls ensure that they reference the -- entity of the spec of the called function (needed since the -- expander may generate calls using the entity of their body). -- See for example Expand_Boolean_Operator(). if not (Comes_From_Source (Call_Node)) and then Nkind (Unit_Declaration_Node (Ultimate_Alias (Entity (Name (Call_Node))))) = N_Subprogram_Body then Set_Entity (Name (Call_Node), Corresponding_Function (Corresponding_Procedure (Ultimate_Alias (Entity (Name (Call_Node)))))); end if; Rewrite_Function_Call_For_C (Call_Node); return; end if; -- First step, compute extra actuals, corresponding to any Extra_Formals -- present. Note that we do not access Extra_Formals directly, instead -- we simply note the presence of the extra formals as we process the -- regular formals collecting corresponding actuals in Extra_Actuals. -- We also generate any required range checks for actuals for in formals -- as we go through the loop, since this is a convenient place to do it. -- (Though it seems that this would be better done in Expand_Actuals???) -- Special case: Thunks must not compute the extra actuals; they must -- just propagate to the target primitive their extra actuals. if Is_Thunk (Current_Scope) and then Thunk_Entity (Current_Scope) = Subp and then Present (Extra_Formals (Subp)) then pragma Assert (Present (Extra_Formals (Current_Scope))); declare Target_Formal : Entity_Id; Thunk_Formal : Entity_Id; begin Target_Formal := Extra_Formals (Subp); Thunk_Formal := Extra_Formals (Current_Scope); while Present (Target_Formal) loop Add_Extra_Actual (New_Occurrence_Of (Thunk_Formal, Loc), Thunk_Formal); Target_Formal := Extra_Formal (Target_Formal); Thunk_Formal := Extra_Formal (Thunk_Formal); end loop; while Is_Non_Empty_List (Extra_Actuals) loop Add_Actual_Parameter (Remove_Head (Extra_Actuals)); end loop; Expand_Actuals (Call_Node, Subp); return; end; end if; Formal := First_Formal (Subp); Actual := First_Actual (Call_Node); Param_Count := 1; while Present (Formal) loop -- Generate range check if required if Do_Range_Check (Actual) and then Ekind (Formal) = E_In_Parameter then Generate_Range_Check (Actual, Etype (Formal), CE_Range_Check_Failed); end if; -- Prepare to examine current entry Prev := Actual; Prev_Orig := Original_Node (Prev); -- Ada 2005 (AI-251): Check if any formal is a class-wide interface -- to expand it in a further round. CW_Interface_Formals_Present := CW_Interface_Formals_Present or else (Is_Class_Wide_Type (Etype (Formal)) and then Is_Interface (Etype (Etype (Formal)))) or else (Ekind (Etype (Formal)) = E_Anonymous_Access_Type and then Is_Class_Wide_Type (Directly_Designated_Type (Etype (Etype (Formal)))) and then Is_Interface (Directly_Designated_Type (Etype (Etype (Formal))))); -- Create possible extra actual for constrained case. Usually, the -- extra actual is of the form actual'constrained, but since this -- attribute is only available for unconstrained records, TRUE is -- expanded if the type of the formal happens to be constrained (for -- instance when this procedure is inherited from an unconstrained -- record to a constrained one) or if the actual has no discriminant -- (its type is constrained). An exception to this is the case of a -- private type without discriminants. In this case we pass FALSE -- because the object has underlying discriminants with defaults. if Present (Extra_Constrained (Formal)) then if Ekind (Etype (Prev)) in Private_Kind and then not Has_Discriminants (Base_Type (Etype (Prev))) then Add_Extra_Actual (New_Occurrence_Of (Standard_False, Loc), Extra_Constrained (Formal)); elsif Is_Constrained (Etype (Formal)) or else not Has_Discriminants (Etype (Prev)) then Add_Extra_Actual (New_Occurrence_Of (Standard_True, Loc), Extra_Constrained (Formal)); -- Do not produce extra actuals for Unchecked_Union parameters. -- Jump directly to the end of the loop. elsif Is_Unchecked_Union (Base_Type (Etype (Actual))) then goto Skip_Extra_Actual_Generation; else -- If the actual is a type conversion, then the constrained -- test applies to the actual, not the target type. declare Act_Prev : Node_Id; begin -- Test for unchecked conversions as well, which can occur -- as out parameter actuals on calls to stream procedures. Act_Prev := Prev; while Nkind_In (Act_Prev, N_Type_Conversion, N_Unchecked_Type_Conversion) loop Act_Prev := Expression (Act_Prev); end loop; -- If the expression is a conversion of a dereference, this -- is internally generated code that manipulates addresses, -- e.g. when building interface tables. No check should -- occur in this case, and the discriminated object is not -- directly a hand. if not Comes_From_Source (Actual) and then Nkind (Actual) = N_Unchecked_Type_Conversion and then Nkind (Act_Prev) = N_Explicit_Dereference then Add_Extra_Actual (New_Occurrence_Of (Standard_False, Loc), Extra_Constrained (Formal)); else Add_Extra_Actual (Make_Attribute_Reference (Sloc (Prev), Prefix => Duplicate_Subexpr_No_Checks (Act_Prev, Name_Req => True), Attribute_Name => Name_Constrained), Extra_Constrained (Formal)); end if; end; end if; end if; -- Create possible extra actual for accessibility level if Present (Extra_Accessibility (Formal)) then -- Ada 2005 (AI-252): If the actual was rewritten as an Access -- attribute, then the original actual may be an aliased object -- occurring as the prefix in a call using "Object.Operation" -- notation. In that case we must pass the level of the object, -- so Prev_Orig is reset to Prev and the attribute will be -- processed by the code for Access attributes further below. if Prev_Orig /= Prev and then Nkind (Prev) = N_Attribute_Reference and then Get_Attribute_Id (Attribute_Name (Prev)) = Attribute_Access and then Is_Aliased_View (Prev_Orig) then Prev_Orig := Prev; end if; -- Ada 2005 (AI-251): Thunks must propagate the extra actuals of -- accessibility levels. if Is_Thunk (Current_Scope) then declare Parm_Ent : Entity_Id; begin if Is_Controlling_Actual (Actual) then -- Find the corresponding actual of the thunk Parm_Ent := First_Entity (Current_Scope); for J in 2 .. Param_Count loop Next_Entity (Parm_Ent); end loop; -- Handle unchecked conversion of access types generated -- in thunks (cf. Expand_Interface_Thunk). elsif Is_Access_Type (Etype (Actual)) and then Nkind (Actual) = N_Unchecked_Type_Conversion then Parm_Ent := Entity (Expression (Actual)); else pragma Assert (Is_Entity_Name (Actual)); Parm_Ent := Entity (Actual); end if; Add_Extra_Actual (New_Occurrence_Of (Extra_Accessibility (Parm_Ent), Loc), Extra_Accessibility (Formal)); end; elsif Is_Entity_Name (Prev_Orig) then -- When passing an access parameter, or a renaming of an access -- parameter, as the actual to another access parameter we need -- to pass along the actual's own access level parameter. This -- is done if we are within the scope of the formal access -- parameter (if this is an inlined body the extra formal is -- irrelevant). if (Is_Formal (Entity (Prev_Orig)) or else (Present (Renamed_Object (Entity (Prev_Orig))) and then Is_Entity_Name (Renamed_Object (Entity (Prev_Orig))) and then Is_Formal (Entity (Renamed_Object (Entity (Prev_Orig)))))) and then Ekind (Etype (Prev_Orig)) = E_Anonymous_Access_Type and then In_Open_Scopes (Scope (Entity (Prev_Orig))) then declare Parm_Ent : constant Entity_Id := Param_Entity (Prev_Orig); begin pragma Assert (Present (Parm_Ent)); if Present (Extra_Accessibility (Parm_Ent)) then Add_Extra_Actual (New_Occurrence_Of (Extra_Accessibility (Parm_Ent), Loc), Extra_Accessibility (Formal)); -- If the actual access parameter does not have an -- associated extra formal providing its scope level, -- then treat the actual as having library-level -- accessibility. else Add_Extra_Actual (Make_Integer_Literal (Loc, Intval => Scope_Depth (Standard_Standard)), Extra_Accessibility (Formal)); end if; end; -- The actual is a normal access value, so just pass the level -- of the actual's access type. else Add_Extra_Actual (Dynamic_Accessibility_Level (Prev_Orig), Extra_Accessibility (Formal)); end if; -- If the actual is an access discriminant, then pass the level -- of the enclosing object (RM05-3.10.2(12.4/2)). elsif Nkind (Prev_Orig) = N_Selected_Component and then Ekind (Entity (Selector_Name (Prev_Orig))) = E_Discriminant and then Ekind (Etype (Entity (Selector_Name (Prev_Orig)))) = E_Anonymous_Access_Type then Add_Extra_Actual (Make_Integer_Literal (Loc, Intval => Object_Access_Level (Prefix (Prev_Orig))), Extra_Accessibility (Formal)); -- All other cases else case Nkind (Prev_Orig) is when N_Attribute_Reference => case Get_Attribute_Id (Attribute_Name (Prev_Orig)) is -- For X'Access, pass on the level of the prefix X when Attribute_Access => -- If this is an Access attribute applied to the -- the current instance object passed to a type -- initialization procedure, then use the level -- of the type itself. This is not really correct, -- as there should be an extra level parameter -- passed in with _init formals (only in the case -- where the type is immutably limited), but we -- don't have an easy way currently to create such -- an extra formal (init procs aren't ever frozen). -- For now we just use the level of the type, -- which may be too shallow, but that works better -- than passing Object_Access_Level of the type, -- which can be one level too deep in some cases. -- ??? if Is_Entity_Name (Prefix (Prev_Orig)) and then Is_Type (Entity (Prefix (Prev_Orig))) then Add_Extra_Actual (Make_Integer_Literal (Loc, Intval => Type_Access_Level (Entity (Prefix (Prev_Orig)))), Extra_Accessibility (Formal)); else Add_Extra_Actual (Make_Integer_Literal (Loc, Intval => Object_Access_Level (Prefix (Prev_Orig))), Extra_Accessibility (Formal)); end if; -- Treat the unchecked attributes as library-level when Attribute_Unchecked_Access | Attribute_Unrestricted_Access => Add_Extra_Actual (Make_Integer_Literal (Loc, Intval => Scope_Depth (Standard_Standard)), Extra_Accessibility (Formal)); -- No other cases of attributes returning access -- values that can be passed to access parameters. when others => raise Program_Error; end case; -- For allocators we pass the level of the execution of the -- called subprogram, which is one greater than the current -- scope level. when N_Allocator => Add_Extra_Actual (Make_Integer_Literal (Loc, Intval => Scope_Depth (Current_Scope) + 1), Extra_Accessibility (Formal)); -- For most other cases we simply pass the level of the -- actual's access type. The type is retrieved from -- Prev rather than Prev_Orig, because in some cases -- Prev_Orig denotes an original expression that has -- not been analyzed. when others => Add_Extra_Actual (Dynamic_Accessibility_Level (Prev), Extra_Accessibility (Formal)); end case; end if; end if; -- Perform the check of 4.6(49) that prevents a null value from being -- passed as an actual to an access parameter. Note that the check -- is elided in the common cases of passing an access attribute or -- access parameter as an actual. Also, we currently don't enforce -- this check for expander-generated actuals and when -gnatdj is set. if Ada_Version >= Ada_2005 then -- Ada 2005 (AI-231): Check null-excluding access types. Note that -- the intent of 6.4.1(13) is that null-exclusion checks should -- not be done for 'out' parameters, even though it refers only -- to constraint checks, and a null_exclusion is not a constraint. -- Note that AI05-0196-1 corrects this mistake in the RM. if Is_Access_Type (Etype (Formal)) and then Can_Never_Be_Null (Etype (Formal)) and then Ekind (Formal) /= E_Out_Parameter and then Nkind (Prev) /= N_Raise_Constraint_Error and then (Known_Null (Prev) or else not Can_Never_Be_Null (Etype (Prev))) then Install_Null_Excluding_Check (Prev); end if; -- Ada_Version < Ada_2005 else if Ekind (Etype (Formal)) /= E_Anonymous_Access_Type or else Access_Checks_Suppressed (Subp) then null; elsif Debug_Flag_J then null; elsif not Comes_From_Source (Prev) then null; elsif Is_Entity_Name (Prev) and then Ekind (Etype (Prev)) = E_Anonymous_Access_Type then null; elsif Nkind_In (Prev, N_Allocator, N_Attribute_Reference) then null; else Install_Null_Excluding_Check (Prev); end if; end if; -- Perform appropriate validity checks on parameters that -- are entities. if Validity_Checks_On then if (Ekind (Formal) = E_In_Parameter and then Validity_Check_In_Params) or else (Ekind (Formal) = E_In_Out_Parameter and then Validity_Check_In_Out_Params) then -- If the actual is an indexed component of a packed type (or -- is an indexed or selected component whose prefix recursively -- meets this condition), it has not been expanded yet. It will -- be copied in the validity code that follows, and has to be -- expanded appropriately, so reanalyze it. -- What we do is just to unset analyzed bits on prefixes till -- we reach something that does not have a prefix. declare Nod : Node_Id; begin Nod := Actual; while Nkind_In (Nod, N_Indexed_Component, N_Selected_Component) loop Set_Analyzed (Nod, False); Nod := Prefix (Nod); end loop; end; Ensure_Valid (Actual); end if; end if; -- For IN OUT and OUT parameters, ensure that subscripts are valid -- since this is a left side reference. We only do this for calls -- from the source program since we assume that compiler generated -- calls explicitly generate any required checks. We also need it -- only if we are doing standard validity checks, since clearly it is -- not needed if validity checks are off, and in subscript validity -- checking mode, all indexed components are checked with a call -- directly from Expand_N_Indexed_Component. if Comes_From_Source (Call_Node) and then Ekind (Formal) /= E_In_Parameter and then Validity_Checks_On and then Validity_Check_Default and then not Validity_Check_Subscripts then Check_Valid_Lvalue_Subscripts (Actual); end if; -- Mark any scalar OUT parameter that is a simple variable as no -- longer known to be valid (unless the type is always valid). This -- reflects the fact that if an OUT parameter is never set in a -- procedure, then it can become invalid on the procedure return. if Ekind (Formal) = E_Out_Parameter and then Is_Entity_Name (Actual) and then Ekind (Entity (Actual)) = E_Variable and then not Is_Known_Valid (Etype (Actual)) then Set_Is_Known_Valid (Entity (Actual), False); end if; -- For an OUT or IN OUT parameter, if the actual is an entity, then -- clear current values, since they can be clobbered. We are probably -- doing this in more places than we need to, but better safe than -- sorry when it comes to retaining bad current values. if Ekind (Formal) /= E_In_Parameter and then Is_Entity_Name (Actual) and then Present (Entity (Actual)) then declare Ent : constant Entity_Id := Entity (Actual); Sav : Node_Id; begin -- For an OUT or IN OUT parameter that is an assignable entity, -- we do not want to clobber the Last_Assignment field, since -- if it is set, it was precisely because it is indeed an OUT -- or IN OUT parameter. We do reset the Is_Known_Valid flag -- since the subprogram could have returned in invalid value. if Ekind_In (Formal, E_Out_Parameter, E_In_Out_Parameter) and then Is_Assignable (Ent) then Sav := Last_Assignment (Ent); Kill_Current_Values (Ent); Set_Last_Assignment (Ent, Sav); Set_Is_Known_Valid (Ent, False); -- For all other cases, just kill the current values else Kill_Current_Values (Ent); end if; end; end if; -- If the formal is class wide and the actual is an aggregate, force -- evaluation so that the back end who does not know about class-wide -- type, does not generate a temporary of the wrong size. if not Is_Class_Wide_Type (Etype (Formal)) then null; elsif Nkind (Actual) = N_Aggregate or else (Nkind (Actual) = N_Qualified_Expression and then Nkind (Expression (Actual)) = N_Aggregate) then Force_Evaluation (Actual); end if; -- In a remote call, if the formal is of a class-wide type, check -- that the actual meets the requirements described in E.4(18). if Remote and then Is_Class_Wide_Type (Etype (Formal)) then Insert_Action (Actual, Make_Transportable_Check (Loc, Duplicate_Subexpr_Move_Checks (Actual))); end if; -- Perform invariant checks for all intermediate types in a view -- conversion after successful return from a call that passes the -- view conversion as an IN OUT or OUT parameter (RM 7.3.2 (12/3, -- 13/3, 14/3)). Consider only source conversion in order to avoid -- generating spurious checks on complex expansion such as object -- initialization through an extension aggregate. if Comes_From_Source (N) and then Ekind (Formal) /= E_In_Parameter and then Nkind (Actual) = N_Type_Conversion then Add_View_Conversion_Invariants (Formal, Actual); end if; -- Generating C the initialization of an allocator is performed by -- means of individual statements, and hence it must be done before -- the call. if Modify_Tree_For_C and then Nkind (Actual) = N_Allocator and then Nkind (Expression (Actual)) = N_Qualified_Expression then Remove_Side_Effects (Actual); end if; -- This label is required when skipping extra actual generation for -- Unchecked_Union parameters. <<Skip_Extra_Actual_Generation>> Param_Count := Param_Count + 1; Next_Actual (Actual); Next_Formal (Formal); end loop; -- If we are calling an Ada 2012 function which needs to have the -- "accessibility level determined by the point of call" (AI05-0234) -- passed in to it, then pass it in. if Ekind_In (Subp, E_Function, E_Operator, E_Subprogram_Type) and then Present (Extra_Accessibility_Of_Result (Ultimate_Alias (Subp))) then declare Ancestor : Node_Id := Parent (Call_Node); Level : Node_Id := Empty; Defer : Boolean := False; begin -- Unimplemented: if Subp returns an anonymous access type, then -- a) if the call is the operand of an explict conversion, then -- the target type of the conversion (a named access type) -- determines the accessibility level pass in; -- b) if the call defines an access discriminant of an object -- (e.g., the discriminant of an object being created by an -- allocator, or the discriminant of a function result), -- then the accessibility level to pass in is that of the -- discriminated object being initialized). -- ??? while Nkind (Ancestor) = N_Qualified_Expression loop Ancestor := Parent (Ancestor); end loop; case Nkind (Ancestor) is when N_Allocator => -- At this point, we'd like to assign -- Level := Dynamic_Accessibility_Level (Ancestor); -- but Etype of Ancestor may not have been set yet, -- so that doesn't work. -- Handle this later in Expand_Allocator_Expression. Defer := True; when N_Object_Declaration | N_Object_Renaming_Declaration => declare Def_Id : constant Entity_Id := Defining_Identifier (Ancestor); begin if Is_Return_Object (Def_Id) then if Present (Extra_Accessibility_Of_Result (Return_Applies_To (Scope (Def_Id)))) then -- Pass along value that was passed in if the -- routine we are returning from also has an -- Accessibility_Of_Result formal. Level := New_Occurrence_Of (Extra_Accessibility_Of_Result (Return_Applies_To (Scope (Def_Id))), Loc); end if; else Level := Make_Integer_Literal (Loc, Intval => Object_Access_Level (Def_Id)); end if; end; when N_Simple_Return_Statement => if Present (Extra_Accessibility_Of_Result (Return_Applies_To (Return_Statement_Entity (Ancestor)))) then -- Pass along value that was passed in if the returned -- routine also has an Accessibility_Of_Result formal. Level := New_Occurrence_Of (Extra_Accessibility_Of_Result (Return_Applies_To (Return_Statement_Entity (Ancestor))), Loc); end if; when others => null; end case; if not Defer then if not Present (Level) then -- The "innermost master that evaluates the function call". -- ??? - Should we use Integer'Last here instead in order -- to deal with (some of) the problems associated with -- calls to subps whose enclosing scope is unknown (e.g., -- Anon_Access_To_Subp_Param.all)? Level := Make_Integer_Literal (Loc, Intval => Scope_Depth (Current_Scope) + 1); end if; Add_Extra_Actual (Level, Extra_Accessibility_Of_Result (Ultimate_Alias (Subp))); end if; end; end if; -- If we are expanding the RHS of an assignment we need to check if tag -- propagation is needed. You might expect this processing to be in -- Analyze_Assignment but has to be done earlier (bottom-up) because the -- assignment might be transformed to a declaration for an unconstrained -- value if the expression is classwide. if Nkind (Call_Node) = N_Function_Call and then Is_Tag_Indeterminate (Call_Node) and then Is_Entity_Name (Name (Call_Node)) then declare Ass : Node_Id := Empty; begin if Nkind (Parent (Call_Node)) = N_Assignment_Statement then Ass := Parent (Call_Node); elsif Nkind (Parent (Call_Node)) = N_Qualified_Expression and then Nkind (Parent (Parent (Call_Node))) = N_Assignment_Statement then Ass := Parent (Parent (Call_Node)); elsif Nkind (Parent (Call_Node)) = N_Explicit_Dereference and then Nkind (Parent (Parent (Call_Node))) = N_Assignment_Statement then Ass := Parent (Parent (Call_Node)); end if; if Present (Ass) and then Is_Class_Wide_Type (Etype (Name (Ass))) then if Is_Access_Type (Etype (Call_Node)) then if Designated_Type (Etype (Call_Node)) /= Root_Type (Etype (Name (Ass))) then Error_Msg_NE ("tag-indeterminate expression " & " must have designated type& (RM 5.2 (6))", Call_Node, Root_Type (Etype (Name (Ass)))); else Propagate_Tag (Name (Ass), Call_Node); end if; elsif Etype (Call_Node) /= Root_Type (Etype (Name (Ass))) then Error_Msg_NE ("tag-indeterminate expression must have type&" & "(RM 5.2 (6))", Call_Node, Root_Type (Etype (Name (Ass)))); else Propagate_Tag (Name (Ass), Call_Node); end if; -- The call will be rewritten as a dispatching call, and -- expanded as such. return; end if; end; end if; -- Ada 2005 (AI-251): If some formal is a class-wide interface, expand -- it to point to the correct secondary virtual table if Nkind (Call_Node) in N_Subprogram_Call and then CW_Interface_Formals_Present then Expand_Interface_Actuals (Call_Node); end if; -- Deals with Dispatch_Call if we still have a call, before expanding -- extra actuals since this will be done on the re-analysis of the -- dispatching call. Note that we do not try to shorten the actual list -- for a dispatching call, it would not make sense to do so. Expansion -- of dispatching calls is suppressed for VM targets, because the VM -- back-ends directly handle the generation of dispatching calls and -- would have to undo any expansion to an indirect call. if Nkind (Call_Node) in N_Subprogram_Call and then Present (Controlling_Argument (Call_Node)) then declare Call_Typ : constant Entity_Id := Etype (Call_Node); Typ : constant Entity_Id := Find_Dispatching_Type (Subp); Eq_Prim_Op : Entity_Id := Empty; New_Call : Node_Id; Param : Node_Id; Prev_Call : Node_Id; begin if not Is_Limited_Type (Typ) then Eq_Prim_Op := Find_Prim_Op (Typ, Name_Op_Eq); end if; if Tagged_Type_Expansion then Expand_Dispatching_Call (Call_Node); -- The following return is worrisome. Is it really OK to skip -- all remaining processing in this procedure ??? return; -- VM targets else Apply_Tag_Checks (Call_Node); -- If this is a dispatching "=", we must first compare the -- tags so we generate: x.tag = y.tag and then x = y if Subp = Eq_Prim_Op then -- Mark the node as analyzed to avoid reanalyzing this -- dispatching call (which would cause a never-ending loop) Prev_Call := Relocate_Node (Call_Node); Set_Analyzed (Prev_Call); Param := First_Actual (Call_Node); New_Call := Make_And_Then (Loc, Left_Opnd => Make_Op_Eq (Loc, Left_Opnd => Make_Selected_Component (Loc, Prefix => New_Value (Param), Selector_Name => New_Occurrence_Of (First_Tag_Component (Typ), Loc)), Right_Opnd => Make_Selected_Component (Loc, Prefix => Unchecked_Convert_To (Typ, New_Value (Next_Actual (Param))), Selector_Name => New_Occurrence_Of (First_Tag_Component (Typ), Loc))), Right_Opnd => Prev_Call); Rewrite (Call_Node, New_Call); Analyze_And_Resolve (Call_Node, Call_Typ, Suppress => All_Checks); end if; -- Expansion of a dispatching call results in an indirect call, -- which in turn causes current values to be killed (see -- Resolve_Call), so on VM targets we do the call here to -- ensure consistent warnings between VM and non-VM targets. Kill_Current_Values; end if; -- If this is a dispatching "=" then we must update the reference -- to the call node because we generated: -- x.tag = y.tag and then x = y if Subp = Eq_Prim_Op then Call_Node := Right_Opnd (Call_Node); end if; end; end if; -- Similarly, expand calls to RCI subprograms on which pragma -- All_Calls_Remote applies. The rewriting will be reanalyzed -- later. Do this only when the call comes from source since we -- do not want such a rewriting to occur in expanded code. if Is_All_Remote_Call (Call_Node) then Expand_All_Calls_Remote_Subprogram_Call (Call_Node); -- Similarly, do not add extra actuals for an entry call whose entity -- is a protected procedure, or for an internal protected subprogram -- call, because it will be rewritten as a protected subprogram call -- and reanalyzed (see Expand_Protected_Subprogram_Call). elsif Is_Protected_Type (Scope (Subp)) and then (Ekind (Subp) = E_Procedure or else Ekind (Subp) = E_Function) then null; -- During that loop we gathered the extra actuals (the ones that -- correspond to Extra_Formals), so now they can be appended. else while Is_Non_Empty_List (Extra_Actuals) loop Add_Actual_Parameter (Remove_Head (Extra_Actuals)); end loop; end if; -- At this point we have all the actuals, so this is the point at which -- the various expansion activities for actuals is carried out. Expand_Actuals (Call_Node, Subp); -- Verify that the actuals do not share storage. This check must be done -- on the caller side rather that inside the subprogram to avoid issues -- of parameter passing. if Check_Aliasing_Of_Parameters then Apply_Parameter_Aliasing_Checks (Call_Node, Subp); end if; -- If the subprogram is a renaming, or if it is inherited, replace it in -- the call with the name of the actual subprogram being called. If this -- is a dispatching call, the run-time decides what to call. The Alias -- attribute does not apply to entries. if Nkind (Call_Node) /= N_Entry_Call_Statement and then No (Controlling_Argument (Call_Node)) and then Present (Parent_Subp) and then not Is_Direct_Deep_Call (Subp) then if Present (Inherited_From_Formal (Subp)) then Parent_Subp := Inherited_From_Formal (Subp); else Parent_Subp := Ultimate_Alias (Parent_Subp); end if; -- The below setting of Entity is suspect, see F109-018 discussion??? Set_Entity (Name (Call_Node), Parent_Subp); if Is_Abstract_Subprogram (Parent_Subp) and then not In_Instance then Error_Msg_NE ("cannot call abstract subprogram &!", Name (Call_Node), Parent_Subp); end if; -- Inspect all formals of derived subprogram Subp. Compare parameter -- types with the parent subprogram and check whether an actual may -- need a type conversion to the corresponding formal of the parent -- subprogram. -- Not clear whether intrinsic subprograms need such conversions. ??? if not Is_Intrinsic_Subprogram (Parent_Subp) or else Is_Generic_Instance (Parent_Subp) then declare procedure Convert (Act : Node_Id; Typ : Entity_Id); -- Rewrite node Act as a type conversion of Act to Typ. Analyze -- and resolve the newly generated construct. ------------- -- Convert -- ------------- procedure Convert (Act : Node_Id; Typ : Entity_Id) is begin Rewrite (Act, OK_Convert_To (Typ, Relocate_Node (Act))); Analyze (Act); Resolve (Act, Typ); end Convert; -- Local variables Actual_Typ : Entity_Id; Formal_Typ : Entity_Id; Parent_Typ : Entity_Id; begin Actual := First_Actual (Call_Node); Formal := First_Formal (Subp); Parent_Formal := First_Formal (Parent_Subp); while Present (Formal) loop Actual_Typ := Etype (Actual); Formal_Typ := Etype (Formal); Parent_Typ := Etype (Parent_Formal); -- For an IN parameter of a scalar type, the parent formal -- type and derived formal type differ or the parent formal -- type and actual type do not match statically. if Is_Scalar_Type (Formal_Typ) and then Ekind (Formal) = E_In_Parameter and then Formal_Typ /= Parent_Typ and then not Subtypes_Statically_Match (Parent_Typ, Actual_Typ) and then not Raises_Constraint_Error (Actual) then Convert (Actual, Parent_Typ); Enable_Range_Check (Actual); -- If the actual has been marked as requiring a range -- check, then generate it here. if Do_Range_Check (Actual) then Generate_Range_Check (Actual, Etype (Formal), CE_Range_Check_Failed); end if; -- For access types, the parent formal type and actual type -- differ. elsif Is_Access_Type (Formal_Typ) and then Base_Type (Parent_Typ) /= Base_Type (Actual_Typ) then if Ekind (Formal) /= E_In_Parameter then Convert (Actual, Parent_Typ); elsif Ekind (Parent_Typ) = E_Anonymous_Access_Type and then Designated_Type (Parent_Typ) /= Designated_Type (Actual_Typ) and then not Is_Controlling_Formal (Formal) then -- This unchecked conversion is not necessary unless -- inlining is enabled, because in that case the type -- mismatch may become visible in the body about to be -- inlined. Rewrite (Actual, Unchecked_Convert_To (Parent_Typ, Relocate_Node (Actual))); Analyze (Actual); Resolve (Actual, Parent_Typ); end if; -- If there is a change of representation, then generate a -- warning, and do the change of representation. elsif not Same_Representation (Formal_Typ, Parent_Typ) then Error_Msg_N ("??change of representation required", Actual); Convert (Actual, Parent_Typ); -- For array and record types, the parent formal type and -- derived formal type have different sizes or pragma Pack -- status. elsif ((Is_Array_Type (Formal_Typ) and then Is_Array_Type (Parent_Typ)) or else (Is_Record_Type (Formal_Typ) and then Is_Record_Type (Parent_Typ))) and then (Esize (Formal_Typ) /= Esize (Parent_Typ) or else Has_Pragma_Pack (Formal_Typ) /= Has_Pragma_Pack (Parent_Typ)) then Convert (Actual, Parent_Typ); end if; Next_Actual (Actual); Next_Formal (Formal); Next_Formal (Parent_Formal); end loop; end; end if; Orig_Subp := Subp; Subp := Parent_Subp; end if; -- Deal with case where call is an explicit dereference if Nkind (Name (Call_Node)) = N_Explicit_Dereference then -- Handle case of access to protected subprogram type if Is_Access_Protected_Subprogram_Type (Base_Type (Etype (Prefix (Name (Call_Node))))) then -- If this is a call through an access to protected operation, the -- prefix has the form (object'address, operation'access). Rewrite -- as a for other protected calls: the object is the 1st parameter -- of the list of actuals. declare Call : Node_Id; Parm : List_Id; Nam : Node_Id; Obj : Node_Id; Ptr : constant Node_Id := Prefix (Name (Call_Node)); T : constant Entity_Id := Equivalent_Type (Base_Type (Etype (Ptr))); D_T : constant Entity_Id := Designated_Type (Base_Type (Etype (Ptr))); begin Obj := Make_Selected_Component (Loc, Prefix => Unchecked_Convert_To (T, Ptr), Selector_Name => New_Occurrence_Of (First_Entity (T), Loc)); Nam := Make_Selected_Component (Loc, Prefix => Unchecked_Convert_To (T, Ptr), Selector_Name => New_Occurrence_Of (Next_Entity (First_Entity (T)), Loc)); Nam := Make_Explicit_Dereference (Loc, Prefix => Nam); if Present (Parameter_Associations (Call_Node)) then Parm := Parameter_Associations (Call_Node); else Parm := New_List; end if; Prepend (Obj, Parm); if Etype (D_T) = Standard_Void_Type then Call := Make_Procedure_Call_Statement (Loc, Name => Nam, Parameter_Associations => Parm); else Call := Make_Function_Call (Loc, Name => Nam, Parameter_Associations => Parm); end if; Set_First_Named_Actual (Call, First_Named_Actual (Call_Node)); Set_Etype (Call, Etype (D_T)); -- We do not re-analyze the call to avoid infinite recursion. -- We analyze separately the prefix and the object, and set -- the checks on the prefix that would otherwise be emitted -- when resolving a call. Rewrite (Call_Node, Call); Analyze (Nam); Apply_Access_Check (Nam); Analyze (Obj); return; end; end if; end if; -- If this is a call to an intrinsic subprogram, then perform the -- appropriate expansion to the corresponding tree node and we -- are all done (since after that the call is gone). -- In the case where the intrinsic is to be processed by the back end, -- the call to Expand_Intrinsic_Call will do nothing, which is fine, -- since the idea in this case is to pass the call unchanged. If the -- intrinsic is an inherited unchecked conversion, and the derived type -- is the target type of the conversion, we must retain it as the return -- type of the expression. Otherwise the expansion below, which uses the -- parent operation, will yield the wrong type. if Is_Intrinsic_Subprogram (Subp) then Expand_Intrinsic_Call (Call_Node, Subp); if Nkind (Call_Node) = N_Unchecked_Type_Conversion and then Parent_Subp /= Orig_Subp and then Etype (Parent_Subp) /= Etype (Orig_Subp) then Set_Etype (Call_Node, Etype (Orig_Subp)); end if; return; end if; if Ekind_In (Subp, E_Function, E_Procedure) then -- We perform a simple optimization on calls for To_Address by -- replacing them with an unchecked conversion. Not only is this -- efficient, but it also avoids order of elaboration problems when -- address clauses are inlined (address expression elaborated at the -- at the wrong point). -- We perform this optimization regardless of whether we are in the -- main unit or in a unit in the context of the main unit, to ensure -- that tree generated is the same in both cases, for CodePeer use. if Is_RTE (Subp, RE_To_Address) then Rewrite (Call_Node, Unchecked_Convert_To (RTE (RE_Address), Relocate_Node (First_Actual (Call_Node)))); return; end if; -- Handle inlining. No action needed if the subprogram is not inlined if not Is_Inlined (Subp) then null; -- Frontend inlining of expression functions (performed also when -- backend inlining is enabled). elsif Is_Inlinable_Expression_Function (Subp) then Rewrite (N, New_Copy (Expression_Of_Expression_Function (Subp))); Analyze (N); return; -- Handle frontend inlining elsif not Back_End_Inlining then Inlined_Subprogram : declare Bod : Node_Id; Must_Inline : Boolean := False; Spec : constant Node_Id := Unit_Declaration_Node (Subp); begin -- Verify that the body to inline has already been seen, and -- that if the body is in the current unit the inlining does -- not occur earlier. This avoids order-of-elaboration problems -- in the back end. -- This should be documented in sinfo/einfo ??? if No (Spec) or else Nkind (Spec) /= N_Subprogram_Declaration or else No (Body_To_Inline (Spec)) then Must_Inline := False; -- If this an inherited function that returns a private type, -- do not inline if the full view is an unconstrained array, -- because such calls cannot be inlined. elsif Present (Orig_Subp) and then Is_Array_Type (Etype (Orig_Subp)) and then not Is_Constrained (Etype (Orig_Subp)) then Must_Inline := False; elsif In_Unfrozen_Instance (Scope (Subp)) then Must_Inline := False; else Bod := Body_To_Inline (Spec); if (In_Extended_Main_Code_Unit (Call_Node) or else In_Extended_Main_Code_Unit (Parent (Call_Node)) or else Has_Pragma_Inline_Always (Subp)) and then (not In_Same_Extended_Unit (Sloc (Bod), Loc) or else Earlier_In_Extended_Unit (Sloc (Bod), Loc)) then Must_Inline := True; -- If we are compiling a package body that is not the main -- unit, it must be for inlining/instantiation purposes, -- in which case we inline the call to insure that the same -- temporaries are generated when compiling the body by -- itself. Otherwise link errors can occur. -- If the function being called is itself in the main unit, -- we cannot inline, because there is a risk of double -- elaboration and/or circularity: the inlining can make -- visible a private entity in the body of the main unit, -- that gigi will see before its sees its proper definition. elsif not (In_Extended_Main_Code_Unit (Call_Node)) and then In_Package_Body then Must_Inline := not In_Extended_Main_Source_Unit (Subp); -- Inline calls to _postconditions when generating C code elsif Modify_Tree_For_C and then In_Same_Extended_Unit (Sloc (Bod), Loc) and then Chars (Name (N)) = Name_uPostconditions then Must_Inline := True; end if; end if; if Must_Inline then Expand_Inlined_Call (Call_Node, Subp, Orig_Subp); else -- Let the back end handle it Add_Inlined_Body (Subp, Call_Node); if Front_End_Inlining and then Nkind (Spec) = N_Subprogram_Declaration and then (In_Extended_Main_Code_Unit (Call_Node)) and then No (Body_To_Inline (Spec)) and then not Has_Completion (Subp) and then In_Same_Extended_Unit (Sloc (Spec), Loc) then Cannot_Inline ("cannot inline& (body not seen yet)?", Call_Node, Subp); end if; end if; end Inlined_Subprogram; -- Back end inlining: let the back end handle it elsif No (Unit_Declaration_Node (Subp)) or else Nkind (Unit_Declaration_Node (Subp)) /= N_Subprogram_Declaration or else No (Body_To_Inline (Unit_Declaration_Node (Subp))) or else Nkind (Body_To_Inline (Unit_Declaration_Node (Subp))) in N_Entity then Add_Inlined_Body (Subp, Call_Node); -- If the inlined call appears within an instantiation and some -- level of optimization is required, ensure that the enclosing -- instance body is available so that the back-end can actually -- perform the inlining. if In_Instance and then Comes_From_Source (Subp) and then Optimization_Level > 0 then declare Decl : Node_Id; Inst : Entity_Id; Inst_Node : Node_Id; begin Inst := Scope (Subp); -- Find enclosing instance while Present (Inst) and then Inst /= Standard_Standard loop exit when Is_Generic_Instance (Inst); Inst := Scope (Inst); end loop; if Present (Inst) and then Is_Generic_Instance (Inst) and then not Is_Inlined (Inst) then Set_Is_Inlined (Inst); Decl := Unit_Declaration_Node (Inst); -- Do not add a pending instantiation if the body exits -- already, or if the instance is a compilation unit, or -- the instance node is missing. if Present (Corresponding_Body (Decl)) or else Nkind (Parent (Decl)) = N_Compilation_Unit or else No (Next (Decl)) then null; else -- The instantiation node usually follows the package -- declaration for the instance. If the generic unit -- has aspect specifications, they are transformed -- into pragmas in the instance, and the instance node -- appears after them. Inst_Node := Next (Decl); while Nkind (Inst_Node) /= N_Package_Instantiation loop Inst_Node := Next (Inst_Node); end loop; Add_Pending_Instantiation (Inst_Node, Decl); end if; end if; end; end if; -- Front end expansion of simple functions returning unconstrained -- types (see Check_And_Split_Unconstrained_Function). Note that the -- case of a simple renaming (Body_To_Inline in N_Entity above, see -- also Build_Renamed_Body) cannot be expanded here because this may -- give rise to order-of-elaboration issues for the types of the -- parameters of the subprogram, if any. else Expand_Inlined_Call (Call_Node, Subp, Orig_Subp); end if; end if; -- Check for protected subprogram. This is either an intra-object call, -- or a protected function call. Protected procedure calls are rewritten -- as entry calls and handled accordingly. -- In Ada 2005, this may be an indirect call to an access parameter that -- is an access_to_subprogram. In that case the anonymous type has a -- scope that is a protected operation, but the call is a regular one. -- In either case do not expand call if subprogram is eliminated. Scop := Scope (Subp); if Nkind (Call_Node) /= N_Entry_Call_Statement and then Is_Protected_Type (Scop) and then Ekind (Subp) /= E_Subprogram_Type and then not Is_Eliminated (Subp) then -- If the call is an internal one, it is rewritten as a call to the -- corresponding unprotected subprogram. Expand_Protected_Subprogram_Call (Call_Node, Subp, Scop); end if; -- Functions returning controlled objects need special attention. If -- the return type is limited, then the context is initialization and -- different processing applies. If the call is to a protected function, -- the expansion above will call Expand_Call recursively. Otherwise the -- function call is transformed into a temporary which obtains the -- result from the secondary stack. if Needs_Finalization (Etype (Subp)) then if not Is_Limited_View (Etype (Subp)) and then (No (First_Formal (Subp)) or else not Is_Concurrent_Record_Type (Etype (First_Formal (Subp)))) then Expand_Ctrl_Function_Call (Call_Node); -- Build-in-place function calls which appear in anonymous contexts -- need a transient scope to ensure the proper finalization of the -- intermediate result after its use. elsif Is_Build_In_Place_Function_Call (Call_Node) and then Nkind_In (Parent (Call_Node), N_Attribute_Reference, N_Function_Call, N_Indexed_Component, N_Object_Renaming_Declaration, N_Procedure_Call_Statement, N_Selected_Component, N_Slice) then Establish_Transient_Scope (Call_Node, Sec_Stack => True); end if; end if; end Expand_Call; ------------------------------- -- Expand_Ctrl_Function_Call -- ------------------------------- procedure Expand_Ctrl_Function_Call (N : Node_Id) is function Is_Element_Reference (N : Node_Id) return Boolean; -- Determine whether node N denotes a reference to an Ada 2012 container -- element. -------------------------- -- Is_Element_Reference -- -------------------------- function Is_Element_Reference (N : Node_Id) return Boolean is Ref : constant Node_Id := Original_Node (N); begin -- Analysis marks an element reference by setting the generalized -- indexing attribute of an indexed component before the component -- is rewritten into a function call. return Nkind (Ref) = N_Indexed_Component and then Present (Generalized_Indexing (Ref)); end Is_Element_Reference; -- Start of processing for Expand_Ctrl_Function_Call begin -- Optimization, if the returned value (which is on the sec-stack) is -- returned again, no need to copy/readjust/finalize, we can just pass -- the value thru (see Expand_N_Simple_Return_Statement), and thus no -- attachment is needed if Nkind (Parent (N)) = N_Simple_Return_Statement then return; end if; -- Resolution is now finished, make sure we don't start analysis again -- because of the duplication. Set_Analyzed (N); -- A function which returns a controlled object uses the secondary -- stack. Rewrite the call into a temporary which obtains the result of -- the function using 'reference. Remove_Side_Effects (N); -- The side effect removal of the function call produced a temporary. -- When the context is a case expression, if expression, or expression -- with actions, the lifetime of the temporary must be extended to match -- that of the context. Otherwise the function result will be finalized -- too early and affect the result of the expression. To prevent this -- unwanted effect, the temporary should not be considered for clean up -- actions by the general finalization machinery. -- Exception to this rule are references to Ada 2012 container elements. -- Such references must be finalized at the end of each iteration of the -- related quantified expression, otherwise the container will remain -- busy. if Nkind (N) = N_Explicit_Dereference and then Within_Case_Or_If_Expression (N) and then not Is_Element_Reference (N) then Set_Is_Ignored_Transient (Entity (Prefix (N))); end if; end Expand_Ctrl_Function_Call; ---------------------------------------- -- Expand_N_Extended_Return_Statement -- ---------------------------------------- -- If there is a Handled_Statement_Sequence, we rewrite this: -- return Result : T := <expression> do -- <handled_seq_of_stms> -- end return; -- to be: -- declare -- Result : T := <expression>; -- begin -- <handled_seq_of_stms> -- return Result; -- end; -- Otherwise (no Handled_Statement_Sequence), we rewrite this: -- return Result : T := <expression>; -- to be: -- return <expression>; -- unless it's build-in-place or there's no <expression>, in which case -- we generate: -- declare -- Result : T := <expression>; -- begin -- return Result; -- end; -- Note that this case could have been written by the user as an extended -- return statement, or could have been transformed to this from a simple -- return statement. -- That is, we need to have a reified return object if there are statements -- (which might refer to it) or if we're doing build-in-place (so we can -- set its address to the final resting place or if there is no expression -- (in which case default initial values might need to be set). procedure Expand_N_Extended_Return_Statement (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); function Build_Heap_Allocator (Temp_Id : Entity_Id; Temp_Typ : Entity_Id; Func_Id : Entity_Id; Ret_Typ : Entity_Id; Alloc_Expr : Node_Id) return Node_Id; -- Create the statements necessary to allocate a return object on the -- caller's master. The master is available through implicit parameter -- BIPfinalizationmaster. -- -- if BIPfinalizationmaster /= null then -- declare -- type Ptr_Typ is access Ret_Typ; -- for Ptr_Typ'Storage_Pool use -- Base_Pool (BIPfinalizationmaster.all).all; -- Local : Ptr_Typ; -- -- begin -- procedure Allocate (...) is -- begin -- System.Storage_Pools.Subpools.Allocate_Any (...); -- end Allocate; -- -- Local := <Alloc_Expr>; -- Temp_Id := Temp_Typ (Local); -- end; -- end if; -- -- Temp_Id is the temporary which is used to reference the internally -- created object in all allocation forms. Temp_Typ is the type of the -- temporary. Func_Id is the enclosing function. Ret_Typ is the return -- type of Func_Id. Alloc_Expr is the actual allocator. function Move_Activation_Chain (Func_Id : Entity_Id) return Node_Id; -- Construct a call to System.Tasking.Stages.Move_Activation_Chain -- with parameters: -- From current activation chain -- To activation chain passed in by the caller -- New_Master master passed in by the caller -- -- Func_Id is the entity of the function where the extended return -- statement appears. -------------------------- -- Build_Heap_Allocator -- -------------------------- function Build_Heap_Allocator (Temp_Id : Entity_Id; Temp_Typ : Entity_Id; Func_Id : Entity_Id; Ret_Typ : Entity_Id; Alloc_Expr : Node_Id) return Node_Id is begin pragma Assert (Is_Build_In_Place_Function (Func_Id)); -- Processing for build-in-place object allocation. if Needs_Finalization (Ret_Typ) then declare Decls : constant List_Id := New_List; Fin_Mas_Id : constant Entity_Id := Build_In_Place_Formal (Func_Id, BIP_Finalization_Master); Stmts : constant List_Id := New_List; Desig_Typ : Entity_Id; Local_Id : Entity_Id; Pool_Id : Entity_Id; Ptr_Typ : Entity_Id; begin -- Generate: -- Pool_Id renames Base_Pool (BIPfinalizationmaster.all).all; Pool_Id := Make_Temporary (Loc, 'P'); Append_To (Decls, Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Pool_Id, Subtype_Mark => New_Occurrence_Of (RTE (RE_Root_Storage_Pool), Loc), Name => Make_Explicit_Dereference (Loc, Prefix => Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_Base_Pool), Loc), Parameter_Associations => New_List ( Make_Explicit_Dereference (Loc, Prefix => New_Occurrence_Of (Fin_Mas_Id, Loc))))))); -- Create an access type which uses the storage pool of the -- caller's master. This additional type is necessary because -- the finalization master cannot be associated with the type -- of the temporary. Otherwise the secondary stack allocation -- will fail. Desig_Typ := Ret_Typ; -- Ensure that the build-in-place machinery uses a fat pointer -- when allocating an unconstrained array on the heap. In this -- case the result object type is a constrained array type even -- though the function type is unconstrained. if Ekind (Desig_Typ) = E_Array_Subtype then Desig_Typ := Base_Type (Desig_Typ); end if; -- Generate: -- type Ptr_Typ is access Desig_Typ; Ptr_Typ := Make_Temporary (Loc, 'P'); Append_To (Decls, Make_Full_Type_Declaration (Loc, Defining_Identifier => Ptr_Typ, Type_Definition => Make_Access_To_Object_Definition (Loc, Subtype_Indication => New_Occurrence_Of (Desig_Typ, Loc)))); -- Perform minor decoration in order to set the master and the -- storage pool attributes. Set_Ekind (Ptr_Typ, E_Access_Type); Set_Finalization_Master (Ptr_Typ, Fin_Mas_Id); Set_Associated_Storage_Pool (Ptr_Typ, Pool_Id); -- Create the temporary, generate: -- Local_Id : Ptr_Typ; Local_Id := Make_Temporary (Loc, 'T'); Append_To (Decls, Make_Object_Declaration (Loc, Defining_Identifier => Local_Id, Object_Definition => New_Occurrence_Of (Ptr_Typ, Loc))); -- Allocate the object, generate: -- Local_Id := <Alloc_Expr>; Append_To (Stmts, Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Local_Id, Loc), Expression => Alloc_Expr)); -- Generate: -- Temp_Id := Temp_Typ (Local_Id); Append_To (Stmts, Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Temp_Id, Loc), Expression => Unchecked_Convert_To (Temp_Typ, New_Occurrence_Of (Local_Id, Loc)))); -- Wrap the allocation in a block. This is further conditioned -- by checking the caller finalization master at runtime. A -- null value indicates a non-existent master, most likely due -- to a Finalize_Storage_Only allocation. -- Generate: -- if BIPfinalizationmaster /= null then -- declare -- <Decls> -- begin -- <Stmts> -- end; -- end if; return Make_If_Statement (Loc, Condition => Make_Op_Ne (Loc, Left_Opnd => New_Occurrence_Of (Fin_Mas_Id, Loc), Right_Opnd => Make_Null (Loc)), Then_Statements => New_List ( Make_Block_Statement (Loc, Declarations => Decls, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, Statements => Stmts)))); end; -- For all other cases, generate: -- Temp_Id := <Alloc_Expr>; else return Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Temp_Id, Loc), Expression => Alloc_Expr); end if; end Build_Heap_Allocator; --------------------------- -- Move_Activation_Chain -- --------------------------- function Move_Activation_Chain (Func_Id : Entity_Id) return Node_Id is begin return Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Move_Activation_Chain), Loc), Parameter_Associations => New_List ( -- Source chain Make_Attribute_Reference (Loc, Prefix => Make_Identifier (Loc, Name_uChain), Attribute_Name => Name_Unrestricted_Access), -- Destination chain New_Occurrence_Of (Build_In_Place_Formal (Func_Id, BIP_Activation_Chain), Loc), -- New master New_Occurrence_Of (Build_In_Place_Formal (Func_Id, BIP_Task_Master), Loc))); end Move_Activation_Chain; -- Local variables Func_Id : constant Entity_Id := Return_Applies_To (Return_Statement_Entity (N)); Is_BIP_Func : constant Boolean := Is_Build_In_Place_Function (Func_Id); Ret_Obj_Id : constant Entity_Id := First_Entity (Return_Statement_Entity (N)); Ret_Obj_Decl : constant Node_Id := Parent (Ret_Obj_Id); Ret_Typ : constant Entity_Id := Etype (Func_Id); Exp : Node_Id; HSS : Node_Id; Result : Node_Id; Return_Stmt : Node_Id; Stmts : List_Id; -- Start of processing for Expand_N_Extended_Return_Statement begin -- Given that functionality of interface thunks is simple (just displace -- the pointer to the object) they are always handled by means of -- simple return statements. pragma Assert (not Is_Thunk (Current_Scope)); if Nkind (Ret_Obj_Decl) = N_Object_Declaration then Exp := Expression (Ret_Obj_Decl); else Exp := Empty; end if; HSS := Handled_Statement_Sequence (N); -- If the returned object needs finalization actions, the function must -- perform the appropriate cleanup should it fail to return. The state -- of the function itself is tracked through a flag which is coupled -- with the scope finalizer. There is one flag per each return object -- in case of multiple returns. if Is_BIP_Func and then Needs_Finalization (Etype (Ret_Obj_Id)) then declare Flag_Decl : Node_Id; Flag_Id : Entity_Id; Func_Bod : Node_Id; begin -- Recover the function body Func_Bod := Unit_Declaration_Node (Func_Id); if Nkind (Func_Bod) = N_Subprogram_Declaration then Func_Bod := Parent (Parent (Corresponding_Body (Func_Bod))); end if; -- Create a flag to track the function state Flag_Id := Make_Temporary (Loc, 'F'); Set_Status_Flag_Or_Transient_Decl (Ret_Obj_Id, Flag_Id); -- Insert the flag at the beginning of the function declarations, -- generate: -- Fnn : Boolean := False; Flag_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Flag_Id, Object_Definition => New_Occurrence_Of (Standard_Boolean, Loc), Expression => New_Occurrence_Of (Standard_False, Loc)); Prepend_To (Declarations (Func_Bod), Flag_Decl); Analyze (Flag_Decl); end; end if; -- Build a simple_return_statement that returns the return object when -- there is a statement sequence, or no expression, or the result will -- be built in place. Note however that we currently do this for all -- composite cases, even though nonlimited composite results are not yet -- built in place (though we plan to do so eventually). if Present (HSS) or else Is_Composite_Type (Ret_Typ) or else No (Exp) then if No (HSS) then Stmts := New_List; -- If the extended return has a handled statement sequence, then wrap -- it in a block and use the block as the first statement. else Stmts := New_List ( Make_Block_Statement (Loc, Declarations => New_List, Handled_Statement_Sequence => HSS)); end if; -- If the result type contains tasks, we call Move_Activation_Chain. -- Later, the cleanup code will call Complete_Master, which will -- terminate any unactivated tasks belonging to the return statement -- master. But Move_Activation_Chain updates their master to be that -- of the caller, so they will not be terminated unless the return -- statement completes unsuccessfully due to exception, abort, goto, -- or exit. As a formality, we test whether the function requires the -- result to be built in place, though that's necessarily true for -- the case of result types with task parts. if Is_BIP_Func and then Has_Task (Ret_Typ) then -- The return expression is an aggregate for a complex type which -- contains tasks. This particular case is left unexpanded since -- the regular expansion would insert all temporaries and -- initialization code in the wrong block. if Nkind (Exp) = N_Aggregate then Expand_N_Aggregate (Exp); end if; -- Do not move the activation chain if the return object does not -- contain tasks. if Has_Task (Etype (Ret_Obj_Id)) then Append_To (Stmts, Move_Activation_Chain (Func_Id)); end if; end if; -- Update the state of the function right before the object is -- returned. if Is_BIP_Func and then Needs_Finalization (Etype (Ret_Obj_Id)) then declare Flag_Id : constant Entity_Id := Status_Flag_Or_Transient_Decl (Ret_Obj_Id); begin -- Generate: -- Fnn := True; Append_To (Stmts, Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Flag_Id, Loc), Expression => New_Occurrence_Of (Standard_True, Loc))); end; end if; -- Build a simple_return_statement that returns the return object Return_Stmt := Make_Simple_Return_Statement (Loc, Expression => New_Occurrence_Of (Ret_Obj_Id, Loc)); Append_To (Stmts, Return_Stmt); HSS := Make_Handled_Sequence_Of_Statements (Loc, Stmts); end if; -- Case where we build a return statement block if Present (HSS) then Result := Make_Block_Statement (Loc, Declarations => Return_Object_Declarations (N), Handled_Statement_Sequence => HSS); -- We set the entity of the new block statement to be that of the -- return statement. This is necessary so that various fields, such -- as Finalization_Chain_Entity carry over from the return statement -- to the block. Note that this block is unusual, in that its entity -- is an E_Return_Statement rather than an E_Block. Set_Identifier (Result, New_Occurrence_Of (Return_Statement_Entity (N), Loc)); -- If the object decl was already rewritten as a renaming, then we -- don't want to do the object allocation and transformation of -- the return object declaration to a renaming. This case occurs -- when the return object is initialized by a call to another -- build-in-place function, and that function is responsible for -- the allocation of the return object. if Is_BIP_Func and then Nkind (Ret_Obj_Decl) = N_Object_Renaming_Declaration then pragma Assert (Nkind (Original_Node (Ret_Obj_Decl)) = N_Object_Declaration and then Is_Build_In_Place_Function_Call (Expression (Original_Node (Ret_Obj_Decl)))); -- Return the build-in-place result by reference Set_By_Ref (Return_Stmt); elsif Is_BIP_Func then -- Locate the implicit access parameter associated with the -- caller-supplied return object and convert the return -- statement's return object declaration to a renaming of a -- dereference of the access parameter. If the return object's -- declaration includes an expression that has not already been -- expanded as separate assignments, then add an assignment -- statement to ensure the return object gets initialized. -- declare -- Result : T [:= <expression>]; -- begin -- ... -- is converted to -- declare -- Result : T renames FuncRA.all; -- [Result := <expression;] -- begin -- ... declare Ret_Obj_Expr : constant Node_Id := Expression (Ret_Obj_Decl); Ret_Obj_Typ : constant Entity_Id := Etype (Ret_Obj_Id); Init_Assignment : Node_Id := Empty; Obj_Acc_Formal : Entity_Id; Obj_Acc_Deref : Node_Id; Obj_Alloc_Formal : Entity_Id; begin -- Build-in-place results must be returned by reference Set_By_Ref (Return_Stmt); -- Retrieve the implicit access parameter passed by the caller Obj_Acc_Formal := Build_In_Place_Formal (Func_Id, BIP_Object_Access); -- If the return object's declaration includes an expression -- and the declaration isn't marked as No_Initialization, then -- we need to generate an assignment to the object and insert -- it after the declaration before rewriting it as a renaming -- (otherwise we'll lose the initialization). The case where -- the result type is an interface (or class-wide interface) -- is also excluded because the context of the function call -- must be unconstrained, so the initialization will always -- be done as part of an allocator evaluation (storage pool -- or secondary stack), never to a constrained target object -- passed in by the caller. Besides the assignment being -- unneeded in this case, it avoids problems with trying to -- generate a dispatching assignment when the return expression -- is a nonlimited descendant of a limited interface (the -- interface has no assignment operation). if Present (Ret_Obj_Expr) and then not No_Initialization (Ret_Obj_Decl) and then not Is_Interface (Ret_Obj_Typ) then Init_Assignment := Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Ret_Obj_Id, Loc), Expression => Relocate_Node (Ret_Obj_Expr)); Set_Etype (Name (Init_Assignment), Etype (Ret_Obj_Id)); Set_Assignment_OK (Name (Init_Assignment)); Set_No_Ctrl_Actions (Init_Assignment); Set_Parent (Name (Init_Assignment), Init_Assignment); Set_Parent (Expression (Init_Assignment), Init_Assignment); Set_Expression (Ret_Obj_Decl, Empty); if Is_Class_Wide_Type (Etype (Ret_Obj_Id)) and then not Is_Class_Wide_Type (Etype (Expression (Init_Assignment))) then Rewrite (Expression (Init_Assignment), Make_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Etype (Ret_Obj_Id), Loc), Expression => Relocate_Node (Expression (Init_Assignment)))); end if; -- In the case of functions where the calling context can -- determine the form of allocation needed, initialization -- is done with each part of the if statement that handles -- the different forms of allocation (this is true for -- unconstrained and tagged result subtypes). if Is_Constrained (Ret_Typ) and then not Is_Tagged_Type (Underlying_Type (Ret_Typ)) then Insert_After (Ret_Obj_Decl, Init_Assignment); end if; end if; -- When the function's subtype is unconstrained, a run-time -- test is needed to determine the form of allocation to use -- for the return object. The function has an implicit formal -- parameter indicating this. If the BIP_Alloc_Form formal has -- the value one, then the caller has passed access to an -- existing object for use as the return object. If the value -- is two, then the return object must be allocated on the -- secondary stack. Otherwise, the object must be allocated in -- a storage pool (currently only supported for the global -- heap, user-defined storage pools TBD ???). We generate an -- if statement to test the implicit allocation formal and -- initialize a local access value appropriately, creating -- allocators in the secondary stack and global heap cases. -- The special formal also exists and must be tested when the -- function has a tagged result, even when the result subtype -- is constrained, because in general such functions can be -- called in dispatching contexts and must be handled similarly -- to functions with a class-wide result. if not Is_Constrained (Ret_Typ) or else Is_Tagged_Type (Underlying_Type (Ret_Typ)) then Obj_Alloc_Formal := Build_In_Place_Formal (Func_Id, BIP_Alloc_Form); declare Pool_Id : constant Entity_Id := Make_Temporary (Loc, 'P'); Alloc_Obj_Id : Entity_Id; Alloc_Obj_Decl : Node_Id; Alloc_If_Stmt : Node_Id; Heap_Allocator : Node_Id; Pool_Decl : Node_Id; Pool_Allocator : Node_Id; Ptr_Type_Decl : Node_Id; Ref_Type : Entity_Id; SS_Allocator : Node_Id; begin -- Reuse the itype created for the function's implicit -- access formal. This avoids the need to create a new -- access type here, plus it allows assigning the access -- formal directly without applying a conversion. -- Ref_Type := Etype (Object_Access); -- Create an access type designating the function's -- result subtype. Ref_Type := Make_Temporary (Loc, 'A'); Ptr_Type_Decl := Make_Full_Type_Declaration (Loc, Defining_Identifier => Ref_Type, Type_Definition => Make_Access_To_Object_Definition (Loc, All_Present => True, Subtype_Indication => New_Occurrence_Of (Ret_Obj_Typ, Loc))); Insert_Before (Ret_Obj_Decl, Ptr_Type_Decl); -- Create an access object that will be initialized to an -- access value denoting the return object, either coming -- from an implicit access value passed in by the caller -- or from the result of an allocator. Alloc_Obj_Id := Make_Temporary (Loc, 'R'); Set_Etype (Alloc_Obj_Id, Ref_Type); Alloc_Obj_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Alloc_Obj_Id, Object_Definition => New_Occurrence_Of (Ref_Type, Loc)); Insert_Before (Ret_Obj_Decl, Alloc_Obj_Decl); -- Create allocators for both the secondary stack and -- global heap. If there's an initialization expression, -- then create these as initialized allocators. if Present (Ret_Obj_Expr) and then not No_Initialization (Ret_Obj_Decl) then -- Always use the type of the expression for the -- qualified expression, rather than the result type. -- In general we cannot always use the result type -- for the allocator, because the expression might be -- of a specific type, such as in the case of an -- aggregate or even a nonlimited object when the -- result type is a limited class-wide interface type. Heap_Allocator := Make_Allocator (Loc, Expression => Make_Qualified_Expression (Loc, Subtype_Mark => New_Occurrence_Of (Etype (Ret_Obj_Expr), Loc), Expression => New_Copy_Tree (Ret_Obj_Expr))); else -- If the function returns a class-wide type we cannot -- use the return type for the allocator. Instead we -- use the type of the expression, which must be an -- aggregate of a definite type. if Is_Class_Wide_Type (Ret_Obj_Typ) then Heap_Allocator := Make_Allocator (Loc, Expression => New_Occurrence_Of (Etype (Ret_Obj_Expr), Loc)); else Heap_Allocator := Make_Allocator (Loc, Expression => New_Occurrence_Of (Ret_Obj_Typ, Loc)); end if; -- If the object requires default initialization then -- that will happen later following the elaboration of -- the object renaming. If we don't turn it off here -- then the object will be default initialized twice. Set_No_Initialization (Heap_Allocator); end if; -- The Pool_Allocator is just like the Heap_Allocator, -- except we set Storage_Pool and Procedure_To_Call so -- it will use the user-defined storage pool. Pool_Allocator := New_Copy_Tree (Heap_Allocator); -- Do not generate the renaming of the build-in-place -- pool parameter on ZFP because the parameter is not -- created in the first place. if RTE_Available (RE_Root_Storage_Pool_Ptr) then Pool_Decl := Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Pool_Id, Subtype_Mark => New_Occurrence_Of (RTE (RE_Root_Storage_Pool), Loc), Name => Make_Explicit_Dereference (Loc, New_Occurrence_Of (Build_In_Place_Formal (Func_Id, BIP_Storage_Pool), Loc))); Set_Storage_Pool (Pool_Allocator, Pool_Id); Set_Procedure_To_Call (Pool_Allocator, RTE (RE_Allocate_Any)); else Pool_Decl := Make_Null_Statement (Loc); end if; -- If the No_Allocators restriction is active, then only -- an allocator for secondary stack allocation is needed. -- It's OK for such allocators to have Comes_From_Source -- set to False, because gigi knows not to flag them as -- being a violation of No_Implicit_Heap_Allocations. if Restriction_Active (No_Allocators) then SS_Allocator := Heap_Allocator; Heap_Allocator := Make_Null (Loc); Pool_Allocator := Make_Null (Loc); -- Otherwise the heap and pool allocators may be needed, -- so we make another allocator for secondary stack -- allocation. else SS_Allocator := New_Copy_Tree (Heap_Allocator); -- The heap and pool allocators are marked as -- Comes_From_Source since they correspond to an -- explicit user-written allocator (that is, it will -- only be executed on behalf of callers that call the -- function as initialization for such an allocator). -- Prevents errors when No_Implicit_Heap_Allocations -- is in force. Set_Comes_From_Source (Heap_Allocator, True); Set_Comes_From_Source (Pool_Allocator, True); end if; -- The allocator is returned on the secondary stack. Set_Storage_Pool (SS_Allocator, RTE (RE_SS_Pool)); Set_Procedure_To_Call (SS_Allocator, RTE (RE_SS_Allocate)); -- The allocator is returned on the secondary stack, -- so indicate that the function return, as well as -- all blocks that encloses the allocator, must not -- release it. The flags must be set now because -- the decision to use the secondary stack is done -- very late in the course of expanding the return -- statement, past the point where these flags are -- normally set. Set_Uses_Sec_Stack (Func_Id); Set_Uses_Sec_Stack (Return_Statement_Entity (N)); Set_Sec_Stack_Needed_For_Return (Return_Statement_Entity (N)); Set_Enclosing_Sec_Stack_Return (N); -- Create an if statement to test the BIP_Alloc_Form -- formal and initialize the access object to either the -- BIP_Object_Access formal (BIP_Alloc_Form = -- Caller_Allocation), the result of allocating the -- object in the secondary stack (BIP_Alloc_Form = -- Secondary_Stack), or else an allocator to create the -- return object in the heap or user-defined pool -- (BIP_Alloc_Form = Global_Heap or User_Storage_Pool). -- ??? An unchecked type conversion must be made in the -- case of assigning the access object formal to the -- local access object, because a normal conversion would -- be illegal in some cases (such as converting access- -- to-unconstrained to access-to-constrained), but the -- the unchecked conversion will presumably fail to work -- right in just such cases. It's not clear at all how to -- handle this. ??? Alloc_If_Stmt := Make_If_Statement (Loc, Condition => Make_Op_Eq (Loc, Left_Opnd => New_Occurrence_Of (Obj_Alloc_Formal, Loc), Right_Opnd => Make_Integer_Literal (Loc, UI_From_Int (BIP_Allocation_Form'Pos (Caller_Allocation)))), Then_Statements => New_List ( Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Alloc_Obj_Id, Loc), Expression => Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Ref_Type, Loc), Expression => New_Occurrence_Of (Obj_Acc_Formal, Loc)))), Elsif_Parts => New_List ( Make_Elsif_Part (Loc, Condition => Make_Op_Eq (Loc, Left_Opnd => New_Occurrence_Of (Obj_Alloc_Formal, Loc), Right_Opnd => Make_Integer_Literal (Loc, UI_From_Int (BIP_Allocation_Form'Pos (Secondary_Stack)))), Then_Statements => New_List ( Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Alloc_Obj_Id, Loc), Expression => SS_Allocator))), Make_Elsif_Part (Loc, Condition => Make_Op_Eq (Loc, Left_Opnd => New_Occurrence_Of (Obj_Alloc_Formal, Loc), Right_Opnd => Make_Integer_Literal (Loc, UI_From_Int (BIP_Allocation_Form'Pos (Global_Heap)))), Then_Statements => New_List ( Build_Heap_Allocator (Temp_Id => Alloc_Obj_Id, Temp_Typ => Ref_Type, Func_Id => Func_Id, Ret_Typ => Ret_Obj_Typ, Alloc_Expr => Heap_Allocator)))), Else_Statements => New_List ( Pool_Decl, Build_Heap_Allocator (Temp_Id => Alloc_Obj_Id, Temp_Typ => Ref_Type, Func_Id => Func_Id, Ret_Typ => Ret_Obj_Typ, Alloc_Expr => Pool_Allocator))); -- If a separate initialization assignment was created -- earlier, append that following the assignment of the -- implicit access formal to the access object, to ensure -- that the return object is initialized in that case. In -- this situation, the target of the assignment must be -- rewritten to denote a dereference of the access to the -- return object passed in by the caller. if Present (Init_Assignment) then Rewrite (Name (Init_Assignment), Make_Explicit_Dereference (Loc, Prefix => New_Occurrence_Of (Alloc_Obj_Id, Loc))); Set_Etype (Name (Init_Assignment), Etype (Ret_Obj_Id)); Append_To (Then_Statements (Alloc_If_Stmt), Init_Assignment); end if; Insert_Before (Ret_Obj_Decl, Alloc_If_Stmt); -- Remember the local access object for use in the -- dereference of the renaming created below. Obj_Acc_Formal := Alloc_Obj_Id; end; end if; -- Replace the return object declaration with a renaming of a -- dereference of the access value designating the return -- object. Obj_Acc_Deref := Make_Explicit_Dereference (Loc, Prefix => New_Occurrence_Of (Obj_Acc_Formal, Loc)); Rewrite (Ret_Obj_Decl, Make_Object_Renaming_Declaration (Loc, Defining_Identifier => Ret_Obj_Id, Access_Definition => Empty, Subtype_Mark => New_Occurrence_Of (Ret_Obj_Typ, Loc), Name => Obj_Acc_Deref)); Set_Renamed_Object (Ret_Obj_Id, Obj_Acc_Deref); end; end if; -- Case where we do not build a block else -- We're about to drop Return_Object_Declarations on the floor, so -- we need to insert it, in case it got expanded into useful code. -- Remove side effects from expression, which may be duplicated in -- subsequent checks (see Expand_Simple_Function_Return). Insert_List_Before (N, Return_Object_Declarations (N)); Remove_Side_Effects (Exp); -- Build simple_return_statement that returns the expression directly Return_Stmt := Make_Simple_Return_Statement (Loc, Expression => Exp); Result := Return_Stmt; end if; -- Set the flag to prevent infinite recursion Set_Comes_From_Extended_Return_Statement (Return_Stmt); Rewrite (N, Result); Analyze (N); end Expand_N_Extended_Return_Statement; ---------------------------- -- Expand_N_Function_Call -- ---------------------------- procedure Expand_N_Function_Call (N : Node_Id) is begin Expand_Call (N); end Expand_N_Function_Call; --------------------------------------- -- Expand_N_Procedure_Call_Statement -- --------------------------------------- procedure Expand_N_Procedure_Call_Statement (N : Node_Id) is begin Expand_Call (N); end Expand_N_Procedure_Call_Statement; -------------------------------------- -- Expand_N_Simple_Return_Statement -- -------------------------------------- procedure Expand_N_Simple_Return_Statement (N : Node_Id) is begin -- Defend against previous errors (i.e. the return statement calls a -- function that is not available in configurable runtime). if Present (Expression (N)) and then Nkind (Expression (N)) = N_Empty then Check_Error_Detected; return; end if; -- Distinguish the function and non-function cases: case Ekind (Return_Applies_To (Return_Statement_Entity (N))) is when E_Function | E_Generic_Function => Expand_Simple_Function_Return (N); when E_Entry | E_Entry_Family | E_Generic_Procedure | E_Procedure | E_Return_Statement => Expand_Non_Function_Return (N); when others => raise Program_Error; end case; exception when RE_Not_Available => return; end Expand_N_Simple_Return_Statement; ------------------------------ -- Expand_N_Subprogram_Body -- ------------------------------ -- Add poll call if ATC polling is enabled, unless the body will be inlined -- by the back-end. -- Add dummy push/pop label nodes at start and end to clear any local -- exception indications if local-exception-to-goto optimization is active. -- Add return statement if last statement in body is not a return statement -- (this makes things easier on Gigi which does not want to have to handle -- a missing return). -- Add call to Activate_Tasks if body is a task activator -- Deal with possible detection of infinite recursion -- Eliminate body completely if convention stubbed -- Encode entity names within body, since we will not need to reference -- these entities any longer in the front end. -- Initialize scalar out parameters if Initialize/Normalize_Scalars -- Reset Pure indication if any parameter has root type System.Address -- or has any parameters of limited types, where limited means that the -- run-time view is limited (i.e. the full type is limited). -- Wrap thread body procedure Expand_N_Subprogram_Body (N : Node_Id) is Body_Id : constant Entity_Id := Defining_Entity (N); HSS : constant Node_Id := Handled_Statement_Sequence (N); Loc : constant Source_Ptr := Sloc (N); procedure Add_Return (Spec_Id : Entity_Id; Stmts : List_Id); -- Append a return statement to the statement sequence Stmts if the last -- statement is not already a return or a goto statement. Note that the -- latter test is not critical, it does not matter if we add a few extra -- returns, since they get eliminated anyway later on. Spec_Id denotes -- the corresponding spec of the subprogram body. ---------------- -- Add_Return -- ---------------- procedure Add_Return (Spec_Id : Entity_Id; Stmts : List_Id) is Last_Stmt : Node_Id; Loc : Source_Ptr; Stmt : Node_Id; begin -- Get last statement, ignoring any Pop_xxx_Label nodes, which are -- not relevant in this context since they are not executable. Last_Stmt := Last (Stmts); while Nkind (Last_Stmt) in N_Pop_xxx_Label loop Prev (Last_Stmt); end loop; -- Now insert return unless last statement is a transfer if not Is_Transfer (Last_Stmt) then -- The source location for the return is the end label of the -- procedure if present. Otherwise use the sloc of the last -- statement in the list. If the list comes from a generated -- exception handler and we are not debugging generated code, -- all the statements within the handler are made invisible -- to the debugger. if Nkind (Parent (Stmts)) = N_Exception_Handler and then not Comes_From_Source (Parent (Stmts)) then Loc := Sloc (Last_Stmt); elsif Present (End_Label (HSS)) then Loc := Sloc (End_Label (HSS)); else Loc := Sloc (Last_Stmt); end if; -- Append return statement, and set analyzed manually. We can't -- call Analyze on this return since the scope is wrong. -- Note: it almost works to push the scope and then do the Analyze -- call, but something goes wrong in some weird cases and it is -- not worth worrying about ??? Stmt := Make_Simple_Return_Statement (Loc); -- The return statement is handled properly, and the call to the -- postcondition, inserted below, does not require information -- from the body either. However, that call is analyzed in the -- enclosing scope, and an elaboration check might improperly be -- added to it. A guard in Sem_Elab is needed to prevent that -- spurious check, see Check_Elab_Call. Append_To (Stmts, Stmt); Set_Analyzed (Stmt); -- Call the _Postconditions procedure if the related subprogram -- has contract assertions that need to be verified on exit. if Ekind (Spec_Id) = E_Procedure and then Present (Postconditions_Proc (Spec_Id)) then Insert_Action (Stmt, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Postconditions_Proc (Spec_Id), Loc))); end if; end if; end Add_Return; -- Local variables Except_H : Node_Id; L : List_Id; Spec_Id : Entity_Id; -- Start of processing for Expand_N_Subprogram_Body begin if Present (Corresponding_Spec (N)) then Spec_Id := Corresponding_Spec (N); else Spec_Id := Body_Id; end if; -- If this is a Pure function which has any parameters whose root type -- is System.Address, reset the Pure indication. -- This check is also performed when the subprogram is frozen, but we -- repeat it on the body so that the indication is consistent, and so -- it applies as well to bodies without separate specifications. if Is_Pure (Spec_Id) and then Is_Subprogram (Spec_Id) and then not Has_Pragma_Pure_Function (Spec_Id) then Check_Function_With_Address_Parameter (Spec_Id); if Spec_Id /= Body_Id then Set_Is_Pure (Body_Id, Is_Pure (Spec_Id)); end if; end if; -- Set L to either the list of declarations if present, or to the list -- of statements if no declarations are present. This is used to insert -- new stuff at the start. if Is_Non_Empty_List (Declarations (N)) then L := Declarations (N); else L := Statements (HSS); end if; -- If local-exception-to-goto optimization active, insert dummy push -- statements at start, and dummy pop statements at end, but inhibit -- this if we have No_Exception_Handlers, since they are useless and -- intefere with analysis, e.g. by codepeer. if (Debug_Flag_Dot_G or else Restriction_Active (No_Exception_Propagation)) and then not Restriction_Active (No_Exception_Handlers) and then not CodePeer_Mode and then Is_Non_Empty_List (L) then declare FS : constant Node_Id := First (L); FL : constant Source_Ptr := Sloc (FS); LS : Node_Id; LL : Source_Ptr; begin -- LS points to either last statement, if statements are present -- or to the last declaration if there are no statements present. -- It is the node after which the pop's are generated. if Is_Non_Empty_List (Statements (HSS)) then LS := Last (Statements (HSS)); else LS := Last (L); end if; LL := Sloc (LS); Insert_List_Before_And_Analyze (FS, New_List ( Make_Push_Constraint_Error_Label (FL), Make_Push_Program_Error_Label (FL), Make_Push_Storage_Error_Label (FL))); Insert_List_After_And_Analyze (LS, New_List ( Make_Pop_Constraint_Error_Label (LL), Make_Pop_Program_Error_Label (LL), Make_Pop_Storage_Error_Label (LL))); end; end if; -- Need poll on entry to subprogram if polling enabled. We only do this -- for non-empty subprograms, since it does not seem necessary to poll -- for a dummy null subprogram. if Is_Non_Empty_List (L) then -- Do not add a polling call if the subprogram is to be inlined by -- the back-end, to avoid repeated calls with multiple inlinings. if Is_Inlined (Spec_Id) and then Front_End_Inlining and then Optimization_Level > 1 then null; else Generate_Poll_Call (First (L)); end if; end if; -- Initialize any scalar OUT args if Initialize/Normalize_Scalars if Init_Or_Norm_Scalars and then Is_Subprogram (Spec_Id) then declare F : Entity_Id; A : Node_Id; begin -- Loop through formals F := First_Formal (Spec_Id); while Present (F) loop if Is_Scalar_Type (Etype (F)) and then Ekind (F) = E_Out_Parameter then Check_Restriction (No_Default_Initialization, F); -- Insert the initialization. We turn off validity checks -- for this assignment, since we do not want any check on -- the initial value itself (which may well be invalid). -- Predicate checks are disabled as well (RM 6.4.1 (13/3)) A := Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (F, Loc), Expression => Get_Simple_Init_Val (Etype (F), N)); Set_Suppress_Assignment_Checks (A); Insert_Before_And_Analyze (First (L), A, Suppress => Validity_Check); end if; Next_Formal (F); end loop; end; end if; -- Clear out statement list for stubbed procedure if Present (Corresponding_Spec (N)) then Set_Elaboration_Flag (N, Spec_Id); if Convention (Spec_Id) = Convention_Stubbed or else Is_Eliminated (Spec_Id) then Set_Declarations (N, Empty_List); Set_Handled_Statement_Sequence (N, Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List (Make_Null_Statement (Loc)))); return; end if; end if; -- Create a set of discriminals for the next protected subprogram body if Is_List_Member (N) and then Present (Parent (List_Containing (N))) and then Nkind (Parent (List_Containing (N))) = N_Protected_Body and then Present (Next_Protected_Operation (N)) then Set_Discriminals (Parent (Base_Type (Scope (Spec_Id)))); end if; -- Returns_By_Ref flag is normally set when the subprogram is frozen but -- subprograms with no specs are not frozen. declare Typ : constant Entity_Id := Etype (Spec_Id); Utyp : constant Entity_Id := Underlying_Type (Typ); begin if Is_Limited_View (Typ) then Set_Returns_By_Ref (Spec_Id); elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then Set_Returns_By_Ref (Spec_Id); end if; end; -- For a procedure, we add a return for all possible syntactic ends of -- the subprogram. if Ekind_In (Spec_Id, E_Procedure, E_Generic_Procedure) then Add_Return (Spec_Id, Statements (HSS)); if Present (Exception_Handlers (HSS)) then Except_H := First_Non_Pragma (Exception_Handlers (HSS)); while Present (Except_H) loop Add_Return (Spec_Id, Statements (Except_H)); Next_Non_Pragma (Except_H); end loop; end if; -- For a function, we must deal with the case where there is at least -- one missing return. What we do is to wrap the entire body of the -- function in a block: -- begin -- ... -- end; -- becomes -- begin -- begin -- ... -- end; -- raise Program_Error; -- end; -- This approach is necessary because the raise must be signalled to the -- caller, not handled by any local handler (RM 6.4(11)). -- Note: we do not need to analyze the constructed sequence here, since -- it has no handler, and an attempt to analyze the handled statement -- sequence twice is risky in various ways (e.g. the issue of expanding -- cleanup actions twice). elsif Has_Missing_Return (Spec_Id) then declare Hloc : constant Source_Ptr := Sloc (HSS); Blok : constant Node_Id := Make_Block_Statement (Hloc, Handled_Statement_Sequence => HSS); Rais : constant Node_Id := Make_Raise_Program_Error (Hloc, Reason => PE_Missing_Return); begin Set_Handled_Statement_Sequence (N, Make_Handled_Sequence_Of_Statements (Hloc, Statements => New_List (Blok, Rais))); Push_Scope (Spec_Id); Analyze (Blok); Analyze (Rais); Pop_Scope; end; end if; -- If subprogram contains a parameterless recursive call, then we may -- have an infinite recursion, so see if we can generate code to check -- for this possibility if storage checks are not suppressed. if Ekind (Spec_Id) = E_Procedure and then Has_Recursive_Call (Spec_Id) and then not Storage_Checks_Suppressed (Spec_Id) then Detect_Infinite_Recursion (N, Spec_Id); end if; -- Set to encode entity names in package body before gigi is called Qualify_Entity_Names (N); end Expand_N_Subprogram_Body; ----------------------------------- -- Expand_N_Subprogram_Body_Stub -- ----------------------------------- procedure Expand_N_Subprogram_Body_Stub (N : Node_Id) is Bod : Node_Id; begin if Present (Corresponding_Body (N)) then Bod := Unit_Declaration_Node (Corresponding_Body (N)); -- The body may have been expanded already when it is analyzed -- through the subunit node. Do no expand again: it interferes -- with the construction of unnesting tables when generating C. if not Analyzed (Bod) then Expand_N_Subprogram_Body (Bod); end if; -- Add full qualification to entities that may be created late -- during unnesting. Qualify_Entity_Names (N); end if; end Expand_N_Subprogram_Body_Stub; ------------------------------------- -- Expand_N_Subprogram_Declaration -- ------------------------------------- -- If the declaration appears within a protected body, it is a private -- operation of the protected type. We must create the corresponding -- protected subprogram an associated formals. For a normal protected -- operation, this is done when expanding the protected type declaration. -- If the declaration is for a null procedure, emit null body procedure Expand_N_Subprogram_Declaration (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Subp : constant Entity_Id := Defining_Entity (N); -- Local variables Scop : constant Entity_Id := Scope (Subp); Prot_Bod : Node_Id; Prot_Decl : Node_Id; Prot_Id : Entity_Id; -- Start of processing for Expand_N_Subprogram_Declaration begin -- In SPARK, subprogram declarations are only allowed in package -- specifications. if Nkind (Parent (N)) /= N_Package_Specification then if Nkind (Parent (N)) = N_Compilation_Unit then Check_SPARK_05_Restriction ("subprogram declaration is not a library item", N); elsif Present (Next (N)) and then Nkind (Next (N)) = N_Pragma and then Get_Pragma_Id (Next (N)) = Pragma_Import then -- In SPARK, subprogram declarations are also permitted in -- declarative parts when immediately followed by a corresponding -- pragma Import. We only check here that there is some pragma -- Import. null; else Check_SPARK_05_Restriction ("subprogram declaration is not allowed here", N); end if; end if; -- Deal with case of protected subprogram. Do not generate protected -- operation if operation is flagged as eliminated. if Is_List_Member (N) and then Present (Parent (List_Containing (N))) and then Nkind (Parent (List_Containing (N))) = N_Protected_Body and then Is_Protected_Type (Scop) then if No (Protected_Body_Subprogram (Subp)) and then not Is_Eliminated (Subp) then Prot_Decl := Make_Subprogram_Declaration (Loc, Specification => Build_Protected_Sub_Specification (N, Scop, Unprotected_Mode)); -- The protected subprogram is declared outside of the protected -- body. Given that the body has frozen all entities so far, we -- analyze the subprogram and perform freezing actions explicitly. -- including the generation of an explicit freeze node, to ensure -- that gigi has the proper order of elaboration. -- If the body is a subunit, the insertion point is before the -- stub in the parent. Prot_Bod := Parent (List_Containing (N)); if Nkind (Parent (Prot_Bod)) = N_Subunit then Prot_Bod := Corresponding_Stub (Parent (Prot_Bod)); end if; Insert_Before (Prot_Bod, Prot_Decl); Prot_Id := Defining_Unit_Name (Specification (Prot_Decl)); Set_Has_Delayed_Freeze (Prot_Id); Push_Scope (Scope (Scop)); Analyze (Prot_Decl); Freeze_Before (N, Prot_Id); Set_Protected_Body_Subprogram (Subp, Prot_Id); -- Create protected operation as well. Even though the operation -- is only accessible within the body, it is possible to make it -- available outside of the protected object by using 'Access to -- provide a callback, so build protected version in all cases. Prot_Decl := Make_Subprogram_Declaration (Loc, Specification => Build_Protected_Sub_Specification (N, Scop, Protected_Mode)); Insert_Before (Prot_Bod, Prot_Decl); Analyze (Prot_Decl); Pop_Scope; end if; -- Ada 2005 (AI-348): Generate body for a null procedure. In most -- cases this is superfluous because calls to it will be automatically -- inlined, but we definitely need the body if preconditions for the -- procedure are present. elsif Nkind (Specification (N)) = N_Procedure_Specification and then Null_Present (Specification (N)) then declare Bod : constant Node_Id := Body_To_Inline (N); begin Set_Has_Completion (Subp, False); Append_Freeze_Action (Subp, Bod); -- The body now contains raise statements, so calls to it will -- not be inlined. Set_Is_Inlined (Subp, False); end; end if; -- When generating C code, transform a function that returns a -- constrained array type into a procedure with an out parameter -- that carries the return value. -- We skip this transformation for unchecked conversions, since they -- are not needed by the C generator (and this also produces cleaner -- output). if Modify_Tree_For_C and then Nkind (Specification (N)) = N_Function_Specification and then Is_Array_Type (Etype (Subp)) and then Is_Constrained (Etype (Subp)) and then not Is_Unchecked_Conversion_Instance (Subp) then Build_Procedure_Form (N); end if; end Expand_N_Subprogram_Declaration; -------------------------------- -- Expand_Non_Function_Return -- -------------------------------- procedure Expand_Non_Function_Return (N : Node_Id) is pragma Assert (No (Expression (N))); Loc : constant Source_Ptr := Sloc (N); Scope_Id : Entity_Id := Return_Applies_To (Return_Statement_Entity (N)); Kind : constant Entity_Kind := Ekind (Scope_Id); Call : Node_Id; Acc_Stat : Node_Id; Goto_Stat : Node_Id; Lab_Node : Node_Id; begin -- Call the _Postconditions procedure if the related subprogram has -- contract assertions that need to be verified on exit. if Ekind_In (Scope_Id, E_Entry, E_Entry_Family, E_Procedure) and then Present (Postconditions_Proc (Scope_Id)) then Insert_Action (N, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Postconditions_Proc (Scope_Id), Loc))); end if; -- If it is a return from a procedure do no extra steps if Kind = E_Procedure or else Kind = E_Generic_Procedure then return; -- If it is a nested return within an extended one, replace it with a -- return of the previously declared return object. elsif Kind = E_Return_Statement then Rewrite (N, Make_Simple_Return_Statement (Loc, Expression => New_Occurrence_Of (First_Entity (Scope_Id), Loc))); Set_Comes_From_Extended_Return_Statement (N); Set_Return_Statement_Entity (N, Scope_Id); Expand_Simple_Function_Return (N); return; end if; pragma Assert (Is_Entry (Scope_Id)); -- Look at the enclosing block to see whether the return is from an -- accept statement or an entry body. for J in reverse 0 .. Scope_Stack.Last loop Scope_Id := Scope_Stack.Table (J).Entity; exit when Is_Concurrent_Type (Scope_Id); end loop; -- If it is a return from accept statement it is expanded as call to -- RTS Complete_Rendezvous and a goto to the end of the accept body. -- (cf : Expand_N_Accept_Statement, Expand_N_Selective_Accept, -- Expand_N_Accept_Alternative in exp_ch9.adb) if Is_Task_Type (Scope_Id) then Call := Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Complete_Rendezvous), Loc)); Insert_Before (N, Call); -- why not insert actions here??? Analyze (Call); Acc_Stat := Parent (N); while Nkind (Acc_Stat) /= N_Accept_Statement loop Acc_Stat := Parent (Acc_Stat); end loop; Lab_Node := Last (Statements (Handled_Statement_Sequence (Acc_Stat))); Goto_Stat := Make_Goto_Statement (Loc, Name => New_Occurrence_Of (Entity (Identifier (Lab_Node)), Loc)); Set_Analyzed (Goto_Stat); Rewrite (N, Goto_Stat); Analyze (N); -- If it is a return from an entry body, put a Complete_Entry_Body call -- in front of the return. elsif Is_Protected_Type (Scope_Id) then Call := Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (RTE (RE_Complete_Entry_Body), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Find_Protection_Object (Current_Scope), Loc), Attribute_Name => Name_Unchecked_Access))); Insert_Before (N, Call); Analyze (Call); end if; end Expand_Non_Function_Return; --------------------------------------- -- Expand_Protected_Object_Reference -- --------------------------------------- function Expand_Protected_Object_Reference (N : Node_Id; Scop : Entity_Id) return Node_Id is Loc : constant Source_Ptr := Sloc (N); Corr : Entity_Id; Rec : Node_Id; Param : Entity_Id; Proc : Entity_Id; begin Rec := Make_Identifier (Loc, Name_uObject); Set_Etype (Rec, Corresponding_Record_Type (Scop)); -- Find enclosing protected operation, and retrieve its first parameter, -- which denotes the enclosing protected object. If the enclosing -- operation is an entry, we are immediately within the protected body, -- and we can retrieve the object from the service entries procedure. A -- barrier function has the same signature as an entry. A barrier -- function is compiled within the protected object, but unlike -- protected operations its never needs locks, so that its protected -- body subprogram points to itself. Proc := Current_Scope; while Present (Proc) and then Scope (Proc) /= Scop loop Proc := Scope (Proc); end loop; Corr := Protected_Body_Subprogram (Proc); if No (Corr) then -- Previous error left expansion incomplete. -- Nothing to do on this call. return Empty; end if; Param := Defining_Identifier (First (Parameter_Specifications (Parent (Corr)))); if Is_Subprogram (Proc) and then Proc /= Corr then -- Protected function or procedure Set_Entity (Rec, Param); -- Rec is a reference to an entity which will not be in scope when -- the call is reanalyzed, and needs no further analysis. Set_Analyzed (Rec); else -- Entry or barrier function for entry body. The first parameter of -- the entry body procedure is pointer to the object. We create a -- local variable of the proper type, duplicating what is done to -- define _object later on. declare Decls : List_Id; Obj_Ptr : constant Entity_Id := Make_Temporary (Loc, 'T'); begin Decls := New_List ( Make_Full_Type_Declaration (Loc, Defining_Identifier => Obj_Ptr, Type_Definition => Make_Access_To_Object_Definition (Loc, Subtype_Indication => New_Occurrence_Of (Corresponding_Record_Type (Scop), Loc)))); Insert_Actions (N, Decls); Freeze_Before (N, Obj_Ptr); Rec := Make_Explicit_Dereference (Loc, Prefix => Unchecked_Convert_To (Obj_Ptr, New_Occurrence_Of (Param, Loc))); -- Analyze new actual. Other actuals in calls are already analyzed -- and the list of actuals is not reanalyzed after rewriting. Set_Parent (Rec, N); Analyze (Rec); end; end if; return Rec; end Expand_Protected_Object_Reference; -------------------------------------- -- Expand_Protected_Subprogram_Call -- -------------------------------------- procedure Expand_Protected_Subprogram_Call (N : Node_Id; Subp : Entity_Id; Scop : Entity_Id) is Rec : Node_Id; procedure Expand_Internal_Init_Call; -- A call to an operation of the type may occur in the initialization -- of a private component. In that case the prefix of the call is an -- entity name and the call is treated as internal even though it -- appears in code outside of the protected type. procedure Freeze_Called_Function; -- If it is a function call it can appear in elaboration code and -- the called entity must be frozen before the call. This must be -- done before the call is expanded, as the expansion may rewrite it -- to something other than a call (e.g. a temporary initialized in a -- transient block). ------------------------------- -- Expand_Internal_Init_Call -- ------------------------------- procedure Expand_Internal_Init_Call is begin -- If the context is a protected object (rather than a protected -- type) the call itself is bound to raise program_error because -- the protected body will not have been elaborated yet. This is -- diagnosed subsequently in Sem_Elab. Freeze_Called_Function; -- The target of the internal call is the first formal of the -- enclosing initialization procedure. Rec := New_Occurrence_Of (First_Formal (Current_Scope), Sloc (N)); Build_Protected_Subprogram_Call (N, Name => Name (N), Rec => Rec, External => False); Analyze (N); Resolve (N, Etype (Subp)); end Expand_Internal_Init_Call; ---------------------------- -- Freeze_Called_Function -- ---------------------------- procedure Freeze_Called_Function is begin if Ekind (Subp) = E_Function then Freeze_Expression (Name (N)); end if; end Freeze_Called_Function; -- Start of processing for Expand_Protected_Subprogram_Call begin -- If the protected object is not an enclosing scope, this is an inter- -- object function call. Inter-object procedure calls are expanded by -- Exp_Ch9.Build_Simple_Entry_Call. The call is intra-object only if the -- subprogram being called is in the protected body being compiled, and -- if the protected object in the call is statically the enclosing type. -- The object may be a component of some other data structure, in which -- case this must be handled as an inter-object call. if not In_Open_Scopes (Scop) or else Is_Entry_Wrapper (Current_Scope) or else not Is_Entity_Name (Name (N)) then if Nkind (Name (N)) = N_Selected_Component then Rec := Prefix (Name (N)); elsif Nkind (Name (N)) = N_Indexed_Component then Rec := Prefix (Prefix (Name (N))); -- If this is a call within an entry wrapper, it appears within a -- precondition that calls another primitive of the synchronized -- type. The target object of the call is the first actual on the -- wrapper. Note that this is an external call, because the wrapper -- is called outside of the synchronized object. This means that -- an entry call to an entry with preconditions involves two -- synchronized operations. elsif Ekind (Current_Scope) = E_Procedure and then Is_Entry_Wrapper (Current_Scope) then Rec := New_Occurrence_Of (First_Entity (Current_Scope), Sloc (N)); else -- If the context is the initialization procedure for a protected -- type, the call is legal because the called entity must be a -- function of that enclosing type, and this is treated as an -- internal call. pragma Assert (Is_Entity_Name (Name (N)) and then Inside_Init_Proc); Expand_Internal_Init_Call; return; end if; Freeze_Called_Function; Build_Protected_Subprogram_Call (N, Name => New_Occurrence_Of (Subp, Sloc (N)), Rec => Convert_Concurrent (Rec, Etype (Rec)), External => True); else Rec := Expand_Protected_Object_Reference (N, Scop); if No (Rec) then return; end if; Freeze_Called_Function; Build_Protected_Subprogram_Call (N, Name => Name (N), Rec => Rec, External => False); end if; -- Analyze and resolve the new call. The actuals have already been -- resolved, but expansion of a function call will add extra actuals -- if needed. Analysis of a procedure call already includes resolution. Analyze (N); if Ekind (Subp) = E_Function then Resolve (N, Etype (Subp)); end if; end Expand_Protected_Subprogram_Call; ----------------------------------- -- Expand_Simple_Function_Return -- ----------------------------------- -- The "simple" comes from the syntax rule simple_return_statement. The -- semantics are not at all simple. procedure Expand_Simple_Function_Return (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Scope_Id : constant Entity_Id := Return_Applies_To (Return_Statement_Entity (N)); -- The function we are returning from R_Type : constant Entity_Id := Etype (Scope_Id); -- The result type of the function Utyp : constant Entity_Id := Underlying_Type (R_Type); Exp : Node_Id := Expression (N); pragma Assert (Present (Exp)); Exptyp : constant Entity_Id := Etype (Exp); -- The type of the expression (not necessarily the same as R_Type) Subtype_Ind : Node_Id; -- If the result type of the function is class-wide and the expression -- has a specific type, then we use the expression's type as the type of -- the return object. In cases where the expression is an aggregate that -- is built in place, this avoids the need for an expensive conversion -- of the return object to the specific type on assignments to the -- individual components. begin if Is_Class_Wide_Type (R_Type) and then not Is_Class_Wide_Type (Exptyp) and then Nkind (Exp) /= N_Type_Conversion then Subtype_Ind := New_Occurrence_Of (Exptyp, Loc); else Subtype_Ind := New_Occurrence_Of (R_Type, Loc); -- If the result type is class-wide and the expression is a view -- conversion, the conversion plays no role in the expansion because -- it does not modify the tag of the object. Remove the conversion -- altogether to prevent tag overwriting. if Is_Class_Wide_Type (R_Type) and then not Is_Class_Wide_Type (Exptyp) and then Nkind (Exp) = N_Type_Conversion then Exp := Expression (Exp); end if; end if; -- For the case of a simple return that does not come from an extended -- return, in the case of Ada 2005 where we are returning a limited -- type, we rewrite "return <expression>;" to be: -- return _anon_ : <return_subtype> := <expression> -- The expansion produced by Expand_N_Extended_Return_Statement will -- contain simple return statements (for example, a block containing -- simple return of the return object), which brings us back here with -- Comes_From_Extended_Return_Statement set. The reason for the barrier -- checking for a simple return that does not come from an extended -- return is to avoid this infinite recursion. -- The reason for this design is that for Ada 2005 limited returns, we -- need to reify the return object, so we can build it "in place", and -- we need a block statement to hang finalization and tasking stuff. -- ??? In order to avoid disruption, we avoid translating to extended -- return except in the cases where we really need to (Ada 2005 for -- inherently limited). We might prefer to do this translation in all -- cases (except perhaps for the case of Ada 95 inherently limited), -- in order to fully exercise the Expand_N_Extended_Return_Statement -- code. This would also allow us to do the build-in-place optimization -- for efficiency even in cases where it is semantically not required. -- As before, we check the type of the return expression rather than the -- return type of the function, because the latter may be a limited -- class-wide interface type, which is not a limited type, even though -- the type of the expression may be. if not Comes_From_Extended_Return_Statement (N) and then Is_Limited_View (Etype (Expression (N))) and then Ada_Version >= Ada_2005 and then not Debug_Flag_Dot_L -- The functionality of interface thunks is simple and it is always -- handled by means of simple return statements. This leaves their -- expansion simple and clean. and then not Is_Thunk (Current_Scope) then declare Return_Object_Entity : constant Entity_Id := Make_Temporary (Loc, 'R', Exp); Obj_Decl : constant Node_Id := Make_Object_Declaration (Loc, Defining_Identifier => Return_Object_Entity, Object_Definition => Subtype_Ind, Expression => Exp); Ext : constant Node_Id := Make_Extended_Return_Statement (Loc, Return_Object_Declarations => New_List (Obj_Decl)); -- Do not perform this high-level optimization if the result type -- is an interface because the "this" pointer must be displaced. begin Rewrite (N, Ext); Analyze (N); return; end; end if; -- Here we have a simple return statement that is part of the expansion -- of an extended return statement (either written by the user, or -- generated by the above code). -- Always normalize C/Fortran boolean result. This is not always needed, -- but it seems a good idea to minimize the passing around of non- -- normalized values, and in any case this handles the processing of -- barrier functions for protected types, which turn the condition into -- a return statement. if Is_Boolean_Type (Exptyp) and then Nonzero_Is_True (Exptyp) then Adjust_Condition (Exp); Adjust_Result_Type (Exp, Exptyp); end if; -- Do validity check if enabled for returns if Validity_Checks_On and then Validity_Check_Returns then Ensure_Valid (Exp); end if; -- Check the result expression of a scalar function against the subtype -- of the function by inserting a conversion. This conversion must -- eventually be performed for other classes of types, but for now it's -- only done for scalars. -- ??? if Is_Scalar_Type (Exptyp) then Rewrite (Exp, Convert_To (R_Type, Exp)); -- The expression is resolved to ensure that the conversion gets -- expanded to generate a possible constraint check. Analyze_And_Resolve (Exp, R_Type); end if; -- Deal with returning variable length objects and controlled types -- Nothing to do if we are returning by reference, or this is not a -- type that requires special processing (indicated by the fact that -- it requires a cleanup scope for the secondary stack case). if Is_Limited_View (Exptyp) or else Is_Limited_Interface (Exptyp) then null; -- No copy needed for thunks returning interface type objects since -- the object is returned by reference and the maximum functionality -- required is just to displace the pointer. elsif Is_Thunk (Current_Scope) and then Is_Interface (Exptyp) then null; -- If the call is within a thunk and the type is a limited view, the -- backend will eventually see the non-limited view of the type. elsif Is_Thunk (Current_Scope) and then Is_Incomplete_Type (Exptyp) then return; elsif not Requires_Transient_Scope (R_Type) then -- Mutable records with variable-length components are not returned -- on the sec-stack, so we need to make sure that the back end will -- only copy back the size of the actual value, and not the maximum -- size. We create an actual subtype for this purpose. However we -- need not do it if the expression is a function call since this -- will be done in the called function and doing it here too would -- cause a temporary with maximum size to be created. declare Ubt : constant Entity_Id := Underlying_Type (Base_Type (Exptyp)); Decl : Node_Id; Ent : Entity_Id; begin if Nkind (Exp) /= N_Function_Call and then Has_Discriminants (Ubt) and then not Is_Constrained (Ubt) and then not Has_Unchecked_Union (Ubt) then Decl := Build_Actual_Subtype (Ubt, Exp); Ent := Defining_Identifier (Decl); Insert_Action (Exp, Decl); Rewrite (Exp, Unchecked_Convert_To (Ent, Exp)); Analyze_And_Resolve (Exp); end if; end; -- Here if secondary stack is used else -- Prevent the reclamation of the secondary stack by all enclosing -- blocks and loops as well as the related function; otherwise the -- result would be reclaimed too early. Set_Enclosing_Sec_Stack_Return (N); -- Optimize the case where the result is a function call. In this -- case either the result is already on the secondary stack, or is -- already being returned with the stack pointer depressed and no -- further processing is required except to set the By_Ref flag -- to ensure that gigi does not attempt an extra unnecessary copy. -- (actually not just unnecessary but harmfully wrong in the case -- of a controlled type, where gigi does not know how to do a copy). -- To make up for a gcc 2.8.1 deficiency (???), we perform the copy -- for array types if the constrained status of the target type is -- different from that of the expression. if Requires_Transient_Scope (Exptyp) and then (not Is_Array_Type (Exptyp) or else Is_Constrained (Exptyp) = Is_Constrained (R_Type) or else CW_Or_Has_Controlled_Part (Utyp)) and then Nkind (Exp) = N_Function_Call then Set_By_Ref (N); -- Remove side effects from the expression now so that other parts -- of the expander do not have to reanalyze this node without this -- optimization Rewrite (Exp, Duplicate_Subexpr_No_Checks (Exp)); -- For controlled types, do the allocation on the secondary stack -- manually in order to call adjust at the right time: -- type Anon1 is access R_Type; -- for Anon1'Storage_pool use ss_pool; -- Anon2 : anon1 := new R_Type'(expr); -- return Anon2.all; -- We do the same for classwide types that are not potentially -- controlled (by the virtue of restriction No_Finalization) because -- gigi is not able to properly allocate class-wide types. elsif CW_Or_Has_Controlled_Part (Utyp) then declare Loc : constant Source_Ptr := Sloc (N); Acc_Typ : constant Entity_Id := Make_Temporary (Loc, 'A'); Alloc_Node : Node_Id; Temp : Entity_Id; begin Set_Ekind (Acc_Typ, E_Access_Type); Set_Associated_Storage_Pool (Acc_Typ, RTE (RE_SS_Pool)); -- This is an allocator for the secondary stack, and it's fine -- to have Comes_From_Source set False on it, as gigi knows not -- to flag it as a violation of No_Implicit_Heap_Allocations. Alloc_Node := Make_Allocator (Loc, Expression => Make_Qualified_Expression (Loc, Subtype_Mark => New_Occurrence_Of (Etype (Exp), Loc), Expression => Relocate_Node (Exp))); -- We do not want discriminant checks on the declaration, -- given that it gets its value from the allocator. Set_No_Initialization (Alloc_Node); Temp := Make_Temporary (Loc, 'R', Alloc_Node); Insert_List_Before_And_Analyze (N, New_List ( Make_Full_Type_Declaration (Loc, Defining_Identifier => Acc_Typ, Type_Definition => Make_Access_To_Object_Definition (Loc, Subtype_Indication => Subtype_Ind)), Make_Object_Declaration (Loc, Defining_Identifier => Temp, Object_Definition => New_Occurrence_Of (Acc_Typ, Loc), Expression => Alloc_Node))); Rewrite (Exp, Make_Explicit_Dereference (Loc, Prefix => New_Occurrence_Of (Temp, Loc))); -- Ada 2005 (AI-251): If the type of the returned object is -- an interface then add an implicit type conversion to force -- displacement of the "this" pointer. if Is_Interface (R_Type) then Rewrite (Exp, Convert_To (R_Type, Relocate_Node (Exp))); end if; Analyze_And_Resolve (Exp, R_Type); end; -- Otherwise use the gigi mechanism to allocate result on the -- secondary stack. else Check_Restriction (No_Secondary_Stack, N); Set_Storage_Pool (N, RTE (RE_SS_Pool)); Set_Procedure_To_Call (N, RTE (RE_SS_Allocate)); end if; end if; -- Implement the rules of 6.5(8-10), which require a tag check in -- the case of a limited tagged return type, and tag reassignment for -- nonlimited tagged results. These actions are needed when the return -- type is a specific tagged type and the result expression is a -- conversion or a formal parameter, because in that case the tag of -- the expression might differ from the tag of the specific result type. if Is_Tagged_Type (Utyp) and then not Is_Class_Wide_Type (Utyp) and then (Nkind_In (Exp, N_Type_Conversion, N_Unchecked_Type_Conversion) or else (Is_Entity_Name (Exp) and then Ekind (Entity (Exp)) in Formal_Kind)) then -- When the return type is limited, perform a check that the tag of -- the result is the same as the tag of the return type. if Is_Limited_Type (R_Type) then Insert_Action (Exp, Make_Raise_Constraint_Error (Loc, Condition => Make_Op_Ne (Loc, Left_Opnd => Make_Selected_Component (Loc, Prefix => Duplicate_Subexpr (Exp), Selector_Name => Make_Identifier (Loc, Name_uTag)), Right_Opnd => Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Base_Type (Utyp), Loc), Attribute_Name => Name_Tag)), Reason => CE_Tag_Check_Failed)); -- If the result type is a specific nonlimited tagged type, then we -- have to ensure that the tag of the result is that of the result -- type. This is handled by making a copy of the expression in -- the case where it might have a different tag, namely when the -- expression is a conversion or a formal parameter. We create a new -- object of the result type and initialize it from the expression, -- which will implicitly force the tag to be set appropriately. else declare ExpR : constant Node_Id := Relocate_Node (Exp); Result_Id : constant Entity_Id := Make_Temporary (Loc, 'R', ExpR); Result_Exp : constant Node_Id := New_Occurrence_Of (Result_Id, Loc); Result_Obj : constant Node_Id := Make_Object_Declaration (Loc, Defining_Identifier => Result_Id, Object_Definition => New_Occurrence_Of (R_Type, Loc), Constant_Present => True, Expression => ExpR); begin Set_Assignment_OK (Result_Obj); Insert_Action (Exp, Result_Obj); Rewrite (Exp, Result_Exp); Analyze_And_Resolve (Exp, R_Type); end; end if; -- Ada 2005 (AI-344): If the result type is class-wide, then insert -- a check that the level of the return expression's underlying type -- is not deeper than the level of the master enclosing the function. -- Always generate the check when the type of the return expression -- is class-wide, when it's a type conversion, or when it's a formal -- parameter. Otherwise, suppress the check in the case where the -- return expression has a specific type whose level is known not to -- be statically deeper than the function's result type. -- No runtime check needed in interface thunks since it is performed -- by the target primitive associated with the thunk. -- Note: accessibility check is skipped in the VM case, since there -- does not seem to be any practical way to implement this check. elsif Ada_Version >= Ada_2005 and then Tagged_Type_Expansion and then Is_Class_Wide_Type (R_Type) and then not Is_Thunk (Current_Scope) and then not Scope_Suppress.Suppress (Accessibility_Check) and then (Is_Class_Wide_Type (Etype (Exp)) or else Nkind_In (Exp, N_Type_Conversion, N_Unchecked_Type_Conversion) or else (Is_Entity_Name (Exp) and then Ekind (Entity (Exp)) in Formal_Kind) or else Scope_Depth (Enclosing_Dynamic_Scope (Etype (Exp))) > Scope_Depth (Enclosing_Dynamic_Scope (Scope_Id))) then declare Tag_Node : Node_Id; begin -- Ada 2005 (AI-251): In class-wide interface objects we displace -- "this" to reference the base of the object. This is required to -- get access to the TSD of the object. if Is_Class_Wide_Type (Etype (Exp)) and then Is_Interface (Etype (Exp)) then -- If the expression is an explicit dereference then we can -- directly displace the pointer to reference the base of -- the object. if Nkind (Exp) = N_Explicit_Dereference then Tag_Node := Make_Explicit_Dereference (Loc, Prefix => Unchecked_Convert_To (RTE (RE_Tag_Ptr), Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_Base_Address), Loc), Parameter_Associations => New_List ( Unchecked_Convert_To (RTE (RE_Address), Duplicate_Subexpr (Prefix (Exp))))))); -- Similar case to the previous one but the expression is a -- renaming of an explicit dereference. elsif Nkind (Exp) = N_Identifier and then Present (Renamed_Object (Entity (Exp))) and then Nkind (Renamed_Object (Entity (Exp))) = N_Explicit_Dereference then Tag_Node := Make_Explicit_Dereference (Loc, Prefix => Unchecked_Convert_To (RTE (RE_Tag_Ptr), Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_Base_Address), Loc), Parameter_Associations => New_List ( Unchecked_Convert_To (RTE (RE_Address), Duplicate_Subexpr (Prefix (Renamed_Object (Entity (Exp))))))))); -- Common case: obtain the address of the actual object and -- displace the pointer to reference the base of the object. else Tag_Node := Make_Explicit_Dereference (Loc, Prefix => Unchecked_Convert_To (RTE (RE_Tag_Ptr), Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_Base_Address), Loc), Parameter_Associations => New_List ( Make_Attribute_Reference (Loc, Prefix => Duplicate_Subexpr (Exp), Attribute_Name => Name_Address))))); end if; else Tag_Node := Make_Attribute_Reference (Loc, Prefix => Duplicate_Subexpr (Exp), Attribute_Name => Name_Tag); end if; Insert_Action (Exp, Make_Raise_Program_Error (Loc, Condition => Make_Op_Gt (Loc, Left_Opnd => Build_Get_Access_Level (Loc, Tag_Node), Right_Opnd => Make_Integer_Literal (Loc, Scope_Depth (Enclosing_Dynamic_Scope (Scope_Id)))), Reason => PE_Accessibility_Check_Failed)); end; -- AI05-0073: If function has a controlling access result, check that -- the tag of the return value, if it is not null, matches designated -- type of return type. -- The return expression is referenced twice in the code below, so it -- must be made free of side effects. Given that different compilers -- may evaluate these parameters in different order, both occurrences -- perform a copy. elsif Ekind (R_Type) = E_Anonymous_Access_Type and then Has_Controlling_Result (Scope_Id) then Insert_Action (N, Make_Raise_Constraint_Error (Loc, Condition => Make_And_Then (Loc, Left_Opnd => Make_Op_Ne (Loc, Left_Opnd => Duplicate_Subexpr (Exp), Right_Opnd => Make_Null (Loc)), Right_Opnd => Make_Op_Ne (Loc, Left_Opnd => Make_Selected_Component (Loc, Prefix => Duplicate_Subexpr (Exp), Selector_Name => Make_Identifier (Loc, Name_uTag)), Right_Opnd => Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Designated_Type (R_Type), Loc), Attribute_Name => Name_Tag))), Reason => CE_Tag_Check_Failed), Suppress => All_Checks); end if; -- AI05-0234: RM 6.5(21/3). Check access discriminants to -- ensure that the function result does not outlive an -- object designated by one of it discriminants. if Present (Extra_Accessibility_Of_Result (Scope_Id)) and then Has_Unconstrained_Access_Discriminants (R_Type) then declare Discrim_Source : Node_Id; procedure Check_Against_Result_Level (Level : Node_Id); -- Check the given accessibility level against the level -- determined by the point of call. (AI05-0234). -------------------------------- -- Check_Against_Result_Level -- -------------------------------- procedure Check_Against_Result_Level (Level : Node_Id) is begin Insert_Action (N, Make_Raise_Program_Error (Loc, Condition => Make_Op_Gt (Loc, Left_Opnd => Level, Right_Opnd => New_Occurrence_Of (Extra_Accessibility_Of_Result (Scope_Id), Loc)), Reason => PE_Accessibility_Check_Failed)); end Check_Against_Result_Level; begin Discrim_Source := Exp; while Nkind (Discrim_Source) = N_Qualified_Expression loop Discrim_Source := Expression (Discrim_Source); end loop; if Nkind (Discrim_Source) = N_Identifier and then Is_Return_Object (Entity (Discrim_Source)) then Discrim_Source := Entity (Discrim_Source); if Is_Constrained (Etype (Discrim_Source)) then Discrim_Source := Etype (Discrim_Source); else Discrim_Source := Expression (Parent (Discrim_Source)); end if; elsif Nkind (Discrim_Source) = N_Identifier and then Nkind_In (Original_Node (Discrim_Source), N_Aggregate, N_Extension_Aggregate) then Discrim_Source := Original_Node (Discrim_Source); elsif Nkind (Discrim_Source) = N_Explicit_Dereference and then Nkind (Original_Node (Discrim_Source)) = N_Function_Call then Discrim_Source := Original_Node (Discrim_Source); end if; while Nkind_In (Discrim_Source, N_Qualified_Expression, N_Type_Conversion, N_Unchecked_Type_Conversion) loop Discrim_Source := Expression (Discrim_Source); end loop; case Nkind (Discrim_Source) is when N_Defining_Identifier => pragma Assert (Is_Composite_Type (Discrim_Source) and then Has_Discriminants (Discrim_Source) and then Is_Constrained (Discrim_Source)); declare Discrim : Entity_Id := First_Discriminant (Base_Type (R_Type)); Disc_Elmt : Elmt_Id := First_Elmt (Discriminant_Constraint (Discrim_Source)); begin loop if Ekind (Etype (Discrim)) = E_Anonymous_Access_Type then Check_Against_Result_Level (Dynamic_Accessibility_Level (Node (Disc_Elmt))); end if; Next_Elmt (Disc_Elmt); Next_Discriminant (Discrim); exit when not Present (Discrim); end loop; end; when N_Aggregate | N_Extension_Aggregate => -- Unimplemented: extension aggregate case where discrims -- come from ancestor part, not extension part. declare Discrim : Entity_Id := First_Discriminant (Base_Type (R_Type)); Disc_Exp : Node_Id := Empty; Positionals_Exhausted : Boolean := not Present (Expressions (Discrim_Source)); function Associated_Expr (Comp_Id : Entity_Id; Associations : List_Id) return Node_Id; -- Given a component and a component associations list, -- locate the expression for that component; returns -- Empty if no such expression is found. --------------------- -- Associated_Expr -- --------------------- function Associated_Expr (Comp_Id : Entity_Id; Associations : List_Id) return Node_Id is Assoc : Node_Id; Choice : Node_Id; begin -- Simple linear search seems ok here Assoc := First (Associations); while Present (Assoc) loop Choice := First (Choices (Assoc)); while Present (Choice) loop if (Nkind (Choice) = N_Identifier and then Chars (Choice) = Chars (Comp_Id)) or else (Nkind (Choice) = N_Others_Choice) then return Expression (Assoc); end if; Next (Choice); end loop; Next (Assoc); end loop; return Empty; end Associated_Expr; -- Start of processing for Expand_Simple_Function_Return begin if not Positionals_Exhausted then Disc_Exp := First (Expressions (Discrim_Source)); end if; loop if Positionals_Exhausted then Disc_Exp := Associated_Expr (Discrim, Component_Associations (Discrim_Source)); end if; if Ekind (Etype (Discrim)) = E_Anonymous_Access_Type then Check_Against_Result_Level (Dynamic_Accessibility_Level (Disc_Exp)); end if; Next_Discriminant (Discrim); exit when not Present (Discrim); if not Positionals_Exhausted then Next (Disc_Exp); Positionals_Exhausted := not Present (Disc_Exp); end if; end loop; end; when N_Function_Call => -- No check needed (check performed by callee) null; when others => declare Level : constant Node_Id := Make_Integer_Literal (Loc, Object_Access_Level (Discrim_Source)); begin -- Unimplemented: check for name prefix that includes -- a dereference of an access value with a dynamic -- accessibility level (e.g., an access param or a -- saooaaat) and use dynamic level in that case. For -- example: -- return Access_Param.all(Some_Index).Some_Component; -- ??? Set_Etype (Level, Standard_Natural); Check_Against_Result_Level (Level); end; end case; end; end if; -- If we are returning an object that may not be bit-aligned, then copy -- the value into a temporary first. This copy may need to expand to a -- loop of component operations. if Is_Possibly_Unaligned_Slice (Exp) or else Is_Possibly_Unaligned_Object (Exp) then declare ExpR : constant Node_Id := Relocate_Node (Exp); Tnn : constant Entity_Id := Make_Temporary (Loc, 'T', ExpR); begin Insert_Action (Exp, Make_Object_Declaration (Loc, Defining_Identifier => Tnn, Constant_Present => True, Object_Definition => New_Occurrence_Of (R_Type, Loc), Expression => ExpR), Suppress => All_Checks); Rewrite (Exp, New_Occurrence_Of (Tnn, Loc)); end; end if; -- Call the _Postconditions procedure if the related function has -- contract assertions that need to be verified on exit. if Ekind (Scope_Id) = E_Function and then Present (Postconditions_Proc (Scope_Id)) then -- In the case of discriminated objects, we have created a -- constrained subtype above, and used the underlying type. This -- transformation is post-analysis and harmless, except that now the -- call to the post-condition will be analyzed and the type kinds -- have to match. if Nkind (Exp) = N_Unchecked_Type_Conversion and then Is_Private_Type (R_Type) /= Is_Private_Type (Etype (Exp)) then Rewrite (Exp, Expression (Relocate_Node (Exp))); end if; -- We are going to reference the returned value twice in this case, -- once in the call to _Postconditions, and once in the actual return -- statement, but we can't have side effects happening twice. Force_Evaluation (Exp, Mode => Strict); -- Generate call to _Postconditions Insert_Action (Exp, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Postconditions_Proc (Scope_Id), Loc), Parameter_Associations => New_List (New_Copy_Tree (Exp)))); end if; -- Ada 2005 (AI-251): If this return statement corresponds with an -- simple return statement associated with an extended return statement -- and the type of the returned object is an interface then generate an -- implicit conversion to force displacement of the "this" pointer. if Ada_Version >= Ada_2005 and then Comes_From_Extended_Return_Statement (N) and then Nkind (Expression (N)) = N_Identifier and then Is_Interface (Utyp) and then Utyp /= Underlying_Type (Exptyp) then Rewrite (Exp, Convert_To (Utyp, Relocate_Node (Exp))); Analyze_And_Resolve (Exp); end if; end Expand_Simple_Function_Return; -------------------------------------------- -- Has_Unconstrained_Access_Discriminants -- -------------------------------------------- function Has_Unconstrained_Access_Discriminants (Subtyp : Entity_Id) return Boolean is Discr : Entity_Id; begin if Has_Discriminants (Subtyp) and then not Is_Constrained (Subtyp) then Discr := First_Discriminant (Subtyp); while Present (Discr) loop if Ekind (Etype (Discr)) = E_Anonymous_Access_Type then return True; end if; Next_Discriminant (Discr); end loop; end if; return False; end Has_Unconstrained_Access_Discriminants; -------------------------------- -- Is_Build_In_Place_Function -- -------------------------------- function Is_Build_In_Place_Function (E : Entity_Id) return Boolean is begin -- This function is called from Expand_Subtype_From_Expr during -- semantic analysis, even when expansion is off. In those cases -- the build_in_place expansion will not take place. if not Expander_Active then return False; end if; -- For now we test whether E denotes a function or access-to-function -- type whose result subtype is inherently limited. Later this test -- may be revised to allow composite nonlimited types. Functions with -- a foreign convention or whose result type has a foreign convention -- never qualify. if Ekind_In (E, E_Function, E_Generic_Function) or else (Ekind (E) = E_Subprogram_Type and then Etype (E) /= Standard_Void_Type) then -- Note: If the function has a foreign convention, it cannot build -- its result in place, so you're on your own. On the other hand, -- if only the return type has a foreign convention, its layout is -- intended to be compatible with the other language, but the build- -- in place machinery can ensure that the object is not copied. if Has_Foreign_Convention (E) then return False; -- In Ada 2005 all functions with an inherently limited return type -- must be handled using a build-in-place profile, including the case -- of a function with a limited interface result, where the function -- may return objects of nonlimited descendants. else return Is_Limited_View (Etype (E)) and then Ada_Version >= Ada_2005 and then not Debug_Flag_Dot_L; end if; else return False; end if; end Is_Build_In_Place_Function; ------------------------------------- -- Is_Build_In_Place_Function_Call -- ------------------------------------- function Is_Build_In_Place_Function_Call (N : Node_Id) return Boolean is Exp_Node : Node_Id := N; Function_Id : Entity_Id; begin -- Return False if the expander is currently inactive, since awareness -- of build-in-place treatment is only relevant during expansion. Note -- that Is_Build_In_Place_Function, which is called as part of this -- function, is also conditioned this way, but we need to check here as -- well to avoid blowing up on processing protected calls when expansion -- is disabled (such as with -gnatc) since those would trip over the -- raise of Program_Error below. -- In SPARK mode, build-in-place calls are not expanded, so that we -- may end up with a call that is neither resolved to an entity, nor -- an indirect call. if not Expander_Active then return False; end if; -- Step past qualification, type conversion (which can occur in actual -- parameter contexts), and unchecked conversion (which can occur in -- cases of calls to 'Input). if Nkind_In (Exp_Node, N_Qualified_Expression, N_Type_Conversion, N_Unchecked_Type_Conversion) then Exp_Node := Expression (N); end if; if Nkind (Exp_Node) /= N_Function_Call then return False; else if Is_Entity_Name (Name (Exp_Node)) then Function_Id := Entity (Name (Exp_Node)); -- In the case of an explicitly dereferenced call, use the subprogram -- type generated for the dereference. elsif Nkind (Name (Exp_Node)) = N_Explicit_Dereference then Function_Id := Etype (Name (Exp_Node)); -- This may be a call to a protected function. elsif Nkind (Name (Exp_Node)) = N_Selected_Component then Function_Id := Etype (Entity (Selector_Name (Name (Exp_Node)))); else raise Program_Error; end if; return Is_Build_In_Place_Function (Function_Id); end if; end Is_Build_In_Place_Function_Call; ----------------------- -- Freeze_Subprogram -- ----------------------- procedure Freeze_Subprogram (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); procedure Register_Predefined_DT_Entry (Prim : Entity_Id); -- (Ada 2005): Register a predefined primitive in all the secondary -- dispatch tables of its primitive type. ---------------------------------- -- Register_Predefined_DT_Entry -- ---------------------------------- procedure Register_Predefined_DT_Entry (Prim : Entity_Id) is Iface_DT_Ptr : Elmt_Id; Tagged_Typ : Entity_Id; Thunk_Id : Entity_Id; Thunk_Code : Node_Id; begin Tagged_Typ := Find_Dispatching_Type (Prim); if No (Access_Disp_Table (Tagged_Typ)) or else not Has_Interfaces (Tagged_Typ) or else not RTE_Available (RE_Interface_Tag) or else Restriction_Active (No_Dispatching_Calls) then return; end if; -- Skip the first two access-to-dispatch-table pointers since they -- leads to the primary dispatch table (predefined DT and user -- defined DT). We are only concerned with the secondary dispatch -- table pointers. Note that the access-to- dispatch-table pointer -- corresponds to the first implemented interface retrieved below. Iface_DT_Ptr := Next_Elmt (Next_Elmt (First_Elmt (Access_Disp_Table (Tagged_Typ)))); while Present (Iface_DT_Ptr) and then Ekind (Node (Iface_DT_Ptr)) = E_Constant loop pragma Assert (Has_Thunks (Node (Iface_DT_Ptr))); Expand_Interface_Thunk (Prim, Thunk_Id, Thunk_Code); if Present (Thunk_Code) then Insert_Actions_After (N, New_List ( Thunk_Code, Build_Set_Predefined_Prim_Op_Address (Loc, Tag_Node => New_Occurrence_Of (Node (Next_Elmt (Iface_DT_Ptr)), Loc), Position => DT_Position (Prim), Address_Node => Unchecked_Convert_To (RTE (RE_Prim_Ptr), Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Thunk_Id, Loc), Attribute_Name => Name_Unrestricted_Access))), Build_Set_Predefined_Prim_Op_Address (Loc, Tag_Node => New_Occurrence_Of (Node (Next_Elmt (Next_Elmt (Next_Elmt (Iface_DT_Ptr)))), Loc), Position => DT_Position (Prim), Address_Node => Unchecked_Convert_To (RTE (RE_Prim_Ptr), Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Prim, Loc), Attribute_Name => Name_Unrestricted_Access))))); end if; -- Skip the tag of the predefined primitives dispatch table Next_Elmt (Iface_DT_Ptr); pragma Assert (Has_Thunks (Node (Iface_DT_Ptr))); -- Skip tag of the no-thunks dispatch table Next_Elmt (Iface_DT_Ptr); pragma Assert (not Has_Thunks (Node (Iface_DT_Ptr))); -- Skip tag of predefined primitives no-thunks dispatch table Next_Elmt (Iface_DT_Ptr); pragma Assert (not Has_Thunks (Node (Iface_DT_Ptr))); Next_Elmt (Iface_DT_Ptr); end loop; end Register_Predefined_DT_Entry; -- Local variables Subp : constant Entity_Id := Entity (N); -- Start of processing for Freeze_Subprogram begin -- We suppress the initialization of the dispatch table entry when -- not Tagged_Type_Expansion because the dispatching mechanism is -- handled internally by the target. if Is_Dispatching_Operation (Subp) and then not Is_Abstract_Subprogram (Subp) and then Present (DTC_Entity (Subp)) and then Present (Scope (DTC_Entity (Subp))) and then Tagged_Type_Expansion and then not Restriction_Active (No_Dispatching_Calls) and then RTE_Available (RE_Tag) then declare Typ : constant Entity_Id := Scope (DTC_Entity (Subp)); begin -- Handle private overridden primitives if not Is_CPP_Class (Typ) then Check_Overriding_Operation (Subp); end if; -- We assume that imported CPP primitives correspond with objects -- whose constructor is in the CPP side; therefore we don't need -- to generate code to register them in the dispatch table. if Is_CPP_Class (Typ) then null; -- Handle CPP primitives found in derivations of CPP_Class types. -- These primitives must have been inherited from some parent, and -- there is no need to register them in the dispatch table because -- Build_Inherit_Prims takes care of initializing these slots. elsif Is_Imported (Subp) and then (Convention (Subp) = Convention_CPP or else Convention (Subp) = Convention_C) then null; -- Generate code to register the primitive in non statically -- allocated dispatch tables elsif not Building_Static_DT (Scope (DTC_Entity (Subp))) then -- When a primitive is frozen, enter its name in its dispatch -- table slot. if not Is_Interface (Typ) or else Present (Interface_Alias (Subp)) then if Is_Predefined_Dispatching_Operation (Subp) then Register_Predefined_DT_Entry (Subp); end if; Insert_Actions_After (N, Register_Primitive (Loc, Prim => Subp)); end if; end if; end; end if; -- Mark functions that return by reference. Note that it cannot be part -- of the normal semantic analysis of the spec since the underlying -- returned type may not be known yet (for private types). declare Typ : constant Entity_Id := Etype (Subp); Utyp : constant Entity_Id := Underlying_Type (Typ); begin if Is_Limited_View (Typ) then Set_Returns_By_Ref (Subp); elsif Present (Utyp) and then CW_Or_Has_Controlled_Part (Utyp) then Set_Returns_By_Ref (Subp); end if; end; -- Wnen freezing a null procedure, analyze its delayed aspects now -- because we may not have reached the end of the declarative list when -- delayed aspects are normally analyzed. This ensures that dispatching -- calls are properly rewritten when the generated _Postcondition -- procedure is analyzed in the null procedure body. if Nkind (Parent (Subp)) = N_Procedure_Specification and then Null_Present (Parent (Subp)) then Analyze_Entry_Or_Subprogram_Contract (Subp); end if; end Freeze_Subprogram; ----------------------- -- Is_Null_Procedure -- ----------------------- function Is_Null_Procedure (Subp : Entity_Id) return Boolean is Decl : constant Node_Id := Unit_Declaration_Node (Subp); begin if Ekind (Subp) /= E_Procedure then return False; -- Check if this is a declared null procedure elsif Nkind (Decl) = N_Subprogram_Declaration then if not Null_Present (Specification (Decl)) then return False; elsif No (Body_To_Inline (Decl)) then return False; -- Check if the body contains only a null statement, followed by -- the return statement added during expansion. else declare Orig_Bod : constant Node_Id := Body_To_Inline (Decl); Stat : Node_Id; Stat2 : Node_Id; begin if Nkind (Orig_Bod) /= N_Subprogram_Body then return False; else -- We must skip SCIL nodes because they are currently -- implemented as special N_Null_Statement nodes. Stat := First_Non_SCIL_Node (Statements (Handled_Statement_Sequence (Orig_Bod))); Stat2 := Next_Non_SCIL_Node (Stat); return Is_Empty_List (Declarations (Orig_Bod)) and then Nkind (Stat) = N_Null_Statement and then (No (Stat2) or else (Nkind (Stat2) = N_Simple_Return_Statement and then No (Next (Stat2)))); end if; end; end if; else return False; end if; end Is_Null_Procedure; ------------------------------------------- -- Make_Build_In_Place_Call_In_Allocator -- ------------------------------------------- procedure Make_Build_In_Place_Call_In_Allocator (Allocator : Node_Id; Function_Call : Node_Id) is Acc_Type : constant Entity_Id := Etype (Allocator); Loc : Source_Ptr; Func_Call : Node_Id := Function_Call; Ref_Func_Call : Node_Id; Function_Id : Entity_Id; Result_Subt : Entity_Id; New_Allocator : Node_Id; Return_Obj_Access : Entity_Id; -- temp for function result Temp_Init : Node_Id; -- initial value of Return_Obj_Access Alloc_Form : BIP_Allocation_Form; Pool : Node_Id; -- nonnull if Alloc_Form = User_Storage_Pool Return_Obj_Actual : Node_Id; -- the temp.all, in caller-allocates case Chain : Entity_Id; -- activation chain, in case of tasks begin -- Step past qualification or unchecked conversion (the latter can occur -- in cases of calls to 'Input). if Nkind_In (Func_Call, N_Qualified_Expression, N_Type_Conversion, N_Unchecked_Type_Conversion) then Func_Call := Expression (Func_Call); end if; -- If the call has already been processed to add build-in-place actuals -- then return. This should not normally occur in an allocator context, -- but we add the protection as a defensive measure. if Is_Expanded_Build_In_Place_Call (Func_Call) then return; end if; -- Mark the call as processed as a build-in-place call Set_Is_Expanded_Build_In_Place_Call (Func_Call); Loc := Sloc (Function_Call); if Is_Entity_Name (Name (Func_Call)) then Function_Id := Entity (Name (Func_Call)); elsif Nkind (Name (Func_Call)) = N_Explicit_Dereference then Function_Id := Etype (Name (Func_Call)); else raise Program_Error; end if; Result_Subt := Available_View (Etype (Function_Id)); -- Create a temp for the function result. In the caller-allocates case, -- this will be initialized to the result of a new uninitialized -- allocator. Note: we do not use Allocator as the Related_Node of -- Return_Obj_Access in call to Make_Temporary below as this would -- create a sort of infinite "recursion". Return_Obj_Access := Make_Temporary (Loc, 'R'); Set_Etype (Return_Obj_Access, Acc_Type); -- When the result subtype is constrained, the return object is -- allocated on the caller side, and access to it is passed to the -- function. -- Here and in related routines, we must examine the full view of the -- type, because the view at the point of call may differ from that -- that in the function body, and the expansion mechanism depends on -- the characteristics of the full view. if Is_Constrained (Underlying_Type (Result_Subt)) then -- Replace the initialized allocator of form "new T'(Func (...))" -- with an uninitialized allocator of form "new T", where T is the -- result subtype of the called function. The call to the function -- is handled separately further below. New_Allocator := Make_Allocator (Loc, Expression => New_Occurrence_Of (Result_Subt, Loc)); Set_No_Initialization (New_Allocator); -- Copy attributes to new allocator. Note that the new allocator -- logically comes from source if the original one did, so copy the -- relevant flag. This ensures proper treatment of the restriction -- No_Implicit_Heap_Allocations in this case. Set_Storage_Pool (New_Allocator, Storage_Pool (Allocator)); Set_Procedure_To_Call (New_Allocator, Procedure_To_Call (Allocator)); Set_Comes_From_Source (New_Allocator, Comes_From_Source (Allocator)); Rewrite (Allocator, New_Allocator); -- Initial value of the temp is the result of the uninitialized -- allocator Temp_Init := Relocate_Node (Allocator); -- Indicate that caller allocates, and pass in the return object Alloc_Form := Caller_Allocation; Pool := Make_Null (No_Location); Return_Obj_Actual := Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Result_Subt, Loc), Expression => Make_Explicit_Dereference (Loc, Prefix => New_Occurrence_Of (Return_Obj_Access, Loc))); -- When the result subtype is unconstrained, the function itself must -- perform the allocation of the return object, so we pass parameters -- indicating that. else Temp_Init := Empty; -- Case of a user-defined storage pool. Pass an allocation parameter -- indicating that the function should allocate its result in the -- pool, and pass the pool. Use 'Unrestricted_Access because the -- pool may not be aliased. if Present (Associated_Storage_Pool (Acc_Type)) then Alloc_Form := User_Storage_Pool; Pool := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Associated_Storage_Pool (Acc_Type), Loc), Attribute_Name => Name_Unrestricted_Access); -- No user-defined pool; pass an allocation parameter indicating that -- the function should allocate its result on the heap. else Alloc_Form := Global_Heap; Pool := Make_Null (No_Location); end if; -- The caller does not provide the return object in this case, so we -- have to pass null for the object access actual. Return_Obj_Actual := Empty; end if; -- Declare the temp object Insert_Action (Allocator, Make_Object_Declaration (Loc, Defining_Identifier => Return_Obj_Access, Object_Definition => New_Occurrence_Of (Acc_Type, Loc), Expression => Temp_Init)); Ref_Func_Call := Make_Reference (Loc, Func_Call); -- Ada 2005 (AI-251): If the type of the allocator is an interface -- then generate an implicit conversion to force displacement of the -- "this" pointer. if Is_Interface (Designated_Type (Acc_Type)) then Rewrite (Ref_Func_Call, OK_Convert_To (Acc_Type, Ref_Func_Call)); end if; declare Assign : constant Node_Id := Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Return_Obj_Access, Loc), Expression => Ref_Func_Call); -- Assign the result of the function call into the temp. In the -- caller-allocates case, this is overwriting the temp with its -- initial value, which has no effect. In the callee-allocates case, -- this is setting the temp to point to the object allocated by the -- callee. Actions : List_Id; -- Actions to be inserted. If there are no tasks, this is just the -- assignment statement. If the allocated object has tasks, we need -- to wrap the assignment in a block that activates them. The -- activation chain of that block must be passed to the function, -- rather than some outer chain. begin if Has_Task (Result_Subt) then Actions := New_List; Build_Task_Allocate_Block_With_Init_Stmts (Actions, Allocator, Init_Stmts => New_List (Assign)); Chain := Activation_Chain_Entity (Last (Actions)); else Actions := New_List (Assign); Chain := Empty; end if; Insert_Actions (Allocator, Actions); end; -- When the function has a controlling result, an allocation-form -- parameter must be passed indicating that the caller is allocating -- the result object. This is needed because such a function can be -- called as a dispatching operation and must be treated similarly -- to functions with unconstrained result subtypes. Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form, Pool_Actual => Pool); Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, Acc_Type); Add_Task_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Master_Actual => Master_Id (Acc_Type), Chain => Chain); -- Add an implicit actual to the function call that provides access -- to the allocated object. An unchecked conversion to the (specific) -- result subtype of the function is inserted to handle cases where -- the access type of the allocator has a class-wide designated type. Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, Return_Obj_Actual); -- Finally, replace the allocator node with a reference to the temp Rewrite (Allocator, New_Occurrence_Of (Return_Obj_Access, Loc)); Analyze_And_Resolve (Allocator, Acc_Type); end Make_Build_In_Place_Call_In_Allocator; --------------------------------------------------- -- Make_Build_In_Place_Call_In_Anonymous_Context -- --------------------------------------------------- procedure Make_Build_In_Place_Call_In_Anonymous_Context (Function_Call : Node_Id) is Loc : Source_Ptr; Func_Call : Node_Id := Function_Call; Function_Id : Entity_Id; Result_Subt : Entity_Id; Return_Obj_Id : Entity_Id; Return_Obj_Decl : Entity_Id; Definite : Boolean; -- True if result subtype is definite, or has a size that does not -- require secondary stack usage (i.e. no variant part or components -- whose type depends on discriminants). In particular, untagged types -- with only access discriminants do not require secondary stack use. -- Note that if the return type is tagged we must always use the sec. -- stack because the call may dispatch on result. begin -- Step past qualification, type conversion (which can occur in actual -- parameter contexts), and unchecked conversion (which can occur in -- cases of calls to 'Input). if Nkind_In (Func_Call, N_Qualified_Expression, N_Type_Conversion, N_Unchecked_Type_Conversion) then Func_Call := Expression (Func_Call); end if; -- If the call has already been processed to add build-in-place actuals -- then return. One place this can occur is for calls to build-in-place -- functions that occur within a call to a protected operation, where -- due to rewriting and expansion of the protected call there can be -- more than one call to Expand_Actuals for the same set of actuals. if Is_Expanded_Build_In_Place_Call (Func_Call) then return; end if; -- Mark the call as processed as a build-in-place call Set_Is_Expanded_Build_In_Place_Call (Func_Call); Loc := Sloc (Function_Call); if Is_Entity_Name (Name (Func_Call)) then Function_Id := Entity (Name (Func_Call)); elsif Nkind (Name (Func_Call)) = N_Explicit_Dereference then Function_Id := Etype (Name (Func_Call)); else raise Program_Error; end if; Result_Subt := Etype (Function_Id); Definite := (Is_Definite_Subtype (Underlying_Type (Result_Subt)) and then not Is_Tagged_Type (Result_Subt)) or else not Requires_Transient_Scope (Underlying_Type (Result_Subt)); -- If the build-in-place function returns a controlled object, then the -- object needs to be finalized immediately after the context. Since -- this case produces a transient scope, the servicing finalizer needs -- to name the returned object. Create a temporary which is initialized -- with the function call: -- -- Temp_Id : Func_Type := BIP_Func_Call; -- -- The initialization expression of the temporary will be rewritten by -- the expander using the appropriate mechanism in Make_Build_In_Place_ -- Call_In_Object_Declaration. if Needs_Finalization (Result_Subt) then declare Temp_Id : constant Entity_Id := Make_Temporary (Loc, 'R'); Temp_Decl : Node_Id; begin -- Reset the guard on the function call since the following does -- not perform actual call expansion. Set_Is_Expanded_Build_In_Place_Call (Func_Call, False); Temp_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Temp_Id, Object_Definition => New_Occurrence_Of (Result_Subt, Loc), Expression => New_Copy_Tree (Function_Call)); Insert_Action (Function_Call, Temp_Decl); Rewrite (Function_Call, New_Occurrence_Of (Temp_Id, Loc)); Analyze (Function_Call); end; -- When the result subtype is definite, an object of the subtype is -- declared and an access value designating it is passed as an actual. elsif Definite then -- Create a temporary object to hold the function result Return_Obj_Id := Make_Temporary (Loc, 'R'); Set_Etype (Return_Obj_Id, Result_Subt); Return_Obj_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Return_Obj_Id, Aliased_Present => True, Object_Definition => New_Occurrence_Of (Result_Subt, Loc)); Set_No_Initialization (Return_Obj_Decl); Insert_Action (Func_Call, Return_Obj_Decl); -- When the function has a controlling result, an allocation-form -- parameter must be passed indicating that the caller is allocating -- the result object. This is needed because such a function can be -- called as a dispatching operation and must be treated similarly -- to functions with unconstrained result subtypes. Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form => Caller_Allocation); Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call, Function_Id); Add_Task_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Make_Identifier (Loc, Name_uMaster)); -- Add an implicit actual to the function call that provides access -- to the caller's return object. Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, New_Occurrence_Of (Return_Obj_Id, Loc)); -- When the result subtype is unconstrained, the function must allocate -- the return object in the secondary stack, so appropriate implicit -- parameters are added to the call to indicate that. A transient -- scope is established to ensure eventual cleanup of the result. else -- Pass an allocation parameter indicating that the function should -- allocate its result on the secondary stack. Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form => Secondary_Stack); Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call, Function_Id); Add_Task_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Make_Identifier (Loc, Name_uMaster)); -- Pass a null value to the function since no return object is -- available on the caller side. Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, Empty); end if; end Make_Build_In_Place_Call_In_Anonymous_Context; -------------------------------------------- -- Make_Build_In_Place_Call_In_Assignment -- -------------------------------------------- procedure Make_Build_In_Place_Call_In_Assignment (Assign : Node_Id; Function_Call : Node_Id) is Lhs : constant Node_Id := Name (Assign); Func_Call : Node_Id := Function_Call; Func_Id : Entity_Id; Loc : Source_Ptr; Obj_Decl : Node_Id; Obj_Id : Entity_Id; Ptr_Typ : Entity_Id; Ptr_Typ_Decl : Node_Id; New_Expr : Node_Id; Result_Subt : Entity_Id; Target : Node_Id; begin -- Step past qualification or unchecked conversion (the latter can occur -- in cases of calls to 'Input). if Nkind_In (Func_Call, N_Qualified_Expression, N_Unchecked_Type_Conversion) then Func_Call := Expression (Func_Call); end if; -- If the call has already been processed to add build-in-place actuals -- then return. This should not normally occur in an assignment context, -- but we add the protection as a defensive measure. if Is_Expanded_Build_In_Place_Call (Func_Call) then return; end if; -- Mark the call as processed as a build-in-place call Set_Is_Expanded_Build_In_Place_Call (Func_Call); Loc := Sloc (Function_Call); if Is_Entity_Name (Name (Func_Call)) then Func_Id := Entity (Name (Func_Call)); elsif Nkind (Name (Func_Call)) = N_Explicit_Dereference then Func_Id := Etype (Name (Func_Call)); else raise Program_Error; end if; Result_Subt := Etype (Func_Id); -- When the result subtype is unconstrained, an additional actual must -- be passed to indicate that the caller is providing the return object. -- This parameter must also be passed when the called function has a -- controlling result, because dispatching calls to the function needs -- to be treated effectively the same as calls to class-wide functions. Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Func_Id, Alloc_Form => Caller_Allocation); Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call, Func_Id); Add_Task_Actuals_To_Build_In_Place_Call (Func_Call, Func_Id, Make_Identifier (Loc, Name_uMaster)); -- Add an implicit actual to the function call that provides access to -- the caller's return object. Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Func_Id, Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Result_Subt, Loc), Expression => Relocate_Node (Lhs))); -- Create an access type designating the function's result subtype Ptr_Typ := Make_Temporary (Loc, 'A'); Ptr_Typ_Decl := Make_Full_Type_Declaration (Loc, Defining_Identifier => Ptr_Typ, Type_Definition => Make_Access_To_Object_Definition (Loc, All_Present => True, Subtype_Indication => New_Occurrence_Of (Result_Subt, Loc))); Insert_After_And_Analyze (Assign, Ptr_Typ_Decl); -- Finally, create an access object initialized to a reference to the -- function call. We know this access value is non-null, so mark the -- entity accordingly to suppress junk access checks. New_Expr := Make_Reference (Loc, Relocate_Node (Func_Call)); Obj_Id := Make_Temporary (Loc, 'R', New_Expr); Set_Etype (Obj_Id, Ptr_Typ); Set_Is_Known_Non_Null (Obj_Id); Obj_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Obj_Id, Object_Definition => New_Occurrence_Of (Ptr_Typ, Loc), Expression => New_Expr); Insert_After_And_Analyze (Ptr_Typ_Decl, Obj_Decl); Rewrite (Assign, Make_Null_Statement (Loc)); -- Retrieve the target of the assignment if Nkind (Lhs) = N_Selected_Component then Target := Selector_Name (Lhs); elsif Nkind (Lhs) = N_Type_Conversion then Target := Expression (Lhs); else Target := Lhs; end if; -- If we are assigning to a return object or this is an expression of -- an extension aggregate, the target should either be an identifier -- or a simple expression. All other cases imply a different scenario. if Nkind (Target) in N_Has_Entity then Target := Entity (Target); else return; end if; end Make_Build_In_Place_Call_In_Assignment; ---------------------------------------------------- -- Make_Build_In_Place_Call_In_Object_Declaration -- ---------------------------------------------------- procedure Make_Build_In_Place_Call_In_Object_Declaration (Obj_Decl : Node_Id; Function_Call : Node_Id) is Obj_Def_Id : constant Entity_Id := Defining_Identifier (Obj_Decl); Encl_Func : constant Entity_Id := Enclosing_Subprogram (Obj_Def_Id); Loc : constant Source_Ptr := Sloc (Function_Call); Obj_Loc : constant Source_Ptr := Sloc (Obj_Decl); Call_Deref : Node_Id; Caller_Object : Node_Id; Def_Id : Entity_Id; Fmaster_Actual : Node_Id := Empty; Func_Call : Node_Id := Function_Call; Function_Id : Entity_Id; Pool_Actual : Node_Id; Ptr_Typ : Entity_Id; Ptr_Typ_Decl : Node_Id; Pass_Caller_Acc : Boolean := False; Res_Decl : Node_Id; Result_Subt : Entity_Id; Definite : Boolean; -- True if result subtype is definite, or has a size that does not -- require secondary stack usage (i.e. no variant part or components -- whose type depends on discriminants). In particular, untagged types -- with only access discriminants do not require secondary stack use. -- Note that if the return type is tagged we must always use the sec. -- stack because the call may dispatch on result. begin -- Step past qualification or unchecked conversion (the latter can occur -- in cases of calls to 'Input). if Nkind_In (Func_Call, N_Qualified_Expression, N_Unchecked_Type_Conversion) then Func_Call := Expression (Func_Call); end if; -- If the call has already been processed to add build-in-place actuals -- then return. This should not normally occur in an object declaration, -- but we add the protection as a defensive measure. if Is_Expanded_Build_In_Place_Call (Func_Call) then return; end if; -- Mark the call as processed as a build-in-place call Set_Is_Expanded_Build_In_Place_Call (Func_Call); if Is_Entity_Name (Name (Func_Call)) then Function_Id := Entity (Name (Func_Call)); elsif Nkind (Name (Func_Call)) = N_Explicit_Dereference then Function_Id := Etype (Name (Func_Call)); else raise Program_Error; end if; Result_Subt := Etype (Function_Id); Definite := (Is_Definite_Subtype (Underlying_Type (Result_Subt)) and then not Is_Tagged_Type (Result_Subt)) or else not Requires_Transient_Scope (Underlying_Type (Result_Subt)); -- Create an access type designating the function's result subtype. We -- use the type of the original call because it may be a call to an -- inherited operation, which the expansion has replaced with the parent -- operation that yields the parent type. Note that this access type -- must be declared before we establish a transient scope, so that it -- receives the proper accessibility level. Ptr_Typ := Make_Temporary (Loc, 'A'); Ptr_Typ_Decl := Make_Full_Type_Declaration (Loc, Defining_Identifier => Ptr_Typ, Type_Definition => Make_Access_To_Object_Definition (Loc, All_Present => True, Subtype_Indication => New_Occurrence_Of (Etype (Function_Call), Loc))); -- The access type and its accompanying object must be inserted after -- the object declaration in the constrained case, so that the function -- call can be passed access to the object. In the indefinite case, -- or if the object declaration is for a return object, the access type -- and object must be inserted before the object, since the object -- declaration is rewritten to be a renaming of a dereference of the -- access object. Note: we need to freeze Ptr_Typ explicitly, because -- the result object is in a different (transient) scope, so won't -- cause freezing. if Definite and then not Is_Return_Object (Defining_Identifier (Obj_Decl)) then Insert_After_And_Analyze (Obj_Decl, Ptr_Typ_Decl); else Insert_Action (Obj_Decl, Ptr_Typ_Decl); end if; -- Force immediate freezing of Ptr_Typ because Res_Decl will be -- elaborated in an inner (transient) scope and thus won't cause -- freezing by itself. declare Ptr_Typ_Freeze_Ref : constant Node_Id := New_Occurrence_Of (Ptr_Typ, Loc); begin Set_Parent (Ptr_Typ_Freeze_Ref, Ptr_Typ_Decl); Freeze_Expression (Ptr_Typ_Freeze_Ref); end; -- If the object is a return object of an enclosing build-in-place -- function, then the implicit build-in-place parameters of the -- enclosing function are simply passed along to the called function. -- (Unfortunately, this won't cover the case of extension aggregates -- where the ancestor part is a build-in-place indefinite function -- call that should be passed along the caller's parameters. Currently -- those get mishandled by reassigning the result of the call to the -- aggregate return object, when the call result should really be -- directly built in place in the aggregate and not in a temporary. ???) if Is_Return_Object (Defining_Identifier (Obj_Decl)) then Pass_Caller_Acc := True; -- When the enclosing function has a BIP_Alloc_Form formal then we -- pass it along to the callee (such as when the enclosing function -- has an unconstrained or tagged result type). if Needs_BIP_Alloc_Form (Encl_Func) then if RTE_Available (RE_Root_Storage_Pool_Ptr) then Pool_Actual := New_Occurrence_Of (Build_In_Place_Formal (Encl_Func, BIP_Storage_Pool), Loc); -- The build-in-place pool formal is not built on e.g. ZFP else Pool_Actual := Empty; end if; Add_Unconstrained_Actuals_To_Build_In_Place_Call (Function_Call => Func_Call, Function_Id => Function_Id, Alloc_Form_Exp => New_Occurrence_Of (Build_In_Place_Formal (Encl_Func, BIP_Alloc_Form), Loc), Pool_Actual => Pool_Actual); -- Otherwise, if enclosing function has a definite result subtype, -- then caller allocation will be used. else Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form => Caller_Allocation); end if; if Needs_BIP_Finalization_Master (Encl_Func) then Fmaster_Actual := New_Occurrence_Of (Build_In_Place_Formal (Encl_Func, BIP_Finalization_Master), Loc); end if; -- Retrieve the BIPacc formal from the enclosing function and convert -- it to the access type of the callee's BIP_Object_Access formal. Caller_Object := Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Etype (Build_In_Place_Formal (Function_Id, BIP_Object_Access)), Loc), Expression => New_Occurrence_Of (Build_In_Place_Formal (Encl_Func, BIP_Object_Access), Loc)); -- In the definite case, add an implicit actual to the function call -- that provides access to the declared object. An unchecked conversion -- to the (specific) result type of the function is inserted to handle -- the case where the object is declared with a class-wide type. elsif Definite then Caller_Object := Make_Unchecked_Type_Conversion (Loc, Subtype_Mark => New_Occurrence_Of (Result_Subt, Loc), Expression => New_Occurrence_Of (Obj_Def_Id, Loc)); -- When the function has a controlling result, an allocation-form -- parameter must be passed indicating that the caller is allocating -- the result object. This is needed because such a function can be -- called as a dispatching operation and must be treated similarly -- to functions with indefinite result subtypes. Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form => Caller_Allocation); -- The allocation for indefinite library-level objects occurs on the -- heap as opposed to the secondary stack. This accommodates DLLs where -- the secondary stack is destroyed after each library unload. This is -- a hybrid mechanism where a stack-allocated object lives on the heap. elsif Is_Library_Level_Entity (Defining_Identifier (Obj_Decl)) and then not Restriction_Active (No_Implicit_Heap_Allocations) then Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form => Global_Heap); Caller_Object := Empty; -- Create a finalization master for the access result type to ensure -- that the heap allocation can properly chain the object and later -- finalize it when the library unit goes out of scope. if Needs_Finalization (Etype (Func_Call)) then Build_Finalization_Master (Typ => Ptr_Typ, For_Lib_Level => True, Insertion_Node => Ptr_Typ_Decl); Fmaster_Actual := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (Finalization_Master (Ptr_Typ), Loc), Attribute_Name => Name_Unrestricted_Access); end if; -- In other indefinite cases, pass an indication to do the allocation -- on the secondary stack and set Caller_Object to Empty so that a null -- value will be passed for the caller's object address. A transient -- scope is established to ensure eventual cleanup of the result. else Add_Unconstrained_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Alloc_Form => Secondary_Stack); Caller_Object := Empty; Establish_Transient_Scope (Obj_Decl, Sec_Stack => True); end if; -- Pass along any finalization master actual, which is needed in the -- case where the called function initializes a return object of an -- enclosing build-in-place function. Add_Finalization_Master_Actual_To_Build_In_Place_Call (Func_Call => Func_Call, Func_Id => Function_Id, Master_Exp => Fmaster_Actual); if Nkind (Parent (Obj_Decl)) = N_Extended_Return_Statement and then Has_Task (Result_Subt) then -- Here we're passing along the master that was passed in to this -- function. Add_Task_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Master_Actual => New_Occurrence_Of (Build_In_Place_Formal (Encl_Func, BIP_Task_Master), Loc)); else Add_Task_Actuals_To_Build_In_Place_Call (Func_Call, Function_Id, Make_Identifier (Loc, Name_uMaster)); end if; Add_Access_Actual_To_Build_In_Place_Call (Func_Call, Function_Id, Caller_Object, Is_Access => Pass_Caller_Acc); -- Finally, create an access object initialized to a reference to the -- function call. We know this access value cannot be null, so mark the -- entity accordingly to suppress the access check. Def_Id := Make_Temporary (Loc, 'R', Func_Call); Set_Etype (Def_Id, Ptr_Typ); Set_Is_Known_Non_Null (Def_Id); Res_Decl := Make_Object_Declaration (Loc, Defining_Identifier => Def_Id, Constant_Present => True, Object_Definition => New_Occurrence_Of (Ptr_Typ, Loc), Expression => Make_Reference (Loc, Relocate_Node (Func_Call))); Insert_After_And_Analyze (Ptr_Typ_Decl, Res_Decl); -- If the result subtype of the called function is definite and is not -- itself the return expression of an enclosing BIP function, then mark -- the object as having no initialization. if Definite and then not Is_Return_Object (Defining_Identifier (Obj_Decl)) then -- The related object declaration is encased in a transient block -- because the build-in-place function call contains at least one -- nested function call that produces a controlled transient -- temporary: -- Obj : ... := BIP_Func_Call (Ctrl_Func_Call); -- Since the build-in-place expansion decouples the call from the -- object declaration, the finalization machinery lacks the context -- which prompted the generation of the transient block. To resolve -- this scenario, store the build-in-place call. if Scope_Is_Transient and then Node_To_Be_Wrapped = Obj_Decl then Set_BIP_Initialization_Call (Obj_Def_Id, Res_Decl); end if; Set_Expression (Obj_Decl, Empty); Set_No_Initialization (Obj_Decl); -- In case of an indefinite result subtype, or if the call is the -- return expression of an enclosing BIP function, rewrite the object -- declaration as an object renaming where the renamed object is a -- dereference of <function_Call>'reference: -- -- Obj : Subt renames <function_call>'Ref.all; else Call_Deref := Make_Explicit_Dereference (Obj_Loc, Prefix => New_Occurrence_Of (Def_Id, Obj_Loc)); Rewrite (Obj_Decl, Make_Object_Renaming_Declaration (Obj_Loc, Defining_Identifier => Make_Temporary (Obj_Loc, 'D'), Subtype_Mark => New_Occurrence_Of (Result_Subt, Obj_Loc), Name => Call_Deref)); Set_Renamed_Object (Defining_Identifier (Obj_Decl), Call_Deref); -- If the original entity comes from source, then mark the new -- entity as needing debug information, even though it's defined -- by a generated renaming that does not come from source, so that -- the Materialize_Entity flag will be set on the entity when -- Debug_Renaming_Declaration is called during analysis. if Comes_From_Source (Obj_Def_Id) then Set_Debug_Info_Needed (Defining_Identifier (Obj_Decl)); end if; Analyze (Obj_Decl); -- Replace the internal identifier of the renaming declaration's -- entity with identifier of the original object entity. We also have -- to exchange the entities containing their defining identifiers to -- ensure the correct replacement of the object declaration by the -- object renaming declaration to avoid homograph conflicts (since -- the object declaration's defining identifier was already entered -- in current scope). The Next_Entity links of the two entities also -- have to be swapped since the entities are part of the return -- scope's entity list and the list structure would otherwise be -- corrupted. Finally, the homonym chain must be preserved as well. declare Ren_Id : constant Entity_Id := Defining_Entity (Obj_Decl); Next_Id : constant Entity_Id := Next_Entity (Ren_Id); begin Set_Chars (Ren_Id, Chars (Obj_Def_Id)); -- Swap next entity links in preparation for exchanging entities Set_Next_Entity (Ren_Id, Next_Entity (Obj_Def_Id)); Set_Next_Entity (Obj_Def_Id, Next_Id); Set_Homonym (Ren_Id, Homonym (Obj_Def_Id)); Exchange_Entities (Ren_Id, Obj_Def_Id); -- Preserve source indication of original declaration, so that -- xref information is properly generated for the right entity. Preserve_Comes_From_Source (Obj_Decl, Original_Node (Obj_Decl)); Preserve_Comes_From_Source (Obj_Def_Id, Original_Node (Obj_Decl)); Set_Comes_From_Source (Ren_Id, False); end; end if; -- If the object entity has a class-wide Etype, then we need to change -- it to the result subtype of the function call, because otherwise the -- object will be class-wide without an explicit initialization and -- won't be allocated properly by the back end. It seems unclean to make -- such a revision to the type at this point, and we should try to -- improve this treatment when build-in-place functions with class-wide -- results are implemented. ??? if Is_Class_Wide_Type (Etype (Defining_Identifier (Obj_Decl))) then Set_Etype (Defining_Identifier (Obj_Decl), Result_Subt); end if; end Make_Build_In_Place_Call_In_Object_Declaration; -------------------------------------------- -- Make_CPP_Constructor_Call_In_Allocator -- -------------------------------------------- procedure Make_CPP_Constructor_Call_In_Allocator (Allocator : Node_Id; Function_Call : Node_Id) is Loc : constant Source_Ptr := Sloc (Function_Call); Acc_Type : constant Entity_Id := Etype (Allocator); Function_Id : constant Entity_Id := Entity (Name (Function_Call)); Result_Subt : constant Entity_Id := Available_View (Etype (Function_Id)); New_Allocator : Node_Id; Return_Obj_Access : Entity_Id; Tmp_Obj : Node_Id; begin pragma Assert (Nkind (Allocator) = N_Allocator and then Nkind (Function_Call) = N_Function_Call); pragma Assert (Convention (Function_Id) = Convention_CPP and then Is_Constructor (Function_Id)); pragma Assert (Is_Constrained (Underlying_Type (Result_Subt))); -- Replace the initialized allocator of form "new T'(Func (...))" with -- an uninitialized allocator of form "new T", where T is the result -- subtype of the called function. The call to the function is handled -- separately further below. New_Allocator := Make_Allocator (Loc, Expression => New_Occurrence_Of (Result_Subt, Loc)); Set_No_Initialization (New_Allocator); -- Copy attributes to new allocator. Note that the new allocator -- logically comes from source if the original one did, so copy the -- relevant flag. This ensures proper treatment of the restriction -- No_Implicit_Heap_Allocations in this case. Set_Storage_Pool (New_Allocator, Storage_Pool (Allocator)); Set_Procedure_To_Call (New_Allocator, Procedure_To_Call (Allocator)); Set_Comes_From_Source (New_Allocator, Comes_From_Source (Allocator)); Rewrite (Allocator, New_Allocator); -- Create a new access object and initialize it to the result of the -- new uninitialized allocator. Note: we do not use Allocator as the -- Related_Node of Return_Obj_Access in call to Make_Temporary below -- as this would create a sort of infinite "recursion". Return_Obj_Access := Make_Temporary (Loc, 'R'); Set_Etype (Return_Obj_Access, Acc_Type); -- Generate: -- Rnnn : constant ptr_T := new (T); -- Init (Rnn.all,...); Tmp_Obj := Make_Object_Declaration (Loc, Defining_Identifier => Return_Obj_Access, Constant_Present => True, Object_Definition => New_Occurrence_Of (Acc_Type, Loc), Expression => Relocate_Node (Allocator)); Insert_Action (Allocator, Tmp_Obj); Insert_List_After_And_Analyze (Tmp_Obj, Build_Initialization_Call (Loc, Id_Ref => Make_Explicit_Dereference (Loc, Prefix => New_Occurrence_Of (Return_Obj_Access, Loc)), Typ => Etype (Function_Id), Constructor_Ref => Function_Call)); -- Finally, replace the allocator node with a reference to the result of -- the function call itself (which will effectively be an access to the -- object created by the allocator). Rewrite (Allocator, New_Occurrence_Of (Return_Obj_Access, Loc)); -- Ada 2005 (AI-251): If the type of the allocator is an interface then -- generate an implicit conversion to force displacement of the "this" -- pointer. if Is_Interface (Designated_Type (Acc_Type)) then Rewrite (Allocator, Convert_To (Acc_Type, Relocate_Node (Allocator))); end if; Analyze_And_Resolve (Allocator, Acc_Type); end Make_CPP_Constructor_Call_In_Allocator; ----------------------------------- -- Needs_BIP_Finalization_Master -- ----------------------------------- function Needs_BIP_Finalization_Master (Func_Id : Entity_Id) return Boolean is pragma Assert (Is_Build_In_Place_Function (Func_Id)); Func_Typ : constant Entity_Id := Underlying_Type (Etype (Func_Id)); begin -- A formal giving the finalization master is needed for build-in-place -- functions whose result type needs finalization or is a tagged type. -- Tagged primitive build-in-place functions need such a formal because -- they can be called by a dispatching call, and extensions may require -- finalization even if the root type doesn't. This means they're also -- needed for tagged nonprimitive build-in-place functions with tagged -- results, since such functions can be called via access-to-function -- types, and those can be used to call primitives, so masters have to -- be passed to all such build-in-place functions, primitive or not. return not Restriction_Active (No_Finalization) and then (Needs_Finalization (Func_Typ) or else Is_Tagged_Type (Func_Typ)); end Needs_BIP_Finalization_Master; -------------------------- -- Needs_BIP_Alloc_Form -- -------------------------- function Needs_BIP_Alloc_Form (Func_Id : Entity_Id) return Boolean is pragma Assert (Is_Build_In_Place_Function (Func_Id)); Func_Typ : constant Entity_Id := Underlying_Type (Etype (Func_Id)); begin return not Is_Constrained (Func_Typ) or else Is_Tagged_Type (Func_Typ); end Needs_BIP_Alloc_Form; -------------------------------------- -- Needs_Result_Accessibility_Level -- -------------------------------------- function Needs_Result_Accessibility_Level (Func_Id : Entity_Id) return Boolean is Func_Typ : constant Entity_Id := Underlying_Type (Etype (Func_Id)); function Has_Unconstrained_Access_Discriminant_Component (Comp_Typ : Entity_Id) return Boolean; -- Returns True if any component of the type has an unconstrained access -- discriminant. ----------------------------------------------------- -- Has_Unconstrained_Access_Discriminant_Component -- ----------------------------------------------------- function Has_Unconstrained_Access_Discriminant_Component (Comp_Typ : Entity_Id) return Boolean is begin if not Is_Limited_Type (Comp_Typ) then return False; -- Only limited types can have access discriminants with -- defaults. elsif Has_Unconstrained_Access_Discriminants (Comp_Typ) then return True; elsif Is_Array_Type (Comp_Typ) then return Has_Unconstrained_Access_Discriminant_Component (Underlying_Type (Component_Type (Comp_Typ))); elsif Is_Record_Type (Comp_Typ) then declare Comp : Entity_Id; begin Comp := First_Component (Comp_Typ); while Present (Comp) loop if Has_Unconstrained_Access_Discriminant_Component (Underlying_Type (Etype (Comp))) then return True; end if; Next_Component (Comp); end loop; end; end if; return False; end Has_Unconstrained_Access_Discriminant_Component; Feature_Disabled : constant Boolean := True; -- Temporary -- Start of processing for Needs_Result_Accessibility_Level begin -- False if completion unavailable (how does this happen???) if not Present (Func_Typ) then return False; elsif Feature_Disabled then return False; -- False if not a function, also handle enum-lit renames case elsif Func_Typ = Standard_Void_Type or else Is_Scalar_Type (Func_Typ) then return False; -- Handle a corner case, a cross-dialect subp renaming. For example, -- an Ada 2012 renaming of an Ada 2005 subprogram. This can occur when -- an Ada 2005 (or earlier) unit references predefined run-time units. elsif Present (Alias (Func_Id)) then -- Unimplemented: a cross-dialect subp renaming which does not set -- the Alias attribute (e.g., a rename of a dereference of an access -- to subprogram value). ??? return Present (Extra_Accessibility_Of_Result (Alias (Func_Id))); -- Remaining cases require Ada 2012 mode elsif Ada_Version < Ada_2012 then return False; elsif Ekind (Func_Typ) = E_Anonymous_Access_Type or else Is_Tagged_Type (Func_Typ) then -- In the case of, say, a null tagged record result type, the need -- for this extra parameter might not be obvious. This function -- returns True for all tagged types for compatibility reasons. -- A function with, say, a tagged null controlling result type might -- be overridden by a primitive of an extension having an access -- discriminant and the overrider and overridden must have compatible -- calling conventions (including implicitly declared parameters). -- Similarly, values of one access-to-subprogram type might designate -- both a primitive subprogram of a given type and a function -- which is, for example, not a primitive subprogram of any type. -- Again, this requires calling convention compatibility. -- It might be possible to solve these issues by introducing -- wrappers, but that is not the approach that was chosen. return True; elsif Has_Unconstrained_Access_Discriminants (Func_Typ) then return True; elsif Has_Unconstrained_Access_Discriminant_Component (Func_Typ) then return True; -- False for all other cases else return False; end if; end Needs_Result_Accessibility_Level; --------------------------------- -- Rewrite_Function_Call_For_C -- --------------------------------- procedure Rewrite_Function_Call_For_C (N : Node_Id) is Orig_Func : constant Entity_Id := Entity (Name (N)); Func_Id : constant Entity_Id := Ultimate_Alias (Orig_Func); Par : constant Node_Id := Parent (N); Proc_Id : constant Entity_Id := Corresponding_Procedure (Func_Id); Loc : constant Source_Ptr := Sloc (Par); Actuals : List_Id; Last_Actual : Node_Id; Last_Formal : Entity_Id; -- Start of processing for Rewrite_Function_Call_For_C begin -- The actuals may be given by named associations, so the added actual -- that is the target of the return value of the call must be a named -- association as well, so we retrieve the name of the generated -- out_formal. Last_Formal := First_Formal (Proc_Id); while Present (Next_Formal (Last_Formal)) loop Last_Formal := Next_Formal (Last_Formal); end loop; Actuals := Parameter_Associations (N); -- The original function may lack parameters if No (Actuals) then Actuals := New_List; end if; -- If the function call is the expression of an assignment statement, -- transform the assignment into a procedure call. Generate: -- LHS := Func_Call (...); -- Proc_Call (..., LHS); -- If function is inherited, a conversion may be necessary. if Nkind (Par) = N_Assignment_Statement then Last_Actual := Name (Par); if not Comes_From_Source (Orig_Func) and then Etype (Orig_Func) /= Etype (Func_Id) then Last_Actual := Make_Type_Conversion (Loc, New_Occurrence_Of (Etype (Func_Id), Loc), Last_Actual); end if; Append_To (Actuals, Make_Parameter_Association (Loc, Selector_Name => Make_Identifier (Loc, Chars (Last_Formal)), Explicit_Actual_Parameter => Last_Actual)); Rewrite (Par, Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Proc_Id, Loc), Parameter_Associations => Actuals)); Analyze (Par); -- Otherwise the context is an expression. Generate a temporary and a -- procedure call to obtain the function result. Generate: -- ... Func_Call (...) ... -- Temp : ...; -- Proc_Call (..., Temp); -- ... Temp ... else declare Temp_Id : constant Entity_Id := Make_Temporary (Loc, 'T'); Call : Node_Id; Decl : Node_Id; begin -- Generate: -- Temp : ...; Decl := Make_Object_Declaration (Loc, Defining_Identifier => Temp_Id, Object_Definition => New_Occurrence_Of (Etype (Func_Id), Loc)); -- Generate: -- Proc_Call (..., Temp); Append_To (Actuals, Make_Parameter_Association (Loc, Selector_Name => Make_Identifier (Loc, Chars (Last_Formal)), Explicit_Actual_Parameter => New_Occurrence_Of (Temp_Id, Loc))); Call := Make_Procedure_Call_Statement (Loc, Name => New_Occurrence_Of (Proc_Id, Loc), Parameter_Associations => Actuals); Insert_Actions (Par, New_List (Decl, Call)); Rewrite (N, New_Occurrence_Of (Temp_Id, Loc)); end; end if; end Rewrite_Function_Call_For_C; ------------------------------------ -- Set_Enclosing_Sec_Stack_Return -- ------------------------------------ procedure Set_Enclosing_Sec_Stack_Return (N : Node_Id) is P : Node_Id := N; begin -- Due to a possible mix of internally generated blocks, source blocks -- and loops, the scope stack may not be contiguous as all labels are -- inserted at the top level within the related function. Instead, -- perform a parent-based traversal and mark all appropriate constructs. while Present (P) loop -- Mark the label of a source or internally generated block or -- loop. if Nkind_In (P, N_Block_Statement, N_Loop_Statement) then Set_Sec_Stack_Needed_For_Return (Entity (Identifier (P))); -- Mark the enclosing function elsif Nkind (P) = N_Subprogram_Body then if Present (Corresponding_Spec (P)) then Set_Sec_Stack_Needed_For_Return (Corresponding_Spec (P)); else Set_Sec_Stack_Needed_For_Return (Defining_Entity (P)); end if; -- Do not go beyond the enclosing function exit; end if; P := Parent (P); end loop; end Set_Enclosing_Sec_Stack_Return; end Exp_Ch6;
----------------------------------------------------------------------- -- util-commands-parsers -- Support to parse command line options -- Copyright (C) 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. ----------------------------------------------------------------------- -- == Command line parsers == -- Parsing command line arguments before their execution is handled by the -- `Config_Parser` generic package. This allows to customize how the arguments are -- parsed. -- -- The `Util.Commands.Parsers.No_Parser` package can be used to execute the command -- without parsing its arguments. -- -- The `Util.Commands.Parsers.GNAT_Parser.Config_Parser` package provides support to -- parse command line arguments by using the `GNAT` `Getopt` support. package Util.Commands.Parsers is -- The config parser that must be instantiated to provide the configuration type -- and the Execute procedure that will parse the arguments before executing the command. generic type Config_Type is limited private; with procedure Execute (Config : in out Config_Type; Args : in Argument_List'Class; Process : not null access procedure (Cmd_Args : in Argument_List'Class)) is <>; with procedure Usage (Name : in String; Config : in out Config_Type) is <>; package Config_Parser is end Config_Parser; -- The empty parser. type No_Config_Type is limited null record; -- Execute the command with its arguments (no parsing). procedure Execute (Config : in out No_Config_Type; Args : in Argument_List'Class; Process : not null access procedure (Cmd_Args : in Argument_List'Class)); procedure Usage (Name : in String; Config : in out No_Config_Type) is null; -- A parser that executes the command immediately (no parsing of arguments). package No_Parser is new Config_Parser (Config_Type => No_Config_Type, Execute => Execute, Usage => Usage); end Util.Commands.Parsers;
------------------------------------------------------------------------------ -- -- -- 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 _ H O L D E R S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2012-2015, 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/>. -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; package body Ada.Containers.Indefinite_Holders is procedure Free is new Ada.Unchecked_Deallocation (Element_Type, Element_Access); --------- -- "=" -- --------- function "=" (Left, Right : Holder) return Boolean is begin if Left.Element = null and Right.Element = null then return True; elsif Left.Element /= null and Right.Element /= null then return Left.Element.all = Right.Element.all; else return False; end if; end "="; ------------ -- Adjust -- ------------ overriding procedure Adjust (Container : in out Holder) is begin if Container.Element /= null then Container.Element := new Element_Type'(Container.Element.all); end if; Container.Busy := 0; end Adjust; overriding procedure Adjust (Control : in out Reference_Control_Type) is begin if Control.Container /= null then declare B : Natural renames Control.Container.Busy; begin B := B + 1; end; end if; end Adjust; ------------ -- Assign -- ------------ procedure Assign (Target : in out Holder; Source : Holder) is begin if Target.Busy /= 0 then raise Program_Error with "attempt to tamper with elements"; end if; if Target.Element /= Source.Element then Free (Target.Element); if Source.Element /= null then Target.Element := new Element_Type'(Source.Element.all); end if; end if; end Assign; ----------- -- Clear -- ----------- procedure Clear (Container : in out Holder) is begin if Container.Busy /= 0 then raise Program_Error with "attempt to tamper with elements"; end if; Free (Container.Element); end Clear; ------------------------ -- Constant_Reference -- ------------------------ function Constant_Reference (Container : aliased Holder) return Constant_Reference_Type is Ref : constant Constant_Reference_Type := (Element => Container.Element.all'Access, Control => (Controlled with Container'Unrestricted_Access)); B : Natural renames Ref.Control.Container.Busy; begin B := B + 1; return Ref; end Constant_Reference; ---------- -- Copy -- ---------- function Copy (Source : Holder) return Holder is begin if Source.Element = null then return (Controlled with null, 0); else return (Controlled with new Element_Type'(Source.Element.all), 0); end if; end Copy; ------------- -- Element -- ------------- function Element (Container : Holder) return Element_Type is begin if Container.Element = null then raise Constraint_Error with "container is empty"; else return Container.Element.all; end if; end Element; -------------- -- Finalize -- -------------- overriding procedure Finalize (Container : in out Holder) is begin if Container.Busy /= 0 then raise Program_Error with "attempt to tamper with elements"; end if; Free (Container.Element); end Finalize; overriding procedure Finalize (Control : in out Reference_Control_Type) is begin if Control.Container /= null then declare B : Natural renames Control.Container.Busy; begin B := B - 1; end; end if; Control.Container := null; end Finalize; -------------- -- Is_Empty -- -------------- function Is_Empty (Container : Holder) return Boolean is begin return Container.Element = null; end Is_Empty; ---------- -- Move -- ---------- procedure Move (Target : in out Holder; Source : in out Holder) is begin if Target.Busy /= 0 then raise Program_Error with "attempt to tamper with elements"; end if; if Source.Busy /= 0 then raise Program_Error with "attempt to tamper with elements"; end if; if Target.Element /= Source.Element then Free (Target.Element); Target.Element := Source.Element; Source.Element := null; end if; end Move; ------------------- -- Query_Element -- ------------------- procedure Query_Element (Container : Holder; Process : not null access procedure (Element : Element_Type)) is B : Natural renames Container'Unrestricted_Access.Busy; begin if Container.Element = null then raise Constraint_Error with "container is empty"; end if; B := B + 1; begin Process (Container.Element.all); exception when others => B := B - 1; raise; end; B := B - 1; end Query_Element; ---------- -- Read -- ---------- procedure Read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Container : out Holder) is begin Clear (Container); if not Boolean'Input (Stream) then Container.Element := new Element_Type'(Element_Type'Input (Stream)); end if; end Read; procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Constant_Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Read; procedure Read (Stream : not null access Root_Stream_Type'Class; Item : out Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Read; --------------- -- Reference -- --------------- function Reference (Container : aliased in out Holder) return Reference_Type is Ref : constant Reference_Type := (Element => Container.Element.all'Access, Control => (Controlled with Container'Unrestricted_Access)); begin Container.Busy := Container.Busy + 1; return Ref; end Reference; --------------------- -- Replace_Element -- --------------------- procedure Replace_Element (Container : in out Holder; New_Item : Element_Type) is begin if Container.Busy /= 0 then raise Program_Error with "attempt to tamper with elements"; end if; declare X : Element_Access := Container.Element; -- Element allocator may need an accessibility check in case actual -- type is class-wide or has access discriminants (RM 4.8(10.1) and -- AI12-0035). pragma Unsuppress (Accessibility_Check); begin Container.Element := new Element_Type'(New_Item); Free (X); end; end Replace_Element; --------------- -- To_Holder -- --------------- function To_Holder (New_Item : Element_Type) return Holder is -- The element allocator may need an accessibility check in the case the -- actual type is class-wide or has access discriminants (RM 4.8(10.1) -- and AI12-0035). pragma Unsuppress (Accessibility_Check); begin return (Controlled with new Element_Type'(New_Item), 0); end To_Holder; -------------------- -- Update_Element -- -------------------- procedure Update_Element (Container : in out Holder; Process : not null access procedure (Element : in out Element_Type)) is B : Natural renames Container.Busy; begin if Container.Element = null then raise Constraint_Error with "container is empty"; end if; B := B + 1; begin Process (Container.Element.all); exception when others => B := B - 1; raise; end; B := B - 1; end Update_Element; ----------- -- Write -- ----------- procedure Write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Container : Holder) is begin Boolean'Output (Stream, Container.Element = null); if Container.Element /= null then Element_Type'Output (Stream, Container.Element.all); end if; end Write; procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Write; procedure Write (Stream : not null access Root_Stream_Type'Class; Item : Constant_Reference_Type) is begin raise Program_Error with "attempt to stream reference"; end Write; end Ada.Containers.Indefinite_Holders;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . S P I T B O L . P A T T E R N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1998-2020, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Note: the data structures and general approach used in this implementation -- are derived from the original MINIMAL sources for SPITBOL. The code is not -- a direct translation, but the approach is followed closely. In particular, -- we use the one stack approach developed in the SPITBOL implementation. with Ada.Strings.Unbounded.Aux; use Ada.Strings.Unbounded.Aux; with GNAT.Debug_Utilities; use GNAT.Debug_Utilities; with System; use System; with Ada.Unchecked_Conversion; with Ada.Unchecked_Deallocation; package body GNAT.Spitbol.Patterns is ------------------------ -- Internal Debugging -- ------------------------ Internal_Debug : constant Boolean := False; -- Set this flag to True to activate some built-in debugging traceback -- These are all lines output with PutD and Put_LineD. procedure New_LineD; pragma Inline (New_LineD); -- Output new blank line with New_Line if Internal_Debug is True procedure PutD (Str : String); pragma Inline (PutD); -- Output string with Put if Internal_Debug is True procedure Put_LineD (Str : String); pragma Inline (Put_LineD); -- Output string with Put_Line if Internal_Debug is True ----------------------------- -- Local Type Declarations -- ----------------------------- subtype String_Ptr is Ada.Strings.Unbounded.String_Access; subtype File_Ptr is Ada.Text_IO.File_Access; function To_Address is new Ada.Unchecked_Conversion (PE_Ptr, Address); -- Used only for debugging output purposes subtype AFC is Ada.Finalization.Controlled; N : constant PE_Ptr := null; -- Shorthand used to initialize Copy fields to null type Natural_Ptr is access all Natural; type Pattern_Ptr is access all Pattern; -------------------------------------------------- -- Description of Algorithm and Data Structures -- -------------------------------------------------- -- A pattern structure is represented as a linked graph of nodes -- with the following structure: -- +------------------------------------+ -- I Pcode I -- +------------------------------------+ -- I Index I -- +------------------------------------+ -- I Pthen I -- +------------------------------------+ -- I parameter(s) I -- +------------------------------------+ -- Pcode is a code value indicating the type of the pattern node. This -- code is used both as the discriminant value for the record, and as -- the case index in the main match routine that branches to the proper -- match code for the given element. -- Index is a serial index number. The use of these serial index -- numbers is described in a separate section. -- Pthen is a pointer to the successor node, i.e the node to be matched -- if the attempt to match the node succeeds. If this is the last node -- of the pattern to be matched, then Pthen points to a dummy node -- of kind PC_EOP (end of pattern), which initializes pattern exit. -- The parameter or parameters are present for certain node types, -- and the type varies with the pattern code. type Pattern_Code is ( PC_Arb_Y, PC_Assign, PC_Bal, PC_BreakX_X, PC_Cancel, PC_EOP, PC_Fail, PC_Fence, PC_Fence_X, PC_Fence_Y, PC_R_Enter, PC_R_Remove, PC_R_Restore, PC_Rest, PC_Succeed, PC_Unanchored, PC_Alt, PC_Arb_X, PC_Arbno_S, PC_Arbno_X, PC_Rpat, PC_Pred_Func, PC_Assign_Imm, PC_Assign_OnM, PC_Any_VP, PC_Break_VP, PC_BreakX_VP, PC_NotAny_VP, PC_NSpan_VP, PC_Span_VP, PC_String_VP, PC_Write_Imm, PC_Write_OnM, PC_Null, PC_String, PC_String_2, PC_String_3, PC_String_4, PC_String_5, PC_String_6, PC_Setcur, PC_Any_CH, PC_Break_CH, PC_BreakX_CH, PC_Char, PC_NotAny_CH, PC_NSpan_CH, PC_Span_CH, PC_Any_CS, PC_Break_CS, PC_BreakX_CS, PC_NotAny_CS, PC_NSpan_CS, PC_Span_CS, PC_Arbno_Y, PC_Len_Nat, PC_Pos_Nat, PC_RPos_Nat, PC_RTab_Nat, PC_Tab_Nat, PC_Pos_NF, PC_Len_NF, PC_RPos_NF, PC_RTab_NF, PC_Tab_NF, PC_Pos_NP, PC_Len_NP, PC_RPos_NP, PC_RTab_NP, PC_Tab_NP, PC_Any_VF, PC_Break_VF, PC_BreakX_VF, PC_NotAny_VF, PC_NSpan_VF, PC_Span_VF, PC_String_VF); type IndexT is range 0 .. +(2 **15 - 1); type PE (Pcode : Pattern_Code) is record Index : IndexT; -- Serial index number of pattern element within pattern Pthen : PE_Ptr; -- Successor element, to be matched after this one case Pcode is when PC_Arb_Y | PC_Assign | PC_Bal | PC_BreakX_X | PC_Cancel | PC_EOP | PC_Fail | PC_Fence | PC_Fence_X | PC_Fence_Y | PC_Null | PC_R_Enter | PC_R_Remove | PC_R_Restore | PC_Rest | PC_Succeed | PC_Unanchored => null; when PC_Alt | PC_Arb_X | PC_Arbno_S | PC_Arbno_X => Alt : PE_Ptr; when PC_Rpat => PP : Pattern_Ptr; when PC_Pred_Func => BF : Boolean_Func; when PC_Assign_Imm | PC_Assign_OnM | PC_Any_VP | PC_Break_VP | PC_BreakX_VP | PC_NotAny_VP | PC_NSpan_VP | PC_Span_VP | PC_String_VP => VP : VString_Ptr; when PC_Write_Imm | PC_Write_OnM => FP : File_Ptr; when PC_String => Str : String_Ptr; when PC_String_2 => Str2 : String (1 .. 2); when PC_String_3 => Str3 : String (1 .. 3); when PC_String_4 => Str4 : String (1 .. 4); when PC_String_5 => Str5 : String (1 .. 5); when PC_String_6 => Str6 : String (1 .. 6); when PC_Setcur => Var : Natural_Ptr; when PC_Any_CH | PC_Break_CH | PC_BreakX_CH | PC_Char | PC_NotAny_CH | PC_NSpan_CH | PC_Span_CH => Char : Character; when PC_Any_CS | PC_Break_CS | PC_BreakX_CS | PC_NotAny_CS | PC_NSpan_CS | PC_Span_CS => CS : Character_Set; when PC_Arbno_Y | PC_Len_Nat | PC_Pos_Nat | PC_RPos_Nat | PC_RTab_Nat | PC_Tab_Nat => Nat : Natural; when PC_Pos_NF | PC_Len_NF | PC_RPos_NF | PC_RTab_NF | PC_Tab_NF => NF : Natural_Func; when PC_Pos_NP | PC_Len_NP | PC_RPos_NP | PC_RTab_NP | PC_Tab_NP => NP : Natural_Ptr; when PC_Any_VF | PC_Break_VF | PC_BreakX_VF | PC_NotAny_VF | PC_NSpan_VF | PC_Span_VF | PC_String_VF => VF : VString_Func; end case; end record; subtype PC_Has_Alt is Pattern_Code range PC_Alt .. PC_Arbno_X; -- Range of pattern codes that has an Alt field. This is used in the -- recursive traversals, since these links must be followed. EOP_Element : aliased constant PE := (PC_EOP, 0, N); -- This is the end of pattern element, and is thus the representation of -- a null pattern. It has a zero index element since it is never placed -- inside a pattern. Furthermore it does not need a successor, since it -- marks the end of the pattern, so that no more successors are needed. EOP : constant PE_Ptr := EOP_Element'Unrestricted_Access; -- This is the end of pattern pointer, that is used in the Pthen pointer -- of other nodes to signal end of pattern. -- The following array is used to determine if a pattern used as an -- argument for Arbno is eligible for treatment using the simple Arbno -- structure (i.e. it is a pattern that is guaranteed to match at least -- one character on success, and not to make any entries on the stack. OK_For_Simple_Arbno : constant array (Pattern_Code) of Boolean := (PC_Any_CS | PC_Any_CH | PC_Any_VF | PC_Any_VP | PC_Char | PC_Len_Nat | PC_NotAny_CS | PC_NotAny_CH | PC_NotAny_VF | PC_NotAny_VP | PC_Span_CS | PC_Span_CH | PC_Span_VF | PC_Span_VP | PC_String | PC_String_2 | PC_String_3 | PC_String_4 | PC_String_5 | PC_String_6 => True, others => False); ------------------------------- -- The Pattern History Stack -- ------------------------------- -- The pattern history stack is used for controlling backtracking when -- a match fails. The idea is to stack entries that give a cursor value -- to be restored, and a node to be reestablished as the current node to -- attempt an appropriate rematch operation. The processing for a pattern -- element that has rematch alternatives pushes an appropriate entry or -- entry on to the stack, and the proceeds. If a match fails at any point, -- the top element of the stack is popped off, resetting the cursor and -- the match continues by accessing the node stored with this entry. type Stack_Entry is record Cursor : Integer; -- Saved cursor value that is restored when this entry is popped -- from the stack if a match attempt fails. Occasionally, this -- field is used to store a history stack pointer instead of a -- cursor. Such cases are noted in the documentation and the value -- stored is negative since stack pointer values are always negative. Node : PE_Ptr; -- This pattern element reference is reestablished as the current -- Node to be matched (which will attempt an appropriate rematch). end record; subtype Stack_Range is Integer range -Stack_Size .. -1; type Stack_Type is array (Stack_Range) of Stack_Entry; -- The type used for a history stack. The actual instance of the stack -- is declared as a local variable in the Match routine, to properly -- handle recursive calls to Match. All stack pointer values are negative -- to distinguish them from normal cursor values. -- Note: the pattern matching stack is used only to handle backtracking. -- If no backtracking occurs, its entries are never accessed, and never -- popped off, and in particular it is normal for a successful match -- to terminate with entries on the stack that are simply discarded. -- Note: in subsequent diagrams of the stack, we always place element -- zero (the deepest element) at the top of the page, then build the -- stack down on the page with the most recent (top of stack) element -- being the bottom-most entry on the page. -- Stack checking is handled by labeling every pattern with the maximum -- number of stack entries that are required, so a single check at the -- start of matching the pattern suffices. There are two exceptions. -- First, the count does not include entries for recursive pattern -- references. Such recursions must therefore perform a specific -- stack check with respect to the number of stack entries required -- by the recursive pattern that is accessed and the amount of stack -- that remains unused. -- Second, the count includes only one iteration of an Arbno pattern, -- so a specific check must be made on subsequent iterations that there -- is still enough stack space left. The Arbno node has a field that -- records the number of stack entries required by its argument for -- this purpose. --------------------------------------------------- -- Use of Serial Index Field in Pattern Elements -- --------------------------------------------------- -- The serial index numbers for the pattern elements are assigned as -- a pattern is constructed from its constituent elements. Note that there -- is never any sharing of pattern elements between patterns (copies are -- always made), so the serial index numbers are unique to a particular -- pattern as referenced from the P field of a value of type Pattern. -- The index numbers meet three separate invariants, which are used for -- various purposes as described in this section. -- First, the numbers uniquely identify the pattern elements within a -- pattern. If Num is the number of elements in a given pattern, then -- the serial index numbers for the elements of this pattern will range -- from 1 .. Num, so that each element has a separate value. -- The purpose of this assignment is to provide a convenient auxiliary -- data structure mechanism during operations which must traverse a -- pattern (e.g. copy and finalization processing). Once constructed -- patterns are strictly read only. This is necessary to allow sharing -- of patterns between tasks. This means that we cannot go marking the -- pattern (e.g. with a visited bit). Instead we construct a separate -- vector that contains the necessary information indexed by the Index -- values in the pattern elements. For this purpose the only requirement -- is that they be uniquely assigned. -- Second, the pattern element referenced directly, i.e. the leading -- pattern element, is always the maximum numbered element and therefore -- indicates the total number of elements in the pattern. More precisely, -- the element referenced by the P field of a pattern value, or the -- element returned by any of the internal pattern construction routines -- in the body (that return a value of type PE_Ptr) always is this -- maximum element, -- The purpose of this requirement is to allow an immediate determination -- of the number of pattern elements within a pattern. This is used to -- properly size the vectors used to contain auxiliary information for -- traversal as described above. -- Third, as compound pattern structures are constructed, the way in which -- constituent parts of the pattern are constructed is stylized. This is -- an automatic consequence of the way that these compound structures -- are constructed, and basically what we are doing is simply documenting -- and specifying the natural result of the pattern construction. The -- section describing compound pattern structures gives details of the -- numbering of each compound pattern structure. -- The purpose of specifying the stylized numbering structures for the -- compound patterns is to help simplify the processing in the Image -- function, since it eases the task of retrieving the original recursive -- structure of the pattern from the flat graph structure of elements. -- This use in the Image function is the only point at which the code -- makes use of the stylized structures. type Ref_Array is array (IndexT range <>) of PE_Ptr; -- This type is used to build an array whose N'th entry references the -- element in a pattern whose Index value is N. See Build_Ref_Array. procedure Build_Ref_Array (E : PE_Ptr; RA : out Ref_Array); -- Given a pattern element which is the leading element of a pattern -- structure, and a Ref_Array with bounds 1 .. E.Index, fills in the -- Ref_Array so that its N'th entry references the element of the -- referenced pattern whose Index value is N. ------------------------------- -- Recursive Pattern Matches -- ------------------------------- -- The pattern primitive (+P) where P is a Pattern_Ptr or Pattern_Func -- causes a recursive pattern match. This cannot be handled by an actual -- recursive call to the outer level Match routine, since this would not -- allow for possible backtracking into the region matched by the inner -- pattern. Indeed this is the classical clash between recursion and -- backtracking, and a simple recursive stack structure does not suffice. -- This section describes how this recursion and the possible associated -- backtracking is handled. We still use a single stack, but we establish -- the concept of nested regions on this stack, each of which has a stack -- base value pointing to the deepest stack entry of the region. The base -- value for the outer level is zero. -- When a recursive match is established, two special stack entries are -- made. The first entry is used to save the original node that starts -- the recursive match. This is saved so that the successor field of -- this node is accessible at the end of the match, but it is never -- popped and executed. -- The second entry corresponds to a standard new region action. A -- PC_R_Remove node is stacked, whose cursor field is used to store -- the outer stack base, and the stack base is reset to point to -- this PC_R_Remove node. Then the recursive pattern is matched and -- it can make history stack entries in the normal matter, so now -- the stack looks like: -- (stack entries made by outer level) -- (Special entry, node is (+P) successor -- cursor entry is not used) -- (PC_R_Remove entry, "cursor" value is (negative) <-- Stack base -- saved base value for the enclosing region) -- (stack entries made by inner level) -- If a subsequent failure occurs and pops the PC_R_Remove node, it -- removes itself and the special entry immediately underneath it, -- restores the stack base value for the enclosing region, and then -- again signals failure to look for alternatives that were stacked -- before the recursion was initiated. -- Now we need to consider what happens if the inner pattern succeeds, as -- signalled by accessing the special PC_EOP pattern primitive. First we -- recognize the nested case by looking at the Base value. If this Base -- value is Stack'First, then the entire match has succeeded, but if the -- base value is greater than Stack'First, then we have successfully -- matched an inner pattern, and processing continues at the outer level. -- There are two cases. The simple case is when the inner pattern has made -- no stack entries, as recognized by the fact that the current stack -- pointer is equal to the current base value. In this case it is fine to -- remove all trace of the recursion by restoring the outer base value and -- using the special entry to find the appropriate successor node. -- The more complex case arises when the inner match does make stack -- entries. In this case, the PC_EOP processing stacks a special entry -- whose cursor value saves the saved inner base value (the one that -- references the corresponding PC_R_Remove value), and whose node -- pointer references a PC_R_Restore node, so the stack looks like: -- (stack entries made by outer level) -- (Special entry, node is (+P) successor, -- cursor entry is not used) -- (PC_R_Remove entry, "cursor" value is (negative) -- saved base value for the enclosing region) -- (stack entries made by inner level) -- (PC_Region_Replace entry, "cursor" value is (negative) -- stack pointer value referencing the PC_R_Remove entry). -- If the entire match succeeds, then these stack entries are, as usual, -- ignored and abandoned. If on the other hand a subsequent failure -- causes the PC_Region_Replace entry to be popped, it restores the -- inner base value from its saved "cursor" value and then fails again. -- Note that it is OK that the cursor is temporarily clobbered by this -- pop, since the second failure will reestablish a proper cursor value. --------------------------------- -- Compound Pattern Structures -- --------------------------------- -- This section discusses the compound structures used to represent -- constructed patterns. It shows the graph structures of pattern -- elements that are constructed, and in the case of patterns that -- provide backtracking possibilities, describes how the history -- stack is used to control the backtracking. Finally, it notes the -- way in which the Index numbers are assigned to the structure. -- In all diagrams, solid lines (built with minus signs or vertical -- bars, represent successor pointers (Pthen fields) with > or V used -- to indicate the direction of the pointer. The initial node of the -- structure is in the upper left of the diagram. A dotted line is an -- alternative pointer from the element above it to the element below -- it. See individual sections for details on how alternatives are used. ------------------- -- Concatenation -- ------------------- -- In the pattern structures listed in this section, a line that looks -- like ----> with nothing to the right indicates an end of pattern -- (EOP) pointer that represents the end of the match. -- When a pattern concatenation (L & R) occurs, the resulting structure -- is obtained by finding all such EOP pointers in L, and replacing -- them to point to R. This is the most important flattening that -- occurs in constructing a pattern, and it means that the pattern -- matching circuitry does not have to keep track of the structure -- of a pattern with respect to concatenation, since the appropriate -- successor is always at hand. -- Concatenation itself generates no additional possibilities for -- backtracking, but the constituent patterns of the concatenated -- structure will make stack entries as usual. The maximum amount -- of stack required by the structure is thus simply the sum of the -- maximums required by L and R. -- The index numbering of a concatenation structure works by leaving -- the numbering of the right hand pattern, R, unchanged and adjusting -- the numbers in the left hand pattern, L up by the count of elements -- in R. This ensures that the maximum numbered element is the leading -- element as required (given that it was the leading element in L). ----------------- -- Alternation -- ----------------- -- A pattern (L or R) constructs the structure: -- +---+ +---+ -- | A |---->| L |----> -- +---+ +---+ -- . -- . -- +---+ -- | R |----> -- +---+ -- The A element here is a PC_Alt node, and the dotted line represents -- the contents of the Alt field. When the PC_Alt element is matched, -- it stacks a pointer to the leading element of R on the history stack -- so that on subsequent failure, a match of R is attempted. -- The A node is the highest numbered element in the pattern. The -- original index numbers of R are unchanged, but the index numbers -- of the L pattern are adjusted up by the count of elements in R. -- Note that the difference between the index of the L leading element -- the index of the R leading element (after building the alt structure) -- indicates the number of nodes in L, and this is true even after the -- structure is incorporated into some larger structure. For example, -- if the A node has index 16, and L has index 15 and R has index -- 5, then we know that L has 10 (15-5) elements in it. -- Suppose that we now concatenate this structure to another pattern -- with 9 elements in it. We will now have the A node with an index -- of 25, L with an index of 24 and R with an index of 14. We still -- know that L has 10 (24-14) elements in it, numbered 15-24, and -- consequently the successor of the alternation structure has an -- index with a value less than 15. This is used in Image to figure -- out the original recursive structure of a pattern. -- To clarify the interaction of the alternation and concatenation -- structures, here is a more complex example of the structure built -- for the pattern: -- (V or W or X) (Y or Z) -- where A,B,C,D,E are all single element patterns: -- +---+ +---+ +---+ +---+ -- I A I---->I V I---+-->I A I---->I Y I----> -- +---+ +---+ I +---+ +---+ -- . I . -- . I . -- +---+ +---+ I +---+ -- I A I---->I W I-->I I Z I----> -- +---+ +---+ I +---+ -- . I -- . I -- +---+ I -- I X I------------>+ -- +---+ -- The numbering of the nodes would be as follows: -- +---+ +---+ +---+ +---+ -- I 8 I---->I 7 I---+-->I 3 I---->I 2 I----> -- +---+ +---+ I +---+ +---+ -- . I . -- . I . -- +---+ +---+ I +---+ -- I 6 I---->I 5 I-->I I 1 I----> -- +---+ +---+ I +---+ -- . I -- . I -- +---+ I -- I 4 I------------>+ -- +---+ -- Note: The above structure actually corresponds to -- (A or (B or C)) (D or E) -- rather than -- ((A or B) or C) (D or E) -- which is the more natural interpretation, but in fact alternation -- is associative, and the construction of an alternative changes the -- left grouped pattern to the right grouped pattern in any case, so -- that the Image function produces a more natural looking output. --------- -- Arb -- --------- -- An Arb pattern builds the structure -- +---+ -- | X |----> -- +---+ -- . -- . -- +---+ -- | Y |----> -- +---+ -- The X node is a PC_Arb_X node, which matches null, and stacks a -- pointer to Y node, which is the PC_Arb_Y node that matches one -- extra character and restacks itself. -- The PC_Arb_X node is numbered 2, and the PC_Arb_Y node is 1 ------------------------- -- Arbno (simple case) -- ------------------------- -- The simple form of Arbno can be used where the pattern always -- matches at least one character if it succeeds, and it is known -- not to make any history stack entries. In this case, Arbno (P) -- can construct the following structure: -- +-------------+ -- | ^ -- V | -- +---+ | -- | S |----> | -- +---+ | -- . | -- . | -- +---+ | -- | P |---------->+ -- +---+ -- The S (PC_Arbno_S) node matches null stacking a pointer to the -- pattern P. If a subsequent failure causes P to be matched and -- this match succeeds, then node A gets restacked to try another -- instance if needed by a subsequent failure. -- The node numbering of the constituent pattern P is not affected. -- The S node has a node number of P.Index + 1. -------------------------- -- Arbno (complex case) -- -------------------------- -- A call to Arbno (P), where P can match null (or at least is not -- known to require a non-null string) and/or P requires pattern stack -- entries, constructs the following structure: -- +--------------------------+ -- | ^ -- V | -- +---+ | -- | X |----> | -- +---+ | -- . | -- . | -- +---+ +---+ +---+ | -- | E |---->| P |---->| Y |--->+ -- +---+ +---+ +---+ -- The node X (PC_Arbno_X) matches null, stacking a pointer to the -- E-P-X structure used to match one Arbno instance. -- Here E is the PC_R_Enter node which matches null and creates two -- stack entries. The first is a special entry whose node field is -- not used at all, and whose cursor field has the initial cursor. -- The second entry corresponds to a standard new region action. A -- PC_R_Remove node is stacked, whose cursor field is used to store -- the outer stack base, and the stack base is reset to point to -- this PC_R_Remove node. Then the pattern P is matched, and it can -- make history stack entries in the normal manner, so now the stack -- looks like: -- (stack entries made before assign pattern) -- (Special entry, node field not used, -- used only to save initial cursor) -- (PC_R_Remove entry, "cursor" value is (negative) <-- Stack Base -- saved base value for the enclosing region) -- (stack entries made by matching P) -- If the match of P fails, then the PC_R_Remove entry is popped and -- it removes both itself and the special entry underneath it, -- restores the outer stack base, and signals failure. -- If the match of P succeeds, then node Y, the PC_Arbno_Y node, pops -- the inner region. There are two possibilities. If matching P left -- no stack entries, then all traces of the inner region can be removed. -- If there are stack entries, then we push an PC_Region_Replace stack -- entry whose "cursor" value is the inner stack base value, and then -- restore the outer stack base value, so the stack looks like: -- (stack entries made before assign pattern) -- (Special entry, node field not used, -- used only to save initial cursor) -- (PC_R_Remove entry, "cursor" value is (negative) -- saved base value for the enclosing region) -- (stack entries made by matching P) -- (PC_Region_Replace entry, "cursor" value is (negative) -- stack pointer value referencing the PC_R_Remove entry). -- Now that we have matched another instance of the Arbno pattern, -- we need to move to the successor. There are two cases. If the -- Arbno pattern matched null, then there is no point in seeking -- alternatives, since we would just match a whole bunch of nulls. -- In this case we look through the alternative node, and move -- directly to its successor (i.e. the successor of the Arbno -- pattern). If on the other hand a non-null string was matched, -- we simply follow the successor to the alternative node, which -- sets up for another possible match of the Arbno pattern. -- As noted in the section on stack checking, the stack count (and -- hence the stack check) for a pattern includes only one iteration -- of the Arbno pattern. To make sure that multiple iterations do not -- overflow the stack, the Arbno node saves the stack count required -- by a single iteration, and the Concat function increments this to -- include stack entries required by any successor. The PC_Arbno_Y -- node uses this count to ensure that sufficient stack remains -- before proceeding after matching each new instance. -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the Y node is numbered N + 1, -- the E node is N + 2, and the X node is N + 3. ---------------------- -- Assign Immediate -- ---------------------- -- Immediate assignment (P * V) constructs the following structure -- +---+ +---+ +---+ -- | E |---->| P |---->| A |----> -- +---+ +---+ +---+ -- Here E is the PC_R_Enter node which matches null and creates two -- stack entries. The first is a special entry whose node field is -- not used at all, and whose cursor field has the initial cursor. -- The second entry corresponds to a standard new region action. A -- PC_R_Remove node is stacked, whose cursor field is used to store -- the outer stack base, and the stack base is reset to point to -- this PC_R_Remove node. Then the pattern P is matched, and it can -- make history stack entries in the normal manner, so now the stack -- looks like: -- (stack entries made before assign pattern) -- (Special entry, node field not used, -- used only to save initial cursor) -- (PC_R_Remove entry, "cursor" value is (negative) <-- Stack Base -- saved base value for the enclosing region) -- (stack entries made by matching P) -- If the match of P fails, then the PC_R_Remove entry is popped -- and it removes both itself and the special entry underneath it, -- restores the outer stack base, and signals failure. -- If the match of P succeeds, then node A, which is the actual -- PC_Assign_Imm node, executes the assignment (using the stack -- base to locate the entry with the saved starting cursor value), -- and the pops the inner region. There are two possibilities, if -- matching P left no stack entries, then all traces of the inner -- region can be removed. If there are stack entries, then we push -- an PC_Region_Replace stack entry whose "cursor" value is the -- inner stack base value, and then restore the outer stack base -- value, so the stack looks like: -- (stack entries made before assign pattern) -- (Special entry, node field not used, -- used only to save initial cursor) -- (PC_R_Remove entry, "cursor" value is (negative) -- saved base value for the enclosing region) -- (stack entries made by matching P) -- (PC_Region_Replace entry, "cursor" value is the (negative) -- stack pointer value referencing the PC_R_Remove entry). -- If a subsequent failure occurs, the PC_Region_Replace node restores -- the inner stack base value and signals failure to explore rematches -- of the pattern P. -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the A node is numbered N + 1, -- and the E node is N + 2. --------------------- -- Assign On Match -- --------------------- -- The assign on match (**) pattern is quite similar to the assign -- immediate pattern, except that the actual assignment has to be -- delayed. The following structure is constructed: -- +---+ +---+ +---+ -- | E |---->| P |---->| A |----> -- +---+ +---+ +---+ -- The operation of this pattern is identical to that described above -- for deferred assignment, up to the point where P has been matched. -- The A node, which is the PC_Assign_OnM node first pushes a -- PC_Assign node onto the history stack. This node saves the ending -- cursor and acts as a flag for the final assignment, as further -- described below. -- It then stores a pointer to itself in the special entry node field. -- This was otherwise unused, and is now used to retrieve the address -- of the variable to be assigned at the end of the pattern. -- After that the inner region is terminated in the usual manner, -- by stacking a PC_R_Restore entry as described for the assign -- immediate case. Note that the optimization of completely -- removing the inner region does not happen in this case, since -- we have at least one stack entry (the PC_Assign one we just made). -- The stack now looks like: -- (stack entries made before assign pattern) -- (Special entry, node points to copy of -- the PC_Assign_OnM node, and the -- cursor field saves the initial cursor). -- (PC_R_Remove entry, "cursor" value is (negative) -- saved base value for the enclosing region) -- (stack entries made by matching P) -- (PC_Assign entry, saves final cursor) -- (PC_Region_Replace entry, "cursor" value is (negative) -- stack pointer value referencing the PC_R_Remove entry). -- If a subsequent failure causes the PC_Assign node to execute it -- simply removes itself and propagates the failure. -- If the match succeeds, then the history stack is scanned for -- PC_Assign nodes, and the assignments are executed (examination -- of the above diagram will show that all the necessary data is -- at hand for the assignment). -- To optimize the common case where no assign-on-match operations -- are present, a global flag Assign_OnM is maintained which is -- initialize to False, and gets set True as part of the execution -- of the PC_Assign_OnM node. The scan of the history stack for -- PC_Assign entries is done only if this flag is set. -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the A node is numbered N + 1, -- and the E node is N + 2. --------- -- Bal -- --------- -- Bal builds a single node: -- +---+ -- | B |----> -- +---+ -- The node B is the PC_Bal node which matches a parentheses balanced -- string, starting at the current cursor position. It then updates -- the cursor past this matched string, and stacks a pointer to itself -- with this updated cursor value on the history stack, to extend the -- matched string on a subsequent failure. -- Since this is a single node it is numbered 1 (the reason we include -- it in the compound patterns section is that it backtracks). ------------ -- BreakX -- ------------ -- BreakX builds the structure -- +---+ +---+ -- | B |---->| A |----> -- +---+ +---+ -- ^ . -- | . -- | +---+ -- +<------| X | -- +---+ -- Here the B node is the BreakX_xx node that performs a normal Break -- function. The A node is an alternative (PC_Alt) node that matches -- null, but stacks a pointer to node X (the PC_BreakX_X node) which -- extends the match one character (to eat up the previously detected -- break character), and then rematches the break. -- The B node is numbered 3, the alternative node is 1, and the X -- node is 2. ----------- -- Fence -- ----------- -- Fence builds a single node: -- +---+ -- | F |----> -- +---+ -- The element F, PC_Fence, matches null, and stacks a pointer to a -- PC_Cancel element which will abort the match on a subsequent failure. -- Since this is a single element it is numbered 1 (the reason we -- include it in the compound patterns section is that it backtracks). -------------------- -- Fence Function -- -------------------- -- A call to the Fence function builds the structure: -- +---+ +---+ +---+ -- | E |---->| P |---->| X |----> -- +---+ +---+ +---+ -- Here E is the PC_R_Enter node which matches null and creates two -- stack entries. The first is a special entry which is not used at -- all in the fence case (it is present merely for uniformity with -- other cases of region enter operations). -- The second entry corresponds to a standard new region action. A -- PC_R_Remove node is stacked, whose cursor field is used to store -- the outer stack base, and the stack base is reset to point to -- this PC_R_Remove node. Then the pattern P is matched, and it can -- make history stack entries in the normal manner, so now the stack -- looks like: -- (stack entries made before fence pattern) -- (Special entry, not used at all) -- (PC_R_Remove entry, "cursor" value is (negative) <-- Stack Base -- saved base value for the enclosing region) -- (stack entries made by matching P) -- If the match of P fails, then the PC_R_Remove entry is popped -- and it removes both itself and the special entry underneath it, -- restores the outer stack base, and signals failure. -- If the match of P succeeds, then node X, the PC_Fence_X node, gets -- control. One might be tempted to think that at this point, the -- history stack entries made by matching P can just be removed since -- they certainly are not going to be used for rematching (that is -- whole point of Fence after all). However, this is wrong, because -- it would result in the loss of possible assign-on-match entries -- for deferred pattern assignments. -- Instead what we do is to make a special entry whose node references -- PC_Fence_Y, and whose cursor saves the inner stack base value, i.e. -- the pointer to the PC_R_Remove entry. Then the outer stack base -- pointer is restored, so the stack looks like: -- (stack entries made before assign pattern) -- (Special entry, not used at all) -- (PC_R_Remove entry, "cursor" value is (negative) -- saved base value for the enclosing region) -- (stack entries made by matching P) -- (PC_Fence_Y entry, "cursor" value is (negative) stack -- pointer value referencing the PC_R_Remove entry). -- If a subsequent failure occurs, then the PC_Fence_Y entry removes -- the entire inner region, including all entries made by matching P, -- and alternatives prior to the Fence pattern are sought. -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the X node is numbered N + 1, -- and the E node is N + 2. ------------- -- Succeed -- ------------- -- Succeed builds a single node: -- +---+ -- | S |----> -- +---+ -- The node S is the PC_Succeed node which matches null, and stacks -- a pointer to itself on the history stack, so that a subsequent -- failure repeats the same match. -- Since this is a single node it is numbered 1 (the reason we include -- it in the compound patterns section is that it backtracks). --------------------- -- Write Immediate -- --------------------- -- The structure built for a write immediate operation (P * F, where -- F is a file access value) is: -- +---+ +---+ +---+ -- | E |---->| P |---->| W |----> -- +---+ +---+ +---+ -- Here E is the PC_R_Enter node and W is the PC_Write_Imm node. The -- handling is identical to that described above for Assign Immediate, -- except that at the point where a successful match occurs, the matched -- substring is written to the referenced file. -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the W node is numbered N + 1, -- and the E node is N + 2. -------------------- -- Write On Match -- -------------------- -- The structure built for a write on match operation (P ** F, where -- F is a file access value) is: -- +---+ +---+ +---+ -- | E |---->| P |---->| W |----> -- +---+ +---+ +---+ -- Here E is the PC_R_Enter node and W is the PC_Write_OnM node. The -- handling is identical to that described above for Assign On Match, -- except that at the point where a successful match has completed, -- the matched substring is written to the referenced file. -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the W node is numbered N + 1, -- and the E node is N + 2. ----------------------- -- Constant Patterns -- ----------------------- -- The following pattern elements are referenced only from the pattern -- history stack. In each case the processing for the pattern element -- results in pattern match abort, or further failure, so there is no -- need for a successor and no need for a node number CP_Assign : aliased PE := (PC_Assign, 0, N); CP_Cancel : aliased PE := (PC_Cancel, 0, N); CP_Fence_Y : aliased PE := (PC_Fence_Y, 0, N); CP_R_Remove : aliased PE := (PC_R_Remove, 0, N); CP_R_Restore : aliased PE := (PC_R_Restore, 0, N); ----------------------- -- Local Subprograms -- ----------------------- function Alternate (L, R : PE_Ptr) return PE_Ptr; function "or" (L, R : PE_Ptr) return PE_Ptr renames Alternate; -- Build pattern structure corresponding to the alternation of L, R. -- (i.e. try to match L, and if that fails, try to match R). function Arbno_Simple (P : PE_Ptr) return PE_Ptr; -- Build simple Arbno pattern, P is a pattern that is guaranteed to -- match at least one character if it succeeds and to require no -- stack entries under all circumstances. The result returned is -- a simple Arbno structure as previously described. function Bracket (E, P, A : PE_Ptr) return PE_Ptr; -- Given two single node pattern elements E and A, and a (possible -- complex) pattern P, construct the concatenation E-->P-->A and -- return a pointer to E. The concatenation does not affect the -- node numbering in P. A has a number one higher than the maximum -- number in P, and E has a number two higher than the maximum -- number in P (see for example the Assign_Immediate structure to -- understand a typical use of this function). function BreakX_Make (B : PE_Ptr) return Pattern; -- Given a pattern element for a Break pattern, returns the -- corresponding BreakX compound pattern structure. function Concat (L, R : PE_Ptr; Incr : Natural) return PE_Ptr; -- Creates a pattern element that represents a concatenation of the -- two given pattern elements (i.e. the pattern L followed by R). -- The result returned is always the same as L, but the pattern -- referenced by L is modified to have R as a successor. This -- procedure does not copy L or R, so if a copy is required, it -- is the responsibility of the caller. The Incr parameter is an -- amount to be added to the Nat field of any P_Arbno_Y node that is -- in the left operand, it represents the additional stack space -- required by the right operand. function C_To_PE (C : PChar) return PE_Ptr; -- Given a character, constructs a pattern element that matches -- the single character. function Copy (P : PE_Ptr) return PE_Ptr; -- Creates a copy of the pattern element referenced by the given -- pattern element reference. This is a deep copy, which means that -- it follows the Next and Alt pointers. function Image (P : PE_Ptr) return String; -- Returns the image of the address of the referenced pattern element. -- This is equivalent to Image (To_Address (P)); function Is_In (C : Character; Str : String) return Boolean; pragma Inline (Is_In); -- Determines if the character C is in string Str procedure Logic_Error; -- Called to raise Program_Error with an appropriate message if an -- internal logic error is detected. function Str_BF (A : Boolean_Func) return String; function Str_FP (A : File_Ptr) return String; function Str_NF (A : Natural_Func) return String; function Str_NP (A : Natural_Ptr) return String; function Str_PP (A : Pattern_Ptr) return String; function Str_VF (A : VString_Func) return String; function Str_VP (A : VString_Ptr) return String; -- These are debugging routines, which return a representation of the -- given access value (they are called only by Image and Dump) procedure Set_Successor (Pat : PE_Ptr; Succ : PE_Ptr); -- Adjusts all EOP pointers in Pat to point to Succ. No other changes -- are made. In particular, Succ is unchanged, and no index numbers -- are modified. Note that Pat may not be equal to EOP on entry. function S_To_PE (Str : PString) return PE_Ptr; -- Given a string, constructs a pattern element that matches the string procedure Uninitialized_Pattern; pragma No_Return (Uninitialized_Pattern); -- Called to raise Program_Error with an appropriate error message if -- an uninitialized pattern is used in any pattern construction or -- pattern matching operation. procedure XMatch (Subject : String; Pat_P : PE_Ptr; Pat_S : Natural; Start : out Natural; Stop : out Natural); -- This is the common pattern match routine. It is passed a string and -- a pattern, and it indicates success or failure, and on success the -- section of the string matched. It does not perform any assignments -- to the subject string, so pattern replacement is for the caller. -- -- Subject The subject string. The lower bound is always one. In the -- Match procedures, it is fine to use strings whose lower bound -- is not one, but we perform a one time conversion before the -- call to XMatch, so that XMatch does not have to be bothered -- with strange lower bounds. -- -- Pat_P Points to initial pattern element of pattern to be matched -- -- Pat_S Maximum required stack entries for pattern to be matched -- -- Start If match is successful, starting index of matched section. -- This value is always non-zero. A value of zero is used to -- indicate a failed match. -- -- Stop If match is successful, ending index of matched section. -- This can be zero if we match the null string at the start, -- in which case Start is set to zero, and Stop to one. If the -- Match fails, then the contents of Stop is undefined. procedure XMatchD (Subject : String; Pat_P : PE_Ptr; Pat_S : Natural; Start : out Natural; Stop : out Natural); -- Identical in all respects to XMatch, except that trace information is -- output on Standard_Output during execution of the match. This is the -- version that is called if the original Match call has Debug => True. --------- -- "&" -- --------- function "&" (L : PString; R : Pattern) return Pattern is begin return (AFC with R.Stk, Concat (S_To_PE (L), Copy (R.P), R.Stk)); end "&"; function "&" (L : Pattern; R : PString) return Pattern is begin return (AFC with L.Stk, Concat (Copy (L.P), S_To_PE (R), 0)); end "&"; function "&" (L : PChar; R : Pattern) return Pattern is begin return (AFC with R.Stk, Concat (C_To_PE (L), Copy (R.P), R.Stk)); end "&"; function "&" (L : Pattern; R : PChar) return Pattern is begin return (AFC with L.Stk, Concat (Copy (L.P), C_To_PE (R), 0)); end "&"; function "&" (L : Pattern; R : Pattern) return Pattern is begin return (AFC with L.Stk + R.Stk, Concat (Copy (L.P), Copy (R.P), R.Stk)); end "&"; --------- -- "*" -- --------- -- Assign immediate -- +---+ +---+ +---+ -- | E |---->| P |---->| A |----> -- +---+ +---+ +---+ -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the A node is numbered N + 1, -- and the E node is N + 2. function "*" (P : Pattern; Var : VString_Var) return Pattern is Pat : constant PE_Ptr := Copy (P.P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); A : constant PE_Ptr := new PE'(PC_Assign_Imm, 0, EOP, Var'Unrestricted_Access); begin return (AFC with P.Stk + 3, Bracket (E, Pat, A)); end "*"; function "*" (P : PString; Var : VString_Var) return Pattern is Pat : constant PE_Ptr := S_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); A : constant PE_Ptr := new PE'(PC_Assign_Imm, 0, EOP, Var'Unrestricted_Access); begin return (AFC with 3, Bracket (E, Pat, A)); end "*"; function "*" (P : PChar; Var : VString_Var) return Pattern is Pat : constant PE_Ptr := C_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); A : constant PE_Ptr := new PE'(PC_Assign_Imm, 0, EOP, Var'Unrestricted_Access); begin return (AFC with 3, Bracket (E, Pat, A)); end "*"; -- Write immediate -- +---+ +---+ +---+ -- | E |---->| P |---->| W |----> -- +---+ +---+ +---+ -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the W node is numbered N + 1, -- and the E node is N + 2. function "*" (P : Pattern; Fil : File_Access) return Pattern is Pat : constant PE_Ptr := Copy (P.P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); W : constant PE_Ptr := new PE'(PC_Write_Imm, 0, EOP, Fil); begin return (AFC with 3, Bracket (E, Pat, W)); end "*"; function "*" (P : PString; Fil : File_Access) return Pattern is Pat : constant PE_Ptr := S_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); W : constant PE_Ptr := new PE'(PC_Write_Imm, 0, EOP, Fil); begin return (AFC with 3, Bracket (E, Pat, W)); end "*"; function "*" (P : PChar; Fil : File_Access) return Pattern is Pat : constant PE_Ptr := C_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); W : constant PE_Ptr := new PE'(PC_Write_Imm, 0, EOP, Fil); begin return (AFC with 3, Bracket (E, Pat, W)); end "*"; ---------- -- "**" -- ---------- -- Assign on match -- +---+ +---+ +---+ -- | E |---->| P |---->| A |----> -- +---+ +---+ +---+ -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the A node is numbered N + 1, -- and the E node is N + 2. function "**" (P : Pattern; Var : VString_Var) return Pattern is Pat : constant PE_Ptr := Copy (P.P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); A : constant PE_Ptr := new PE'(PC_Assign_OnM, 0, EOP, Var'Unrestricted_Access); begin return (AFC with P.Stk + 3, Bracket (E, Pat, A)); end "**"; function "**" (P : PString; Var : VString_Var) return Pattern is Pat : constant PE_Ptr := S_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); A : constant PE_Ptr := new PE'(PC_Assign_OnM, 0, EOP, Var'Unrestricted_Access); begin return (AFC with 3, Bracket (E, Pat, A)); end "**"; function "**" (P : PChar; Var : VString_Var) return Pattern is Pat : constant PE_Ptr := C_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); A : constant PE_Ptr := new PE'(PC_Assign_OnM, 0, EOP, Var'Unrestricted_Access); begin return (AFC with 3, Bracket (E, Pat, A)); end "**"; -- Write on match -- +---+ +---+ +---+ -- | E |---->| P |---->| W |----> -- +---+ +---+ +---+ -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the W node is numbered N + 1, -- and the E node is N + 2. function "**" (P : Pattern; Fil : File_Access) return Pattern is Pat : constant PE_Ptr := Copy (P.P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); W : constant PE_Ptr := new PE'(PC_Write_OnM, 0, EOP, Fil); begin return (AFC with P.Stk + 3, Bracket (E, Pat, W)); end "**"; function "**" (P : PString; Fil : File_Access) return Pattern is Pat : constant PE_Ptr := S_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); W : constant PE_Ptr := new PE'(PC_Write_OnM, 0, EOP, Fil); begin return (AFC with 3, Bracket (E, Pat, W)); end "**"; function "**" (P : PChar; Fil : File_Access) return Pattern is Pat : constant PE_Ptr := C_To_PE (P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); W : constant PE_Ptr := new PE'(PC_Write_OnM, 0, EOP, Fil); begin return (AFC with 3, Bracket (E, Pat, W)); end "**"; --------- -- "+" -- --------- function "+" (Str : VString_Var) return Pattern is begin return (AFC with 0, new PE'(PC_String_VP, 1, EOP, Str'Unrestricted_Access)); end "+"; function "+" (Str : VString_Func) return Pattern is begin return (AFC with 0, new PE'(PC_String_VF, 1, EOP, Str)); end "+"; function "+" (P : Pattern_Var) return Pattern is begin return (AFC with 3, new PE'(PC_Rpat, 1, EOP, P'Unrestricted_Access)); end "+"; function "+" (P : Boolean_Func) return Pattern is begin return (AFC with 3, new PE'(PC_Pred_Func, 1, EOP, P)); end "+"; ---------- -- "or" -- ---------- function "or" (L : PString; R : Pattern) return Pattern is begin return (AFC with R.Stk + 1, S_To_PE (L) or Copy (R.P)); end "or"; function "or" (L : Pattern; R : PString) return Pattern is begin return (AFC with L.Stk + 1, Copy (L.P) or S_To_PE (R)); end "or"; function "or" (L : PString; R : PString) return Pattern is begin return (AFC with 1, S_To_PE (L) or S_To_PE (R)); end "or"; function "or" (L : Pattern; R : Pattern) return Pattern is begin return (AFC with Natural'Max (L.Stk, R.Stk) + 1, Copy (L.P) or Copy (R.P)); end "or"; function "or" (L : PChar; R : Pattern) return Pattern is begin return (AFC with 1, C_To_PE (L) or Copy (R.P)); end "or"; function "or" (L : Pattern; R : PChar) return Pattern is begin return (AFC with 1, Copy (L.P) or C_To_PE (R)); end "or"; function "or" (L : PChar; R : PChar) return Pattern is begin return (AFC with 1, C_To_PE (L) or C_To_PE (R)); end "or"; function "or" (L : PString; R : PChar) return Pattern is begin return (AFC with 1, S_To_PE (L) or C_To_PE (R)); end "or"; function "or" (L : PChar; R : PString) return Pattern is begin return (AFC with 1, C_To_PE (L) or S_To_PE (R)); end "or"; ------------ -- Adjust -- ------------ -- No two patterns share the same pattern elements, so the adjust -- procedure for a Pattern assignment must do a deep copy of the -- pattern element structure. procedure Adjust (Object : in out Pattern) is begin Object.P := Copy (Object.P); end Adjust; --------------- -- Alternate -- --------------- function Alternate (L, R : PE_Ptr) return PE_Ptr is begin -- If the left pattern is null, then we just add the alternation -- node with an index one greater than the right hand pattern. if L = EOP then return new PE'(PC_Alt, R.Index + 1, EOP, R); -- If the left pattern is non-null, then build a reference vector -- for its elements, and adjust their index values to accommodate -- the right hand elements. Then add the alternation node. else declare Refs : Ref_Array (1 .. L.Index); begin Build_Ref_Array (L, Refs); for J in Refs'Range loop Refs (J).Index := Refs (J).Index + R.Index; end loop; end; return new PE'(PC_Alt, L.Index + 1, L, R); end if; end Alternate; --------- -- Any -- --------- function Any (Str : String) return Pattern is begin return (AFC with 0, new PE'(PC_Any_CS, 1, EOP, To_Set (Str))); end Any; function Any (Str : VString) return Pattern is begin return Any (S (Str)); end Any; function Any (Str : Character) return Pattern is begin return (AFC with 0, new PE'(PC_Any_CH, 1, EOP, Str)); end Any; function Any (Str : Character_Set) return Pattern is begin return (AFC with 0, new PE'(PC_Any_CS, 1, EOP, Str)); end Any; function Any (Str : not null access VString) return Pattern is begin return (AFC with 0, new PE'(PC_Any_VP, 1, EOP, VString_Ptr (Str))); end Any; function Any (Str : VString_Func) return Pattern is begin return (AFC with 0, new PE'(PC_Any_VF, 1, EOP, Str)); end Any; --------- -- Arb -- --------- -- +---+ -- | X |----> -- +---+ -- . -- . -- +---+ -- | Y |----> -- +---+ -- The PC_Arb_X element is numbered 2, and the PC_Arb_Y element is 1 function Arb return Pattern is Y : constant PE_Ptr := new PE'(PC_Arb_Y, 1, EOP); X : constant PE_Ptr := new PE'(PC_Arb_X, 2, EOP, Y); begin return (AFC with 1, X); end Arb; ----------- -- Arbno -- ----------- function Arbno (P : PString) return Pattern is begin if P'Length = 0 then return (AFC with 0, EOP); else return (AFC with 0, Arbno_Simple (S_To_PE (P))); end if; end Arbno; function Arbno (P : PChar) return Pattern is begin return (AFC with 0, Arbno_Simple (C_To_PE (P))); end Arbno; function Arbno (P : Pattern) return Pattern is Pat : constant PE_Ptr := Copy (P.P); begin if P.Stk = 0 and then OK_For_Simple_Arbno (Pat.Pcode) then return (AFC with 0, Arbno_Simple (Pat)); end if; -- This is the complex case, either the pattern makes stack entries -- or it is possible for the pattern to match the null string (more -- accurately, we don't know that this is not the case). -- +--------------------------+ -- | ^ -- V | -- +---+ | -- | X |----> | -- +---+ | -- . | -- . | -- +---+ +---+ +---+ | -- | E |---->| P |---->| Y |--->+ -- +---+ +---+ +---+ -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the Y node is numbered N + 1, -- the E node is N + 2, and the X node is N + 3. declare E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); X : constant PE_Ptr := new PE'(PC_Arbno_X, 0, EOP, E); Y : constant PE_Ptr := new PE'(PC_Arbno_Y, 0, X, P.Stk + 3); EPY : constant PE_Ptr := Bracket (E, Pat, Y); begin X.Alt := EPY; X.Index := EPY.Index + 1; return (AFC with P.Stk + 3, X); end; end Arbno; ------------------ -- Arbno_Simple -- ------------------ -- +-------------+ -- | ^ -- V | -- +---+ | -- | S |----> | -- +---+ | -- . | -- . | -- +---+ | -- | P |---------->+ -- +---+ -- The node numbering of the constituent pattern P is not affected. -- The S node has a node number of P.Index + 1. -- Note that we know that P cannot be EOP, because a null pattern -- does not meet the requirements for simple Arbno. function Arbno_Simple (P : PE_Ptr) return PE_Ptr is S : constant PE_Ptr := new PE'(PC_Arbno_S, P.Index + 1, EOP, P); begin Set_Successor (P, S); return S; end Arbno_Simple; --------- -- Bal -- --------- function Bal return Pattern is begin return (AFC with 1, new PE'(PC_Bal, 1, EOP)); end Bal; ------------- -- Bracket -- ------------- function Bracket (E, P, A : PE_Ptr) return PE_Ptr is begin if P = EOP then E.Pthen := A; E.Index := 2; A.Index := 1; else E.Pthen := P; Set_Successor (P, A); E.Index := P.Index + 2; A.Index := P.Index + 1; end if; return E; end Bracket; ----------- -- Break -- ----------- function Break (Str : String) return Pattern is begin return (AFC with 0, new PE'(PC_Break_CS, 1, EOP, To_Set (Str))); end Break; function Break (Str : VString) return Pattern is begin return Break (S (Str)); end Break; function Break (Str : Character) return Pattern is begin return (AFC with 0, new PE'(PC_Break_CH, 1, EOP, Str)); end Break; function Break (Str : Character_Set) return Pattern is begin return (AFC with 0, new PE'(PC_Break_CS, 1, EOP, Str)); end Break; function Break (Str : not null access VString) return Pattern is begin return (AFC with 0, new PE'(PC_Break_VP, 1, EOP, Str.all'Unchecked_Access)); end Break; function Break (Str : VString_Func) return Pattern is begin return (AFC with 0, new PE'(PC_Break_VF, 1, EOP, Str)); end Break; ------------ -- BreakX -- ------------ function BreakX (Str : String) return Pattern is begin return BreakX_Make (new PE'(PC_BreakX_CS, 3, N, To_Set (Str))); end BreakX; function BreakX (Str : VString) return Pattern is begin return BreakX (S (Str)); end BreakX; function BreakX (Str : Character) return Pattern is begin return BreakX_Make (new PE'(PC_BreakX_CH, 3, N, Str)); end BreakX; function BreakX (Str : Character_Set) return Pattern is begin return BreakX_Make (new PE'(PC_BreakX_CS, 3, N, Str)); end BreakX; function BreakX (Str : not null access VString) return Pattern is begin return BreakX_Make (new PE'(PC_BreakX_VP, 3, N, VString_Ptr (Str))); end BreakX; function BreakX (Str : VString_Func) return Pattern is begin return BreakX_Make (new PE'(PC_BreakX_VF, 3, N, Str)); end BreakX; ----------------- -- BreakX_Make -- ----------------- -- +---+ +---+ -- | B |---->| A |----> -- +---+ +---+ -- ^ . -- | . -- | +---+ -- +<------| X | -- +---+ -- The B node is numbered 3, the alternative node is 1, and the X -- node is 2. function BreakX_Make (B : PE_Ptr) return Pattern is X : constant PE_Ptr := new PE'(PC_BreakX_X, 2, B); A : constant PE_Ptr := new PE'(PC_Alt, 1, EOP, X); begin B.Pthen := A; return (AFC with 2, B); end BreakX_Make; --------------------- -- Build_Ref_Array -- --------------------- procedure Build_Ref_Array (E : PE_Ptr; RA : out Ref_Array) is procedure Record_PE (E : PE_Ptr); -- Record given pattern element if not already recorded in RA, -- and also record any referenced pattern elements recursively. --------------- -- Record_PE -- --------------- procedure Record_PE (E : PE_Ptr) is begin PutD (" Record_PE called with PE_Ptr = " & Image (E)); if E = EOP or else RA (E.Index) /= null then Put_LineD (", nothing to do"); return; else Put_LineD (", recording" & IndexT'Image (E.Index)); RA (E.Index) := E; Record_PE (E.Pthen); if E.Pcode in PC_Has_Alt then Record_PE (E.Alt); end if; end if; end Record_PE; -- Start of processing for Build_Ref_Array begin New_LineD; Put_LineD ("Entering Build_Ref_Array"); Record_PE (E); New_LineD; end Build_Ref_Array; ------------- -- C_To_PE -- ------------- function C_To_PE (C : PChar) return PE_Ptr is begin return new PE'(PC_Char, 1, EOP, C); end C_To_PE; ------------ -- Cancel -- ------------ function Cancel return Pattern is begin return (AFC with 0, new PE'(PC_Cancel, 1, EOP)); end Cancel; ------------ -- Concat -- ------------ -- Concat needs to traverse the left operand performing the following -- set of fixups: -- a) Any successor pointers (Pthen fields) that are set to EOP are -- reset to point to the second operand. -- b) Any PC_Arbno_Y node has its stack count field incremented -- by the parameter Incr provided for this purpose. -- d) Num fields of all pattern elements in the left operand are -- adjusted to include the elements of the right operand. -- Note: we do not use Set_Successor in the processing for Concat, since -- there is no point in doing two traversals, we may as well do everything -- at the same time. function Concat (L, R : PE_Ptr; Incr : Natural) return PE_Ptr is begin if L = EOP then return R; elsif R = EOP then return L; else declare Refs : Ref_Array (1 .. L.Index); -- We build a reference array for L whose N'th element points to -- the pattern element of L whose original Index value is N. P : PE_Ptr; begin Build_Ref_Array (L, Refs); for J in Refs'Range loop P := Refs (J); P.Index := P.Index + R.Index; if P.Pcode = PC_Arbno_Y then P.Nat := P.Nat + Incr; end if; if P.Pthen = EOP then P.Pthen := R; end if; if P.Pcode in PC_Has_Alt and then P.Alt = EOP then P.Alt := R; end if; end loop; end; return L; end if; end Concat; ---------- -- Copy -- ---------- function Copy (P : PE_Ptr) return PE_Ptr is begin if P = null then Uninitialized_Pattern; else declare Refs : Ref_Array (1 .. P.Index); -- References to elements in P, indexed by Index field Copy : Ref_Array (1 .. P.Index); -- Holds copies of elements of P, indexed by Index field E : PE_Ptr; begin Build_Ref_Array (P, Refs); -- Now copy all nodes for J in Refs'Range loop Copy (J) := new PE'(Refs (J).all); end loop; -- Adjust all internal references for J in Copy'Range loop E := Copy (J); -- Adjust successor pointer to point to copy if E.Pthen /= EOP then E.Pthen := Copy (E.Pthen.Index); end if; -- Adjust Alt pointer if there is one to point to copy if E.Pcode in PC_Has_Alt and then E.Alt /= EOP then E.Alt := Copy (E.Alt.Index); end if; -- Copy referenced string if E.Pcode = PC_String then E.Str := new String'(E.Str.all); end if; end loop; return Copy (P.Index); end; end if; end Copy; ---------- -- Dump -- ---------- procedure Dump (P : Pattern) is procedure Write_Node_Id (E : PE_Ptr; Cols : Natural); -- Writes out a string identifying the given pattern element. Cols is -- the column indentation level. ------------------- -- Write_Node_Id -- ------------------- procedure Write_Node_Id (E : PE_Ptr; Cols : Natural) is begin if E = EOP then Put ("EOP"); for J in 4 .. Cols loop Put (' '); end loop; else declare Str : String (1 .. Cols); N : Natural := Natural (E.Index); begin Put ("#"); for J in reverse Str'Range loop Str (J) := Character'Val (48 + N mod 10); N := N / 10; end loop; Put (Str); end; end if; end Write_Node_Id; -- Local variables Cols : Natural := 2; -- Number of columns used for pattern numbers, minimum is 2 E : PE_Ptr; subtype Count is Ada.Text_IO.Count; Scol : Count; -- Used to keep track of column in dump output -- Start of processing for Dump begin New_Line; Put ("Pattern Dump Output (pattern at " & Image (P'Address) & ", S = " & Natural'Image (P.Stk) & ')'); New_Line; Scol := Col; while Col < Scol loop Put ('-'); end loop; New_Line; -- If uninitialized pattern, dump line and we are done if P.P = null then Put_Line ("Uninitialized pattern value"); return; end if; -- If null pattern, just dump it and we are all done if P.P = EOP then Put_Line ("EOP (null pattern)"); return; end if; declare Refs : Ref_Array (1 .. P.P.Index); -- We build a reference array whose N'th element points to the -- pattern element whose Index value is N. begin Build_Ref_Array (P.P, Refs); -- Set number of columns required for node numbers while 10 ** Cols - 1 < Integer (P.P.Index) loop Cols := Cols + 1; end loop; -- Now dump the nodes in reverse sequence. We output them in reverse -- sequence since this corresponds to the natural order used to -- construct the patterns. for J in reverse Refs'Range loop E := Refs (J); Write_Node_Id (E, Cols); Set_Col (Count (Cols) + 4); Put (Image (E)); Put (" "); Put (Pattern_Code'Image (E.Pcode)); Put (" "); Set_Col (21 + Count (Cols) + Address_Image_Length); Write_Node_Id (E.Pthen, Cols); Set_Col (24 + 2 * Count (Cols) + Address_Image_Length); case E.Pcode is when PC_Alt | PC_Arb_X | PC_Arbno_S | PC_Arbno_X => Write_Node_Id (E.Alt, Cols); when PC_Rpat => Put (Str_PP (E.PP)); when PC_Pred_Func => Put (Str_BF (E.BF)); when PC_Assign_Imm | PC_Assign_OnM | PC_Any_VP | PC_Break_VP | PC_BreakX_VP | PC_NotAny_VP | PC_NSpan_VP | PC_Span_VP | PC_String_VP => Put (Str_VP (E.VP)); when PC_Write_Imm | PC_Write_OnM => Put (Str_FP (E.FP)); when PC_String => Put (Image (E.Str.all)); when PC_String_2 => Put (Image (E.Str2)); when PC_String_3 => Put (Image (E.Str3)); when PC_String_4 => Put (Image (E.Str4)); when PC_String_5 => Put (Image (E.Str5)); when PC_String_6 => Put (Image (E.Str6)); when PC_Setcur => Put (Str_NP (E.Var)); when PC_Any_CH | PC_Break_CH | PC_BreakX_CH | PC_Char | PC_NotAny_CH | PC_NSpan_CH | PC_Span_CH => Put (''' & E.Char & '''); when PC_Any_CS | PC_Break_CS | PC_BreakX_CS | PC_NotAny_CS | PC_NSpan_CS | PC_Span_CS => Put ('"' & To_Sequence (E.CS) & '"'); when PC_Arbno_Y | PC_Len_Nat | PC_Pos_Nat | PC_RPos_Nat | PC_RTab_Nat | PC_Tab_Nat => Put (S (E.Nat)); when PC_Pos_NF | PC_Len_NF | PC_RPos_NF | PC_RTab_NF | PC_Tab_NF => Put (Str_NF (E.NF)); when PC_Pos_NP | PC_Len_NP | PC_RPos_NP | PC_RTab_NP | PC_Tab_NP => Put (Str_NP (E.NP)); when PC_Any_VF | PC_Break_VF | PC_BreakX_VF | PC_NotAny_VF | PC_NSpan_VF | PC_Span_VF | PC_String_VF => Put (Str_VF (E.VF)); when others => null; end case; New_Line; end loop; New_Line; end; end Dump; ---------- -- Fail -- ---------- function Fail return Pattern is begin return (AFC with 0, new PE'(PC_Fail, 1, EOP)); end Fail; ----------- -- Fence -- ----------- -- Simple case function Fence return Pattern is begin return (AFC with 1, new PE'(PC_Fence, 1, EOP)); end Fence; -- Function case -- +---+ +---+ +---+ -- | E |---->| P |---->| X |----> -- +---+ +---+ +---+ -- The node numbering of the constituent pattern P is not affected. -- Where N is the number of nodes in P, the X node is numbered N + 1, -- and the E node is N + 2. function Fence (P : Pattern) return Pattern is Pat : constant PE_Ptr := Copy (P.P); E : constant PE_Ptr := new PE'(PC_R_Enter, 0, EOP); X : constant PE_Ptr := new PE'(PC_Fence_X, 0, EOP); begin return (AFC with P.Stk + 1, Bracket (E, Pat, X)); end Fence; -------------- -- Finalize -- -------------- procedure Finalize (Object : in out Pattern) is procedure Free is new Ada.Unchecked_Deallocation (PE, PE_Ptr); procedure Free is new Ada.Unchecked_Deallocation (String, String_Ptr); begin -- Nothing to do if already freed if Object.P = null then return; -- Otherwise we must free all elements else declare Refs : Ref_Array (1 .. Object.P.Index); -- References to elements in pattern to be finalized begin Build_Ref_Array (Object.P, Refs); for J in Refs'Range loop if Refs (J).Pcode = PC_String then Free (Refs (J).Str); end if; Free (Refs (J)); end loop; Object.P := null; end; end if; end Finalize; ----------- -- Image -- ----------- function Image (P : PE_Ptr) return String is begin return Image (To_Address (P)); end Image; function Image (P : Pattern) return String is begin return S (Image (P)); end Image; function Image (P : Pattern) return VString is Kill_Ampersand : Boolean := False; -- Set True to delete next & to be output to Result Result : VString := Nul; -- The result is accumulated here, using Append Refs : Ref_Array (1 .. P.P.Index); -- We build a reference array whose N'th element points to the -- pattern element whose Index value is N. procedure Delete_Ampersand; -- Deletes the ampersand at the end of Result procedure Image_Seq (E : PE_Ptr; Succ : PE_Ptr; Paren : Boolean); -- E refers to a pattern structure whose successor is given by Succ. -- This procedure appends to Result a representation of this pattern. -- The Paren parameter indicates whether parentheses are required if -- the output is more than one element. procedure Image_One (E : in out PE_Ptr); -- E refers to a pattern structure. This procedure appends to Result -- a representation of the single simple or compound pattern structure -- at the start of E and updates E to point to its successor. ---------------------- -- Delete_Ampersand -- ---------------------- procedure Delete_Ampersand is L : constant Natural := Length (Result); begin if L > 2 then Delete (Result, L - 1, L); end if; end Delete_Ampersand; --------------- -- Image_One -- --------------- procedure Image_One (E : in out PE_Ptr) is ER : PE_Ptr := E.Pthen; -- Successor set as result in E unless reset begin case E.Pcode is when PC_Cancel => Append (Result, "Cancel"); when PC_Alt => Alt : declare Elmts_In_L : constant IndexT := E.Pthen.Index - E.Alt.Index; -- Number of elements in left pattern of alternation Lowest_In_L : constant IndexT := E.Index - Elmts_In_L; -- Number of lowest index in elements of left pattern E1 : PE_Ptr; begin -- The successor of the alternation node must have a lower -- index than any node that is in the left pattern or a -- higher index than the alternation node itself. while ER /= EOP and then ER.Index >= Lowest_In_L and then ER.Index < E.Index loop ER := ER.Pthen; end loop; Append (Result, '('); E1 := E; loop Image_Seq (E1.Pthen, ER, False); Append (Result, " or "); E1 := E1.Alt; exit when E1.Pcode /= PC_Alt; end loop; Image_Seq (E1, ER, False); Append (Result, ')'); end Alt; when PC_Any_CS => Append (Result, "Any (" & Image (To_Sequence (E.CS)) & ')'); when PC_Any_VF => Append (Result, "Any (" & Str_VF (E.VF) & ')'); when PC_Any_VP => Append (Result, "Any (" & Str_VP (E.VP) & ')'); when PC_Arb_X => Append (Result, "Arb"); when PC_Arbno_S => Append (Result, "Arbno ("); Image_Seq (E.Alt, E, False); Append (Result, ')'); when PC_Arbno_X => Append (Result, "Arbno ("); Image_Seq (E.Alt.Pthen, Refs (E.Index - 2), False); Append (Result, ')'); when PC_Assign_Imm => Delete_Ampersand; Append (Result, "* " & Str_VP (Refs (E.Index).VP)); when PC_Assign_OnM => Delete_Ampersand; Append (Result, "** " & Str_VP (Refs (E.Index).VP)); when PC_Any_CH => Append (Result, "Any ('" & E.Char & "')"); when PC_Bal => Append (Result, "Bal"); when PC_Break_CH => Append (Result, "Break ('" & E.Char & "')"); when PC_Break_CS => Append (Result, "Break (" & Image (To_Sequence (E.CS)) & ')'); when PC_Break_VF => Append (Result, "Break (" & Str_VF (E.VF) & ')'); when PC_Break_VP => Append (Result, "Break (" & Str_VP (E.VP) & ')'); when PC_BreakX_CH => Append (Result, "BreakX ('" & E.Char & "')"); ER := ER.Pthen; when PC_BreakX_CS => Append (Result, "BreakX (" & Image (To_Sequence (E.CS)) & ')'); ER := ER.Pthen; when PC_BreakX_VF => Append (Result, "BreakX (" & Str_VF (E.VF) & ')'); ER := ER.Pthen; when PC_BreakX_VP => Append (Result, "BreakX (" & Str_VP (E.VP) & ')'); ER := ER.Pthen; when PC_Char => Append (Result, ''' & E.Char & '''); when PC_Fail => Append (Result, "Fail"); when PC_Fence => Append (Result, "Fence"); when PC_Fence_X => Append (Result, "Fence ("); Image_Seq (E.Pthen, Refs (E.Index - 1), False); Append (Result, ")"); ER := Refs (E.Index - 1).Pthen; when PC_Len_Nat => Append (Result, "Len (" & E.Nat & ')'); when PC_Len_NF => Append (Result, "Len (" & Str_NF (E.NF) & ')'); when PC_Len_NP => Append (Result, "Len (" & Str_NP (E.NP) & ')'); when PC_NotAny_CH => Append (Result, "NotAny ('" & E.Char & "')"); when PC_NotAny_CS => Append (Result, "NotAny (" & Image (To_Sequence (E.CS)) & ')'); when PC_NotAny_VF => Append (Result, "NotAny (" & Str_VF (E.VF) & ')'); when PC_NotAny_VP => Append (Result, "NotAny (" & Str_VP (E.VP) & ')'); when PC_NSpan_CH => Append (Result, "NSpan ('" & E.Char & "')"); when PC_NSpan_CS => Append (Result, "NSpan (" & Image (To_Sequence (E.CS)) & ')'); when PC_NSpan_VF => Append (Result, "NSpan (" & Str_VF (E.VF) & ')'); when PC_NSpan_VP => Append (Result, "NSpan (" & Str_VP (E.VP) & ')'); when PC_Null => Append (Result, """"""); when PC_Pos_Nat => Append (Result, "Pos (" & E.Nat & ')'); when PC_Pos_NF => Append (Result, "Pos (" & Str_NF (E.NF) & ')'); when PC_Pos_NP => Append (Result, "Pos (" & Str_NP (E.NP) & ')'); when PC_R_Enter => Kill_Ampersand := True; when PC_Rest => Append (Result, "Rest"); when PC_Rpat => Append (Result, "(+ " & Str_PP (E.PP) & ')'); when PC_Pred_Func => Append (Result, "(+ " & Str_BF (E.BF) & ')'); when PC_RPos_Nat => Append (Result, "RPos (" & E.Nat & ')'); when PC_RPos_NF => Append (Result, "RPos (" & Str_NF (E.NF) & ')'); when PC_RPos_NP => Append (Result, "RPos (" & Str_NP (E.NP) & ')'); when PC_RTab_Nat => Append (Result, "RTab (" & E.Nat & ')'); when PC_RTab_NF => Append (Result, "RTab (" & Str_NF (E.NF) & ')'); when PC_RTab_NP => Append (Result, "RTab (" & Str_NP (E.NP) & ')'); when PC_Setcur => Append (Result, "Setcur (" & Str_NP (E.Var) & ')'); when PC_Span_CH => Append (Result, "Span ('" & E.Char & "')"); when PC_Span_CS => Append (Result, "Span (" & Image (To_Sequence (E.CS)) & ')'); when PC_Span_VF => Append (Result, "Span (" & Str_VF (E.VF) & ')'); when PC_Span_VP => Append (Result, "Span (" & Str_VP (E.VP) & ')'); when PC_String => Append (Result, Image (E.Str.all)); when PC_String_2 => Append (Result, Image (E.Str2)); when PC_String_3 => Append (Result, Image (E.Str3)); when PC_String_4 => Append (Result, Image (E.Str4)); when PC_String_5 => Append (Result, Image (E.Str5)); when PC_String_6 => Append (Result, Image (E.Str6)); when PC_String_VF => Append (Result, "(+" & Str_VF (E.VF) & ')'); when PC_String_VP => Append (Result, "(+" & Str_VP (E.VP) & ')'); when PC_Succeed => Append (Result, "Succeed"); when PC_Tab_Nat => Append (Result, "Tab (" & E.Nat & ')'); when PC_Tab_NF => Append (Result, "Tab (" & Str_NF (E.NF) & ')'); when PC_Tab_NP => Append (Result, "Tab (" & Str_NP (E.NP) & ')'); when PC_Write_Imm => Append (Result, '('); Image_Seq (E, Refs (E.Index - 1), True); Append (Result, " * " & Str_FP (Refs (E.Index - 1).FP)); ER := Refs (E.Index - 1).Pthen; when PC_Write_OnM => Append (Result, '('); Image_Seq (E.Pthen, Refs (E.Index - 1), True); Append (Result, " ** " & Str_FP (Refs (E.Index - 1).FP)); ER := Refs (E.Index - 1).Pthen; -- Other pattern codes should not appear as leading elements when PC_Arb_Y | PC_Arbno_Y | PC_Assign | PC_BreakX_X | PC_EOP | PC_Fence_Y | PC_R_Remove | PC_R_Restore | PC_Unanchored => Append (Result, "???"); end case; E := ER; end Image_One; --------------- -- Image_Seq -- --------------- procedure Image_Seq (E : PE_Ptr; Succ : PE_Ptr; Paren : Boolean) is Indx : constant Natural := Length (Result); E1 : PE_Ptr := E; Mult : Boolean := False; begin -- The image of EOP is "" (the null string) if E = EOP then Append (Result, """"""); -- Else generate appropriate concatenation sequence else loop Image_One (E1); exit when E1 = Succ; exit when E1 = EOP; Mult := True; if Kill_Ampersand then Kill_Ampersand := False; else Append (Result, " & "); end if; end loop; end if; if Mult and Paren then Insert (Result, Indx + 1, "("); Append (Result, ")"); end if; end Image_Seq; -- Start of processing for Image begin Build_Ref_Array (P.P, Refs); Image_Seq (P.P, EOP, False); return Result; end Image; ----------- -- Is_In -- ----------- function Is_In (C : Character; Str : String) return Boolean is begin for J in Str'Range loop if Str (J) = C then return True; end if; end loop; return False; end Is_In; --------- -- Len -- --------- function Len (Count : Natural) return Pattern is begin -- Note, the following is not just an optimization, it is needed -- to ensure that Arbno (Len (0)) does not generate an infinite -- matching loop (since PC_Len_Nat is OK_For_Simple_Arbno). if Count = 0 then return (AFC with 0, new PE'(PC_Null, 1, EOP)); else return (AFC with 0, new PE'(PC_Len_Nat, 1, EOP, Count)); end if; end Len; function Len (Count : Natural_Func) return Pattern is begin return (AFC with 0, new PE'(PC_Len_NF, 1, EOP, Count)); end Len; function Len (Count : not null access Natural) return Pattern is begin return (AFC with 0, new PE'(PC_Len_NP, 1, EOP, Natural_Ptr (Count))); end Len; ----------------- -- Logic_Error -- ----------------- procedure Logic_Error is begin raise Program_Error with "Internal logic error in GNAT.Spitbol.Patterns"; end Logic_Error; ----------- -- Match -- ----------- function Match (Subject : VString; Pat : Pattern) return Boolean is S : Big_String_Access; L : Natural; Start : Natural; Stop : Natural; pragma Unreferenced (Stop); begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; return Start /= 0; end Match; function Match (Subject : String; Pat : Pattern) return Boolean is Start, Stop : Natural; pragma Unreferenced (Stop); subtype String1 is String (1 .. Subject'Length); begin if Debug_Mode then XMatchD (String1 (Subject), Pat.P, Pat.Stk, Start, Stop); else XMatch (String1 (Subject), Pat.P, Pat.Stk, Start, Stop); end if; return Start /= 0; end Match; function Match (Subject : VString_Var; Pat : Pattern; Replace : VString) return Boolean is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; if Start = 0 then return False; else Get_String (Replace, S, L); Replace_Slice (Subject'Unrestricted_Access.all, Start, Stop, S (1 .. L)); return True; end if; end Match; function Match (Subject : VString_Var; Pat : Pattern; Replace : String) return Boolean is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; if Start = 0 then return False; else Replace_Slice (Subject'Unrestricted_Access.all, Start, Stop, Replace); return True; end if; end Match; procedure Match (Subject : VString; Pat : Pattern) is S : Big_String_Access; L : Natural; Start : Natural; Stop : Natural; pragma Unreferenced (Start, Stop); begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; end Match; procedure Match (Subject : String; Pat : Pattern) is Start, Stop : Natural; pragma Unreferenced (Start, Stop); subtype String1 is String (1 .. Subject'Length); begin if Debug_Mode then XMatchD (String1 (Subject), Pat.P, Pat.Stk, Start, Stop); else XMatch (String1 (Subject), Pat.P, Pat.Stk, Start, Stop); end if; end Match; procedure Match (Subject : in out VString; Pat : Pattern; Replace : VString) is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; if Start /= 0 then Get_String (Replace, S, L); Replace_Slice (Subject, Start, Stop, S (1 .. L)); end if; end Match; procedure Match (Subject : in out VString; Pat : Pattern; Replace : String) is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; if Start /= 0 then Replace_Slice (Subject, Start, Stop, Replace); end if; end Match; function Match (Subject : VString; Pat : PString) return Boolean is Pat_Len : constant Natural := Pat'Length; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Anchored_Mode then if Pat_Len > L then return False; else return Pat = S (1 .. Pat_Len); end if; else for J in 1 .. L - Pat_Len + 1 loop if Pat = S (J .. J + (Pat_Len - 1)) then return True; end if; end loop; return False; end if; end Match; function Match (Subject : String; Pat : PString) return Boolean is Pat_Len : constant Natural := Pat'Length; Sub_Len : constant Natural := Subject'Length; SFirst : constant Natural := Subject'First; begin if Anchored_Mode then if Pat_Len > Sub_Len then return False; else return Pat = Subject (SFirst .. SFirst + Pat_Len - 1); end if; else for J in SFirst .. SFirst + Sub_Len - Pat_Len loop if Pat = Subject (J .. J + (Pat_Len - 1)) then return True; end if; end loop; return False; end if; end Match; function Match (Subject : VString_Var; Pat : PString; Replace : VString) return Boolean is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); else XMatch (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); end if; if Start = 0 then return False; else Get_String (Replace, S, L); Replace_Slice (Subject'Unrestricted_Access.all, Start, Stop, S (1 .. L)); return True; end if; end Match; function Match (Subject : VString_Var; Pat : PString; Replace : String) return Boolean is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); else XMatch (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); end if; if Start = 0 then return False; else Replace_Slice (Subject'Unrestricted_Access.all, Start, Stop, Replace); return True; end if; end Match; procedure Match (Subject : VString; Pat : PString) is S : Big_String_Access; L : Natural; Start : Natural; Stop : Natural; pragma Unreferenced (Start, Stop); begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); else XMatch (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); end if; end Match; procedure Match (Subject : String; Pat : PString) is Start, Stop : Natural; pragma Unreferenced (Start, Stop); subtype String1 is String (1 .. Subject'Length); begin if Debug_Mode then XMatchD (String1 (Subject), S_To_PE (Pat), 0, Start, Stop); else XMatch (String1 (Subject), S_To_PE (Pat), 0, Start, Stop); end if; end Match; procedure Match (Subject : in out VString; Pat : PString; Replace : VString) is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); else XMatch (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); end if; if Start /= 0 then Get_String (Replace, S, L); Replace_Slice (Subject, Start, Stop, S (1 .. L)); end if; end Match; procedure Match (Subject : in out VString; Pat : PString; Replace : String) is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); else XMatch (S (1 .. L), S_To_PE (Pat), 0, Start, Stop); end if; if Start /= 0 then Replace_Slice (Subject, Start, Stop, Replace); end if; end Match; function Match (Subject : VString_Var; Pat : Pattern; Result : Match_Result_Var) return Boolean is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; if Start = 0 then Result'Unrestricted_Access.all.Var := null; return False; else Result'Unrestricted_Access.all.Var := Subject'Unrestricted_Access; Result'Unrestricted_Access.all.Start := Start; Result'Unrestricted_Access.all.Stop := Stop; return True; end if; end Match; procedure Match (Subject : in out VString; Pat : Pattern; Result : out Match_Result) is Start : Natural; Stop : Natural; S : Big_String_Access; L : Natural; begin Get_String (Subject, S, L); if Debug_Mode then XMatchD (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); else XMatch (S (1 .. L), Pat.P, Pat.Stk, Start, Stop); end if; if Start = 0 then Result.Var := null; else Result.Var := Subject'Unrestricted_Access; Result.Start := Start; Result.Stop := Stop; end if; end Match; --------------- -- New_LineD -- --------------- procedure New_LineD is begin if Internal_Debug then New_Line; end if; end New_LineD; ------------ -- NotAny -- ------------ function NotAny (Str : String) return Pattern is begin return (AFC with 0, new PE'(PC_NotAny_CS, 1, EOP, To_Set (Str))); end NotAny; function NotAny (Str : VString) return Pattern is begin return NotAny (S (Str)); end NotAny; function NotAny (Str : Character) return Pattern is begin return (AFC with 0, new PE'(PC_NotAny_CH, 1, EOP, Str)); end NotAny; function NotAny (Str : Character_Set) return Pattern is begin return (AFC with 0, new PE'(PC_NotAny_CS, 1, EOP, Str)); end NotAny; function NotAny (Str : not null access VString) return Pattern is begin return (AFC with 0, new PE'(PC_NotAny_VP, 1, EOP, VString_Ptr (Str))); end NotAny; function NotAny (Str : VString_Func) return Pattern is begin return (AFC with 0, new PE'(PC_NotAny_VF, 1, EOP, Str)); end NotAny; ----------- -- NSpan -- ----------- function NSpan (Str : String) return Pattern is begin return (AFC with 0, new PE'(PC_NSpan_CS, 1, EOP, To_Set (Str))); end NSpan; function NSpan (Str : VString) return Pattern is begin return NSpan (S (Str)); end NSpan; function NSpan (Str : Character) return Pattern is begin return (AFC with 0, new PE'(PC_NSpan_CH, 1, EOP, Str)); end NSpan; function NSpan (Str : Character_Set) return Pattern is begin return (AFC with 0, new PE'(PC_NSpan_CS, 1, EOP, Str)); end NSpan; function NSpan (Str : not null access VString) return Pattern is begin return (AFC with 0, new PE'(PC_NSpan_VP, 1, EOP, VString_Ptr (Str))); end NSpan; function NSpan (Str : VString_Func) return Pattern is begin return (AFC with 0, new PE'(PC_NSpan_VF, 1, EOP, Str)); end NSpan; --------- -- Pos -- --------- function Pos (Count : Natural) return Pattern is begin return (AFC with 0, new PE'(PC_Pos_Nat, 1, EOP, Count)); end Pos; function Pos (Count : Natural_Func) return Pattern is begin return (AFC with 0, new PE'(PC_Pos_NF, 1, EOP, Count)); end Pos; function Pos (Count : not null access Natural) return Pattern is begin return (AFC with 0, new PE'(PC_Pos_NP, 1, EOP, Natural_Ptr (Count))); end Pos; ---------- -- PutD -- ---------- procedure PutD (Str : String) is begin if Internal_Debug then Put (Str); end if; end PutD; --------------- -- Put_LineD -- --------------- procedure Put_LineD (Str : String) is begin if Internal_Debug then Put_Line (Str); end if; end Put_LineD; ------------- -- Replace -- ------------- procedure Replace (Result : in out Match_Result; Replace : VString) is S : Big_String_Access; L : Natural; begin Get_String (Replace, S, L); if Result.Var /= null then Replace_Slice (Result.Var.all, Result.Start, Result.Stop, S (1 .. L)); Result.Var := null; end if; end Replace; ---------- -- Rest -- ---------- function Rest return Pattern is begin return (AFC with 0, new PE'(PC_Rest, 1, EOP)); end Rest; ---------- -- Rpos -- ---------- function Rpos (Count : Natural) return Pattern is begin return (AFC with 0, new PE'(PC_RPos_Nat, 1, EOP, Count)); end Rpos; function Rpos (Count : Natural_Func) return Pattern is begin return (AFC with 0, new PE'(PC_RPos_NF, 1, EOP, Count)); end Rpos; function Rpos (Count : not null access Natural) return Pattern is begin return (AFC with 0, new PE'(PC_RPos_NP, 1, EOP, Natural_Ptr (Count))); end Rpos; ---------- -- Rtab -- ---------- function Rtab (Count : Natural) return Pattern is begin return (AFC with 0, new PE'(PC_RTab_Nat, 1, EOP, Count)); end Rtab; function Rtab (Count : Natural_Func) return Pattern is begin return (AFC with 0, new PE'(PC_RTab_NF, 1, EOP, Count)); end Rtab; function Rtab (Count : not null access Natural) return Pattern is begin return (AFC with 0, new PE'(PC_RTab_NP, 1, EOP, Natural_Ptr (Count))); end Rtab; ------------- -- S_To_PE -- ------------- function S_To_PE (Str : PString) return PE_Ptr is Len : constant Natural := Str'Length; begin case Len is when 0 => return new PE'(PC_Null, 1, EOP); when 1 => return new PE'(PC_Char, 1, EOP, Str (Str'First)); when 2 => return new PE'(PC_String_2, 1, EOP, Str); when 3 => return new PE'(PC_String_3, 1, EOP, Str); when 4 => return new PE'(PC_String_4, 1, EOP, Str); when 5 => return new PE'(PC_String_5, 1, EOP, Str); when 6 => return new PE'(PC_String_6, 1, EOP, Str); when others => return new PE'(PC_String, 1, EOP, new String'(Str)); end case; end S_To_PE; ------------------- -- Set_Successor -- ------------------- -- Note: this procedure is not used by the normal concatenation circuit, -- since other fixups are required on the left operand in this case, and -- they might as well be done all together. procedure Set_Successor (Pat : PE_Ptr; Succ : PE_Ptr) is begin if Pat = null then Uninitialized_Pattern; elsif Pat = EOP then Logic_Error; else declare Refs : Ref_Array (1 .. Pat.Index); -- We build a reference array for L whose N'th element points to -- the pattern element of L whose original Index value is N. P : PE_Ptr; begin Build_Ref_Array (Pat, Refs); for J in Refs'Range loop P := Refs (J); if P.Pthen = EOP then P.Pthen := Succ; end if; if P.Pcode in PC_Has_Alt and then P.Alt = EOP then P.Alt := Succ; end if; end loop; end; end if; end Set_Successor; ------------ -- Setcur -- ------------ function Setcur (Var : not null access Natural) return Pattern is begin return (AFC with 0, new PE'(PC_Setcur, 1, EOP, Natural_Ptr (Var))); end Setcur; ---------- -- Span -- ---------- function Span (Str : String) return Pattern is begin return (AFC with 0, new PE'(PC_Span_CS, 1, EOP, To_Set (Str))); end Span; function Span (Str : VString) return Pattern is begin return Span (S (Str)); end Span; function Span (Str : Character) return Pattern is begin return (AFC with 0, new PE'(PC_Span_CH, 1, EOP, Str)); end Span; function Span (Str : Character_Set) return Pattern is begin return (AFC with 0, new PE'(PC_Span_CS, 1, EOP, Str)); end Span; function Span (Str : not null access VString) return Pattern is begin return (AFC with 0, new PE'(PC_Span_VP, 1, EOP, VString_Ptr (Str))); end Span; function Span (Str : VString_Func) return Pattern is begin return (AFC with 0, new PE'(PC_Span_VF, 1, EOP, Str)); end Span; ------------ -- Str_BF -- ------------ function Str_BF (A : Boolean_Func) return String is function To_A is new Ada.Unchecked_Conversion (Boolean_Func, Address); begin return "BF(" & Image (To_A (A)) & ')'; end Str_BF; ------------ -- Str_FP -- ------------ function Str_FP (A : File_Ptr) return String is begin return "FP(" & Image (A.all'Address) & ')'; end Str_FP; ------------ -- Str_NF -- ------------ function Str_NF (A : Natural_Func) return String is function To_A is new Ada.Unchecked_Conversion (Natural_Func, Address); begin return "NF(" & Image (To_A (A)) & ')'; end Str_NF; ------------ -- Str_NP -- ------------ function Str_NP (A : Natural_Ptr) return String is begin return "NP(" & Image (A.all'Address) & ')'; end Str_NP; ------------ -- Str_PP -- ------------ function Str_PP (A : Pattern_Ptr) return String is begin return "PP(" & Image (A.all'Address) & ')'; end Str_PP; ------------ -- Str_VF -- ------------ function Str_VF (A : VString_Func) return String is function To_A is new Ada.Unchecked_Conversion (VString_Func, Address); begin return "VF(" & Image (To_A (A)) & ')'; end Str_VF; ------------ -- Str_VP -- ------------ function Str_VP (A : VString_Ptr) return String is begin return "VP(" & Image (A.all'Address) & ')'; end Str_VP; ------------- -- Succeed -- ------------- function Succeed return Pattern is begin return (AFC with 1, new PE'(PC_Succeed, 1, EOP)); end Succeed; --------- -- Tab -- --------- function Tab (Count : Natural) return Pattern is begin return (AFC with 0, new PE'(PC_Tab_Nat, 1, EOP, Count)); end Tab; function Tab (Count : Natural_Func) return Pattern is begin return (AFC with 0, new PE'(PC_Tab_NF, 1, EOP, Count)); end Tab; function Tab (Count : not null access Natural) return Pattern is begin return (AFC with 0, new PE'(PC_Tab_NP, 1, EOP, Natural_Ptr (Count))); end Tab; --------------------------- -- Uninitialized_Pattern -- --------------------------- procedure Uninitialized_Pattern is begin raise Program_Error with "uninitialized value of type GNAT.Spitbol.Patterns.Pattern"; end Uninitialized_Pattern; ------------ -- XMatch -- ------------ procedure XMatch (Subject : String; Pat_P : PE_Ptr; Pat_S : Natural; Start : out Natural; Stop : out Natural) is Node : PE_Ptr; -- Pointer to current pattern node. Initialized from Pat_P, and then -- updated as the match proceeds through its constituent elements. Length : constant Natural := Subject'Length; -- Length of string (= Subject'Last, since Subject'First is always 1) Cursor : Integer := 0; -- If the value is non-negative, then this value is the index showing -- the current position of the match in the subject string. The next -- character to be matched is at Subject (Cursor + 1). Note that since -- our view of the subject string in XMatch always has a lower bound -- of one, regardless of original bounds, that this definition exactly -- corresponds to the cursor value as referenced by functions like Pos. -- -- If the value is negative, then this is a saved stack pointer, -- typically a base pointer of an inner or outer region. Cursor -- temporarily holds such a value when it is popped from the stack -- by Fail. In all cases, Cursor is reset to a proper non-negative -- cursor value before the match proceeds (e.g. by propagating the -- failure and popping a "real" cursor value from the stack. PE_Unanchored : aliased PE := (PC_Unanchored, 0, Pat_P); -- Dummy pattern element used in the unanchored case Stack : Stack_Type; -- The pattern matching failure stack for this call to Match Stack_Ptr : Stack_Range; -- Current stack pointer. This points to the top element of the stack -- that is currently in use. At the outer level this is the special -- entry placed on the stack according to the anchor mode. Stack_Init : constant Stack_Range := Stack'First + 1; -- This is the initial value of the Stack_Ptr and Stack_Base. The -- initial (Stack'First) element of the stack is not used so that -- when we pop the last element off, Stack_Ptr is still in range. Stack_Base : Stack_Range; -- This value is the stack base value, i.e. the stack pointer for the -- first history stack entry in the current stack region. See separate -- section on handling of recursive pattern matches. Assign_OnM : Boolean := False; -- Set True if assign-on-match or write-on-match operations may be -- present in the history stack, which must then be scanned on a -- successful match. procedure Pop_Region; pragma Inline (Pop_Region); -- Used at the end of processing of an inner region. If the inner -- region left no stack entries, then all trace of it is removed. -- Otherwise a PC_Restore_Region entry is pushed to ensure proper -- handling of alternatives in the inner region. procedure Push (Node : PE_Ptr); pragma Inline (Push); -- Make entry in pattern matching stack with current cursor value procedure Push_Region; pragma Inline (Push_Region); -- This procedure makes a new region on the history stack. The -- caller first establishes the special entry on the stack, but -- does not push the stack pointer. Then this call stacks a -- PC_Remove_Region node, on top of this entry, using the cursor -- field of the PC_Remove_Region entry to save the outer level -- stack base value, and resets the stack base to point to this -- PC_Remove_Region node. ---------------- -- Pop_Region -- ---------------- procedure Pop_Region is begin -- If nothing was pushed in the inner region, we can just get -- rid of it entirely, leaving no traces that it was ever there if Stack_Ptr = Stack_Base then Stack_Ptr := Stack_Base - 2; Stack_Base := Stack (Stack_Ptr + 2).Cursor; -- If stuff was pushed in the inner region, then we have to -- push a PC_R_Restore node so that we properly handle possible -- rematches within the region. else Stack_Ptr := Stack_Ptr + 1; Stack (Stack_Ptr).Cursor := Stack_Base; Stack (Stack_Ptr).Node := CP_R_Restore'Access; Stack_Base := Stack (Stack_Base).Cursor; end if; end Pop_Region; ---------- -- Push -- ---------- procedure Push (Node : PE_Ptr) is begin Stack_Ptr := Stack_Ptr + 1; Stack (Stack_Ptr).Cursor := Cursor; Stack (Stack_Ptr).Node := Node; end Push; ----------------- -- Push_Region -- ----------------- procedure Push_Region is begin Stack_Ptr := Stack_Ptr + 2; Stack (Stack_Ptr).Cursor := Stack_Base; Stack (Stack_Ptr).Node := CP_R_Remove'Access; Stack_Base := Stack_Ptr; end Push_Region; -- Start of processing for XMatch begin if Pat_P = null then Uninitialized_Pattern; end if; -- Check we have enough stack for this pattern. This check deals with -- every possibility except a match of a recursive pattern, where we -- make a check at each recursion level. if Pat_S >= Stack_Size - 1 then raise Pattern_Stack_Overflow; end if; -- In anchored mode, the bottom entry on the stack is an abort entry if Anchored_Mode then Stack (Stack_Init).Node := CP_Cancel'Access; Stack (Stack_Init).Cursor := 0; -- In unanchored more, the bottom entry on the stack references -- the special pattern element PE_Unanchored, whose Pthen field -- points to the initial pattern element. The cursor value in this -- entry is the number of anchor moves so far. else Stack (Stack_Init).Node := PE_Unanchored'Unchecked_Access; Stack (Stack_Init).Cursor := 0; end if; Stack_Ptr := Stack_Init; Stack_Base := Stack_Ptr; Cursor := 0; Node := Pat_P; goto Match; ----------------------------------------- -- Main Pattern Matching State Control -- ----------------------------------------- -- This is a state machine which uses gotos to change state. The -- initial state is Match, to initiate the matching of the first -- element, so the goto Match above starts the match. In the -- following descriptions, we indicate the global values that -- are relevant for the state transition. -- Come here if entire match fails <<Match_Fail>> Start := 0; Stop := 0; return; -- Come here if entire match succeeds -- Cursor current position in subject string <<Match_Succeed>> Start := Stack (Stack_Init).Cursor + 1; Stop := Cursor; -- Scan history stack for deferred assignments or writes if Assign_OnM then for S in Stack_Init .. Stack_Ptr loop if Stack (S).Node = CP_Assign'Access then declare Inner_Base : constant Stack_Range := Stack (S + 1).Cursor; Special_Entry : constant Stack_Range := Inner_Base - 1; Node_OnM : constant PE_Ptr := Stack (Special_Entry).Node; Start : constant Natural := Stack (Special_Entry).Cursor + 1; Stop : constant Natural := Stack (S).Cursor; begin if Node_OnM.Pcode = PC_Assign_OnM then Set_Unbounded_String (Node_OnM.VP.all, Subject (Start .. Stop)); elsif Node_OnM.Pcode = PC_Write_OnM then Put_Line (Node_OnM.FP.all, Subject (Start .. Stop)); else Logic_Error; end if; end; end if; end loop; end if; return; -- Come here if attempt to match current element fails -- Stack_Base current stack base -- Stack_Ptr current stack pointer <<Fail>> Cursor := Stack (Stack_Ptr).Cursor; Node := Stack (Stack_Ptr).Node; Stack_Ptr := Stack_Ptr - 1; goto Match; -- Come here if attempt to match current element succeeds -- Cursor current position in subject string -- Node pointer to node successfully matched -- Stack_Base current stack base -- Stack_Ptr current stack pointer <<Succeed>> Node := Node.Pthen; -- Come here to match the next pattern element -- Cursor current position in subject string -- Node pointer to node to be matched -- Stack_Base current stack base -- Stack_Ptr current stack pointer <<Match>> -------------------------------------------------- -- Main Pattern Match Element Matching Routines -- -------------------------------------------------- -- Here is the case statement that processes the current node. The -- processing for each element does one of five things: -- goto Succeed to move to the successor -- goto Match_Succeed if the entire match succeeds -- goto Match_Fail if the entire match fails -- goto Fail to signal failure of current match -- Processing is NOT allowed to fall through case Node.Pcode is -- Cancel when PC_Cancel => goto Match_Fail; -- Alternation when PC_Alt => Push (Node.Alt); Node := Node.Pthen; goto Match; -- Any (one character case) when PC_Any_CH => if Cursor < Length and then Subject (Cursor + 1) = Node.Char then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- Any (character set case) when PC_Any_CS => if Cursor < Length and then Is_In (Subject (Cursor + 1), Node.CS) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- Any (string function case) when PC_Any_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); if Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- Any (string pointer case) when PC_Any_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); if Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- Arb (initial match) when PC_Arb_X => Push (Node.Alt); Node := Node.Pthen; goto Match; -- Arb (extension) when PC_Arb_Y => if Cursor < Length then Cursor := Cursor + 1; Push (Node); goto Succeed; else goto Fail; end if; -- Arbno_S (simple Arbno initialize). This is the node that -- initiates the match of a simple Arbno structure. when PC_Arbno_S => Push (Node.Alt); Node := Node.Pthen; goto Match; -- Arbno_X (Arbno initialize). This is the node that initiates -- the match of a complex Arbno structure. when PC_Arbno_X => Push (Node.Alt); Node := Node.Pthen; goto Match; -- Arbno_Y (Arbno rematch). This is the node that is executed -- following successful matching of one instance of a complex -- Arbno pattern. when PC_Arbno_Y => declare Null_Match : constant Boolean := Cursor = Stack (Stack_Base - 1).Cursor; begin Pop_Region; -- If arbno extension matched null, then immediately fail if Null_Match then goto Fail; end if; -- Here we must do a stack check to make sure enough stack -- is left. This check will happen once for each instance of -- the Arbno pattern that is matched. The Nat field of a -- PC_Arbno pattern contains the maximum stack entries needed -- for the Arbno with one instance and the successor pattern if Stack_Ptr + Node.Nat >= Stack'Last then raise Pattern_Stack_Overflow; end if; goto Succeed; end; -- Assign. If this node is executed, it means the assign-on-match -- or write-on-match operation will not happen after all, so we -- is propagate the failure, removing the PC_Assign node. when PC_Assign => goto Fail; -- Assign immediate. This node performs the actual assignment when PC_Assign_Imm => Set_Unbounded_String (Node.VP.all, Subject (Stack (Stack_Base - 1).Cursor + 1 .. Cursor)); Pop_Region; goto Succeed; -- Assign on match. This node sets up for the eventual assignment when PC_Assign_OnM => Stack (Stack_Base - 1).Node := Node; Push (CP_Assign'Access); Pop_Region; Assign_OnM := True; goto Succeed; -- Bal when PC_Bal => if Cursor >= Length or else Subject (Cursor + 1) = ')' then goto Fail; elsif Subject (Cursor + 1) = '(' then declare Paren_Count : Natural := 1; begin loop Cursor := Cursor + 1; if Cursor >= Length then goto Fail; elsif Subject (Cursor + 1) = '(' then Paren_Count := Paren_Count + 1; elsif Subject (Cursor + 1) = ')' then Paren_Count := Paren_Count - 1; exit when Paren_Count = 0; end if; end loop; end; end if; Cursor := Cursor + 1; Push (Node); goto Succeed; -- Break (one character case) when PC_Break_CH => while Cursor < Length loop if Subject (Cursor + 1) = Node.Char then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- Break (character set case) when PC_Break_CS => while Cursor < Length loop if Is_In (Subject (Cursor + 1), Node.CS) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- Break (string function case) when PC_Break_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- Break (string pointer case) when PC_Break_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- BreakX (one character case) when PC_BreakX_CH => while Cursor < Length loop if Subject (Cursor + 1) = Node.Char then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- BreakX (character set case) when PC_BreakX_CS => while Cursor < Length loop if Is_In (Subject (Cursor + 1), Node.CS) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- BreakX (string function case) when PC_BreakX_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- BreakX (string pointer case) when PC_BreakX_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- BreakX_X (BreakX extension). See section on "Compound Pattern -- Structures". This node is the alternative that is stacked to -- skip past the break character and extend the break. when PC_BreakX_X => Cursor := Cursor + 1; goto Succeed; -- Character (one character string) when PC_Char => if Cursor < Length and then Subject (Cursor + 1) = Node.Char then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- End of Pattern when PC_EOP => if Stack_Base = Stack_Init then goto Match_Succeed; -- End of recursive inner match. See separate section on -- handing of recursive pattern matches for details. else Node := Stack (Stack_Base - 1).Node; Pop_Region; goto Match; end if; -- Fail when PC_Fail => goto Fail; -- Fence (built in pattern) when PC_Fence => Push (CP_Cancel'Access); goto Succeed; -- Fence function node X. This is the node that gets control -- after a successful match of the fenced pattern. when PC_Fence_X => Stack_Ptr := Stack_Ptr + 1; Stack (Stack_Ptr).Cursor := Stack_Base; Stack (Stack_Ptr).Node := CP_Fence_Y'Access; Stack_Base := Stack (Stack_Base).Cursor; goto Succeed; -- Fence function node Y. This is the node that gets control on -- a failure that occurs after the fenced pattern has matched. -- Note: the Cursor at this stage is actually the inner stack -- base value. We don't reset this, but we do use it to strip -- off all the entries made by the fenced pattern. when PC_Fence_Y => Stack_Ptr := Cursor - 2; goto Fail; -- Len (integer case) when PC_Len_Nat => if Cursor + Node.Nat > Length then goto Fail; else Cursor := Cursor + Node.Nat; goto Succeed; end if; -- Len (Integer function case) when PC_Len_NF => declare N : constant Natural := Node.NF.all; begin if Cursor + N > Length then goto Fail; else Cursor := Cursor + N; goto Succeed; end if; end; -- Len (integer pointer case) when PC_Len_NP => if Cursor + Node.NP.all > Length then goto Fail; else Cursor := Cursor + Node.NP.all; goto Succeed; end if; -- NotAny (one character case) when PC_NotAny_CH => if Cursor < Length and then Subject (Cursor + 1) /= Node.Char then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- NotAny (character set case) when PC_NotAny_CS => if Cursor < Length and then not Is_In (Subject (Cursor + 1), Node.CS) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- NotAny (string function case) when PC_NotAny_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); if Cursor < Length and then not Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- NotAny (string pointer case) when PC_NotAny_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); if Cursor < Length and then not Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- NSpan (one character case) when PC_NSpan_CH => while Cursor < Length and then Subject (Cursor + 1) = Node.Char loop Cursor := Cursor + 1; end loop; goto Succeed; -- NSpan (character set case) when PC_NSpan_CS => while Cursor < Length and then Is_In (Subject (Cursor + 1), Node.CS) loop Cursor := Cursor + 1; end loop; goto Succeed; -- NSpan (string function case) when PC_NSpan_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); while Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) loop Cursor := Cursor + 1; end loop; goto Succeed; end; -- NSpan (string pointer case) when PC_NSpan_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); while Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) loop Cursor := Cursor + 1; end loop; goto Succeed; end; -- Null string when PC_Null => goto Succeed; -- Pos (integer case) when PC_Pos_Nat => if Cursor = Node.Nat then goto Succeed; else goto Fail; end if; -- Pos (Integer function case) when PC_Pos_NF => declare N : constant Natural := Node.NF.all; begin if Cursor = N then goto Succeed; else goto Fail; end if; end; -- Pos (integer pointer case) when PC_Pos_NP => if Cursor = Node.NP.all then goto Succeed; else goto Fail; end if; -- Predicate function when PC_Pred_Func => if Node.BF.all then goto Succeed; else goto Fail; end if; -- Region Enter. Initiate new pattern history stack region when PC_R_Enter => Stack (Stack_Ptr + 1).Cursor := Cursor; Push_Region; goto Succeed; -- Region Remove node. This is the node stacked by an R_Enter. -- It removes the special format stack entry right underneath, and -- then restores the outer level stack base and signals failure. -- Note: the cursor value at this stage is actually the (negative) -- stack base value for the outer level. when PC_R_Remove => Stack_Base := Cursor; Stack_Ptr := Stack_Ptr - 1; goto Fail; -- Region restore node. This is the node stacked at the end of an -- inner level match. Its function is to restore the inner level -- region, so that alternatives in this region can be sought. -- Note: the Cursor at this stage is actually the negative of the -- inner stack base value, which we use to restore the inner region. when PC_R_Restore => Stack_Base := Cursor; goto Fail; -- Rest when PC_Rest => Cursor := Length; goto Succeed; -- Initiate recursive match (pattern pointer case) when PC_Rpat => Stack (Stack_Ptr + 1).Node := Node.Pthen; Push_Region; if Stack_Ptr + Node.PP.all.Stk >= Stack_Size then raise Pattern_Stack_Overflow; else Node := Node.PP.all.P; goto Match; end if; -- RPos (integer case) when PC_RPos_Nat => if Cursor = (Length - Node.Nat) then goto Succeed; else goto Fail; end if; -- RPos (integer function case) when PC_RPos_NF => declare N : constant Natural := Node.NF.all; begin if Length - Cursor = N then goto Succeed; else goto Fail; end if; end; -- RPos (integer pointer case) when PC_RPos_NP => if Cursor = (Length - Node.NP.all) then goto Succeed; else goto Fail; end if; -- RTab (integer case) when PC_RTab_Nat => if Cursor <= (Length - Node.Nat) then Cursor := Length - Node.Nat; goto Succeed; else goto Fail; end if; -- RTab (integer function case) when PC_RTab_NF => declare N : constant Natural := Node.NF.all; begin if Length - Cursor >= N then Cursor := Length - N; goto Succeed; else goto Fail; end if; end; -- RTab (integer pointer case) when PC_RTab_NP => if Cursor <= (Length - Node.NP.all) then Cursor := Length - Node.NP.all; goto Succeed; else goto Fail; end if; -- Cursor assignment when PC_Setcur => Node.Var.all := Cursor; goto Succeed; -- Span (one character case) when PC_Span_CH => declare P : Natural; begin P := Cursor; while P < Length and then Subject (P + 1) = Node.Char loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- Span (character set case) when PC_Span_CS => declare P : Natural; begin P := Cursor; while P < Length and then Is_In (Subject (P + 1), Node.CS) loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- Span (string function case) when PC_Span_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; P : Natural; begin Get_String (U, S, L); P := Cursor; while P < Length and then Is_In (Subject (P + 1), S (1 .. L)) loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- Span (string pointer case) when PC_Span_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; P : Natural; begin Get_String (U, S, L); P := Cursor; while P < Length and then Is_In (Subject (P + 1), S (1 .. L)) loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- String (two character case) when PC_String_2 => if (Length - Cursor) >= 2 and then Subject (Cursor + 1 .. Cursor + 2) = Node.Str2 then Cursor := Cursor + 2; goto Succeed; else goto Fail; end if; -- String (three character case) when PC_String_3 => if (Length - Cursor) >= 3 and then Subject (Cursor + 1 .. Cursor + 3) = Node.Str3 then Cursor := Cursor + 3; goto Succeed; else goto Fail; end if; -- String (four character case) when PC_String_4 => if (Length - Cursor) >= 4 and then Subject (Cursor + 1 .. Cursor + 4) = Node.Str4 then Cursor := Cursor + 4; goto Succeed; else goto Fail; end if; -- String (five character case) when PC_String_5 => if (Length - Cursor) >= 5 and then Subject (Cursor + 1 .. Cursor + 5) = Node.Str5 then Cursor := Cursor + 5; goto Succeed; else goto Fail; end if; -- String (six character case) when PC_String_6 => if (Length - Cursor) >= 6 and then Subject (Cursor + 1 .. Cursor + 6) = Node.Str6 then Cursor := Cursor + 6; goto Succeed; else goto Fail; end if; -- String (case of more than six characters) when PC_String => declare Len : constant Natural := Node.Str'Length; begin if (Length - Cursor) >= Len and then Node.Str.all = Subject (Cursor + 1 .. Cursor + Len) then Cursor := Cursor + Len; goto Succeed; else goto Fail; end if; end; -- String (function case) when PC_String_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); if (Length - Cursor) >= L and then S (1 .. L) = Subject (Cursor + 1 .. Cursor + L) then Cursor := Cursor + L; goto Succeed; else goto Fail; end if; end; -- String (pointer case) when PC_String_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); if (Length - Cursor) >= L and then S (1 .. L) = Subject (Cursor + 1 .. Cursor + L) then Cursor := Cursor + L; goto Succeed; else goto Fail; end if; end; -- Succeed when PC_Succeed => Push (Node); goto Succeed; -- Tab (integer case) when PC_Tab_Nat => if Cursor <= Node.Nat then Cursor := Node.Nat; goto Succeed; else goto Fail; end if; -- Tab (integer function case) when PC_Tab_NF => declare N : constant Natural := Node.NF.all; begin if Cursor <= N then Cursor := N; goto Succeed; else goto Fail; end if; end; -- Tab (integer pointer case) when PC_Tab_NP => if Cursor <= Node.NP.all then Cursor := Node.NP.all; goto Succeed; else goto Fail; end if; -- Unanchored movement when PC_Unanchored => -- All done if we tried every position if Cursor > Length then goto Match_Fail; -- Otherwise extend the anchor point, and restack ourself else Cursor := Cursor + 1; Push (Node); goto Succeed; end if; -- Write immediate. This node performs the actual write when PC_Write_Imm => Put_Line (Node.FP.all, Subject (Stack (Stack_Base - 1).Cursor + 1 .. Cursor)); Pop_Region; goto Succeed; -- Write on match. This node sets up for the eventual write when PC_Write_OnM => Stack (Stack_Base - 1).Node := Node; Push (CP_Assign'Access); Pop_Region; Assign_OnM := True; goto Succeed; end case; -- We are NOT allowed to fall though this case statement, since every -- match routine must end by executing a goto to the appropriate point -- in the finite state machine model. pragma Warnings (Off); Logic_Error; pragma Warnings (On); end XMatch; ------------- -- XMatchD -- ------------- -- Maintenance note: There is a LOT of code duplication between XMatch -- and XMatchD. This is quite intentional, the point is to avoid any -- unnecessary debugging overhead in the XMatch case, but this does mean -- that any changes to XMatchD must be mirrored in XMatch. In case of -- any major changes, the proper approach is to delete XMatch, make the -- changes to XMatchD, and then make a copy of XMatchD, removing all -- calls to Dout, and all Put and Put_Line operations. This copy becomes -- the new XMatch. procedure XMatchD (Subject : String; Pat_P : PE_Ptr; Pat_S : Natural; Start : out Natural; Stop : out Natural) is Node : PE_Ptr; -- Pointer to current pattern node. Initialized from Pat_P, and then -- updated as the match proceeds through its constituent elements. Length : constant Natural := Subject'Length; -- Length of string (= Subject'Last, since Subject'First is always 1) Cursor : Integer := 0; -- If the value is non-negative, then this value is the index showing -- the current position of the match in the subject string. The next -- character to be matched is at Subject (Cursor + 1). Note that since -- our view of the subject string in XMatch always has a lower bound -- of one, regardless of original bounds, that this definition exactly -- corresponds to the cursor value as referenced by functions like Pos. -- -- If the value is negative, then this is a saved stack pointer, -- typically a base pointer of an inner or outer region. Cursor -- temporarily holds such a value when it is popped from the stack -- by Fail. In all cases, Cursor is reset to a proper non-negative -- cursor value before the match proceeds (e.g. by propagating the -- failure and popping a "real" cursor value from the stack. PE_Unanchored : aliased PE := (PC_Unanchored, 0, Pat_P); -- Dummy pattern element used in the unanchored case Region_Level : Natural := 0; -- Keeps track of recursive region level. This is used only for -- debugging, it is the number of saved history stack base values. Stack : Stack_Type; -- The pattern matching failure stack for this call to Match Stack_Ptr : Stack_Range; -- Current stack pointer. This points to the top element of the stack -- that is currently in use. At the outer level this is the special -- entry placed on the stack according to the anchor mode. Stack_Init : constant Stack_Range := Stack'First + 1; -- This is the initial value of the Stack_Ptr and Stack_Base. The -- initial (Stack'First) element of the stack is not used so that -- when we pop the last element off, Stack_Ptr is still in range. Stack_Base : Stack_Range; -- This value is the stack base value, i.e. the stack pointer for the -- first history stack entry in the current stack region. See separate -- section on handling of recursive pattern matches. Assign_OnM : Boolean := False; -- Set True if assign-on-match or write-on-match operations may be -- present in the history stack, which must then be scanned on a -- successful match. procedure Dout (Str : String); -- Output string to standard error with bars indicating region level procedure Dout (Str : String; A : Character); -- Calls Dout with the string S ('A') procedure Dout (Str : String; A : Character_Set); -- Calls Dout with the string S ("A") procedure Dout (Str : String; A : Natural); -- Calls Dout with the string S (A) procedure Dout (Str : String; A : String); -- Calls Dout with the string S ("A") function Img (P : PE_Ptr) return String; -- Returns a string of the form #nnn where nnn is P.Index procedure Pop_Region; pragma Inline (Pop_Region); -- Used at the end of processing of an inner region. If the inner -- region left no stack entries, then all trace of it is removed. -- Otherwise a PC_Restore_Region entry is pushed to ensure proper -- handling of alternatives in the inner region. procedure Push (Node : PE_Ptr); pragma Inline (Push); -- Make entry in pattern matching stack with current cursor value procedure Push_Region; pragma Inline (Push_Region); -- This procedure makes a new region on the history stack. The -- caller first establishes the special entry on the stack, but -- does not push the stack pointer. Then this call stacks a -- PC_Remove_Region node, on top of this entry, using the cursor -- field of the PC_Remove_Region entry to save the outer level -- stack base value, and resets the stack base to point to this -- PC_Remove_Region node. ---------- -- Dout -- ---------- procedure Dout (Str : String) is begin for J in 1 .. Region_Level loop Put ("| "); end loop; Put_Line (Str); end Dout; procedure Dout (Str : String; A : Character) is begin Dout (Str & " ('" & A & "')"); end Dout; procedure Dout (Str : String; A : Character_Set) is begin Dout (Str & " (" & Image (To_Sequence (A)) & ')'); end Dout; procedure Dout (Str : String; A : Natural) is begin Dout (Str & " (" & A & ')'); end Dout; procedure Dout (Str : String; A : String) is begin Dout (Str & " (" & Image (A) & ')'); end Dout; --------- -- Img -- --------- function Img (P : PE_Ptr) return String is begin return "#" & Integer (P.Index) & " "; end Img; ---------------- -- Pop_Region -- ---------------- procedure Pop_Region is begin Region_Level := Region_Level - 1; -- If nothing was pushed in the inner region, we can just get -- rid of it entirely, leaving no traces that it was ever there if Stack_Ptr = Stack_Base then Stack_Ptr := Stack_Base - 2; Stack_Base := Stack (Stack_Ptr + 2).Cursor; -- If stuff was pushed in the inner region, then we have to -- push a PC_R_Restore node so that we properly handle possible -- rematches within the region. else Stack_Ptr := Stack_Ptr + 1; Stack (Stack_Ptr).Cursor := Stack_Base; Stack (Stack_Ptr).Node := CP_R_Restore'Access; Stack_Base := Stack (Stack_Base).Cursor; end if; end Pop_Region; ---------- -- Push -- ---------- procedure Push (Node : PE_Ptr) is begin Stack_Ptr := Stack_Ptr + 1; Stack (Stack_Ptr).Cursor := Cursor; Stack (Stack_Ptr).Node := Node; end Push; ----------------- -- Push_Region -- ----------------- procedure Push_Region is begin Region_Level := Region_Level + 1; Stack_Ptr := Stack_Ptr + 2; Stack (Stack_Ptr).Cursor := Stack_Base; Stack (Stack_Ptr).Node := CP_R_Remove'Access; Stack_Base := Stack_Ptr; end Push_Region; -- Start of processing for XMatchD begin New_Line; Put_Line ("Initiating pattern match, subject = " & Image (Subject)); Put ("--------------------------------------"); for J in 1 .. Length loop Put ('-'); end loop; New_Line; Put_Line ("subject length = " & Length); if Pat_P = null then Uninitialized_Pattern; end if; -- Check we have enough stack for this pattern. This check deals with -- every possibility except a match of a recursive pattern, where we -- make a check at each recursion level. if Pat_S >= Stack_Size - 1 then raise Pattern_Stack_Overflow; end if; -- In anchored mode, the bottom entry on the stack is an abort entry if Anchored_Mode then Stack (Stack_Init).Node := CP_Cancel'Access; Stack (Stack_Init).Cursor := 0; -- In unanchored more, the bottom entry on the stack references -- the special pattern element PE_Unanchored, whose Pthen field -- points to the initial pattern element. The cursor value in this -- entry is the number of anchor moves so far. else Stack (Stack_Init).Node := PE_Unanchored'Unchecked_Access; Stack (Stack_Init).Cursor := 0; end if; Stack_Ptr := Stack_Init; Stack_Base := Stack_Ptr; Cursor := 0; Node := Pat_P; goto Match; ----------------------------------------- -- Main Pattern Matching State Control -- ----------------------------------------- -- This is a state machine which uses gotos to change state. The -- initial state is Match, to initiate the matching of the first -- element, so the goto Match above starts the match. In the -- following descriptions, we indicate the global values that -- are relevant for the state transition. -- Come here if entire match fails <<Match_Fail>> Dout ("match fails"); New_Line; Start := 0; Stop := 0; return; -- Come here if entire match succeeds -- Cursor current position in subject string <<Match_Succeed>> Dout ("match succeeds"); Start := Stack (Stack_Init).Cursor + 1; Stop := Cursor; Dout ("first matched character index = " & Start); Dout ("last matched character index = " & Stop); Dout ("matched substring = " & Image (Subject (Start .. Stop))); -- Scan history stack for deferred assignments or writes if Assign_OnM then for S in Stack'First .. Stack_Ptr loop if Stack (S).Node = CP_Assign'Access then declare Inner_Base : constant Stack_Range := Stack (S + 1).Cursor; Special_Entry : constant Stack_Range := Inner_Base - 1; Node_OnM : constant PE_Ptr := Stack (Special_Entry).Node; Start : constant Natural := Stack (Special_Entry).Cursor + 1; Stop : constant Natural := Stack (S).Cursor; begin if Node_OnM.Pcode = PC_Assign_OnM then Set_Unbounded_String (Node_OnM.VP.all, Subject (Start .. Stop)); Dout (Img (Stack (S).Node) & "deferred assignment of " & Image (Subject (Start .. Stop))); elsif Node_OnM.Pcode = PC_Write_OnM then Put_Line (Node_OnM.FP.all, Subject (Start .. Stop)); Dout (Img (Stack (S).Node) & "deferred write of " & Image (Subject (Start .. Stop))); else Logic_Error; end if; end; end if; end loop; end if; New_Line; return; -- Come here if attempt to match current element fails -- Stack_Base current stack base -- Stack_Ptr current stack pointer <<Fail>> Cursor := Stack (Stack_Ptr).Cursor; Node := Stack (Stack_Ptr).Node; Stack_Ptr := Stack_Ptr - 1; if Cursor >= 0 then Dout ("failure, cursor reset to " & Cursor); end if; goto Match; -- Come here if attempt to match current element succeeds -- Cursor current position in subject string -- Node pointer to node successfully matched -- Stack_Base current stack base -- Stack_Ptr current stack pointer <<Succeed>> Dout ("success, cursor = " & Cursor); Node := Node.Pthen; -- Come here to match the next pattern element -- Cursor current position in subject string -- Node pointer to node to be matched -- Stack_Base current stack base -- Stack_Ptr current stack pointer <<Match>> -------------------------------------------------- -- Main Pattern Match Element Matching Routines -- -------------------------------------------------- -- Here is the case statement that processes the current node. The -- processing for each element does one of five things: -- goto Succeed to move to the successor -- goto Match_Succeed if the entire match succeeds -- goto Match_Fail if the entire match fails -- goto Fail to signal failure of current match -- Processing is NOT allowed to fall through case Node.Pcode is -- Cancel when PC_Cancel => Dout (Img (Node) & "matching Cancel"); goto Match_Fail; -- Alternation when PC_Alt => Dout (Img (Node) & "setting up alternative " & Img (Node.Alt)); Push (Node.Alt); Node := Node.Pthen; goto Match; -- Any (one character case) when PC_Any_CH => Dout (Img (Node) & "matching Any", Node.Char); if Cursor < Length and then Subject (Cursor + 1) = Node.Char then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- Any (character set case) when PC_Any_CS => Dout (Img (Node) & "matching Any", Node.CS); if Cursor < Length and then Is_In (Subject (Cursor + 1), Node.CS) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- Any (string function case) when PC_Any_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching Any", S (1 .. L)); if Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- Any (string pointer case) when PC_Any_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching Any", S (1 .. L)); if Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- Arb (initial match) when PC_Arb_X => Dout (Img (Node) & "matching Arb"); Push (Node.Alt); Node := Node.Pthen; goto Match; -- Arb (extension) when PC_Arb_Y => Dout (Img (Node) & "extending Arb"); if Cursor < Length then Cursor := Cursor + 1; Push (Node); goto Succeed; else goto Fail; end if; -- Arbno_S (simple Arbno initialize). This is the node that -- initiates the match of a simple Arbno structure. when PC_Arbno_S => Dout (Img (Node) & "setting up Arbno alternative " & Img (Node.Alt)); Push (Node.Alt); Node := Node.Pthen; goto Match; -- Arbno_X (Arbno initialize). This is the node that initiates -- the match of a complex Arbno structure. when PC_Arbno_X => Dout (Img (Node) & "setting up Arbno alternative " & Img (Node.Alt)); Push (Node.Alt); Node := Node.Pthen; goto Match; -- Arbno_Y (Arbno rematch). This is the node that is executed -- following successful matching of one instance of a complex -- Arbno pattern. when PC_Arbno_Y => declare Null_Match : constant Boolean := Cursor = Stack (Stack_Base - 1).Cursor; begin Dout (Img (Node) & "extending Arbno"); Pop_Region; -- If arbno extension matched null, then immediately fail if Null_Match then Dout ("Arbno extension matched null, so fails"); goto Fail; end if; -- Here we must do a stack check to make sure enough stack -- is left. This check will happen once for each instance of -- the Arbno pattern that is matched. The Nat field of a -- PC_Arbno pattern contains the maximum stack entries needed -- for the Arbno with one instance and the successor pattern if Stack_Ptr + Node.Nat >= Stack'Last then raise Pattern_Stack_Overflow; end if; goto Succeed; end; -- Assign. If this node is executed, it means the assign-on-match -- or write-on-match operation will not happen after all, so we -- is propagate the failure, removing the PC_Assign node. when PC_Assign => Dout (Img (Node) & "deferred assign/write cancelled"); goto Fail; -- Assign immediate. This node performs the actual assignment when PC_Assign_Imm => Dout (Img (Node) & "executing immediate assignment of " & Image (Subject (Stack (Stack_Base - 1).Cursor + 1 .. Cursor))); Set_Unbounded_String (Node.VP.all, Subject (Stack (Stack_Base - 1).Cursor + 1 .. Cursor)); Pop_Region; goto Succeed; -- Assign on match. This node sets up for the eventual assignment when PC_Assign_OnM => Dout (Img (Node) & "registering deferred assignment"); Stack (Stack_Base - 1).Node := Node; Push (CP_Assign'Access); Pop_Region; Assign_OnM := True; goto Succeed; -- Bal when PC_Bal => Dout (Img (Node) & "matching or extending Bal"); if Cursor >= Length or else Subject (Cursor + 1) = ')' then goto Fail; elsif Subject (Cursor + 1) = '(' then declare Paren_Count : Natural := 1; begin loop Cursor := Cursor + 1; if Cursor >= Length then goto Fail; elsif Subject (Cursor + 1) = '(' then Paren_Count := Paren_Count + 1; elsif Subject (Cursor + 1) = ')' then Paren_Count := Paren_Count - 1; exit when Paren_Count = 0; end if; end loop; end; end if; Cursor := Cursor + 1; Push (Node); goto Succeed; -- Break (one character case) when PC_Break_CH => Dout (Img (Node) & "matching Break", Node.Char); while Cursor < Length loop if Subject (Cursor + 1) = Node.Char then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- Break (character set case) when PC_Break_CS => Dout (Img (Node) & "matching Break", Node.CS); while Cursor < Length loop if Is_In (Subject (Cursor + 1), Node.CS) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- Break (string function case) when PC_Break_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching Break", S (1 .. L)); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- Break (string pointer case) when PC_Break_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching Break", S (1 .. L)); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- BreakX (one character case) when PC_BreakX_CH => Dout (Img (Node) & "matching BreakX", Node.Char); while Cursor < Length loop if Subject (Cursor + 1) = Node.Char then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- BreakX (character set case) when PC_BreakX_CS => Dout (Img (Node) & "matching BreakX", Node.CS); while Cursor < Length loop if Is_In (Subject (Cursor + 1), Node.CS) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; -- BreakX (string function case) when PC_BreakX_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching BreakX", S (1 .. L)); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- BreakX (string pointer case) when PC_BreakX_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching BreakX", S (1 .. L)); while Cursor < Length loop if Is_In (Subject (Cursor + 1), S (1 .. L)) then goto Succeed; else Cursor := Cursor + 1; end if; end loop; goto Fail; end; -- BreakX_X (BreakX extension). See section on "Compound Pattern -- Structures". This node is the alternative that is stacked -- to skip past the break character and extend the break. when PC_BreakX_X => Dout (Img (Node) & "extending BreakX"); Cursor := Cursor + 1; goto Succeed; -- Character (one character string) when PC_Char => Dout (Img (Node) & "matching '" & Node.Char & '''); if Cursor < Length and then Subject (Cursor + 1) = Node.Char then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- End of Pattern when PC_EOP => if Stack_Base = Stack_Init then Dout ("end of pattern"); goto Match_Succeed; -- End of recursive inner match. See separate section on -- handing of recursive pattern matches for details. else Dout ("terminating recursive match"); Node := Stack (Stack_Base - 1).Node; Pop_Region; goto Match; end if; -- Fail when PC_Fail => Dout (Img (Node) & "matching Fail"); goto Fail; -- Fence (built in pattern) when PC_Fence => Dout (Img (Node) & "matching Fence"); Push (CP_Cancel'Access); goto Succeed; -- Fence function node X. This is the node that gets control -- after a successful match of the fenced pattern. when PC_Fence_X => Dout (Img (Node) & "matching Fence function"); Stack_Ptr := Stack_Ptr + 1; Stack (Stack_Ptr).Cursor := Stack_Base; Stack (Stack_Ptr).Node := CP_Fence_Y'Access; Stack_Base := Stack (Stack_Base).Cursor; Region_Level := Region_Level - 1; goto Succeed; -- Fence function node Y. This is the node that gets control on -- a failure that occurs after the fenced pattern has matched. -- Note: the Cursor at this stage is actually the inner stack -- base value. We don't reset this, but we do use it to strip -- off all the entries made by the fenced pattern. when PC_Fence_Y => Dout (Img (Node) & "pattern matched by Fence caused failure"); Stack_Ptr := Cursor - 2; goto Fail; -- Len (integer case) when PC_Len_Nat => Dout (Img (Node) & "matching Len", Node.Nat); if Cursor + Node.Nat > Length then goto Fail; else Cursor := Cursor + Node.Nat; goto Succeed; end if; -- Len (Integer function case) when PC_Len_NF => declare N : constant Natural := Node.NF.all; begin Dout (Img (Node) & "matching Len", N); if Cursor + N > Length then goto Fail; else Cursor := Cursor + N; goto Succeed; end if; end; -- Len (integer pointer case) when PC_Len_NP => Dout (Img (Node) & "matching Len", Node.NP.all); if Cursor + Node.NP.all > Length then goto Fail; else Cursor := Cursor + Node.NP.all; goto Succeed; end if; -- NotAny (one character case) when PC_NotAny_CH => Dout (Img (Node) & "matching NotAny", Node.Char); if Cursor < Length and then Subject (Cursor + 1) /= Node.Char then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- NotAny (character set case) when PC_NotAny_CS => Dout (Img (Node) & "matching NotAny", Node.CS); if Cursor < Length and then not Is_In (Subject (Cursor + 1), Node.CS) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; -- NotAny (string function case) when PC_NotAny_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching NotAny", S (1 .. L)); if Cursor < Length and then not Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- NotAny (string pointer case) when PC_NotAny_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching NotAny", S (1 .. L)); if Cursor < Length and then not Is_In (Subject (Cursor + 1), S (1 .. L)) then Cursor := Cursor + 1; goto Succeed; else goto Fail; end if; end; -- NSpan (one character case) when PC_NSpan_CH => Dout (Img (Node) & "matching NSpan", Node.Char); while Cursor < Length and then Subject (Cursor + 1) = Node.Char loop Cursor := Cursor + 1; end loop; goto Succeed; -- NSpan (character set case) when PC_NSpan_CS => Dout (Img (Node) & "matching NSpan", Node.CS); while Cursor < Length and then Is_In (Subject (Cursor + 1), Node.CS) loop Cursor := Cursor + 1; end loop; goto Succeed; -- NSpan (string function case) when PC_NSpan_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching NSpan", S (1 .. L)); while Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) loop Cursor := Cursor + 1; end loop; goto Succeed; end; -- NSpan (string pointer case) when PC_NSpan_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching NSpan", S (1 .. L)); while Cursor < Length and then Is_In (Subject (Cursor + 1), S (1 .. L)) loop Cursor := Cursor + 1; end loop; goto Succeed; end; when PC_Null => Dout (Img (Node) & "matching null"); goto Succeed; -- Pos (integer case) when PC_Pos_Nat => Dout (Img (Node) & "matching Pos", Node.Nat); if Cursor = Node.Nat then goto Succeed; else goto Fail; end if; -- Pos (Integer function case) when PC_Pos_NF => declare N : constant Natural := Node.NF.all; begin Dout (Img (Node) & "matching Pos", N); if Cursor = N then goto Succeed; else goto Fail; end if; end; -- Pos (integer pointer case) when PC_Pos_NP => Dout (Img (Node) & "matching Pos", Node.NP.all); if Cursor = Node.NP.all then goto Succeed; else goto Fail; end if; -- Predicate function when PC_Pred_Func => Dout (Img (Node) & "matching predicate function"); if Node.BF.all then goto Succeed; else goto Fail; end if; -- Region Enter. Initiate new pattern history stack region when PC_R_Enter => Dout (Img (Node) & "starting match of nested pattern"); Stack (Stack_Ptr + 1).Cursor := Cursor; Push_Region; goto Succeed; -- Region Remove node. This is the node stacked by an R_Enter. -- It removes the special format stack entry right underneath, and -- then restores the outer level stack base and signals failure. -- Note: the cursor value at this stage is actually the (negative) -- stack base value for the outer level. when PC_R_Remove => Dout ("failure, match of nested pattern terminated"); Stack_Base := Cursor; Region_Level := Region_Level - 1; Stack_Ptr := Stack_Ptr - 1; goto Fail; -- Region restore node. This is the node stacked at the end of an -- inner level match. Its function is to restore the inner level -- region, so that alternatives in this region can be sought. -- Note: the Cursor at this stage is actually the negative of the -- inner stack base value, which we use to restore the inner region. when PC_R_Restore => Dout ("failure, search for alternatives in nested pattern"); Region_Level := Region_Level + 1; Stack_Base := Cursor; goto Fail; -- Rest when PC_Rest => Dout (Img (Node) & "matching Rest"); Cursor := Length; goto Succeed; -- Initiate recursive match (pattern pointer case) when PC_Rpat => Stack (Stack_Ptr + 1).Node := Node.Pthen; Push_Region; Dout (Img (Node) & "initiating recursive match"); if Stack_Ptr + Node.PP.all.Stk >= Stack_Size then raise Pattern_Stack_Overflow; else Node := Node.PP.all.P; goto Match; end if; -- RPos (integer case) when PC_RPos_Nat => Dout (Img (Node) & "matching RPos", Node.Nat); if Cursor = (Length - Node.Nat) then goto Succeed; else goto Fail; end if; -- RPos (integer function case) when PC_RPos_NF => declare N : constant Natural := Node.NF.all; begin Dout (Img (Node) & "matching RPos", N); if Length - Cursor = N then goto Succeed; else goto Fail; end if; end; -- RPos (integer pointer case) when PC_RPos_NP => Dout (Img (Node) & "matching RPos", Node.NP.all); if Cursor = (Length - Node.NP.all) then goto Succeed; else goto Fail; end if; -- RTab (integer case) when PC_RTab_Nat => Dout (Img (Node) & "matching RTab", Node.Nat); if Cursor <= (Length - Node.Nat) then Cursor := Length - Node.Nat; goto Succeed; else goto Fail; end if; -- RTab (integer function case) when PC_RTab_NF => declare N : constant Natural := Node.NF.all; begin Dout (Img (Node) & "matching RPos", N); if Length - Cursor >= N then Cursor := Length - N; goto Succeed; else goto Fail; end if; end; -- RTab (integer pointer case) when PC_RTab_NP => Dout (Img (Node) & "matching RPos", Node.NP.all); if Cursor <= (Length - Node.NP.all) then Cursor := Length - Node.NP.all; goto Succeed; else goto Fail; end if; -- Cursor assignment when PC_Setcur => Dout (Img (Node) & "matching Setcur"); Node.Var.all := Cursor; goto Succeed; -- Span (one character case) when PC_Span_CH => declare P : Natural := Cursor; begin Dout (Img (Node) & "matching Span", Node.Char); while P < Length and then Subject (P + 1) = Node.Char loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- Span (character set case) when PC_Span_CS => declare P : Natural := Cursor; begin Dout (Img (Node) & "matching Span", Node.CS); while P < Length and then Is_In (Subject (P + 1), Node.CS) loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- Span (string function case) when PC_Span_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; P : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching Span", S (1 .. L)); P := Cursor; while P < Length and then Is_In (Subject (P + 1), S (1 .. L)) loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- Span (string pointer case) when PC_Span_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; P : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching Span", S (1 .. L)); P := Cursor; while P < Length and then Is_In (Subject (P + 1), S (1 .. L)) loop P := P + 1; end loop; if P /= Cursor then Cursor := P; goto Succeed; else goto Fail; end if; end; -- String (two character case) when PC_String_2 => Dout (Img (Node) & "matching " & Image (Node.Str2)); if (Length - Cursor) >= 2 and then Subject (Cursor + 1 .. Cursor + 2) = Node.Str2 then Cursor := Cursor + 2; goto Succeed; else goto Fail; end if; -- String (three character case) when PC_String_3 => Dout (Img (Node) & "matching " & Image (Node.Str3)); if (Length - Cursor) >= 3 and then Subject (Cursor + 1 .. Cursor + 3) = Node.Str3 then Cursor := Cursor + 3; goto Succeed; else goto Fail; end if; -- String (four character case) when PC_String_4 => Dout (Img (Node) & "matching " & Image (Node.Str4)); if (Length - Cursor) >= 4 and then Subject (Cursor + 1 .. Cursor + 4) = Node.Str4 then Cursor := Cursor + 4; goto Succeed; else goto Fail; end if; -- String (five character case) when PC_String_5 => Dout (Img (Node) & "matching " & Image (Node.Str5)); if (Length - Cursor) >= 5 and then Subject (Cursor + 1 .. Cursor + 5) = Node.Str5 then Cursor := Cursor + 5; goto Succeed; else goto Fail; end if; -- String (six character case) when PC_String_6 => Dout (Img (Node) & "matching " & Image (Node.Str6)); if (Length - Cursor) >= 6 and then Subject (Cursor + 1 .. Cursor + 6) = Node.Str6 then Cursor := Cursor + 6; goto Succeed; else goto Fail; end if; -- String (case of more than six characters) when PC_String => declare Len : constant Natural := Node.Str'Length; begin Dout (Img (Node) & "matching " & Image (Node.Str.all)); if (Length - Cursor) >= Len and then Node.Str.all = Subject (Cursor + 1 .. Cursor + Len) then Cursor := Cursor + Len; goto Succeed; else goto Fail; end if; end; -- String (function case) when PC_String_VF => declare U : constant VString := Node.VF.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching " & Image (S (1 .. L))); if (Length - Cursor) >= L and then S (1 .. L) = Subject (Cursor + 1 .. Cursor + L) then Cursor := Cursor + L; goto Succeed; else goto Fail; end if; end; -- String (vstring pointer case) when PC_String_VP => declare U : constant VString := Node.VP.all; S : Big_String_Access; L : Natural; begin Get_String (U, S, L); Dout (Img (Node) & "matching " & Image (S (1 .. L))); if (Length - Cursor) >= L and then S (1 .. L) = Subject (Cursor + 1 .. Cursor + L) then Cursor := Cursor + L; goto Succeed; else goto Fail; end if; end; -- Succeed when PC_Succeed => Dout (Img (Node) & "matching Succeed"); Push (Node); goto Succeed; -- Tab (integer case) when PC_Tab_Nat => Dout (Img (Node) & "matching Tab", Node.Nat); if Cursor <= Node.Nat then Cursor := Node.Nat; goto Succeed; else goto Fail; end if; -- Tab (integer function case) when PC_Tab_NF => declare N : constant Natural := Node.NF.all; begin Dout (Img (Node) & "matching Tab ", N); if Cursor <= N then Cursor := N; goto Succeed; else goto Fail; end if; end; -- Tab (integer pointer case) when PC_Tab_NP => Dout (Img (Node) & "matching Tab ", Node.NP.all); if Cursor <= Node.NP.all then Cursor := Node.NP.all; goto Succeed; else goto Fail; end if; -- Unanchored movement when PC_Unanchored => Dout ("attempting to move anchor point"); -- All done if we tried every position if Cursor > Length then goto Match_Fail; -- Otherwise extend the anchor point, and restack ourself else Cursor := Cursor + 1; Push (Node); goto Succeed; end if; -- Write immediate. This node performs the actual write when PC_Write_Imm => Dout (Img (Node) & "executing immediate write of " & Subject (Stack (Stack_Base - 1).Cursor + 1 .. Cursor)); Put_Line (Node.FP.all, Subject (Stack (Stack_Base - 1).Cursor + 1 .. Cursor)); Pop_Region; goto Succeed; -- Write on match. This node sets up for the eventual write when PC_Write_OnM => Dout (Img (Node) & "registering deferred write"); Stack (Stack_Base - 1).Node := Node; Push (CP_Assign'Access); Pop_Region; Assign_OnM := True; goto Succeed; end case; -- We are NOT allowed to fall though this case statement, since every -- match routine must end by executing a goto to the appropriate point -- in the finite state machine model. pragma Warnings (Off); Logic_Error; pragma Warnings (On); end XMatchD; end GNAT.Spitbol.Patterns;
-- Copyright 2008-2020 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. with Ident; procedure Assign is Q: array (1..5) of Integer := (2, 3, 5, 7, 11); begin Q(1) := Ident (Q(3)); -- START end Assign;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="15"> <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>write_data</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>buf_r</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>buf</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>16</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>64</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>output_r</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>output</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>16</bitwidth> </Value> <direction>1</direction> <if_type>1</if_type> <array_size>64</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>28</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>3</id> <name>_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second class_id="11" tracking_level="0" version="0"> <count>1</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>dct.cpp</first> <second>write_data</second> </first> <second>115</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>41</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.73</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>5</id> <name>indvar_flatten</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>43</item> <item>44</item> <item>45</item> <item>46</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>6</id> <name>r_0</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</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>48</item> <item>49</item> <item>50</item> <item>51</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>7</id> <name>c_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>52</item> <item>53</item> <item>54</item> <item>55</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>8</id> <name>icmp_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</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> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.71</m_delay> <m_topoIndex>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>9</id> <name>add_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>59</item> <item>61</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.85</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>10</id> <name>_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>62</item> <item>63</item> <item>64</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>12</id> <name>r</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName>r</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>66</item> <item>67</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.80</m_delay> <m_topoIndex>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>15</id> <name>icmp_ln117</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</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>68</item> <item>70</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.72</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>16</id> <name>select_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</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> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.18</m_delay> <m_topoIndex>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>17</id> <name>select_ln115_1</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</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> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.18</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>18</id> <name>tmp</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>7</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>78</item> <item>79</item> <item>81</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>19</id> <name>zext_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</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>82</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>13</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>20</id> <name>trunc_ln115</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>83</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>14</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>21</id> <name>shl_ln118_mid2</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>115</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>115</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>85</item> <item>86</item> <item>87</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>15</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>22</id> <name>zext_ln117</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</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>88</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>16</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>26</id> <name>zext_ln118</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</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>89</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>17</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>27</id> <name>add_ln118_1</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>90</item> <item>91</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.85</m_delay> <m_topoIndex>18</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>28</id> <name>zext_ln118_1</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>92</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>19</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>29</id> <name>buf_addr</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>93</item> <item>95</item> <item>96</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>20</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>30</id> <name>buf_load</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>16</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>97</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.29</m_delay> <m_topoIndex>21</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>31</id> <name>add_ln118</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>98</item> <item>99</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.84</m_delay> <m_topoIndex>22</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>32</id> <name>zext_ln118_2</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>100</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>24</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>33</id> <name>output_addr</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>101</item> <item>102</item> <item>103</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>25</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>34</id> <name>output_addr_write_ln118</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>104</item> <item>105</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.29</m_delay> <m_topoIndex>26</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>36</id> <name>c</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>117</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>117</second> </item> </second> </item> </inlineStackInfo> <originalName>c</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>4</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>106</item> <item>107</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.80</m_delay> <m_topoIndex>23</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>37</id> <name>_ln0</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>108</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>27</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>39</id> <name>_ln120</name> <fileName>dct.cpp</fileName> <fileDirectory>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</fileDirectory> <lineNumber>120</lineNumber> <contextFuncName>write_data</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/usr/local/labs/SDS/current/ge46bod/Design_Analysis/lab1</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>dct.cpp</first> <second>write_data</second> </first> <second>120</second> </item> </second> </item> </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> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>28</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>8</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_31"> <Value> <Obj> <type>2</type> <id>42</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>7</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_32"> <Value> <Obj> <type>2</type> <id>47</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="_33"> <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>7</bitwidth> </Value> <const_type>0</const_type> <content>64</content> </item> <item class_id_reference="16" object_id="_34"> <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>7</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_35"> <Value> <Obj> <type>2</type> <id>65</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>1</content> </item> <item class_id_reference="16" object_id="_36"> <Value> <Obj> <type>2</type> <id>69</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>8</content> </item> <item class_id_reference="16" object_id="_37"> <Value> <Obj> <type>2</type> <id>80</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>3</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_38"> <Value> <Obj> <type>2</type> <id>94</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>64</bitwidth> </Value> <const_type>0</const_type> <content>0</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="_39"> <Obj> <type>3</type> <id>4</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> <node_objs> <count>1</count> <item_version>0</item_version> <item>3</item> </node_objs> </item> <item class_id_reference="18" object_id="_40"> <Obj> <type>3</type> <id>11</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> <node_objs> <count>6</count> <item_version>0</item_version> <item>5</item> <item>6</item> <item>7</item> <item>8</item> <item>9</item> <item>10</item> </node_objs> </item> <item class_id_reference="18" object_id="_41"> <Obj> <type>3</type> <id>38</id> <name>WR_Loop_Col</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>20</count> <item_version>0</item_version> <item>12</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>26</item> <item>27</item> <item>28</item> <item>29</item> <item>30</item> <item>31</item> <item>32</item> <item>33</item> <item>34</item> <item>36</item> <item>37</item> </node_objs> </item> <item class_id_reference="18" object_id="_42"> <Obj> <type>3</type> <id>40</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> <node_objs> <count>1</count> <item_version>0</item_version> <item>39</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>60</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_43"> <id>41</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>3</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_44"> <id>43</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_45"> <id>44</id> <edge_type>2</edge_type> <source_obj>4</source_obj> <sink_obj>5</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_46"> <id>45</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>5</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_47"> <id>46</id> <edge_type>2</edge_type> <source_obj>38</source_obj> <sink_obj>5</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_48"> <id>48</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>6</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_49"> <id>49</id> <edge_type>2</edge_type> <source_obj>4</source_obj> <sink_obj>6</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_50"> <id>50</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>6</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_51"> <id>51</id> <edge_type>2</edge_type> <source_obj>38</source_obj> <sink_obj>6</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_52"> <id>52</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>7</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_53"> <id>53</id> <edge_type>2</edge_type> <source_obj>4</source_obj> <sink_obj>7</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_54"> <id>54</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>7</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_55"> <id>55</id> <edge_type>2</edge_type> <source_obj>38</source_obj> <sink_obj>7</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_56"> <id>56</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_57"> <id>58</id> <edge_type>1</edge_type> <source_obj>57</source_obj> <sink_obj>8</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_58"> <id>59</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_59"> <id>61</id> <edge_type>1</edge_type> <source_obj>60</source_obj> <sink_obj>9</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_60"> <id>62</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_61"> <id>63</id> <edge_type>2</edge_type> <source_obj>38</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_62"> <id>64</id> <edge_type>2</edge_type> <source_obj>40</source_obj> <sink_obj>10</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_63"> <id>66</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_64"> <id>67</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_65"> <id>68</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_66"> <id>70</id> <edge_type>1</edge_type> <source_obj>69</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_67"> <id>71</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_68"> <id>72</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_69"> <id>73</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_70"> <id>74</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_71"> <id>75</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_72"> <id>76</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_73"> <id>79</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_74"> <id>81</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_75"> <id>82</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_76"> <id>83</id> <edge_type>1</edge_type> <source_obj>17</source_obj> <sink_obj>20</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_77"> <id>86</id> <edge_type>1</edge_type> <source_obj>20</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_78"> <id>87</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_79"> <id>88</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_80"> <id>89</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_81"> <id>90</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_82"> <id>91</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_83"> <id>92</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_84"> <id>93</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_85"> <id>95</id> <edge_type>1</edge_type> <source_obj>94</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_86"> <id>96</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_87"> <id>97</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_88"> <id>98</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_89"> <id>99</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_90"> <id>100</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_91"> <id>101</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_92"> <id>102</id> <edge_type>1</edge_type> <source_obj>94</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_93"> <id>103</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_94"> <id>104</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_95"> <id>105</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_96"> <id>106</id> <edge_type>1</edge_type> <source_obj>65</source_obj> <sink_obj>36</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_97"> <id>107</id> <edge_type>1</edge_type> <source_obj>16</source_obj> <sink_obj>36</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_98"> <id>108</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_99"> <id>140</id> <edge_type>2</edge_type> <source_obj>4</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_100"> <id>141</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_101"> <id>142</id> <edge_type>2</edge_type> <source_obj>11</source_obj> <sink_obj>38</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_102"> <id>143</id> <edge_type>2</edge_type> <source_obj>38</source_obj> <sink_obj>11</sink_obj> <is_back_edge>1</is_back_edge> </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="_103"> <mId>1</mId> <mTag>write_data</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>66</mMinLatency> <mMaxLatency>66</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_104"> <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>4</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_105"> <mId>3</mId> <mTag>WR_Loop_Row_WR_Loop_Col</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>11</item> <item>38</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>64</mMinTripCount> <mMaxTripCount>64</mMaxTripCount> <mMinLatency>64</mMinLatency> <mMaxLatency>64</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_106"> <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>40</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</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>28</count> <item_version>0</item_version> <item class_id="27" tracking_level="0" version="0"> <first>3</first> <second class_id="28" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>5</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>6</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>7</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>8</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>10</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>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>17</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>18</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>1</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>29</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>31</first> <second> <first>1</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>36</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>3</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>4</first> <second class_id="31" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>38</first> <second> <first>1</first> <second>2</second> </second> </item> <item> <first>40</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="_107"> <region_name>WR_Loop_Row_WR_Loop_Col</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>11</item> <item>38</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>2</pipe_depth> </item> </regions> <dp_fu_nodes class_id="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>
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S I N F O -- -- -- -- B o d y -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ pragma Style_Checks (All_Checks); -- No subprogram ordering check, due to logical grouping with Atree; use Atree; package body Sinfo is use Atree.Unchecked_Access; -- This package is one of the few packages which is allowed to make direct -- references to tree nodes (since it is in the business of providing a -- higher level of tree access which other clients are expected to use and -- which implements checks). use Atree_Private_Part; -- The only reason that we ask for direct access to the private part of -- the tree package is so that we can directly reference the Nkind field -- of nodes table entries. We do this since it helps the efficiency of -- the Sinfo debugging checks considerably (note that when we are checking -- Nkind values, we don't need to check for a valid node reference, because -- we will check that anyway when we reference the field). NT : Nodes.Table_Ptr renames Nodes.Table; -- A short hand abbreviation, useful for the debugging checks ---------------------------- -- Field Access Functions -- ---------------------------- function ABE_Is_Certain (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation); return Flag18 (N); end ABE_Is_Certain; function Abort_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Requeue_Statement); return Flag15 (N); end Abort_Present; function Abortable_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); return Node2 (N); end Abortable_Part; function Abstract_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); return Flag4 (N); end Abstract_Present; function Accept_Handler_Records (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); return List5 (N); end Accept_Handler_Records; function Accept_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); return Node2 (N); end Accept_Statement; function Access_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration); return Node3 (N); end Access_Definition; function Access_To_Subprogram_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition); return Node3 (N); end Access_To_Subprogram_Definition; function Access_Types_To_Process (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); return Elist2 (N); end Access_Types_To_Process; function Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Compound_Statement or else NT (N).Nkind = N_Expression_With_Actions or else NT (N).Nkind = N_Freeze_Entity or else NT (N).Nkind = N_Or_Else); return List1 (N); end Actions; function Activation_Chain_Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Node3 (N); end Activation_Chain_Entity; function Acts_As_Spec (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Subprogram_Body); return Flag4 (N); end Acts_As_Spec; function Actual_Designated_Subtype (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Free_Statement); return Node4 (N); end Actual_Designated_Subtype; function Address_Warning_Posted (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); return Flag18 (N); end Address_Warning_Posted; function Aggregate_Bounds (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); return Node3 (N); end Aggregate_Bounds; function Aliased_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag4 (N); end Aliased_Present; function All_Others (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); return Flag11 (N); end All_Others; function All_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Quantified_Expression or else NT (N).Nkind = N_Use_Type_Clause); return Flag15 (N); end All_Present; function Alternatives (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Case_Expression or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In); return List4 (N); end Alternatives; function Ancestor_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Extension_Aggregate); return Node3 (N); end Ancestor_Part; function Atomic_Sync_Required (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Identifier or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Selected_Component); return Flag14 (N); end Atomic_Sync_Required; function Array_Aggregate (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Representation_Clause); return Node3 (N); end Array_Aggregate; function Aspect_Rep_Item (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification); return Node2 (N); end Aspect_Rep_Item; function Assignment_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind in N_Subexpr); return Flag15 (N); end Assignment_OK; function Associated_Node (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_Selected_Component); return Node4 (N); end Associated_Node; function At_End_Proc (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return Node1 (N); end At_End_Proc; function Attribute_Name (N : Node_Id) return Name_Id is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); return Name2 (N); end Attribute_Name; function Aux_Decls_Node (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Node5 (N); end Aux_Decls_Node; function Backwards_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag6 (N); end Backwards_OK; function Bad_Is_Detected (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); return Flag15 (N); end Bad_Is_Detected; function Body_Required (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Flag13 (N); end Body_Required; function Body_To_Inline (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Declaration); return Node3 (N); end Body_To_Inline; function Box_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Generic_Association); return Flag15 (N); end Box_Present; function By_Ref (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Simple_Return_Statement); return Flag5 (N); end By_Ref; function Char_Literal_Value (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Character_Literal); return Uint2 (N); end Char_Literal_Value; function Chars (N : Node_Id) return Name_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Chars); return Name1 (N); end Chars; function Check_Address_Alignment (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); return Flag11 (N); end Check_Address_Alignment; function Choice_Parameter (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return Node2 (N); end Choice_Parameter; function Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); return List1 (N); end Choices; function Class_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); return Flag6 (N); end Class_Present; function Classifications (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Contract); return Node3 (N); end Classifications; function Cleanup_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); return List5 (N); end Cleanup_Actions; function Comes_From_Extended_Return_Statement (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Simple_Return_Statement); return Flag18 (N); end Comes_From_Extended_Return_Statement; function Compile_Time_Known_Aggregate (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); return Flag18 (N); end Compile_Time_Known_Aggregate; function Component_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return List2 (N); end Component_Associations; function Component_Clauses (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); return List3 (N); end Component_Clauses; function Component_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Constrained_Array_Definition or else NT (N).Nkind = N_Unconstrained_Array_Definition); return Node4 (N); end Component_Definition; function Component_Items (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); return List3 (N); end Component_Items; function Component_List (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Variant); return Node1 (N); end Component_List; function Component_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node1 (N); end Component_Name; function Componentwise_Assignment (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag14 (N); end Componentwise_Assignment; function Condition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Quantified_Expression or else NT (N).Nkind = N_Raise_Constraint_Error or else NT (N).Nkind = N_Raise_Program_Error or else NT (N).Nkind = N_Raise_Storage_Error or else NT (N).Nkind = N_Terminate_Alternative); return Node1 (N); end Condition; function Condition_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Iteration_Scheme); return List3 (N); end Condition_Actions; function Config_Pragmas (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux); return List4 (N); end Config_Pragmas; function Constant_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Object_Declaration); return Flag17 (N); end Constant_Present; function Constraint (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication); return Node3 (N); end Constraint; function Constraints (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Index_Or_Discriminant_Constraint); return List1 (N); end Constraints; function Context_Installed (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag13 (N); end Context_Installed; function Context_Items (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return List1 (N); end Context_Items; function Context_Pending (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Flag16 (N); end Context_Pending; function Contract_Test_Cases (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Contract); return Node2 (N); end Contract_Test_Cases; function Controlling_Argument (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return Node1 (N); end Controlling_Argument; function Conversion_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); return Flag14 (N); end Conversion_OK; function Convert_To_Return_False (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Raise_Expression); return Flag13 (N); end Convert_To_Return_False; function Corresponding_Aspect (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Node3 (N); end Corresponding_Aspect; function Corresponding_Body (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); return Node5 (N); end Corresponding_Body; function Corresponding_Formal_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); return Node3 (N); end Corresponding_Formal_Spec; function Corresponding_Generic_Association (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration); return Node5 (N); end Corresponding_Generic_Association; function Corresponding_Integer_Value (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); return Uint4 (N); end Corresponding_Integer_Value; function Corresponding_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Expression_Function or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_With_Clause); return Node5 (N); end Corresponding_Spec; function Corresponding_Spec_Of_Stub (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Task_Body_Stub); return Node2 (N); end Corresponding_Spec_Of_Stub; function Corresponding_Stub (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); return Node3 (N); end Corresponding_Stub; function Dcheck_Function (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Variant); return Node5 (N); end Dcheck_Function; function Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return List2 (N); end Declarations; function Default_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Node5 (N); end Default_Expression; function Default_Storage_Pool (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux); return Node3 (N); end Default_Storage_Pool; function Default_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration); return Node2 (N); end Default_Name; function Defining_Identifier (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Implicit_Label_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); return Node1 (N); end Defining_Identifier; function Defining_Unit_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); return Node1 (N); end Defining_Unit_Name; function Delay_Alternative (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Timed_Entry_Call); return Node4 (N); end Delay_Alternative; function Delay_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Delay_Alternative); return Node2 (N); end Delay_Statement; function Delta_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); return Node3 (N); end Delta_Expression; function Digits_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Digits_Constraint or else NT (N).Nkind = N_Floating_Point_Definition); return Node2 (N); end Digits_Expression; function Discr_Check_Funcs_Built (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); return Flag11 (N); end Discr_Check_Funcs_Built; function Discrete_Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Variant); return List4 (N); end Discrete_Choices; function Discrete_Range (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Slice); return Node4 (N); end Discrete_Range; function Discrete_Subtype_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification); return Node4 (N); end Discrete_Subtype_Definition; function Discrete_Subtype_Definitions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Constrained_Array_Definition); return List2 (N); end Discrete_Subtype_Definitions; function Discriminant_Specifications (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); return List4 (N); end Discriminant_Specifications; function Discriminant_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Specification); return Node5 (N); end Discriminant_Type; function Do_Accessibility_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); return Flag13 (N); end Do_Accessibility_Check; function Do_Discriminant_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Type_Conversion); return Flag1 (N); end Do_Discriminant_Check; function Do_Division_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Rem); return Flag13 (N); end Do_Division_Check; function Do_Length_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Op_And or else NT (N).Nkind = N_Op_Or or else NT (N).Nkind = N_Op_Xor or else NT (N).Nkind = N_Type_Conversion); return Flag4 (N); end Do_Length_Check; function Do_Overflow_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Case_Expression or else NT (N).Nkind = N_If_Expression or else NT (N).Nkind = N_Type_Conversion); return Flag17 (N); end Do_Overflow_Check; function Do_Range_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag9 (N); end Do_Range_Check; function Do_Storage_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Subprogram_Body); return Flag17 (N); end Do_Storage_Check; function Do_Tag_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Simple_Return_Statement or else NT (N).Nkind = N_Type_Conversion); return Flag13 (N); end Do_Tag_Check; function Elaborate_All_Desirable (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag9 (N); end Elaborate_All_Desirable; function Elaborate_All_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag14 (N); end Elaborate_All_Present; function Elaborate_Desirable (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag11 (N); end Elaborate_Desirable; function Elaborate_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag4 (N); end Elaborate_Present; function Else_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_If_Expression); return List3 (N); end Else_Actions; function Else_Statements (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Selective_Accept); return List4 (N); end Else_Statements; function Elsif_Parts (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_If_Statement); return List3 (N); end Elsif_Parts; function Enclosing_Variant (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Variant); return Node2 (N); end Enclosing_Variant; function End_Label (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Type_Definition or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Task_Definition); return Node4 (N); end End_Label; function End_Span (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_If_Statement); return Uint5 (N); end End_Span; function Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Freeze_Entity or else NT (N).Nkind = N_Freeze_Generic_Entity); return Node4 (N); end Entity; function Entity_Or_Associated_Node (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Freeze_Entity); return Node4 (N); end Entity_Or_Associated_Node; function Entry_Body_Formal_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body); return Node5 (N); end Entry_Body_Formal_Part; function Entry_Call_Alternative (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_Timed_Entry_Call); return Node1 (N); end Entry_Call_Alternative; function Entry_Call_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Alternative); return Node1 (N); end Entry_Call_Statement; function Entry_Direct_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); return Node1 (N); end Entry_Direct_Name; function Entry_Index (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); return Node5 (N); end Entry_Index; function Entry_Index_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body_Formal_Part); return Node4 (N); end Entry_Index_Specification; function Etype (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Has_Etype); return Node5 (N); end Etype; function Exception_Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return List4 (N); end Exception_Choices; function Exception_Handlers (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return List5 (N); end Exception_Handlers; function Exception_Junk (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Subtype_Declaration); return Flag8 (N); end Exception_Junk; function Exception_Label (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Push_Constraint_Error_Label or else NT (N).Nkind = N_Push_Program_Error_Label or else NT (N).Nkind = N_Push_Storage_Error_Label); return Node5 (N); end Exception_Label; function Expansion_Delayed (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return Flag11 (N); end Expansion_Delayed; function Explicit_Actual_Parameter (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); return Node3 (N); end Explicit_Actual_Parameter; function Explicit_Generic_Actual_Parameter (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Association); return Node1 (N); end Explicit_Generic_Actual_Parameter; function Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Case_Expression or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_Code_Statement or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Delay_Relative_Statement or else NT (N).Nkind = N_Delay_Until_Statement or else NT (N).Nkind = N_Discriminant_Association or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Expression_Function or else NT (N).Nkind = N_Expression_With_Actions or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Modular_Type_Definition or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Pragma_Argument_Association or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Raise_Expression or else NT (N).Nkind = N_Raise_Statement or else NT (N).Nkind = N_Simple_Return_Statement or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Expression or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Node3 (N); end Expression; function Expressions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_If_Expression or else NT (N).Nkind = N_Indexed_Component); return List1 (N); end Expressions; function First_Bit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node3 (N); end First_Bit; function First_Inlined_Subprogram (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Node3 (N); end First_Inlined_Subprogram; function First_Name (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag5 (N); end First_Name; function First_Named_Actual (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return Node4 (N); end First_Named_Actual; function First_Real_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); return Node2 (N); end First_Real_Statement; function First_Subtype_Link (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); return Node5 (N); end First_Subtype_Link; function Float_Truncate (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); return Flag11 (N); end Float_Truncate; function Formal_Type_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration); return Node3 (N); end Formal_Type_Definition; function Forwards_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag5 (N); end Forwards_OK; function From_Aspect_Specification (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Pragma); return Flag13 (N); end From_Aspect_Specification; function From_At_End (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Raise_Statement); return Flag4 (N); end From_At_End; function From_At_Mod (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); return Flag4 (N); end From_At_Mod; function From_Conditional_Expression (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_If_Statement); return Flag1 (N); end From_Conditional_Expression; function From_Default (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); return Flag6 (N); end From_Default; function Generalized_Indexing (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Indexed_Component); return Node4 (N); end Generalized_Indexing; function Generic_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); return List3 (N); end Generic_Associations; function Generic_Formal_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration); return List2 (N); end Generic_Formal_Declarations; function Generic_Parent (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Specification); return Node5 (N); end Generic_Parent; function Generic_Parent_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Declaration); return Node4 (N); end Generic_Parent_Type; function Handled_Statement_Sequence (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Node4 (N); end Handled_Statement_Sequence; function Handler_List_Entry (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Node2 (N); end Handler_List_Entry; function Has_Created_Identifier (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Loop_Statement); return Flag15 (N); end Has_Created_Identifier; function Has_Dereference_Action (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Explicit_Dereference); return Flag13 (N); end Has_Dereference_Action; function Has_Dynamic_Length_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag10 (N); end Has_Dynamic_Length_Check; function Has_Dynamic_Range_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind in N_Subexpr); return Flag12 (N); end Has_Dynamic_Range_Check; function Has_Init_Expression (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Flag14 (N); end Has_Init_Expression; function Has_Local_Raise (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return Flag8 (N); end Has_Local_Raise; function Has_No_Elaboration_Code (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Flag17 (N); end Has_No_Elaboration_Code; function Has_Pragma_Suppress_All (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Flag14 (N); end Has_Pragma_Suppress_All; function Has_Private_View (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Character_Literal or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier or else NT (N).Nkind = N_Operator_Symbol); return Flag11 (N); end Has_Private_View; function Has_Relative_Deadline_Pragma (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Definition); return Flag9 (N); end Has_Relative_Deadline_Pragma; function Has_Self_Reference (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return Flag13 (N); end Has_Self_Reference; function Has_SP_Choice (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Variant); return Flag15 (N); end Has_SP_Choice; function Has_Storage_Size_Pragma (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); return Flag5 (N); end Has_Storage_Size_Pragma; function Has_Wide_Character (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); return Flag11 (N); end Has_Wide_Character; function Has_Wide_Wide_Character (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); return Flag13 (N); end Has_Wide_Wide_Character; function Header_Size_Added (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); return Flag11 (N); end Header_Size_Added; function Hidden_By_Use_Clause (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); return Elist4 (N); end Hidden_By_Use_Clause; function High_Bound (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); return Node2 (N); end High_Bound; function Identifier (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Record_Representation_Clause); return Node1 (N); end Identifier; function Implicit_With (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag16 (N); end Implicit_With; function Implicit_With_From_Instantiation (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag12 (N); end Implicit_With_From_Instantiation; function Interface_List (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Single_Protected_Declaration or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); return List2 (N); end Interface_List; function Interface_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Record_Definition); return Flag16 (N); end Interface_Present; function Import_Interface_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Flag16 (N); end Import_Interface_Present; function In_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag15 (N); end In_Present; function Includes_Infinities (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Range); return Flag11 (N); end Includes_Infinities; function Incomplete_View (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); return Node2 (N); end Incomplete_View; function Inherited_Discriminant (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); return Flag13 (N); end Inherited_Discriminant; function Instance_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); return Node5 (N); end Instance_Spec; function Intval (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); return Uint3 (N); end Intval; function Is_Accessibility_Actual (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); return Flag13 (N); end Is_Accessibility_Actual; function Is_Asynchronous_Call_Block (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); return Flag7 (N); end Is_Asynchronous_Call_Block; function Is_Boolean_Aspect (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification); return Flag16 (N); end Is_Boolean_Aspect; function Is_Checked (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); return Flag11 (N); end Is_Checked; function Is_Component_Left_Opnd (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); return Flag13 (N); end Is_Component_Left_Opnd; function Is_Component_Right_Opnd (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); return Flag14 (N); end Is_Component_Right_Opnd; function Is_Controlling_Actual (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag16 (N); end Is_Controlling_Actual; function Is_Disabled (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); return Flag15 (N); end Is_Disabled; function Is_Delayed_Aspect (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Pragma); return Flag14 (N); end Is_Delayed_Aspect; function Is_Dynamic_Coextension (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); return Flag18 (N); end Is_Dynamic_Coextension; function Is_Elsif (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_If_Expression); return Flag13 (N); end Is_Elsif; function Is_Entry_Barrier_Function (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); return Flag8 (N); end Is_Entry_Barrier_Function; function Is_Expanded_Build_In_Place_Call (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call); return Flag11 (N); end Is_Expanded_Build_In_Place_Call; function Is_Finalization_Wrapper (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); return Flag9 (N); end Is_Finalization_Wrapper; function Is_Folded_In_Parser (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); return Flag4 (N); end Is_Folded_In_Parser; function Is_Ignored (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); return Flag9 (N); end Is_Ignored; function Is_In_Discriminant_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Selected_Component); return Flag11 (N); end Is_In_Discriminant_Check; function Is_Inherited (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Flag4 (N); end Is_Inherited; function Is_Machine_Number (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); return Flag11 (N); end Is_Machine_Number; function Is_Null_Loop (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); return Flag16 (N); end Is_Null_Loop; function Is_Overloaded (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag5 (N); end Is_Overloaded; function Is_Power_Of_2_For_Shift (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Expon); return Flag13 (N); end Is_Power_Of_2_For_Shift; function Is_Prefixed_Call (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Selected_Component); return Flag17 (N); end Is_Prefixed_Call; function Is_Protected_Subprogram_Body (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); return Flag7 (N); end Is_Protected_Subprogram_Body; function Is_Static_Coextension (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); return Flag14 (N); end Is_Static_Coextension; function Is_Static_Expression (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag6 (N); end Is_Static_Expression; function Is_Subprogram_Descriptor (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Flag16 (N); end Is_Subprogram_Descriptor; function Is_Task_Allocation_Block (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); return Flag6 (N); end Is_Task_Allocation_Block; function Is_Task_Master (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Flag5 (N); end Is_Task_Master; function Iteration_Scheme (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); return Node2 (N); end Iteration_Scheme; function Iterator_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Quantified_Expression); return Node2 (N); end Iterator_Specification; function Itype (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Itype_Reference); return Node1 (N); end Itype; function Kill_Range_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Flag11 (N); end Kill_Range_Check; function Label_Construct (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Implicit_Label_Declaration); return Node2 (N); end Label_Construct; function Last_Bit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node4 (N); end Last_Bit; function Last_Name (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag6 (N); end Last_Name; function Left_Opnd (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else or else NT (N).Nkind in N_Binary_Op); return Node2 (N); end Left_Opnd; function Library_Unit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_With_Clause); return Node4 (N); end Library_Unit; function Limited_View_Installed (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_With_Clause); return Flag18 (N); end Limited_View_Installed; function Limited_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_With_Clause); return Flag17 (N); end Limited_Present; function Literals (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Type_Definition); return List1 (N); end Literals; function Local_Raise_Not_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return Flag7 (N); end Local_Raise_Not_OK; function Local_Raise_Statements (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); return Elist1 (N); end Local_Raise_Statements; function Loop_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); return List2 (N); end Loop_Actions; function Loop_Parameter_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Quantified_Expression); return Node4 (N); end Loop_Parameter_Specification; function Low_Bound (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); return Node1 (N); end Low_Bound; function Mod_Clause (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); return Node2 (N); end Mod_Clause; function More_Ids (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag5 (N); end More_Ids; function Must_Be_Byte_Aligned (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); return Flag14 (N); end Must_Be_Byte_Aligned; function Must_Not_Freeze (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind in N_Subexpr); return Flag8 (N); end Must_Not_Freeze; function Must_Not_Override (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); return Flag15 (N); end Must_Not_Override; function Must_Override (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); return Flag14 (N); end Must_Override; function Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Raise_Expression or else NT (N).Nkind = N_Raise_Statement or else NT (N).Nkind = N_Requeue_Statement or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Subunit or else NT (N).Nkind = N_Variant_Part or else NT (N).Nkind = N_With_Clause); return Node2 (N); end Name; function Names (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Abort_Statement or else NT (N).Nkind = N_Use_Package_Clause); return List2 (N); end Names; function Next_Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); return Node2 (N); end Next_Entity; function Next_Exit_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exit_Statement); return Node3 (N); end Next_Exit_Statement; function Next_Implicit_With (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Node3 (N); end Next_Implicit_With; function Next_Named_Actual (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); return Node4 (N); end Next_Named_Actual; function Next_Pragma (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Node1 (N); end Next_Pragma; function Next_Rep_Item (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Pragma or else NT (N).Nkind = N_Record_Representation_Clause); return Node5 (N); end Next_Rep_Item; function Next_Use_Clause (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); return Node3 (N); end Next_Use_Clause; function No_Ctrl_Actions (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); return Flag7 (N); end No_Ctrl_Actions; function No_Elaboration_Check (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return Flag14 (N); end No_Elaboration_Check; function No_Entities_Ref_In_Spec (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag8 (N); end No_Entities_Ref_In_Spec; function No_Initialization (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Object_Declaration); return Flag13 (N); end No_Initialization; function No_Minimize_Eliminate (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In); return Flag17 (N); end No_Minimize_Eliminate; function No_Truncation (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Flag17 (N); end No_Truncation; function Non_Aliased_Prefix (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); return Flag18 (N); end Non_Aliased_Prefix; function Null_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_List or else NT (N).Nkind = N_Procedure_Specification or else NT (N).Nkind = N_Record_Definition); return Flag13 (N); end Null_Present; function Null_Excluding_Subtype (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition); return Flag16 (N); end Null_Excluding_Subtype; function Null_Exclusion_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Subtype_Declaration); return Flag11 (N); end Null_Exclusion_Present; function Null_Exclusion_In_Return_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition); return Flag14 (N); end Null_Exclusion_In_Return_Present; function Null_Record_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); return Flag17 (N); end Null_Record_Present; function Object_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); return Node4 (N); end Object_Definition; function Of_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Iterator_Specification); return Flag16 (N); end Of_Present; function Original_Discriminant (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Identifier); return Node2 (N); end Original_Discriminant; function Original_Entity (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal or else NT (N).Nkind = N_Real_Literal); return Node2 (N); end Original_Entity; function Others_Discrete_Choices (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); return List1 (N); end Others_Discrete_Choices; function Out_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag17 (N); end Out_Present; function Parameter_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); return List3 (N); end Parameter_Associations; function Parameter_Specifications (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Specification); return List3 (N); end Parameter_Specifications; function Parameter_Type (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); return Node2 (N); end Parameter_Type; function Parent_Spec (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); return Node4 (N); end Parent_Spec; function Position (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); return Node2 (N); end Position; function Pragma_Argument_Associations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return List2 (N); end Pragma_Argument_Associations; function Pragma_Identifier (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Node4 (N); end Pragma_Identifier; function Pragmas_After (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Terminate_Alternative); return List5 (N); end Pragmas_After; function Pragmas_Before (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Terminate_Alternative or else NT (N).Nkind = N_Triggering_Alternative); return List4 (N); end Pragmas_Before; function Pre_Post_Conditions (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Contract); return Node1 (N); end Pre_Post_Conditions; function Prefix (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Reference or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Slice); return Node3 (N); end Prefix; function Premature_Use (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Incomplete_Type_Declaration); return Node5 (N); end Premature_Use; function Present_Expr (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Variant); return Uint3 (N); end Present_Expr; function Prev_Ids (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); return Flag6 (N); end Prev_Ids; function Print_In_Hex (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); return Flag13 (N); end Print_In_Hex; function Private_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); return List3 (N); end Private_Declarations; function Private_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_With_Clause); return Flag15 (N); end Private_Present; function Procedure_To_Call (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Simple_Return_Statement); return Node2 (N); end Procedure_To_Call; function Proper_Body (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); return Node1 (N); end Proper_Body; function Protected_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration); return Node3 (N); end Protected_Definition; function Protected_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Record_Definition); return Flag6 (N); end Protected_Present; function Raises_Constraint_Error (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); return Flag7 (N); end Raises_Constraint_Error; function Range_Constraint (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Digits_Constraint); return Node4 (N); end Range_Constraint; function Range_Expression (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Range_Constraint); return Node4 (N); end Range_Expression; function Real_Range_Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Floating_Point_Definition or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); return Node4 (N); end Real_Range_Specification; function Realval (N : Node_Id) return Ureal is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); return Ureal3 (N); end Realval; function Reason (N : Node_Id) return Uint is begin pragma Assert (False or else NT (N).Nkind = N_Raise_Constraint_Error or else NT (N).Nkind = N_Raise_Program_Error or else NT (N).Nkind = N_Raise_Storage_Error); return Uint3 (N); end Reason; function Record_Extension_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition); return Node3 (N); end Record_Extension_Part; function Redundant_Use (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier); return Flag13 (N); end Redundant_Use; function Renaming_Exception (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Declaration); return Node2 (N); end Renaming_Exception; function Result_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Function_Specification); return Node4 (N); end Result_Definition; function Return_Object_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Extended_Return_Statement); return List3 (N); end Return_Object_Declarations; function Return_Statement_Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Simple_Return_Statement); return Node5 (N); end Return_Statement_Entity; function Reverse_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification); return Flag15 (N); end Reverse_Present; function Right_Opnd (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else); return Node3 (N); end Right_Opnd; function Rounded_Result (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Type_Conversion); return Flag18 (N); end Rounded_Result; function SCIL_Controlling_Tag (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Dispatching_Call); return Node5 (N); end SCIL_Controlling_Tag; function SCIL_Entity (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Dispatch_Table_Tag_Init or else NT (N).Nkind = N_SCIL_Dispatching_Call or else NT (N).Nkind = N_SCIL_Membership_Test); return Node4 (N); end SCIL_Entity; function SCIL_Tag_Value (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Membership_Test); return Node5 (N); end SCIL_Tag_Value; function SCIL_Target_Prim (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Dispatching_Call); return Node2 (N); end SCIL_Target_Prim; function Scope (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); return Node3 (N); end Scope; function Select_Alternatives (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Selective_Accept); return List1 (N); end Select_Alternatives; function Selector_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Generic_Association or else NT (N).Nkind = N_Parameter_Association or else NT (N).Nkind = N_Selected_Component); return Node2 (N); end Selector_Name; function Selector_Names (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Association); return List1 (N); end Selector_Names; function Shift_Count_OK (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Rotate_Left or else NT (N).Nkind = N_Op_Rotate_Right or else NT (N).Nkind = N_Op_Shift_Left or else NT (N).Nkind = N_Op_Shift_Right or else NT (N).Nkind = N_Op_Shift_Right_Arithmetic); return Flag4 (N); end Shift_Count_OK; function Source_Type (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); return Node1 (N); end Source_Type; function Specification (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Expression_Function or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); return Node1 (N); end Specification; function Split_PPC (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); return Flag17 (N); end Split_PPC; function Statements (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Abortable_Part or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Triggering_Alternative); return List3 (N); end Statements; function Storage_Pool (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Simple_Return_Statement); return Node1 (N); end Storage_Pool; function Subpool_Handle_Name (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); return Node4 (N); end Subpool_Handle_Name; function Strval (N : Node_Id) return String_Id is begin pragma Assert (False or else NT (N).Nkind = N_Operator_Symbol or else NT (N).Nkind = N_String_Literal); return Str3 (N); end Strval; function Subtype_Indication (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Subtype_Declaration); return Node5 (N); end Subtype_Indication; function Suppress_Assignment_Checks (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Object_Declaration); return Flag18 (N); end Suppress_Assignment_Checks; function Suppress_Loop_Warnings (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); return Flag17 (N); end Suppress_Loop_Warnings; function Subtype_Mark (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Type_Conversion); return Node4 (N); end Subtype_Mark; function Subtype_Marks (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Unconstrained_Array_Definition or else NT (N).Nkind = N_Use_Type_Clause); return List2 (N); end Subtype_Marks; function Synchronized_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Record_Definition); return Flag7 (N); end Synchronized_Present; function Tagged_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Incomplete_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); return Flag15 (N); end Tagged_Present; function Target_Type (N : Node_Id) return Entity_Id is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); return Node2 (N); end Target_Type; function Task_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); return Node3 (N); end Task_Definition; function Task_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Record_Definition); return Flag5 (N); end Task_Present; function Then_Actions (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_If_Expression); return List2 (N); end Then_Actions; function Then_Statements (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_If_Statement); return List2 (N); end Then_Statements; function Treat_Fixed_As_Integer (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Op_Rem); return Flag14 (N); end Treat_Fixed_As_Integer; function Triggering_Alternative (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); return Node1 (N); end Triggering_Alternative; function Triggering_Statement (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Triggering_Alternative); return Node1 (N); end Triggering_Statement; function TSS_Elist (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); return Elist3 (N); end TSS_Elist; function Type_Definition (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); return Node3 (N); end Type_Definition; function Uneval_Old_Accept (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Flag7 (N); end Uneval_Old_Accept; function Uneval_Old_Warn (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); return Flag18 (N); end Uneval_Old_Warn; function Unit (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); return Node2 (N); end Unit; function Unknown_Discriminants_Present (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration); return Flag13 (N); end Unknown_Discriminants_Present; function Unreferenced_In_Spec (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Flag7 (N); end Unreferenced_In_Spec; function Variant_Part (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); return Node4 (N); end Variant_Part; function Variants (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Variant_Part); return List1 (N); end Variants; function Visible_Declarations (N : Node_Id) return List_Id is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); return List2 (N); end Visible_Declarations; function Uninitialized_Variable (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration); return Node3 (N); end Uninitialized_Variable; function Used_Operations (N : Node_Id) return Elist_Id is begin pragma Assert (False or else NT (N).Nkind = N_Use_Type_Clause); return Elist5 (N); end Used_Operations; function Was_Originally_Stub (N : Node_Id) return Boolean is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); return Flag13 (N); end Was_Originally_Stub; function Withed_Body (N : Node_Id) return Node_Id is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); return Node1 (N); end Withed_Body; -------------------------- -- Field Set Procedures -- -------------------------- procedure Set_ABE_Is_Certain (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation); Set_Flag18 (N, Val); end Set_ABE_Is_Certain; procedure Set_Abort_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Requeue_Statement); Set_Flag15 (N, Val); end Set_Abort_Present; procedure Set_Abortable_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); Set_Node2_With_Parent (N, Val); end Set_Abortable_Part; procedure Set_Abstract_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); Set_Flag4 (N, Val); end Set_Abstract_Present; procedure Set_Accept_Handler_Records (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); Set_List5 (N, Val); -- semantic field, no parent set end Set_Accept_Handler_Records; procedure Set_Accept_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative); Set_Node2_With_Parent (N, Val); end Set_Accept_Statement; procedure Set_Access_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration); Set_Node3_With_Parent (N, Val); end Set_Access_Definition; procedure Set_Access_To_Subprogram_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition); Set_Node3_With_Parent (N, Val); end Set_Access_To_Subprogram_Definition; procedure Set_Access_Types_To_Process (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); Set_Elist2 (N, Val); -- semantic field, no parent set end Set_Access_Types_To_Process; procedure Set_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Compound_Statement or else NT (N).Nkind = N_Expression_With_Actions or else NT (N).Nkind = N_Freeze_Entity or else NT (N).Nkind = N_Or_Else); Set_List1_With_Parent (N, Val); end Set_Actions; procedure Set_Activation_Chain_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Activation_Chain_Entity; procedure Set_Acts_As_Spec (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Subprogram_Body); Set_Flag4 (N, Val); end Set_Acts_As_Spec; procedure Set_Actual_Designated_Subtype (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Free_Statement); Set_Node4 (N, Val); end Set_Actual_Designated_Subtype; procedure Set_Address_Warning_Posted (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); Set_Flag18 (N, Val); end Set_Address_Warning_Posted; procedure Set_Aggregate_Bounds (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Aggregate_Bounds; procedure Set_Aliased_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag4 (N, Val); end Set_Aliased_Present; procedure Set_All_Others (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); Set_Flag11 (N, Val); end Set_All_Others; procedure Set_All_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Quantified_Expression or else NT (N).Nkind = N_Use_Type_Clause); Set_Flag15 (N, Val); end Set_All_Present; procedure Set_Alternatives (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Expression or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In); Set_List4_With_Parent (N, Val); end Set_Alternatives; procedure Set_Ancestor_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Extension_Aggregate); Set_Node3_With_Parent (N, Val); end Set_Ancestor_Part; procedure Set_Atomic_Sync_Required (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Identifier or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Selected_Component); Set_Flag14 (N, Val); end Set_Atomic_Sync_Required; procedure Set_Array_Aggregate (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Representation_Clause); Set_Node3_With_Parent (N, Val); end Set_Array_Aggregate; procedure Set_Aspect_Rep_Item (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification); Set_Node2 (N, Val); end Set_Aspect_Rep_Item; procedure Set_Assignment_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind in N_Subexpr); Set_Flag15 (N, Val); end Set_Assignment_OK; procedure Set_Associated_Node (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_Selected_Component); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Associated_Node; procedure Set_At_End_Proc (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_Node1 (N, Val); end Set_At_End_Proc; procedure Set_Attribute_Name (N : Node_Id; Val : Name_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); Set_Name2 (N, Val); end Set_Attribute_Name; procedure Set_Aux_Decls_Node (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Node5_With_Parent (N, Val); end Set_Aux_Decls_Node; procedure Set_Backwards_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag6 (N, Val); end Set_Backwards_OK; procedure Set_Bad_Is_Detected (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); Set_Flag15 (N, Val); end Set_Bad_Is_Detected; procedure Set_Body_Required (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Flag13 (N, Val); end Set_Body_Required; procedure Set_Body_To_Inline (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Declaration); Set_Node3 (N, Val); end Set_Body_To_Inline; procedure Set_Box_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Generic_Association); Set_Flag15 (N, Val); end Set_Box_Present; procedure Set_By_Ref (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Simple_Return_Statement); Set_Flag5 (N, Val); end Set_By_Ref; procedure Set_Char_Literal_Value (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Character_Literal); Set_Uint2 (N, Val); end Set_Char_Literal_Value; procedure Set_Chars (N : Node_Id; Val : Name_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Chars); Set_Name1 (N, Val); end Set_Chars; procedure Set_Check_Address_Alignment (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); Set_Flag11 (N, Val); end Set_Check_Address_Alignment; procedure Set_Choice_Parameter (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_Node2_With_Parent (N, Val); end Set_Choice_Parameter; procedure Set_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); Set_List1_With_Parent (N, Val); end Set_Choices; procedure Set_Class_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); Set_Flag6 (N, Val); end Set_Class_Present; procedure Set_Classifications (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Contract); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Classifications; procedure Set_Cleanup_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); Set_List5 (N, Val); -- semantic field, no parent set end Set_Cleanup_Actions; procedure Set_Comes_From_Extended_Return_Statement (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Simple_Return_Statement); Set_Flag18 (N, Val); end Set_Comes_From_Extended_Return_Statement; procedure Set_Compile_Time_Known_Aggregate (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate); Set_Flag18 (N, Val); end Set_Compile_Time_Known_Aggregate; procedure Set_Component_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_List2_With_Parent (N, Val); end Set_Component_Associations; procedure Set_Component_Clauses (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); Set_List3_With_Parent (N, Val); end Set_Component_Clauses; procedure Set_Component_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Constrained_Array_Definition or else NT (N).Nkind = N_Unconstrained_Array_Definition); Set_Node4_With_Parent (N, Val); end Set_Component_Definition; procedure Set_Component_Items (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); Set_List3_With_Parent (N, Val); end Set_Component_Items; procedure Set_Component_List (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Variant); Set_Node1_With_Parent (N, Val); end Set_Component_List; procedure Set_Component_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node1_With_Parent (N, Val); end Set_Component_Name; procedure Set_Componentwise_Assignment (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag14 (N, Val); end Set_Componentwise_Assignment; procedure Set_Condition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Quantified_Expression or else NT (N).Nkind = N_Raise_Constraint_Error or else NT (N).Nkind = N_Raise_Program_Error or else NT (N).Nkind = N_Raise_Storage_Error or else NT (N).Nkind = N_Terminate_Alternative); Set_Node1_With_Parent (N, Val); end Set_Condition; procedure Set_Condition_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_Iteration_Scheme); Set_List3 (N, Val); -- semantic field, no parent set end Set_Condition_Actions; procedure Set_Config_Pragmas (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux); Set_List4_With_Parent (N, Val); end Set_Config_Pragmas; procedure Set_Constant_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Object_Declaration); Set_Flag17 (N, Val); end Set_Constant_Present; procedure Set_Constraint (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication); Set_Node3_With_Parent (N, Val); end Set_Constraint; procedure Set_Constraints (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Index_Or_Discriminant_Constraint); Set_List1_With_Parent (N, Val); end Set_Constraints; procedure Set_Context_Installed (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag13 (N, Val); end Set_Context_Installed; procedure Set_Context_Items (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_List1_With_Parent (N, Val); end Set_Context_Items; procedure Set_Context_Pending (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Flag16 (N, Val); end Set_Context_Pending; procedure Set_Contract_Test_Cases (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Contract); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Contract_Test_Cases; procedure Set_Controlling_Argument (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Controlling_Argument; procedure Set_Conversion_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); Set_Flag14 (N, Val); end Set_Conversion_OK; procedure Set_Convert_To_Return_False (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Raise_Expression); Set_Flag13 (N, Val); end Set_Convert_To_Return_False; procedure Set_Corresponding_Aspect (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Node3 (N, Val); end Set_Corresponding_Aspect; procedure Set_Corresponding_Body (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Corresponding_Body; procedure Set_Corresponding_Formal_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Corresponding_Formal_Spec; procedure Set_Corresponding_Generic_Association (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Corresponding_Generic_Association; procedure Set_Corresponding_Integer_Value (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); Set_Uint4 (N, Val); -- semantic field, no parent set end Set_Corresponding_Integer_Value; procedure Set_Corresponding_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Expression_Function or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_With_Clause); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Corresponding_Spec; procedure Set_Corresponding_Spec_Of_Stub (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Task_Body_Stub); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Corresponding_Spec_Of_Stub; procedure Set_Corresponding_Stub (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); Set_Node3 (N, Val); end Set_Corresponding_Stub; procedure Set_Dcheck_Function (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Variant); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Dcheck_Function; procedure Set_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_List2_With_Parent (N, Val); end Set_Declarations; procedure Set_Default_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Default_Expression; procedure Set_Default_Storage_Pool (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Default_Storage_Pool; procedure Set_Default_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration); Set_Node2_With_Parent (N, Val); end Set_Default_Name; procedure Set_Defining_Identifier (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Implicit_Label_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind = N_Task_Body or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node1_With_Parent (N, Val); end Set_Defining_Identifier; procedure Set_Defining_Unit_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); Set_Node1_With_Parent (N, Val); end Set_Defining_Unit_Name; procedure Set_Delay_Alternative (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Timed_Entry_Call); Set_Node4_With_Parent (N, Val); end Set_Delay_Alternative; procedure Set_Delay_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Delay_Alternative); Set_Node2_With_Parent (N, Val); end Set_Delay_Statement; procedure Set_Delta_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); Set_Node3_With_Parent (N, Val); end Set_Delta_Expression; procedure Set_Digits_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Digits_Constraint or else NT (N).Nkind = N_Floating_Point_Definition); Set_Node2_With_Parent (N, Val); end Set_Digits_Expression; procedure Set_Discr_Check_Funcs_Built (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); Set_Flag11 (N, Val); end Set_Discr_Check_Funcs_Built; procedure Set_Discrete_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Variant); Set_List4_With_Parent (N, Val); end Set_Discrete_Choices; procedure Set_Discrete_Range (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Slice); Set_Node4_With_Parent (N, Val); end Set_Discrete_Range; procedure Set_Discrete_Subtype_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Entry_Index_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification); Set_Node4_With_Parent (N, Val); end Set_Discrete_Subtype_Definition; procedure Set_Discrete_Subtype_Definitions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Constrained_Array_Definition); Set_List2_With_Parent (N, Val); end Set_Discrete_Subtype_Definitions; procedure Set_Discriminant_Specifications (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Full_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); Set_List4_With_Parent (N, Val); end Set_Discriminant_Specifications; procedure Set_Discriminant_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Specification); Set_Node5_With_Parent (N, Val); end Set_Discriminant_Type; procedure Set_Do_Accessibility_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); Set_Flag13 (N, Val); end Set_Do_Accessibility_Check; procedure Set_Do_Discriminant_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Type_Conversion); Set_Flag1 (N, Val); end Set_Do_Discriminant_Check; procedure Set_Do_Division_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Rem); Set_Flag13 (N, Val); end Set_Do_Division_Check; procedure Set_Do_Length_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Op_And or else NT (N).Nkind = N_Op_Or or else NT (N).Nkind = N_Op_Xor or else NT (N).Nkind = N_Type_Conversion); Set_Flag4 (N, Val); end Set_Do_Length_Check; procedure Set_Do_Overflow_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Case_Expression or else NT (N).Nkind = N_If_Expression or else NT (N).Nkind = N_Type_Conversion); Set_Flag17 (N, Val); end Set_Do_Overflow_Check; procedure Set_Do_Range_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag9 (N, Val); end Set_Do_Range_Check; procedure Set_Do_Storage_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Subprogram_Body); Set_Flag17 (N, Val); end Set_Do_Storage_Check; procedure Set_Do_Tag_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Simple_Return_Statement or else NT (N).Nkind = N_Type_Conversion); Set_Flag13 (N, Val); end Set_Do_Tag_Check; procedure Set_Elaborate_All_Desirable (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag9 (N, Val); end Set_Elaborate_All_Desirable; procedure Set_Elaborate_All_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag14 (N, Val); end Set_Elaborate_All_Present; procedure Set_Elaborate_Desirable (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag11 (N, Val); end Set_Elaborate_Desirable; procedure Set_Elaborate_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag4 (N, Val); end Set_Elaborate_Present; procedure Set_Else_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_If_Expression); Set_List3_With_Parent (N, Val); -- semantic field, but needs parents end Set_Else_Actions; procedure Set_Else_Statements (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_If_Statement or else NT (N).Nkind = N_Selective_Accept); Set_List4_With_Parent (N, Val); end Set_Else_Statements; procedure Set_Elsif_Parts (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_If_Statement); Set_List3_With_Parent (N, Val); end Set_Elsif_Parts; procedure Set_Enclosing_Variant (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Variant); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Enclosing_Variant; procedure Set_End_Label (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Type_Definition or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Task_Definition); Set_Node4_With_Parent (N, Val); end Set_End_Label; procedure Set_End_Span (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_If_Statement); Set_Uint5 (N, Val); end Set_End_Span; procedure Set_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Entity or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Freeze_Entity or else NT (N).Nkind = N_Freeze_Generic_Entity); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Entity; procedure Set_Entry_Body_Formal_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body); Set_Node5_With_Parent (N, Val); end Set_Entry_Body_Formal_Part; procedure Set_Entry_Call_Alternative (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Conditional_Entry_Call or else NT (N).Nkind = N_Timed_Entry_Call); Set_Node1_With_Parent (N, Val); end Set_Entry_Call_Alternative; procedure Set_Entry_Call_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Alternative); Set_Node1_With_Parent (N, Val); end Set_Entry_Call_Statement; procedure Set_Entry_Direct_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); Set_Node1_With_Parent (N, Val); end Set_Entry_Direct_Name; procedure Set_Entry_Index (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement); Set_Node5_With_Parent (N, Val); end Set_Entry_Index; procedure Set_Entry_Index_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Body_Formal_Part); Set_Node4_With_Parent (N, Val); end Set_Entry_Index_Specification; procedure Set_Etype (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Has_Etype); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Etype; procedure Set_Exception_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_List4_With_Parent (N, Val); end Set_Exception_Choices; procedure Set_Exception_Handlers (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_List5_With_Parent (N, Val); end Set_Exception_Handlers; procedure Set_Exception_Junk (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Subtype_Declaration); Set_Flag8 (N, Val); end Set_Exception_Junk; procedure Set_Exception_Label (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Push_Constraint_Error_Label or else NT (N).Nkind = N_Push_Program_Error_Label or else NT (N).Nkind = N_Push_Storage_Error_Label); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Exception_Label; procedure Set_Expansion_Delayed (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_Flag11 (N, Val); end Set_Expansion_Delayed; procedure Set_Explicit_Actual_Parameter (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); Set_Node3_With_Parent (N, Val); end Set_Explicit_Actual_Parameter; procedure Set_Explicit_Generic_Actual_Parameter (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Association); Set_Node1_With_Parent (N, Val); end Set_Explicit_Generic_Actual_Parameter; procedure Set_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Case_Expression or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_Code_Statement or else NT (N).Nkind = N_Component_Association or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Delay_Relative_Statement or else NT (N).Nkind = N_Delay_Until_Statement or else NT (N).Nkind = N_Discriminant_Association or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Expression_Function or else NT (N).Nkind = N_Expression_With_Actions or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Modular_Type_Definition or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Pragma_Argument_Association or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Raise_Expression or else NT (N).Nkind = N_Raise_Statement or else NT (N).Nkind = N_Simple_Return_Statement or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Expression or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Node3_With_Parent (N, Val); end Set_Expression; procedure Set_Expressions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Extension_Aggregate or else NT (N).Nkind = N_If_Expression or else NT (N).Nkind = N_Indexed_Component); Set_List1_With_Parent (N, Val); end Set_Expressions; procedure Set_First_Bit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node3_With_Parent (N, Val); end Set_First_Bit; procedure Set_First_Inlined_Subprogram (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Node3 (N, Val); -- semantic field, no parent set end Set_First_Inlined_Subprogram; procedure Set_First_Name (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag5 (N, Val); end Set_First_Name; procedure Set_First_Named_Actual (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_Node4 (N, Val); -- semantic field, no parent set end Set_First_Named_Actual; procedure Set_First_Real_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Handled_Sequence_Of_Statements); Set_Node2 (N, Val); -- semantic field, no parent set end Set_First_Real_Statement; procedure Set_First_Subtype_Link (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); Set_Node5 (N, Val); -- semantic field, no parent set end Set_First_Subtype_Link; procedure Set_Float_Truncate (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Type_Conversion); Set_Flag11 (N, Val); end Set_Float_Truncate; procedure Set_Formal_Type_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration); Set_Node3_With_Parent (N, Val); end Set_Formal_Type_Definition; procedure Set_Forwards_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag5 (N, Val); end Set_Forwards_OK; procedure Set_From_Aspect_Specification (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Pragma); Set_Flag13 (N, Val); end Set_From_Aspect_Specification; procedure Set_From_At_End (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Raise_Statement); Set_Flag4 (N, Val); end Set_From_At_End; procedure Set_From_At_Mod (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Definition_Clause); Set_Flag4 (N, Val); end Set_From_At_Mod; procedure Set_From_Conditional_Expression (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Statement or else NT (N).Nkind = N_If_Statement); Set_Flag1 (N, Val); end Set_From_Conditional_Expression; procedure Set_From_Default (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); Set_Flag6 (N, Val); end Set_From_Default; procedure Set_Generalized_Indexing (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Indexed_Component); Set_Node4 (N, Val); end Set_Generalized_Indexing; procedure Set_Generic_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); Set_List3_With_Parent (N, Val); end Set_Generic_Associations; procedure Set_Generic_Formal_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration); Set_List2_With_Parent (N, Val); end Set_Generic_Formal_Declarations; procedure Set_Generic_Parent (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Procedure_Specification); Set_Node5 (N, Val); end Set_Generic_Parent; procedure Set_Generic_Parent_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Declaration); Set_Node4 (N, Val); end Set_Generic_Parent_Type; procedure Set_Handled_Statement_Sequence (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Entry_Body or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Node4_With_Parent (N, Val); end Set_Handled_Statement_Sequence; procedure Set_Handler_List_Entry (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Node2 (N, Val); end Set_Handler_List_Entry; procedure Set_Has_Created_Identifier (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Loop_Statement); Set_Flag15 (N, Val); end Set_Has_Created_Identifier; procedure Set_Has_Dereference_Action (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Explicit_Dereference); Set_Flag13 (N, Val); end Set_Has_Dereference_Action; procedure Set_Has_Dynamic_Length_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag10 (N, Val); end Set_Has_Dynamic_Length_Check; procedure Set_Has_Dynamic_Range_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Declaration or else NT (N).Nkind in N_Subexpr); Set_Flag12 (N, Val); end Set_Has_Dynamic_Range_Check; procedure Set_Has_Init_Expression (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Flag14 (N, Val); end Set_Has_Init_Expression; procedure Set_Has_Local_Raise (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_Flag8 (N, Val); end Set_Has_Local_Raise; procedure Set_Has_No_Elaboration_Code (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Flag17 (N, Val); end Set_Has_No_Elaboration_Code; procedure Set_Has_Pragma_Suppress_All (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Flag14 (N, Val); end Set_Has_Pragma_Suppress_All; procedure Set_Has_Private_View (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_Character_Literal or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier or else NT (N).Nkind = N_Operator_Symbol); Set_Flag11 (N, Val); end Set_Has_Private_View; procedure Set_Has_Relative_Deadline_Pragma (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Definition); Set_Flag9 (N, Val); end Set_Has_Relative_Deadline_Pragma; procedure Set_Has_Self_Reference (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_Flag13 (N, Val); end Set_Has_Self_Reference; procedure Set_Has_SP_Choice (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Case_Expression_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Variant); Set_Flag15 (N, Val); end Set_Has_SP_Choice; procedure Set_Has_Storage_Size_Pragma (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Task_Definition); Set_Flag5 (N, Val); end Set_Has_Storage_Size_Pragma; procedure Set_Has_Wide_Character (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); Set_Flag11 (N, Val); end Set_Has_Wide_Character; procedure Set_Has_Wide_Wide_Character (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); Set_Flag13 (N, Val); end Set_Has_Wide_Wide_Character; procedure Set_Header_Size_Added (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); Set_Flag11 (N, Val); end Set_Header_Size_Added; procedure Set_Hidden_By_Use_Clause (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); Set_Elist4 (N, Val); end Set_Hidden_By_Use_Clause; procedure Set_High_Bound (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); Set_Node2_With_Parent (N, Val); end Set_High_Bound; procedure Set_Identifier (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_At_Clause or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Label or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Record_Representation_Clause); Set_Node1_With_Parent (N, Val); end Set_Identifier; procedure Set_Implicit_With (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag16 (N, Val); end Set_Implicit_With; procedure Set_Implicit_With_From_Instantiation (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag12 (N, Val); end Set_Implicit_With_From_Instantiation; procedure Set_Interface_List (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_Single_Protected_Declaration or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); Set_List2_With_Parent (N, Val); end Set_Interface_List; procedure Set_Interface_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Record_Definition); Set_Flag16 (N, Val); end Set_Interface_Present; procedure Set_Import_Interface_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Flag16 (N, Val); end Set_Import_Interface_Present; procedure Set_In_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag15 (N, Val); end Set_In_Present; procedure Set_Includes_Infinities (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Range); Set_Flag11 (N, Val); end Set_Includes_Infinities; procedure Set_Incomplete_View (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); Set_Node2 (N, Val); -- semantic field, no Parent set end Set_Incomplete_View; procedure Set_Inherited_Discriminant (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); Set_Flag13 (N, Val); end Set_Inherited_Discriminant; procedure Set_Instance_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Procedure_Instantiation); Set_Node5 (N, Val); -- semantic field, no Parent set end Set_Instance_Spec; procedure Set_Intval (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); Set_Uint3 (N, Val); end Set_Intval; procedure Set_Is_Accessibility_Actual (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); Set_Flag13 (N, Val); end Set_Is_Accessibility_Actual; procedure Set_Is_Asynchronous_Call_Block (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); Set_Flag7 (N, Val); end Set_Is_Asynchronous_Call_Block; procedure Set_Is_Boolean_Aspect (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification); Set_Flag16 (N, Val); end Set_Is_Boolean_Aspect; procedure Set_Is_Checked (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); Set_Flag11 (N, Val); end Set_Is_Checked; procedure Set_Is_Component_Left_Opnd (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); Set_Flag13 (N, Val); end Set_Is_Component_Left_Opnd; procedure Set_Is_Component_Right_Opnd (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Concat); Set_Flag14 (N, Val); end Set_Is_Component_Right_Opnd; procedure Set_Is_Controlling_Actual (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag16 (N, Val); end Set_Is_Controlling_Actual; procedure Set_Is_Delayed_Aspect (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Pragma); Set_Flag14 (N, Val); end Set_Is_Delayed_Aspect; procedure Set_Is_Disabled (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); Set_Flag15 (N, Val); end Set_Is_Disabled; procedure Set_Is_Dynamic_Coextension (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); Set_Flag18 (N, Val); end Set_Is_Dynamic_Coextension; procedure Set_Is_Elsif (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_If_Expression); Set_Flag13 (N, Val); end Set_Is_Elsif; procedure Set_Is_Entry_Barrier_Function (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); Set_Flag8 (N, Val); end Set_Is_Entry_Barrier_Function; procedure Set_Is_Expanded_Build_In_Place_Call (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call); Set_Flag11 (N, Val); end Set_Is_Expanded_Build_In_Place_Call; procedure Set_Is_Finalization_Wrapper (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); Set_Flag9 (N, Val); end Set_Is_Finalization_Wrapper; procedure Set_Is_Folded_In_Parser (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_String_Literal); Set_Flag4 (N, Val); end Set_Is_Folded_In_Parser; procedure Set_Is_Ignored (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); Set_Flag9 (N, Val); end Set_Is_Ignored; procedure Set_Is_In_Discriminant_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Selected_Component); Set_Flag11 (N, Val); end Set_Is_In_Discriminant_Check; procedure Set_Is_Inherited (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Flag4 (N, Val); end Set_Is_Inherited; procedure Set_Is_Machine_Number (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); Set_Flag11 (N, Val); end Set_Is_Machine_Number; procedure Set_Is_Null_Loop (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); Set_Flag16 (N, Val); end Set_Is_Null_Loop; procedure Set_Is_Overloaded (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag5 (N, Val); end Set_Is_Overloaded; procedure Set_Is_Power_Of_2_For_Shift (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Expon); Set_Flag13 (N, Val); end Set_Is_Power_Of_2_For_Shift; procedure Set_Is_Prefixed_Call (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Selected_Component); Set_Flag17 (N, Val); end Set_Is_Prefixed_Call; procedure Set_Is_Protected_Subprogram_Body (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subprogram_Body); Set_Flag7 (N, Val); end Set_Is_Protected_Subprogram_Body; procedure Set_Is_Static_Coextension (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); Set_Flag14 (N, Val); end Set_Is_Static_Coextension; procedure Set_Is_Static_Expression (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag6 (N, Val); end Set_Is_Static_Expression; procedure Set_Is_Subprogram_Descriptor (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Flag16 (N, Val); end Set_Is_Subprogram_Descriptor; procedure Set_Is_Task_Allocation_Block (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement); Set_Flag6 (N, Val); end Set_Is_Task_Allocation_Block; procedure Set_Is_Task_Master (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Block_Statement or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Flag5 (N, Val); end Set_Is_Task_Master; procedure Set_Iteration_Scheme (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); Set_Node2_With_Parent (N, Val); end Set_Iteration_Scheme; procedure Set_Iterator_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Quantified_Expression); Set_Node2_With_Parent (N, Val); end Set_Iterator_Specification; procedure Set_Itype (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Itype_Reference); Set_Node1 (N, Val); -- no parent, semantic field end Set_Itype; procedure Set_Kill_Range_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Flag11 (N, Val); end Set_Kill_Range_Check; procedure Set_Label_Construct (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Implicit_Label_Declaration); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Label_Construct; procedure Set_Last_Bit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node4_With_Parent (N, Val); end Set_Last_Bit; procedure Set_Last_Name (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag6 (N, Val); end Set_Last_Name; procedure Set_Left_Opnd (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else or else NT (N).Nkind in N_Binary_Op); Set_Node2_With_Parent (N, Val); end Set_Left_Opnd; procedure Set_Library_Unit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Package_Body_Stub or else NT (N).Nkind = N_Protected_Body_Stub or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Task_Body_Stub or else NT (N).Nkind = N_With_Clause); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Library_Unit; procedure Set_Limited_View_Installed (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_With_Clause); Set_Flag18 (N, Val); end Set_Limited_View_Installed; procedure Set_Limited_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition or else NT (N).Nkind = N_With_Clause); Set_Flag17 (N, Val); end Set_Limited_Present; procedure Set_Literals (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Enumeration_Type_Definition); Set_List1_With_Parent (N, Val); end Set_Literals; procedure Set_Local_Raise_Not_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_Flag7 (N, Val); end Set_Local_Raise_Not_OK; procedure Set_Local_Raise_Statements (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Handler); Set_Elist1 (N, Val); end Set_Local_Raise_Statements; procedure Set_Loop_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Association); Set_List2 (N, Val); -- semantic field, no parent set end Set_Loop_Actions; procedure Set_Loop_Parameter_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Iteration_Scheme or else NT (N).Nkind = N_Quantified_Expression); Set_Node4_With_Parent (N, Val); end Set_Loop_Parameter_Specification; procedure Set_Low_Bound (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Range or else NT (N).Nkind = N_Real_Range_Specification or else NT (N).Nkind = N_Signed_Integer_Type_Definition); Set_Node1_With_Parent (N, Val); end Set_Low_Bound; procedure Set_Mod_Clause (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Record_Representation_Clause); Set_Node2_With_Parent (N, Val); end Set_Mod_Clause; procedure Set_More_Ids (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag5 (N, Val); end Set_More_Ids; procedure Set_Must_Be_Byte_Aligned (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); Set_Flag14 (N, Val); end Set_Must_Be_Byte_Aligned; procedure Set_Must_Not_Freeze (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind in N_Subexpr); Set_Flag8 (N, Val); end Set_Must_Not_Freeze; procedure Set_Must_Not_Override (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); Set_Flag15 (N, Val); end Set_Must_Not_Override; procedure Set_Must_Override (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Procedure_Specification); Set_Flag14 (N, Val); end Set_Must_Override; procedure Set_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Defining_Program_Unit_Name or else NT (N).Nkind = N_Designator or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Exception_Renaming_Declaration or else NT (N).Nkind = N_Exit_Statement or else NT (N).Nkind = N_Formal_Package_Declaration or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Goto_Statement or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Call_Statement or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Raise_Expression or else NT (N).Nkind = N_Raise_Statement or else NT (N).Nkind = N_Requeue_Statement or else NT (N).Nkind = N_Subprogram_Renaming_Declaration or else NT (N).Nkind = N_Subunit or else NT (N).Nkind = N_Variant_Part or else NT (N).Nkind = N_With_Clause); Set_Node2_With_Parent (N, Val); end Set_Name; procedure Set_Names (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Abort_Statement or else NT (N).Nkind = N_Use_Package_Clause); Set_List2_With_Parent (N, Val); end Set_Names; procedure Set_Next_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Next_Entity; procedure Set_Next_Exit_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exit_Statement); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Next_Exit_Statement; procedure Set_Next_Implicit_With (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Next_Implicit_With; procedure Set_Next_Named_Actual (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Association); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Next_Named_Actual; procedure Set_Next_Pragma (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Next_Pragma; procedure Set_Next_Rep_Item (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Attribute_Definition_Clause or else NT (N).Nkind = N_Enumeration_Representation_Clause or else NT (N).Nkind = N_Pragma or else NT (N).Nkind = N_Record_Representation_Clause); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Next_Rep_Item; procedure Set_Next_Use_Clause (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Use_Package_Clause or else NT (N).Nkind = N_Use_Type_Clause); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Next_Use_Clause; procedure Set_No_Ctrl_Actions (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement); Set_Flag7 (N, Val); end Set_No_Ctrl_Actions; procedure Set_No_Elaboration_Check (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_Flag14 (N, Val); end Set_No_Elaboration_Check; procedure Set_No_Entities_Ref_In_Spec (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag8 (N, Val); end Set_No_Entities_Ref_In_Spec; procedure Set_No_Initialization (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Object_Declaration); Set_Flag13 (N, Val); end Set_No_Initialization; procedure Set_No_Minimize_Eliminate (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In); Set_Flag17 (N, Val); end Set_No_Minimize_Eliminate; procedure Set_No_Truncation (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Flag17 (N, Val); end Set_No_Truncation; procedure Set_Non_Aliased_Prefix (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference); Set_Flag18 (N, Val); end Set_Non_Aliased_Prefix; procedure Set_Null_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_List or else NT (N).Nkind = N_Procedure_Specification or else NT (N).Nkind = N_Record_Definition); Set_Flag13 (N, Val); end Set_Null_Present; procedure Set_Null_Excluding_Subtype (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition); Set_Flag16 (N, Val); end Set_Null_Excluding_Subtype; procedure Set_Null_Exclusion_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Parameter_Specification or else NT (N).Nkind = N_Subtype_Declaration); Set_Flag11 (N, Val); end Set_Null_Exclusion_Present; procedure Set_Null_Exclusion_In_Return_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition); Set_Flag14 (N, Val); end Set_Null_Exclusion_In_Return_Present; procedure Set_Null_Record_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Aggregate or else NT (N).Nkind = N_Extension_Aggregate); Set_Flag17 (N, Val); end Set_Null_Record_Present; procedure Set_Object_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Object_Declaration); Set_Node4_With_Parent (N, Val); end Set_Object_Definition; procedure Set_Of_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Iterator_Specification); Set_Flag16 (N, Val); end Set_Of_Present; procedure Set_Original_Discriminant (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Identifier); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Original_Discriminant; procedure Set_Original_Entity (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal or else NT (N).Nkind = N_Real_Literal); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Original_Entity; procedure Set_Others_Discrete_Choices (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Others_Choice); Set_List1_With_Parent (N, Val); end Set_Others_Discrete_Choices; procedure Set_Out_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag17 (N, Val); end Set_Out_Present; procedure Set_Parameter_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Entry_Call_Statement or else NT (N).Nkind = N_Function_Call or else NT (N).Nkind = N_Procedure_Call_Statement); Set_List3_With_Parent (N, Val); end Set_Parameter_Associations; procedure Set_Parameter_Specifications (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Statement or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Entry_Body_Formal_Part or else NT (N).Nkind = N_Entry_Declaration or else NT (N).Nkind = N_Function_Specification or else NT (N).Nkind = N_Procedure_Specification); Set_List3_With_Parent (N, Val); end Set_Parameter_Specifications; procedure Set_Parameter_Type (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Parameter_Specification); Set_Node2_With_Parent (N, Val); end Set_Parameter_Type; procedure Set_Parent_Spec (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Function_Instantiation or else NT (N).Nkind = N_Generic_Function_Renaming_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Package_Renaming_Declaration or else NT (N).Nkind = N_Generic_Procedure_Renaming_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Package_Instantiation or else NT (N).Nkind = N_Package_Renaming_Declaration or else NT (N).Nkind = N_Procedure_Instantiation or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); Set_Node4 (N, Val); -- semantic field, no parent set end Set_Parent_Spec; procedure Set_Position (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Clause); Set_Node2_With_Parent (N, Val); end Set_Position; procedure Set_Pragma_Argument_Associations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_List2_With_Parent (N, Val); end Set_Pragma_Argument_Associations; procedure Set_Pragma_Identifier (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Node4_With_Parent (N, Val); end Set_Pragma_Identifier; procedure Set_Pragmas_After (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit_Aux or else NT (N).Nkind = N_Terminate_Alternative); Set_List5_With_Parent (N, Val); end Set_Pragmas_After; procedure Set_Pragmas_Before (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Mod_Clause or else NT (N).Nkind = N_Terminate_Alternative or else NT (N).Nkind = N_Triggering_Alternative); Set_List4_With_Parent (N, Val); end Set_Pragmas_Before; procedure Set_Pre_Post_Conditions (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Contract); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Pre_Post_Conditions; procedure Set_Prefix (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Explicit_Dereference or else NT (N).Nkind = N_Indexed_Component or else NT (N).Nkind = N_Reference or else NT (N).Nkind = N_Selected_Component or else NT (N).Nkind = N_Slice); Set_Node3_With_Parent (N, Val); end Set_Prefix; procedure Set_Premature_Use (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Incomplete_Type_Declaration); Set_Node5 (N, Val); end Set_Premature_Use; procedure Set_Present_Expr (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Variant); Set_Uint3 (N, Val); end Set_Present_Expr; procedure Set_Prev_Ids (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Component_Declaration or else NT (N).Nkind = N_Discriminant_Specification or else NT (N).Nkind = N_Exception_Declaration or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Number_Declaration or else NT (N).Nkind = N_Object_Declaration or else NT (N).Nkind = N_Parameter_Specification); Set_Flag6 (N, Val); end Set_Prev_Ids; procedure Set_Print_In_Hex (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Integer_Literal); Set_Flag13 (N, Val); end Set_Print_In_Hex; procedure Set_Private_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); Set_List3_With_Parent (N, Val); end Set_Private_Declarations; procedure Set_Private_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_With_Clause); Set_Flag15 (N, Val); end Set_Private_Present; procedure Set_Procedure_To_Call (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Simple_Return_Statement); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Procedure_To_Call; procedure Set_Proper_Body (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Subunit); Set_Node1_With_Parent (N, Val); end Set_Proper_Body; procedure Set_Protected_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Protected_Type_Declaration or else NT (N).Nkind = N_Single_Protected_Declaration); Set_Node3_With_Parent (N, Val); end Set_Protected_Definition; procedure Set_Protected_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Access_Procedure_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Record_Definition); Set_Flag6 (N, Val); end Set_Protected_Present; procedure Set_Raises_Constraint_Error (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind in N_Subexpr); Set_Flag7 (N, Val); end Set_Raises_Constraint_Error; procedure Set_Range_Constraint (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Delta_Constraint or else NT (N).Nkind = N_Digits_Constraint); Set_Node4_With_Parent (N, Val); end Set_Range_Constraint; procedure Set_Range_Expression (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Range_Constraint); Set_Node4_With_Parent (N, Val); end Set_Range_Expression; procedure Set_Real_Range_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Decimal_Fixed_Point_Definition or else NT (N).Nkind = N_Floating_Point_Definition or else NT (N).Nkind = N_Ordinary_Fixed_Point_Definition); Set_Node4_With_Parent (N, Val); end Set_Real_Range_Specification; procedure Set_Realval (N : Node_Id; Val : Ureal) is begin pragma Assert (False or else NT (N).Nkind = N_Real_Literal); Set_Ureal3 (N, Val); end Set_Realval; procedure Set_Reason (N : Node_Id; Val : Uint) is begin pragma Assert (False or else NT (N).Nkind = N_Raise_Constraint_Error or else NT (N).Nkind = N_Raise_Program_Error or else NT (N).Nkind = N_Raise_Storage_Error); Set_Uint3 (N, Val); end Set_Reason; procedure Set_Record_Extension_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition); Set_Node3_With_Parent (N, Val); end Set_Record_Extension_Part; procedure Set_Redundant_Use (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Attribute_Reference or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Identifier); Set_Flag13 (N, Val); end Set_Redundant_Use; procedure Set_Renaming_Exception (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Exception_Declaration); Set_Node2 (N, Val); end Set_Renaming_Exception; procedure Set_Result_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Function_Definition or else NT (N).Nkind = N_Function_Specification); Set_Node4_With_Parent (N, Val); end Set_Result_Definition; procedure Set_Return_Object_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Extended_Return_Statement); Set_List3_With_Parent (N, Val); end Set_Return_Object_Declarations; procedure Set_Return_Statement_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Simple_Return_Statement); Set_Node5 (N, Val); -- semantic field, no parent set end Set_Return_Statement_Entity; procedure Set_Reverse_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Loop_Parameter_Specification); Set_Flag15 (N, Val); end Set_Reverse_Present; procedure Set_Right_Opnd (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind in N_Op or else NT (N).Nkind = N_And_Then or else NT (N).Nkind = N_In or else NT (N).Nkind = N_Not_In or else NT (N).Nkind = N_Or_Else); Set_Node3_With_Parent (N, Val); end Set_Right_Opnd; procedure Set_Rounded_Result (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Type_Conversion); Set_Flag18 (N, Val); end Set_Rounded_Result; procedure Set_SCIL_Controlling_Tag (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Dispatching_Call); Set_Node5 (N, Val); -- semantic field, no parent set end Set_SCIL_Controlling_Tag; procedure Set_SCIL_Entity (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Dispatch_Table_Tag_Init or else NT (N).Nkind = N_SCIL_Dispatching_Call or else NT (N).Nkind = N_SCIL_Membership_Test); Set_Node4 (N, Val); -- semantic field, no parent set end Set_SCIL_Entity; procedure Set_SCIL_Tag_Value (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Membership_Test); Set_Node5 (N, Val); -- semantic field, no parent set end Set_SCIL_Tag_Value; procedure Set_SCIL_Target_Prim (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_SCIL_Dispatching_Call); Set_Node2 (N, Val); -- semantic field, no parent set end Set_SCIL_Target_Prim; procedure Set_Scope (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Defining_Character_Literal or else NT (N).Nkind = N_Defining_Identifier or else NT (N).Nkind = N_Defining_Operator_Symbol); Set_Node3 (N, Val); -- semantic field, no parent set end Set_Scope; procedure Set_Select_Alternatives (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Selective_Accept); Set_List1_With_Parent (N, Val); end Set_Select_Alternatives; procedure Set_Selector_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Expanded_Name or else NT (N).Nkind = N_Generic_Association or else NT (N).Nkind = N_Parameter_Association or else NT (N).Nkind = N_Selected_Component); Set_Node2_With_Parent (N, Val); end Set_Selector_Name; procedure Set_Selector_Names (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Discriminant_Association); Set_List1_With_Parent (N, Val); end Set_Selector_Names; procedure Set_Shift_Count_OK (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Rotate_Left or else NT (N).Nkind = N_Op_Rotate_Right or else NT (N).Nkind = N_Op_Shift_Left or else NT (N).Nkind = N_Op_Shift_Right or else NT (N).Nkind = N_Op_Shift_Right_Arithmetic); Set_Flag4 (N, Val); end Set_Shift_Count_OK; procedure Set_Source_Type (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Source_Type; procedure Set_Specification (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Expression_Function or else NT (N).Nkind = N_Formal_Abstract_Subprogram_Declaration or else NT (N).Nkind = N_Formal_Concrete_Subprogram_Declaration or else NT (N).Nkind = N_Generic_Package_Declaration or else NT (N).Nkind = N_Generic_Subprogram_Declaration or else NT (N).Nkind = N_Package_Declaration or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Subprogram_Body_Stub or else NT (N).Nkind = N_Subprogram_Declaration or else NT (N).Nkind = N_Subprogram_Renaming_Declaration); Set_Node1_With_Parent (N, Val); end Set_Specification; procedure Set_Split_PPC (N : Node_Id; Val : Boolean) is begin pragma Assert (False or else NT (N).Nkind = N_Aspect_Specification or else NT (N).Nkind = N_Pragma); Set_Flag17 (N, Val); end Set_Split_PPC; procedure Set_Statements (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Abortable_Part or else NT (N).Nkind = N_Accept_Alternative or else NT (N).Nkind = N_Case_Statement_Alternative or else NT (N).Nkind = N_Delay_Alternative or else NT (N).Nkind = N_Entry_Call_Alternative or else NT (N).Nkind = N_Exception_Handler or else NT (N).Nkind = N_Handled_Sequence_Of_Statements or else NT (N).Nkind = N_Loop_Statement or else NT (N).Nkind = N_Triggering_Alternative); Set_List3_With_Parent (N, Val); end Set_Statements; procedure Set_Storage_Pool (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator or else NT (N).Nkind = N_Extended_Return_Statement or else NT (N).Nkind = N_Free_Statement or else NT (N).Nkind = N_Simple_Return_Statement); Set_Node1 (N, Val); -- semantic field, no parent set end Set_Storage_Pool; procedure Set_Subpool_Handle_Name (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Allocator); Set_Node4_With_Parent (N, Val); end Set_Subpool_Handle_Name; procedure Set_Strval (N : Node_Id; Val : String_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Operator_Symbol or else NT (N).Nkind = N_String_Literal); Set_Str3 (N, Val); end Set_Strval; procedure Set_Subtype_Indication (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Access_To_Object_Definition or else NT (N).Nkind = N_Component_Definition or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Iterator_Specification or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Subtype_Declaration); Set_Node5_With_Parent (N, Val); end Set_Subtype_Indication; procedure Set_Subtype_Mark (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Access_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Object_Declaration or else NT (N).Nkind = N_Object_Renaming_Declaration or else NT (N).Nkind = N_Qualified_Expression or else NT (N).Nkind = N_Subtype_Indication or else NT (N).Nkind = N_Type_Conversion or else NT (N).Nkind = N_Unchecked_Type_Conversion); Set_Node4_With_Parent (N, Val); end Set_Subtype_Mark; procedure Set_Subtype_Marks (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Unconstrained_Array_Definition or else NT (N).Nkind = N_Use_Type_Clause); Set_List2_With_Parent (N, Val); end Set_Subtype_Marks; procedure Set_Suppress_Assignment_Checks (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Assignment_Statement or else NT (N).Nkind = N_Object_Declaration); Set_Flag18 (N, Val); end Set_Suppress_Assignment_Checks; procedure Set_Suppress_Loop_Warnings (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Loop_Statement); Set_Flag17 (N, Val); end Set_Suppress_Loop_Warnings; procedure Set_Synchronized_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Formal_Derived_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Record_Definition); Set_Flag7 (N, Val); end Set_Synchronized_Present; procedure Set_Tagged_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Incomplete_Type_Definition or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Type_Declaration or else NT (N).Nkind = N_Record_Definition); Set_Flag15 (N, Val); end Set_Tagged_Present; procedure Set_Target_Type (N : Node_Id; Val : Entity_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Validate_Unchecked_Conversion); Set_Node2 (N, Val); -- semantic field, no parent set end Set_Target_Type; procedure Set_Task_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Single_Task_Declaration or else NT (N).Nkind = N_Task_Type_Declaration); Set_Node3_With_Parent (N, Val); end Set_Task_Definition; procedure Set_Task_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Derived_Type_Definition or else NT (N).Nkind = N_Record_Definition); Set_Flag5 (N, Val); end Set_Task_Present; procedure Set_Then_Actions (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_If_Expression); Set_List2_With_Parent (N, Val); -- semantic field, but needs parents end Set_Then_Actions; procedure Set_Then_Statements (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Elsif_Part or else NT (N).Nkind = N_If_Statement); Set_List2_With_Parent (N, Val); end Set_Then_Statements; procedure Set_Treat_Fixed_As_Integer (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Op_Divide or else NT (N).Nkind = N_Op_Mod or else NT (N).Nkind = N_Op_Multiply or else NT (N).Nkind = N_Op_Rem); Set_Flag14 (N, Val); end Set_Treat_Fixed_As_Integer; procedure Set_Triggering_Alternative (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Asynchronous_Select); Set_Node1_With_Parent (N, Val); end Set_Triggering_Alternative; procedure Set_Triggering_Statement (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Triggering_Alternative); Set_Node1_With_Parent (N, Val); end Set_Triggering_Statement; procedure Set_TSS_Elist (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Freeze_Entity); Set_Elist3 (N, Val); -- semantic field, no parent set end Set_TSS_Elist; procedure Set_Uneval_Old_Accept (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Flag7 (N, Val); end Set_Uneval_Old_Accept; procedure Set_Uneval_Old_Warn (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Pragma); Set_Flag18 (N, Val); end Set_Uneval_Old_Warn; procedure Set_Type_Definition (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Full_Type_Declaration); Set_Node3_With_Parent (N, Val); end Set_Type_Definition; procedure Set_Unit (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Compilation_Unit); Set_Node2_With_Parent (N, Val); end Set_Unit; procedure Set_Unknown_Discriminants_Present (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Type_Declaration or else NT (N).Nkind = N_Incomplete_Type_Declaration or else NT (N).Nkind = N_Private_Extension_Declaration or else NT (N).Nkind = N_Private_Type_Declaration); Set_Flag13 (N, Val); end Set_Unknown_Discriminants_Present; procedure Set_Unreferenced_In_Spec (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Flag7 (N, Val); end Set_Unreferenced_In_Spec; procedure Set_Variant_Part (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Component_List); Set_Node4_With_Parent (N, Val); end Set_Variant_Part; procedure Set_Variants (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Variant_Part); Set_List1_With_Parent (N, Val); end Set_Variants; procedure Set_Visible_Declarations (N : Node_Id; Val : List_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Specification or else NT (N).Nkind = N_Protected_Definition or else NT (N).Nkind = N_Task_Definition); Set_List2_With_Parent (N, Val); end Set_Visible_Declarations; procedure Set_Uninitialized_Variable (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Formal_Private_Type_Definition or else NT (N).Nkind = N_Private_Extension_Declaration); Set_Node3 (N, Val); end Set_Uninitialized_Variable; procedure Set_Used_Operations (N : Node_Id; Val : Elist_Id) is begin pragma Assert (False or else NT (N).Nkind = N_Use_Type_Clause); Set_Elist5 (N, Val); end Set_Used_Operations; procedure Set_Was_Originally_Stub (N : Node_Id; Val : Boolean := True) is begin pragma Assert (False or else NT (N).Nkind = N_Package_Body or else NT (N).Nkind = N_Protected_Body or else NT (N).Nkind = N_Subprogram_Body or else NT (N).Nkind = N_Task_Body); Set_Flag13 (N, Val); end Set_Was_Originally_Stub; procedure Set_Withed_Body (N : Node_Id; Val : Node_Id) is begin pragma Assert (False or else NT (N).Nkind = N_With_Clause); Set_Node1 (N, Val); end Set_Withed_Body; ------------------------- -- Iterator Procedures -- ------------------------- procedure Next_Entity (N : in out Node_Id) is begin N := Next_Entity (N); end Next_Entity; procedure Next_Named_Actual (N : in out Node_Id) is begin N := Next_Named_Actual (N); end Next_Named_Actual; procedure Next_Rep_Item (N : in out Node_Id) is begin N := Next_Rep_Item (N); end Next_Rep_Item; procedure Next_Use_Clause (N : in out Node_Id) is begin N := Next_Use_Clause (N); end Next_Use_Clause; ------------------ -- End_Location -- ------------------ function End_Location (N : Node_Id) return Source_Ptr is L : constant Uint := End_Span (N); begin if L = No_Uint then return No_Location; else return Source_Ptr (Int (Sloc (N)) + UI_To_Int (L)); end if; end End_Location; -------------------- -- Get_Pragma_Arg -- -------------------- function Get_Pragma_Arg (Arg : Node_Id) return Node_Id is begin if Nkind (Arg) = N_Pragma_Argument_Association then return Expression (Arg); else return Arg; end if; end Get_Pragma_Arg; ---------------------- -- Set_End_Location -- ---------------------- procedure Set_End_Location (N : Node_Id; S : Source_Ptr) is begin Set_End_Span (N, UI_From_Int (Int (S) - Int (Sloc (N)))); end Set_End_Location; -------------- -- Nkind_In -- -------------- function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind) return Boolean is begin return T = V1 or else T = V2; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3 or else T = V4; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3 or else T = V4 or else T = V5; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3 or else T = V4 or else T = V5 or else T = V6; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind; V7 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3 or else T = V4 or else T = V5 or else T = V6 or else T = V7; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind; V7 : Node_Kind; V8 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3 or else T = V4 or else T = V5 or else T = V6 or else T = V7 or else T = V8; end Nkind_In; function Nkind_In (T : Node_Kind; V1 : Node_Kind; V2 : Node_Kind; V3 : Node_Kind; V4 : Node_Kind; V5 : Node_Kind; V6 : Node_Kind; V7 : Node_Kind; V8 : Node_Kind; V9 : Node_Kind) return Boolean is begin return T = V1 or else T = V2 or else T = V3 or else T = V4 or else T = V5 or else T = V6 or else T = V7 or else T = V8 or else T = V9; end Nkind_In; ----------------- -- Pragma_Name -- ----------------- function Pragma_Name (N : Node_Id) return Name_Id is begin return Chars (Pragma_Identifier (N)); end Pragma_Name; end Sinfo;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="15"> <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>conv_read</name> <ret_bitwidth>32</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>9</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>cofm</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>cofm</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>512</bitwidth> </Value> <direction>2</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>ofm_buff0_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ofm_buff0[0]</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>32</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>ofm_buff0_1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ofm_buff0[1]</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>32</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>ofm_buff0_2</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ofm_buff0[2]</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>32</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_5"> <Value> <Obj> <type>1</type> <id>5</id> <name>ofm_buff0_3</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ofm_buff0[3]</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>32</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_6"> <Value> <Obj> <type>1</type> <id>6</id> <name>ofm_buff0_4</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ofm_buff0[4]</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>32</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_7"> <Value> <Obj> <type>1</type> <id>7</id> <name>ofm_buff0_5</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>ofm_buff0[5]</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</direction> <if_type>1</if_type> <array_size>32</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_8"> <Value> <Obj> <type>1</type> <id>8</id> <name>cofm_counter_read</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>cofm_counter</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <direction>0</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="_9"> <Value> <Obj> <type>1</type> <id>9</id> <name>enable</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>enable</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <direction>0</direction> <if_type>0</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>36</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_10"> <Value> <Obj> <type>0</type> <id>11</id> <name>enable_read</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>229</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="10" tracking_level="0" version="0"> <first>D:\Course\mSOC\final</first> <second class_id="11" tracking_level="0" version="0"> <count>1</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>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>229</second> </item> </second> </item> </inlineStackInfo> <originalName>enable</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>58</item> <item>59</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>1</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>12</id> <name>cofm_counter_read_1</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>229</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>229</second> </item> </second> </item> </inlineStackInfo> <originalName>cofm_counter</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>61</item> <item>62</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>2</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>13</id> <name>_ln231</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>231</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>231</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>63</item> <item>64</item> <item>65</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.76</m_delay> <m_topoIndex>3</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>15</id> <name>add_ln233</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>233</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>233</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>66</item> <item>68</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>2.55</m_delay> <m_topoIndex>4</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>16</id> <name>_ln233</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>233</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>233</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>69</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.76</m_delay> <m_topoIndex>5</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>18</id> <name>j_0</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>j</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>70</item> <item>71</item> <item>73</item> <item>74</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>6</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>19</id> <name>icmp_ln233</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>233</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>233</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>75</item> <item>77</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.42</m_delay> <m_topoIndex>7</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>21</id> <name>j</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>233</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>233</second> </item> </second> </item> </inlineStackInfo> <originalName>j</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>6</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>78</item> <item>80</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.82</m_delay> <m_topoIndex>8</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>22</id> <name>_ln233</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>233</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>233</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>81</item> <item>82</item> <item>83</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>9</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>26</id> <name>zext_ln236</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>236</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>236</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>64</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>84</item> </oprand_edges> <opcode>zext</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>10</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>27</id> <name>ofm_buff0_0_addr</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>236</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>236</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>85</item> <item>87</item> <item>88</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>11</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>28</id> <name>ofm_buff0_0_load</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>236</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>236</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>89</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>12</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>29</id> <name>bitcast_ln236</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>236</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>236</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>90</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>23</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>30</id> <name>cofm_read</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>236</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>236</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>512</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>92</item> <item>93</item> </oprand_edges> <opcode>read</opcode> <m_Display>1</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>1</m_isLCDNode> <m_isStartOfPath>1</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>24</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>31</id> <name>ofm_buff0_1_addr</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>237</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>237</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>94</item> <item>95</item> <item>96</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>13</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>32</id> <name>ofm_buff0_1_load</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>237</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>237</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>97</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>14</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>33</id> <name>bitcast_ln237</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>237</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>237</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>98</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>25</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>34</id> <name>ofm_buff0_2_addr</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>238</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>238</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>99</item> <item>100</item> <item>101</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>15</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>35</id> <name>ofm_buff0_2_load</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>238</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>238</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>102</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>16</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>36</id> <name>bitcast_ln238</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>238</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>238</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>103</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>26</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>37</id> <name>ofm_buff0_3_addr</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>239</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>239</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>104</item> <item>105</item> <item>106</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>17</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>38</id> <name>ofm_buff0_3_load</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>239</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>239</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>107</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>18</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>39</id> <name>bitcast_ln239</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>239</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>239</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>108</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>27</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>40</id> <name>ofm_buff0_4_addr</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>240</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>240</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>109</item> <item>110</item> <item>111</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>19</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>41</id> <name>ofm_buff0_4_load</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>240</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>240</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>112</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>20</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>42</id> <name>bitcast_ln240</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>240</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>240</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>113</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>28</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>43</id> <name>ofm_buff0_5_addr</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>241</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>241</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>5</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>114</item> <item>115</item> <item>116</item> </oprand_edges> <opcode>getelementptr</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>21</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>44</id> <name>ofm_buff0_5_load</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>241</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>241</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>117</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>3.25</m_delay> <m_topoIndex>22</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>45</id> <name>bitcast_ln241</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>241</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>241</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>118</item> </oprand_edges> <opcode>bitcast</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>29</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_39"> <Value> <Obj> <type>0</type> <id>46</id> <name>tmp_5</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>241</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>241</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>192</bitwidth> </Value> <oprand_edges> <count>7</count> <item_version>0</item_version> <item>120</item> <item>121</item> <item>122</item> <item>123</item> <item>124</item> <item>125</item> <item>126</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>30</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_40"> <Value> <Obj> <type>0</type> <id>47</id> <name>cofm_b5_addr1516_par</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>241</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>241</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>512</bitwidth> </Value> <oprand_edges> <count>5</count> <item_version>0</item_version> <item>128</item> <item>129</item> <item>130</item> <item>132</item> <item>134</item> </oprand_edges> <opcode>partset</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>31</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_41"> <Value> <Obj> <type>0</type> <id>48</id> <name>cofm_write_ln241</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>241</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>241</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>136</item> <item>137</item> <item>138</item> <item>201</item> <item>2147483647</item> </oprand_edges> <opcode>write</opcode> <m_Display>1</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>1</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>32</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_42"> <Value> <Obj> <type>0</type> <id>50</id> <name>_ln233</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>233</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>233</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>139</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>33</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_43"> <Value> <Obj> <type>0</type> <id>52</id> <name>_ln0</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>140</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>1.76</m_delay> <m_topoIndex>34</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_44"> <Value> <Obj> <type>0</type> <id>54</id> <name>cofm_counter_1</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>229</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>229</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>32</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>141</item> <item>142</item> <item>143</item> <item>144</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>35</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> <item class_id_reference="9" object_id="_45"> <Value> <Obj> <type>0</type> <id>55</id> <name>_ln256</name> <fileName>finalconv_Jan19.cpp</fileName> <fileDirectory>D:\Course\mSOC\final</fileDirectory> <lineNumber>256</lineNumber> <contextFuncName>conv_read</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>D:\Course\mSOC\final</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>finalconv_Jan19.cpp</first> <second>conv_read</second> </first> <second>256</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>ret</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_isStartOfPath>0</m_isStartOfPath> <m_delay>0.00</m_delay> <m_topoIndex>36</m_topoIndex> <m_clusterGroupNumber>-1</m_clusterGroupNumber> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" 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>32</bitwidth> </Value> <const_type>0</const_type> <content>32</content> </item> <item class_id_reference="16" object_id="_47"> <Value> <Obj> <type>2</type> <id>72</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>6</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_48"> <Value> <Obj> <type>2</type> <id>76</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>6</bitwidth> </Value> <const_type>0</const_type> <content>32</content> </item> <item class_id_reference="16" object_id="_49"> <Value> <Obj> <type>2</type> <id>79</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>6</bitwidth> </Value> <const_type>0</const_type> <content>1</content> </item> <item class_id_reference="16" object_id="_50"> <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>64</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_51"> <Value> <Obj> <type>2</type> <id>131</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>0</content> </item> <item class_id_reference="16" object_id="_52"> <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>32</bitwidth> </Value> <const_type>0</const_type> <content>191</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_53"> <Obj> <type>3</type> <id>14</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> <node_objs> <count>3</count> <item_version>0</item_version> <item>11</item> <item>12</item> <item>13</item> </node_objs> </item> <item class_id_reference="18" object_id="_54"> <Obj> <type>3</type> <id>17</id> <name>.preheader.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>2</count> <item_version>0</item_version> <item>15</item> <item>16</item> </node_objs> </item> <item class_id_reference="18" object_id="_55"> <Obj> <type>3</type> <id>23</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>4</count> <item_version>0</item_version> <item>18</item> <item>19</item> <item>21</item> <item>22</item> </node_objs> </item> <item class_id_reference="18" object_id="_56"> <Obj> <type>3</type> <id>51</id> <name>hls_label_7</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>24</count> <item_version>0</item_version> <item>26</item> <item>27</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> </node_objs> </item> <item class_id_reference="18" object_id="_57"> <Obj> <type>3</type> <id>53</id> <name>.loopexit.loopexit</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>52</item> </node_objs> </item> <item class_id_reference="18" object_id="_58"> <Obj> <type>3</type> <id>56</id> <name>.loopexit</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>2</count> <item_version>0</item_version> <item>54</item> <item>55</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>79</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_59"> <id>59</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>11</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_60"> <id>62</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>12</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_61"> <id>63</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_62"> <id>64</id> <edge_type>2</edge_type> <source_obj>56</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_63"> <id>65</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>13</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_64"> <id>66</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_65"> <id>68</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>15</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_66"> <id>69</id> <edge_type>2</edge_type> <source_obj>23</source_obj> <sink_obj>16</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_67"> <id>70</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>18</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_68"> <id>71</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>18</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_69"> <id>73</id> <edge_type>1</edge_type> <source_obj>72</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_70"> <id>74</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>18</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_71"> <id>75</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_72"> <id>77</id> <edge_type>1</edge_type> <source_obj>76</source_obj> <sink_obj>19</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_73"> <id>78</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_74"> <id>80</id> <edge_type>1</edge_type> <source_obj>79</source_obj> <sink_obj>21</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_75"> <id>81</id> <edge_type>1</edge_type> <source_obj>19</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_76"> <id>82</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_77"> <id>83</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>22</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_78"> <id>84</id> <edge_type>1</edge_type> <source_obj>18</source_obj> <sink_obj>26</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_79"> <id>85</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_80"> <id>87</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_81"> <id>88</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>27</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_82"> <id>89</id> <edge_type>1</edge_type> <source_obj>27</source_obj> <sink_obj>28</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_83"> <id>90</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>29</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_84"> <id>93</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>30</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_85"> <id>94</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_86"> <id>95</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_87"> <id>96</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>31</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_88"> <id>97</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_89"> <id>98</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_90"> <id>99</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_91"> <id>100</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_92"> <id>101</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>34</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_93"> <id>102</id> <edge_type>1</edge_type> <source_obj>34</source_obj> <sink_obj>35</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_94"> <id>103</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>36</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_95"> <id>104</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </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> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_97"> <id>106</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>37</sink_obj> <is_back_edge>0</is_back_edge> </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> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_99"> <id>108</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>39</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_100"> <id>109</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_101"> <id>110</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_102"> <id>111</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>40</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_103"> <id>112</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>41</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_104"> <id>113</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>42</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_105"> <id>114</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_106"> <id>115</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_107"> <id>116</id> <edge_type>1</edge_type> <source_obj>26</source_obj> <sink_obj>43</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_108"> <id>117</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>44</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_109"> <id>118</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>45</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_110"> <id>121</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_111"> <id>122</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_112"> <id>123</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_113"> <id>124</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_114"> <id>125</id> <edge_type>1</edge_type> <source_obj>33</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_115"> <id>126</id> <edge_type>1</edge_type> <source_obj>29</source_obj> <sink_obj>46</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_116"> <id>129</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_117"> <id>130</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_118"> <id>132</id> <edge_type>1</edge_type> <source_obj>131</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_119"> <id>134</id> <edge_type>1</edge_type> <source_obj>133</source_obj> <sink_obj>47</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_120"> <id>137</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_121"> <id>138</id> <edge_type>1</edge_type> <source_obj>47</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_122"> <id>139</id> <edge_type>2</edge_type> <source_obj>23</source_obj> <sink_obj>50</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_123"> <id>140</id> <edge_type>2</edge_type> <source_obj>56</source_obj> <sink_obj>52</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_124"> <id>141</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_125"> <id>142</id> <edge_type>2</edge_type> <source_obj>14</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_126"> <id>143</id> <edge_type>1</edge_type> <source_obj>15</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_127"> <id>144</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>54</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_128"> <id>145</id> <edge_type>1</edge_type> <source_obj>54</source_obj> <sink_obj>55</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_129"> <id>194</id> <edge_type>2</edge_type> <source_obj>14</source_obj> <sink_obj>17</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_130"> <id>195</id> <edge_type>2</edge_type> <source_obj>14</source_obj> <sink_obj>56</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_131"> <id>196</id> <edge_type>2</edge_type> <source_obj>17</source_obj> <sink_obj>23</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_132"> <id>197</id> <edge_type>2</edge_type> <source_obj>23</source_obj> <sink_obj>53</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_133"> <id>198</id> <edge_type>2</edge_type> <source_obj>23</source_obj> <sink_obj>51</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_134"> <id>199</id> <edge_type>2</edge_type> <source_obj>51</source_obj> <sink_obj>23</sink_obj> <is_back_edge>1</is_back_edge> </item> <item class_id_reference="20" object_id="_135"> <id>200</id> <edge_type>2</edge_type> <source_obj>53</source_obj> <sink_obj>56</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_136"> <id>201</id> <edge_type>4</edge_type> <source_obj>30</source_obj> <sink_obj>48</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_137"> <id>2147483647</id> <edge_type>1</edge_type> <source_obj>48</source_obj> <sink_obj>30</sink_obj> <is_back_edge>1</is_back_edge> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_138"> <mId>1</mId> <mTag>conv_read</mTag> <mType>0</mType> <sub_regions> <count>4</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>4</item> <item>5</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>1</mMinLatency> <mMaxLatency>67</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_139"> <mId>2</mId> <mTag>Entry</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>14</item> <item>17</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_140"> <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>23</item> <item>51</item> </basic_blocks> <mII>2</mII> <mDepth>3</mDepth> <mMinTripCount>32</mMinTripCount> <mMaxTripCount>32</mMaxTripCount> <mMinLatency>64</mMinLatency> <mMaxLatency>64</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_141"> <mId>4</mId> <mTag>Region 1</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>53</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_142"> <mId>5</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>56</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>0</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>36</count> <item_version>0</item_version> <item class_id="27" tracking_level="0" version="0"> <first>11</first> <second class_id="28" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>13</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>16</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>18</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>26</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>27</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>28</first> <second> <first>1</first> <second>1</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>1</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>33</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>34</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>36</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>39</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>42</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>45</first> <second> <first>2</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>2</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>4</first> <second>0</second> </second> </item> <item> <first>54</first> <second> <first>5</first> <second>0</second> </second> </item> <item> <first>55</first> <second> <first>5</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="29" tracking_level="0" version="0"> <count>6</count> <item_version>0</item_version> <item class_id="30" tracking_level="0" version="0"> <first>14</first> <second class_id="31" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>17</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>23</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>51</first> <second> <first>1</first> <second>3</second> </second> </item> <item> <first>53</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>56</first> <second> <first>3</first> <second>3</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="_143"> <region_name>Loop 1</region_name> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>23</item> <item>51</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>2</interval> <pipe_depth>3</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>
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ADA.WIDE_WIDE_TEXT_IO.ENUMERATION_AUX -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-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. -- -- -- ------------------------------------------------------------------------------ with Ada.Wide_Wide_Text_IO.Generic_Aux; use Ada.Wide_Wide_Text_IO.Generic_Aux; with Ada.Characters.Conversions; use Ada.Characters.Conversions; with Ada.Characters.Handling; use Ada.Characters.Handling; with Interfaces.C_Streams; use Interfaces.C_Streams; with System.WCh_Con; use System.WCh_Con; package body Ada.Wide_Wide_Text_IO.Enumeration_Aux is subtype TFT is Ada.Wide_Wide_Text_IO.File_Type; -- File type required for calls to routines in Aux ----------------------- -- Local Subprograms -- ----------------------- procedure Store_Char (WC : Wide_Wide_Character; Buf : out Wide_Wide_String; Ptr : in out Integer); -- Store a single character in buffer, checking for overflow -- These definitions replace the ones in Ada.Characters.Handling, which -- do not seem to work for some strange not understood reason ??? at -- least in the OS/2 version. function To_Lower (C : Character) return Character; ------------------ -- Get_Enum_Lit -- ------------------ procedure Get_Enum_Lit (File : File_Type; Buf : out Wide_Wide_String; Buflen : out Natural) is ch : int; WC : Wide_Wide_Character; begin Buflen := 0; Load_Skip (TFT (File)); ch := Nextc (TFT (File)); -- Character literal case. If the initial character is a quote, then -- we read as far as we can without backup (see ACVC test CE3905L) if ch = Character'Pos (''') then Get (File, WC); Store_Char (WC, Buf, Buflen); ch := Nextc (TFT (File)); if ch = LM or else ch = EOF then return; end if; Get (File, WC); Store_Char (WC, Buf, Buflen); ch := Nextc (TFT (File)); if ch /= Character'Pos (''') then return; end if; Get (File, WC); Store_Char (WC, Buf, Buflen); -- Similarly for identifiers, read as far as we can, in particular, -- do read a trailing underscore (again see ACVC test CE3905L to -- understand why we do this, although it seems somewhat peculiar). else -- Identifier must start with a letter. Any wide character value -- outside the normal Latin-1 range counts as a letter for this. if ch < 255 and then not Is_Letter (Character'Val (ch)) then return; end if; -- If we do have a letter, loop through the characters quitting on -- the first non-identifier character (note that this includes the -- cases of hitting a line mark or page mark). loop Get (File, WC); Store_Char (WC, Buf, Buflen); ch := Nextc (TFT (File)); exit when ch = EOF; if ch = Character'Pos ('_') then exit when Buf (Buflen) = '_'; elsif ch = Character'Pos (ASCII.ESC) then null; elsif File.WC_Method in WC_Upper_Half_Encoding_Method and then ch > 127 then null; else exit when not Is_Letter (Character'Val (ch)) and then not Is_Digit (Character'Val (ch)); end if; end loop; end if; end Get_Enum_Lit; --------- -- Put -- --------- procedure Put (File : File_Type; Item : Wide_Wide_String; Width : Field; Set : Type_Set) is Actual_Width : constant Integer := Integer'Max (Integer (Width), Item'Length); begin Check_On_One_Line (TFT (File), Actual_Width); if Set = Lower_Case and then Item (Item'First) /= ''' then declare Iteml : Wide_Wide_String (Item'First .. Item'Last); begin for J in Item'Range loop if Is_Character (Item (J)) then Iteml (J) := To_Wide_Wide_Character (To_Lower (To_Character (Item (J)))); else Iteml (J) := Item (J); end if; end loop; Put (File, Iteml); end; else Put (File, Item); end if; for J in 1 .. Actual_Width - Item'Length loop Put (File, ' '); end loop; end Put; ---------- -- Puts -- ---------- procedure Puts (To : out Wide_Wide_String; Item : Wide_Wide_String; Set : Type_Set) is Ptr : Natural; begin if Item'Length > To'Length then raise Layout_Error; else Ptr := To'First; for J in Item'Range loop if Set = Lower_Case and then Item (Item'First) /= ''' and then Is_Character (Item (J)) then To (Ptr) := To_Wide_Wide_Character (To_Lower (To_Character (Item (J)))); else To (Ptr) := Item (J); end if; Ptr := Ptr + 1; end loop; while Ptr <= To'Last loop To (Ptr) := ' '; Ptr := Ptr + 1; end loop; end if; end Puts; ------------------- -- Scan_Enum_Lit -- ------------------- procedure Scan_Enum_Lit (From : Wide_Wide_String; Start : out Natural; Stop : out Natural) is WC : Wide_Wide_Character; -- Processing for Scan_Enum_Lit begin Start := From'First; loop if Start > From'Last then raise End_Error; elsif Is_Character (From (Start)) and then not Is_Blank (To_Character (From (Start))) then exit; else Start := Start + 1; end if; end loop; -- Character literal case. If the initial character is a quote, then -- we read as far as we can without backup (see ACVC test CE3905L -- which is for the analogous case for reading from a file). if From (Start) = ''' then Stop := Start; if Stop = From'Last then raise Data_Error; else Stop := Stop + 1; end if; if From (Stop) in ' ' .. '~' or else From (Stop) >= Wide_Wide_Character'Val (16#80#) then if Stop = From'Last then raise Data_Error; else Stop := Stop + 1; if From (Stop) = ''' then return; end if; end if; end if; raise Data_Error; -- Similarly for identifiers, read as far as we can, in particular, -- do read a trailing underscore (again see ACVC test CE3905L to -- understand why we do this, although it seems somewhat peculiar). else -- Identifier must start with a letter, any wide character outside -- the normal Latin-1 range is considered a letter for this test. if Is_Character (From (Start)) and then not Is_Letter (To_Character (From (Start))) then raise Data_Error; end if; -- If we do have a letter, loop through the characters quitting on -- the first non-identifier character (note that this includes the -- cases of hitting a line mark or page mark). Stop := Start + 1; while Stop < From'Last loop WC := From (Stop + 1); exit when Is_Character (WC) and then not Is_Letter (To_Character (WC)) and then not Is_Letter (To_Character (WC)) and then (WC /= '_' or else From (Stop - 1) = '_'); Stop := Stop + 1; end loop; end if; end Scan_Enum_Lit; ---------------- -- Store_Char -- ---------------- procedure Store_Char (WC : Wide_Wide_Character; Buf : out Wide_Wide_String; Ptr : in out Integer) is begin if Ptr = Buf'Last then raise Data_Error; else Ptr := Ptr + 1; Buf (Ptr) := WC; end if; end Store_Char; -------------- -- To_Lower -- -------------- function To_Lower (C : Character) return Character is begin if C in 'A' .. 'Z' then return Character'Val (Character'Pos (C) + 32); else return C; end if; end To_Lower; end Ada.Wide_Wide_Text_IO.Enumeration_Aux;
with Ada.Text_IO; use Ada.Text_IO; procedure Test_Binomial is function Binomial (N, K : Natural) return Natural is Result : Natural := 1; M : Natural; begin if N < K then raise Constraint_Error; end if; if K > N/2 then -- Use symmetry M := N - K; else M := K; end if; for I in 1..M loop Result := Result * (N - M + I) / I; end loop; return Result; end Binomial; begin for N in 0..17 loop for K in 0..N loop Put (Integer'Image (Binomial (N, K))); end loop; New_Line; end loop; end Test_Binomial;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2020, 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 is a POSIX version of this package where foreign threads are -- recognized. separate (System.Task_Primitives.Operations) package body Specific is ATCB_Key : aliased pthread_key_t; -- Key used to find the Ada Task_Id associated with a thread ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is pragma Warnings (Off, Environment_Task); Result : Interfaces.C.int; begin Result := pthread_key_create (ATCB_Key'Access, null); pragma Assert (Result = 0); end Initialize; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean is begin return pthread_getspecific (ATCB_Key) /= System.Null_Address; end Is_Valid_Task; --------- -- Set -- --------- procedure Set (Self_Id : Task_Id) is Result : Interfaces.C.int; begin Result := pthread_setspecific (ATCB_Key, To_Address (Self_Id)); pragma Assert (Result = 0); end Set; ---------- -- Self -- ---------- -- To make Ada tasks and C threads interoperate better, we have added some -- functionality to Self. Suppose a C main program (with threads) calls an -- Ada procedure and the Ada procedure calls the tasking runtime system. -- Eventually, a call will be made to self. Since the call is not coming -- from an Ada task, there will be no corresponding ATCB. -- What we do in Self is to catch references that do not come from -- recognized Ada tasks, and create an ATCB for the calling thread. -- The new ATCB will be "detached" from the normal Ada task master -- hierarchy, much like the existing implicitly created signal-server -- tasks. function Self return Task_Id is Result : System.Address; begin Result := pthread_getspecific (ATCB_Key); -- If the key value is Null then it is a non-Ada task if Result /= System.Null_Address then return To_Task_Id (Result); else return Register_Foreign_Thread; end if; end Self; end Specific;
with System.Native_Time; with C.winbase; with C.windef; package body System.Native_Real_Time is use type C.windef.WINBOOL; use type C.winnt.LONGLONG; subtype Positive_LONGLONG is C.winnt.LONGLONG range 1 .. C.winnt.LONGLONG'Last; Performance_Counter_Enabled : Boolean; Frequency : Positive_LONGLONG; procedure Initialize; procedure Initialize is Freq : aliased C.winnt.LARGE_INTEGER; begin Performance_Counter_Enabled := C.winbase.QueryPerformanceFrequency (Freq'Access) /= C.windef.FALSE; Frequency := Freq.QuadPart; end Initialize; -- implementation function To_Native_Time (T : Duration) return Native_Time is begin return C.winnt.LONGLONG ( System.Native_Time.Nanosecond_Number'Integer_Value (T)); end To_Native_Time; function To_Duration (T : Native_Time) return Duration is begin return Duration'Fixed_Value (System.Native_Time.Nanosecond_Number (T)); end To_Duration; function Clock return Native_Time is begin if Performance_Counter_Enabled then declare Count : aliased C.winnt.LARGE_INTEGER; begin if C.winbase.QueryPerformanceCounter (Count'Access) = C.windef.FALSE then raise Program_Error; -- ??? else return Count.QuadPart * 1_000_000_000 / Frequency; end if; end; else raise Program_Error; -- ??? end if; end Clock; procedure Delay_Until (T : Native_Time) is Timeout_T : constant Duration := To_Duration (T); Current_T : constant Duration := To_Duration (Clock); D : Duration; begin if Timeout_T > Current_T then D := Timeout_T - Current_T; else D := 0.0; -- always calling Delay_For for abort checking end if; System.Native_Time.Delay_For (D); end Delay_Until; begin Initialize; end System.Native_Real_Time;
with Ada.Streams; package AdaM.a_Type.task_type is type Item is new a_Type.elementary_Type with private; type View is access all Item'Class; -- Forge -- function new_Type (Name : in String := "") return task_type.view; overriding procedure destruct (Self : in out Item); procedure free (Self : in out task_type.view); -- Attributes -- overriding function Id (Self : access Item) return AdaM.Id; overriding function to_Source (Self : in Item) return text_Vectors.Vector; private type Item is new a_Type.elementary_Type with record null; end record; -- Streams -- 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; end AdaM.a_Type.task_type;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E V A L _ F A T -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2006, 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Einfo; use Einfo; with Errout; use Errout; with Sem_Util; use Sem_Util; with Ttypef; use Ttypef; with Targparm; use Targparm; package body Eval_Fat is Radix : constant Int := 2; -- This code is currently only correct for the radix 2 case. We use -- the symbolic value Radix where possible to help in the unlikely -- case of anyone ever having to adjust this code for another value, -- and for documentation purposes. -- Another assumption is that the range of the floating-point type -- is symmetric around zero. type Radix_Power_Table is array (Int range 1 .. 4) of Int; Radix_Powers : constant Radix_Power_Table := (Radix ** 1, Radix ** 2, Radix ** 3, Radix ** 4); ----------------------- -- Local Subprograms -- ----------------------- procedure Decompose (RT : R; X : T; Fraction : out T; Exponent : out UI; Mode : Rounding_Mode := Round); -- Decomposes a non-zero floating-point number into fraction and -- exponent parts. The fraction is in the interval 1.0 / Radix .. -- T'Pred (1.0) and uses Rbase = Radix. -- The result is rounded to a nearest machine number. procedure Decompose_Int (RT : R; X : T; Fraction : out UI; Exponent : out UI; Mode : Rounding_Mode); -- This is similar to Decompose, except that the Fraction value returned -- is an integer representing the value Fraction * Scale, where Scale is -- the value (Radix ** Machine_Mantissa (RT)). The value is obtained by -- using biased rounding (halfway cases round away from zero), round to -- even, a floor operation or a ceiling operation depending on the setting -- of Mode (see corresponding descriptions in Urealp). function Machine_Emin (RT : R) return Int; -- Return value of the Machine_Emin attribute -------------- -- Adjacent -- -------------- function Adjacent (RT : R; X, Towards : T) return T is begin if Towards = X then return X; elsif Towards > X then return Succ (RT, X); else return Pred (RT, X); end if; end Adjacent; ------------- -- Ceiling -- ------------- function Ceiling (RT : R; X : T) return T is XT : constant T := Truncation (RT, X); begin if UR_Is_Negative (X) then return XT; elsif X = XT then return X; else return XT + Ureal_1; end if; end Ceiling; ------------- -- Compose -- ------------- function Compose (RT : R; Fraction : T; Exponent : UI) return T is Arg_Frac : T; Arg_Exp : UI; begin if UR_Is_Zero (Fraction) then return Fraction; else Decompose (RT, Fraction, Arg_Frac, Arg_Exp); return Scaling (RT, Arg_Frac, Exponent); end if; end Compose; --------------- -- Copy_Sign -- --------------- function Copy_Sign (RT : R; Value, Sign : T) return T is pragma Warnings (Off, RT); Result : T; begin Result := abs Value; if UR_Is_Negative (Sign) then return -Result; else return Result; end if; end Copy_Sign; --------------- -- Decompose -- --------------- procedure Decompose (RT : R; X : T; Fraction : out T; Exponent : out UI; Mode : Rounding_Mode := Round) is Int_F : UI; begin Decompose_Int (RT, abs X, Int_F, Exponent, Mode); Fraction := UR_From_Components (Num => Int_F, Den => UI_From_Int (Machine_Mantissa (RT)), Rbase => Radix, Negative => False); if UR_Is_Negative (X) then Fraction := -Fraction; end if; return; end Decompose; ------------------- -- Decompose_Int -- ------------------- -- This procedure should be modified with care, as there are many -- non-obvious details that may cause problems that are hard to -- detect. The cases of positive and negative zeroes are also -- special and should be verified separately. procedure Decompose_Int (RT : R; X : T; Fraction : out UI; Exponent : out UI; Mode : Rounding_Mode) is Base : Int := Rbase (X); N : UI := abs Numerator (X); D : UI := Denominator (X); N_Times_Radix : UI; Even : Boolean; -- True iff Fraction is even Most_Significant_Digit : constant UI := Radix ** (Machine_Mantissa (RT) - 1); Uintp_Mark : Uintp.Save_Mark; -- The code is divided into blocks that systematically release -- intermediate values (this routine generates lots of junk!) begin Calculate_D_And_Exponent_1 : begin Uintp_Mark := Mark; Exponent := Uint_0; -- In cases where Base > 1, the actual denominator is -- Base**D. For cases where Base is a power of Radix, use -- the value 1 for the Denominator and adjust the exponent. -- Note: Exponent has different sign from D, because D is a divisor for Power in 1 .. Radix_Powers'Last loop if Base = Radix_Powers (Power) then Exponent := -D * Power; Base := 0; D := Uint_1; exit; end if; end loop; Release_And_Save (Uintp_Mark, D, Exponent); end Calculate_D_And_Exponent_1; if Base > 0 then Calculate_Exponent : begin Uintp_Mark := Mark; -- For bases that are a multiple of the Radix, divide -- the base by Radix and adjust the Exponent. This will -- help because D will be much smaller and faster to process. -- This occurs for decimal bases on a machine with binary -- floating-point for example. When calculating 1E40, -- with Radix = 2, N will be 93 bits instead of 133. -- N E -- ------ * Radix -- D -- Base -- N E -- = -------------------------- * Radix -- D D -- (Base/Radix) * Radix -- N E-D -- = --------------- * Radix -- D -- (Base/Radix) -- This code is commented out, because it causes numerous -- failures in the regression suite. To be studied ??? while False and then Base > 0 and then Base mod Radix = 0 loop Base := Base / Radix; Exponent := Exponent + D; end loop; Release_And_Save (Uintp_Mark, Exponent); end Calculate_Exponent; -- For remaining bases we must actually compute -- the exponentiation. -- Because the exponentiation can be negative, and D must -- be integer, the numerator is corrected instead. Calculate_N_And_D : begin Uintp_Mark := Mark; if D < 0 then N := N * Base ** (-D); D := Uint_1; else D := Base ** D; end if; Release_And_Save (Uintp_Mark, N, D); end Calculate_N_And_D; Base := 0; end if; -- Now scale N and D so that N / D is a value in the -- interval [1.0 / Radix, 1.0) and adjust Exponent accordingly, -- so the value N / D * Radix ** Exponent remains unchanged. -- Step 1 - Adjust N so N / D >= 1 / Radix, or N = 0 -- N and D are positive, so N / D >= 1 / Radix implies N * Radix >= D. -- This scaling is not possible for N is Uint_0 as there -- is no way to scale Uint_0 so the first digit is non-zero. Calculate_N_And_Exponent : begin Uintp_Mark := Mark; N_Times_Radix := N * Radix; if N /= Uint_0 then while not (N_Times_Radix >= D) loop N := N_Times_Radix; Exponent := Exponent - 1; N_Times_Radix := N * Radix; end loop; end if; Release_And_Save (Uintp_Mark, N, Exponent); end Calculate_N_And_Exponent; -- Step 2 - Adjust D so N / D < 1 -- Scale up D so N / D < 1, so N < D Calculate_D_And_Exponent_2 : begin Uintp_Mark := Mark; while not (N < D) loop -- As N / D >= 1, N / (D * Radix) will be at least 1 / Radix, -- so the result of Step 1 stays valid D := D * Radix; Exponent := Exponent + 1; end loop; Release_And_Save (Uintp_Mark, D, Exponent); end Calculate_D_And_Exponent_2; -- Here the value N / D is in the range [1.0 / Radix .. 1.0) -- Now find the fraction by doing a very simple-minded -- division until enough digits have been computed. -- This division works for all radices, but is only efficient for -- a binary radix. It is just like a manual division algorithm, -- but instead of moving the denominator one digit right, we move -- the numerator one digit left so the numerator and denominator -- remain integral. Fraction := Uint_0; Even := True; Calculate_Fraction_And_N : begin Uintp_Mark := Mark; loop while N >= D loop N := N - D; Fraction := Fraction + 1; Even := not Even; end loop; -- Stop when the result is in [1.0 / Radix, 1.0) exit when Fraction >= Most_Significant_Digit; N := N * Radix; Fraction := Fraction * Radix; Even := True; end loop; Release_And_Save (Uintp_Mark, Fraction, N); end Calculate_Fraction_And_N; Calculate_Fraction_And_Exponent : begin Uintp_Mark := Mark; -- Determine correct rounding based on the remainder which is in -- N and the divisor D. The rounding is performed on the absolute -- value of X, so Ceiling and Floor need to check for the sign of -- X explicitly. case Mode is when Round_Even => -- This rounding mode should not be used for static -- expressions, but only for compile-time evaluation -- of non-static expressions. if (Even and then N * 2 > D) or else (not Even and then N * 2 >= D) then Fraction := Fraction + 1; end if; when Round => -- Do not round to even as is done with IEEE arithmetic, -- but instead round away from zero when the result is -- exactly between two machine numbers. See RM 4.9(38). if N * 2 >= D then Fraction := Fraction + 1; end if; when Ceiling => if N > Uint_0 and then not UR_Is_Negative (X) then Fraction := Fraction + 1; end if; when Floor => if N > Uint_0 and then UR_Is_Negative (X) then Fraction := Fraction + 1; end if; end case; -- The result must be normalized to [1.0/Radix, 1.0), -- so adjust if the result is 1.0 because of rounding. if Fraction = Most_Significant_Digit * Radix then Fraction := Most_Significant_Digit; Exponent := Exponent + 1; end if; -- Put back sign after applying the rounding if UR_Is_Negative (X) then Fraction := -Fraction; end if; Release_And_Save (Uintp_Mark, Fraction, Exponent); end Calculate_Fraction_And_Exponent; end Decompose_Int; -------------- -- Exponent -- -------------- function Exponent (RT : R; X : T) return UI is X_Frac : UI; X_Exp : UI; begin if UR_Is_Zero (X) then return Uint_0; else Decompose_Int (RT, X, X_Frac, X_Exp, Round_Even); return X_Exp; end if; end Exponent; ----------- -- Floor -- ----------- function Floor (RT : R; X : T) return T is XT : constant T := Truncation (RT, X); begin if UR_Is_Positive (X) then return XT; elsif XT = X then return X; else return XT - Ureal_1; end if; end Floor; -------------- -- Fraction -- -------------- function Fraction (RT : R; X : T) return T is X_Frac : T; X_Exp : UI; begin if UR_Is_Zero (X) then return X; else Decompose (RT, X, X_Frac, X_Exp); return X_Frac; end if; end Fraction; ------------------ -- Leading_Part -- ------------------ function Leading_Part (RT : R; X : T; Radix_Digits : UI) return T is RD : constant UI := UI_Min (Radix_Digits, Machine_Mantissa (RT)); L : UI; Y : T; begin L := Exponent (RT, X) - RD; Y := UR_From_Uint (UR_Trunc (Scaling (RT, X, -L))); return Scaling (RT, Y, L); end Leading_Part; ------------- -- Machine -- ------------- function Machine (RT : R; X : T; Mode : Rounding_Mode; Enode : Node_Id) return T is X_Frac : T; X_Exp : UI; Emin : constant UI := UI_From_Int (Machine_Emin (RT)); begin if UR_Is_Zero (X) then return X; else Decompose (RT, X, X_Frac, X_Exp, Mode); -- Case of denormalized number or (gradual) underflow -- A denormalized number is one with the minimum exponent Emin, but -- that breaks the assumption that the first digit of the mantissa -- is a one. This allows the first non-zero digit to be in any -- of the remaining Mant - 1 spots. The gap between subsequent -- denormalized numbers is the same as for the smallest normalized -- numbers. However, the number of significant digits left decreases -- as a result of the mantissa now having leading seros. if X_Exp < Emin then declare Emin_Den : constant UI := UI_From_Int (Machine_Emin (RT) - Machine_Mantissa (RT) + 1); begin if X_Exp < Emin_Den or not Denorm_On_Target then if UR_Is_Negative (X) then Error_Msg_N ("floating-point value underflows to -0.0?", Enode); return Ureal_M_0; else Error_Msg_N ("floating-point value underflows to 0.0?", Enode); return Ureal_0; end if; elsif Denorm_On_Target then -- Emin - Mant <= X_Exp < Emin, so result is denormal. -- Handle gradual underflow by first computing the -- number of significant bits still available for the -- mantissa and then truncating the fraction to this -- number of bits. -- If this value is different from the original -- fraction, precision is lost due to gradual underflow. -- We probably should round here and prevent double -- rounding as a result of first rounding to a model -- number and then to a machine number. However, this -- is an extremely rare case that is not worth the extra -- complexity. In any case, a warning is issued in cases -- where gradual underflow occurs. declare Denorm_Sig_Bits : constant UI := X_Exp - Emin_Den + 1; X_Frac_Denorm : constant T := UR_From_Components (UR_Trunc (Scaling (RT, abs X_Frac, Denorm_Sig_Bits)), Denorm_Sig_Bits, Radix, UR_Is_Negative (X)); begin if X_Frac_Denorm /= X_Frac then Error_Msg_N ("gradual underflow causes loss of precision?", Enode); X_Frac := X_Frac_Denorm; end if; end; end if; end; end if; return Scaling (RT, X_Frac, X_Exp); end if; end Machine; ------------------ -- Machine_Emin -- ------------------ function Machine_Emin (RT : R) return Int is Digs : constant UI := Digits_Value (RT); Emin : Int; begin if Vax_Float (RT) then if Digs = VAXFF_Digits then Emin := VAXFF_Machine_Emin; elsif Digs = VAXDF_Digits then Emin := VAXDF_Machine_Emin; else pragma Assert (Digs = VAXGF_Digits); Emin := VAXGF_Machine_Emin; end if; elsif Is_AAMP_Float (RT) then if Digs = AAMPS_Digits then Emin := AAMPS_Machine_Emin; else pragma Assert (Digs = AAMPL_Digits); Emin := AAMPL_Machine_Emin; end if; else if Digs = IEEES_Digits then Emin := IEEES_Machine_Emin; elsif Digs = IEEEL_Digits then Emin := IEEEL_Machine_Emin; else pragma Assert (Digs = IEEEX_Digits); Emin := IEEEX_Machine_Emin; end if; end if; return Emin; end Machine_Emin; ---------------------- -- Machine_Mantissa -- ---------------------- function Machine_Mantissa (RT : R) return Nat is Digs : constant UI := Digits_Value (RT); Mant : Nat; begin if Vax_Float (RT) then if Digs = VAXFF_Digits then Mant := VAXFF_Machine_Mantissa; elsif Digs = VAXDF_Digits then Mant := VAXDF_Machine_Mantissa; else pragma Assert (Digs = VAXGF_Digits); Mant := VAXGF_Machine_Mantissa; end if; elsif Is_AAMP_Float (RT) then if Digs = AAMPS_Digits then Mant := AAMPS_Machine_Mantissa; else pragma Assert (Digs = AAMPL_Digits); Mant := AAMPL_Machine_Mantissa; end if; else if Digs = IEEES_Digits then Mant := IEEES_Machine_Mantissa; elsif Digs = IEEEL_Digits then Mant := IEEEL_Machine_Mantissa; else pragma Assert (Digs = IEEEX_Digits); Mant := IEEEX_Machine_Mantissa; end if; end if; return Mant; end Machine_Mantissa; ------------------- -- Machine_Radix -- ------------------- function Machine_Radix (RT : R) return Nat is pragma Warnings (Off, RT); begin return Radix; end Machine_Radix; ----------- -- Model -- ----------- function Model (RT : R; X : T) return T is X_Frac : T; X_Exp : UI; begin Decompose (RT, X, X_Frac, X_Exp); return Compose (RT, X_Frac, X_Exp); end Model; ---------- -- Pred -- ---------- function Pred (RT : R; X : T) return T is begin return -Succ (RT, -X); end Pred; --------------- -- Remainder -- --------------- function Remainder (RT : R; X, Y : T) return T is A : T; B : T; Arg : T; P : T; Arg_Frac : T; P_Frac : T; Sign_X : T; IEEE_Rem : T; Arg_Exp : UI; P_Exp : UI; K : UI; P_Even : Boolean; begin if UR_Is_Positive (X) then Sign_X := Ureal_1; else Sign_X := -Ureal_1; end if; Arg := abs X; P := abs Y; if Arg < P then P_Even := True; IEEE_Rem := Arg; P_Exp := Exponent (RT, P); else -- ??? what about zero cases? Decompose (RT, Arg, Arg_Frac, Arg_Exp); Decompose (RT, P, P_Frac, P_Exp); P := Compose (RT, P_Frac, Arg_Exp); K := Arg_Exp - P_Exp; P_Even := True; IEEE_Rem := Arg; for Cnt in reverse 0 .. UI_To_Int (K) loop if IEEE_Rem >= P then P_Even := False; IEEE_Rem := IEEE_Rem - P; else P_Even := True; end if; P := P * Ureal_Half; end loop; end if; -- That completes the calculation of modulus remainder. The final step -- is get the IEEE remainder. Here we compare Rem with (abs Y) / 2. if P_Exp >= 0 then A := IEEE_Rem; B := abs Y * Ureal_Half; else A := IEEE_Rem * Ureal_2; B := abs Y; end if; if A > B or else (A = B and then not P_Even) then IEEE_Rem := IEEE_Rem - abs Y; end if; return Sign_X * IEEE_Rem; end Remainder; -------------- -- Rounding -- -------------- function Rounding (RT : R; X : T) return T is Result : T; Tail : T; begin Result := Truncation (RT, abs X); Tail := abs X - Result; if Tail >= Ureal_Half then Result := Result + Ureal_1; end if; if UR_Is_Negative (X) then return -Result; else return Result; end if; end Rounding; ------------- -- Scaling -- ------------- function Scaling (RT : R; X : T; Adjustment : UI) return T is pragma Warnings (Off, RT); begin if Rbase (X) = Radix then return UR_From_Components (Num => Numerator (X), Den => Denominator (X) - Adjustment, Rbase => Radix, Negative => UR_Is_Negative (X)); elsif Adjustment >= 0 then return X * Radix ** Adjustment; else return X / Radix ** (-Adjustment); end if; end Scaling; ---------- -- Succ -- ---------- function Succ (RT : R; X : T) return T is Emin : constant UI := UI_From_Int (Machine_Emin (RT)); Mantissa : constant UI := UI_From_Int (Machine_Mantissa (RT)); Exp : UI := UI_Max (Emin, Exponent (RT, X)); Frac : T; New_Frac : T; begin if UR_Is_Zero (X) then Exp := Emin; end if; -- Set exponent such that the radix point will be directly -- following the mantissa after scaling if Denorm_On_Target or Exp /= Emin then Exp := Exp - Mantissa; else Exp := Exp - 1; end if; Frac := Scaling (RT, X, -Exp); New_Frac := Ceiling (RT, Frac); if New_Frac = Frac then if New_Frac = Scaling (RT, -Ureal_1, Mantissa - 1) then New_Frac := New_Frac + Scaling (RT, Ureal_1, Uint_Minus_1); else New_Frac := New_Frac + Ureal_1; end if; end if; return Scaling (RT, New_Frac, Exp); end Succ; ---------------- -- Truncation -- ---------------- function Truncation (RT : R; X : T) return T is pragma Warnings (Off, RT); begin return UR_From_Uint (UR_Trunc (X)); end Truncation; ----------------------- -- Unbiased_Rounding -- ----------------------- function Unbiased_Rounding (RT : R; X : T) return T is Abs_X : constant T := abs X; Result : T; Tail : T; begin Result := Truncation (RT, Abs_X); Tail := Abs_X - Result; if Tail > Ureal_Half then Result := Result + Ureal_1; elsif Tail = Ureal_Half then Result := Ureal_2 * Truncation (RT, (Result / Ureal_2) + Ureal_Half); end if; if UR_Is_Negative (X) then return -Result; elsif UR_Is_Positive (X) then return Result; -- For zero case, make sure sign of zero is preserved else return X; end if; end Unbiased_Rounding; end Eval_Fat;
-- Copyright 2008 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package body Pck is procedure Call_Me (D : in out Data) is begin if D.One > D.Two then D.Three := D.Four; end if; end Call_Me; end Pck;
with Ada.Text_IO,Ada.Calendar, Ada.Numerics.Discrete_Random; use Ada.Text_IO; procedure Grade3 is type Barr is array (Natural range <>,Natural range <>) of Boolean; protected Organism is entry Move(X,Y : Natural; is_infected : out Boolean); function inArea(x,y:Natural) return Boolean; procedure Init; private X, Y : Natural; is_infected : Boolean; a : Barr(2..10,2..10); end Organism; task type Virus(varx,vary: Natural; dx,dy: Integer); task body Virus is act_x,act_y : Natural; dis_x,dis_y : Integer; got_virus : Boolean := False; procedure spread(varx,vary : Natural; dx,dy : Integer) is begin loop act_x := act_x + dis_x; act_y := act_y + dis_y; exit when Organism.inArea(act_x,act_y); end loop; end spread; begin act_x := varx; act_y := vary; dis_x := dx; dis_y := dy; while not got_virus loop Organism.Move(act_x,act_y,got_virus); spread(act_x,act_y,dis_x,dis_y); delay 2.0; end loop; end Virus; protected body Organism is entry Move(X,Y : Natural;is_infected : out Boolean) when True is begin if(a(X,Y)=True) then is_infected := True; Put_Line("virus is infected at "& X'Image &","& Y'Image); else Put_Line("virus is at "& X'Image &","& Y'Image); end if; end Move; procedure Init is cnt : Natural := 0; begin for i in 2..10 loop for j in 2..10 loop if (i=j)then a(i,j) := True; elsif (i mod j =0) then a(i,j) := True; else a(i,j) := False; end if; end loop; end loop; end Init; function inArea(x,y : Natural) return Boolean is begin if (x>=2 and then x<=10 and then y>=2 and then y<=10) then return True; else return False; end if; end inArea; end Organism; type Virusptr is access Virus; f,t,s : Virusptr; begin Organism.Init; f := new Virus(2,7,1,0); t := new Virus(2,3,1,1); s := new Virus(10,2,-1,1); end Grade3;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Testsuite Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 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$ ------------------------------------------------------------------------------ -- Test:T34 -- -- Description: -- -- This test consists of Node A sending a msg with a header that has MU=1 in -- the SOAP 1.1 NS. Node C, ignores this header. -- -- Messages: -- -- Message sent from Node A -- -- <?xml version='1.0' ?> -- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> -- <env:Header> -- <test:Unknown xmlns:test="http://example.org/ts-tests" -- xmlns:env1="http://schemas.xmlsoap.org/soap/envelope/" -- env1:mustUnderstand="true"> -- foo -- </test:Unknown> -- </env:Header> -- <env:Body> -- </env:Body> -- </env:Envelope> -- -- Message sent from Node C -- -- <?xml version='1.0' ?> -- <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> -- <env:Body> -- </env:Body> -- </env:Envelope> ------------------------------------------------------------------------------ package SOAPConf.Testcases.Test_T34 is Scenario : constant Testcase_Data := (League.Strings.To_Universal_String ("<?xml version='1.0'?>" & "<env:Envelope" & " xmlns:env='http://www.w3.org/2003/05/soap-envelope'>" & "<env:Header>" & "<test:Unknown" & " xmlns:test='http://example.org/ts-tests'" & " xmlns:env1='http://schemas.xmlsoap.org/soap/envelope/'" & " env1:mustUnderstand='true'>" & "foo" & "</test:Unknown>" & "</env:Header>" & "<env:Body>" & "</env:Body>" & "</env:Envelope>"), League.Strings.To_Universal_String ("<?xml version='1.0'?>" & "<env:Envelope" & " xmlns:env='http://www.w3.org/2003/05/soap-envelope'>" & "<env:Body/>" & "</env:Envelope>")); end SOAPConf.Testcases.Test_T34;
-- CE3305A.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 THE LINE AND PAGE LENGTHS MAY BE ALTERED DYNAMICALLY -- SEVERAL TIMES. CHECK THAT WHEN RESET TO ZERO, THE LENGTHS ARE -- UNBOUNDED. -- APPLICABILITY CRITERIA: -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT -- TEXT FILES WITH UNBOUNDED LINE LENGTH. -- HISTORY: -- SPS 09/28/82 -- EG 05/22/85 -- DWC 08/18/87 ADDED CHECK_FILE WITHOUT A'S. WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; WITH CHECK_FILE; PROCEDURE CE3305A IS INCOMPLETE : EXCEPTION; BEGIN TEST ("CE3305A", "CHECK THAT LINE AND PAGE LENGTHS MAY BE " & "ALTERED DYNAMICALLY"); DECLARE FT : FILE_TYPE; PROCEDURE PUT_CHARS (CNT: INTEGER; CH: CHARACTER) IS BEGIN FOR I IN 1 .. CNT LOOP PUT (FT, CH); END LOOP; END PUT_CHARS; BEGIN BEGIN CREATE(FT, OUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE " & "WITH OUT_FILE MODE"); RAISE INCOMPLETE; WHEN NAME_ERROR => NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE " & "WITH OUT_FILE MODE"); RAISE INCOMPLETE; WHEN OTHERS => FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE"); RAISE INCOMPLETE; END; SET_LINE_LENGTH (FT, 10); SET_PAGE_LENGTH (FT, 5); PUT_CHARS (150, 'X'); -- 15 LINES BEGIN SET_LINE_LENGTH (FT, 5); SET_PAGE_LENGTH (FT, 10); EXCEPTION WHEN OTHERS => FAILED ("UNABLE TO CHANGE LINE OR PAGE LENGTH"); END; PUT_CHARS (50, 'B'); -- 10 LINES BEGIN SET_LINE_LENGTH (FT, 25); SET_PAGE_LENGTH (FT,4); EXCEPTION WHEN OTHERS => FAILED ("UNABLE TO CHANGE LINE OR PAGE LENGTH - 2"); END; PUT_CHARS (310, 'K'); -- 12 LINES, 10 CHARACTERS -- THIS CAN RAISE USE_ERROR IF AN IMPLEMENTATION REQUIRES A BOUNDED -- LINE LENGTH FOR AN EXTERNAL FILE. BEGIN BEGIN SET_LINE_LENGTH (FT, UNBOUNDED); SET_PAGE_LENGTH (FT, UNBOUNDED); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("BOUNDED LINE LENGTH " & "REQUIRED"); RAISE INCOMPLETE; END; PUT_CHARS (100, 'A'); -- ONE LINE CHECK_FILE (FT,"XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#@" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#@" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "XXXXXXXXXX#" & "BBBBB#" & "BBBBB#" & "BBBBB#" & "BBBBB#" & "BBBBB#@" & "BBBBB#" & "BBBBB#" & "BBBBB#" & "BBBBB#" & "BBBBBKKKKKKKKKKKKKKKKKKKK#@" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#@" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#@" & "KKKKKKKKKKKKKKKKKKKKKKKKK#" & "KKKKKKKKKKKKKKKKKKKKKKKKK#"& "KKKKKKKKKKKKKKKKKKKKKKKKK#"& "KKKKKKKKKKKKKKKAAAAAAAAAAA" & "AAAAAAAAAAAAAAAAAAAAAAAAAA" & "AAAAAAAAAAAAAAAAAAAAAAAAAA" & "AAAAAAAAAAAAAAAAAAAAAAAAAA" & "AAAAAAAAAAA#@%"); EXCEPTION WHEN INCOMPLETE => NULL; END; BEGIN DELETE (FT); EXCEPTION WHEN USE_ERROR => NULL; END; EXCEPTION WHEN INCOMPLETE => NULL; END; RESULT; END CE3305A;
with STM32GD.GPIO; use STM32GD.GPIO; with STM32GD.GPIO.Pin; with STM32GD.USART; with STM32GD.USART.Peripheral; with STM32GD.SPI; with STM32GD.SPI.Peripheral; with STM32GD.RTC; with STM32GD.Clock; with STM32GD.Clock.Tree; with Drivers.Text_IO; package STM32GD.Board is package CLOCKS is new STM32GD.Clock.Tree; package LED is new Pin (Pin => Pin_5, Port => Port_A, Mode => Speed_2MHz, Out_Conf => Out_PushPull); package LED2 is new Pin (Pin => Pin_8, Port => Port_C, Mode => Speed_2MHz, Out_Conf => Out_PushPull); package LED3 is new Pin (Pin => Pin_6, Port => Port_C, Mode => Speed_2MHz, Out_Conf => Out_PushPull); package SCLK is new Pin (Pin => Pin_5, Port => Port_A, Mode => Speed_50MHz, Out_Conf => Alt_PushPull); package MISO is new Pin (Pin => Pin_6, Port => Port_A, Mode => Speed_50MHz, Out_Conf => Alt_PushPull); package MOSI is new Pin (Pin => Pin_7, Port => Port_A, Mode => Speed_50MHz, Out_Conf => Alt_PushPull); package CSN is new Pin (Pin => Pin_4, Port => Port_A, Mode => Speed_50MHz, Out_Conf => Out_PushPull); package TX is new Pin (Pin => Pin_2, Port => Port_A, Mode => Speed_50MHz, Out_Conf => Alt_PushPull); package RX is new Pin (Pin => Pin_3, Port => Port_A); package SCL is new Pin (Pin => Pin_6, Port => Port_B, Mode => Speed_50MHz, Out_Conf => Alt_OpenDrain); package SDA is new Pin (Pin => Pin_7, Port => Port_B, Mode => Speed_50MHz, Out_Conf => Alt_OpenDrain); package SPI is new STM32GD.SPI.Peripheral (SPI => STM32GD.SPI.SPI_1); package USART is new STM32GD.USART.Peripheral (USART => STM32GD.USART.USART_2, Speed => 115200, Clock => 8_000_000); package Text_IO is new Drivers.Text_IO (USART => STM32GD.Board.USART); package BUTTON is new Pin (Pin => Pin_13, Port => Port_C, Mode => Input); package RTC is new STM32GD.RTC (Clock_Tree => STM32GD.Board.Clocks, Clock => STM32GD.Clock.LSI); procedure Init; end STM32GD.Board;
with Ada.Assertions; use Ada.Assertions; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package body Rejuvenation.Nested is function Remove_Nested_Flags (Source : String; On_Flag : String; Off_Flag : String; Depth : Natural := 0) return String is function Next_Flag_Location (From : Positive; Flag : String) return Positive; function Next_Flag_Location (From : Positive; Flag : String) return Positive is I : constant Natural := Index (Source, Flag, From); begin return (if I = 0 then Source'Last + 1 else I); end Next_Flag_Location; function Next_On_Flag_Location (From : Positive) return Positive is (Next_Flag_Location (From, On_Flag)); function Next_Off_Flag_Location (From : Positive) return Positive is (Next_Flag_Location (From, Off_Flag)); Current_Location : Natural := Source'First; Current_Depth : Natural := Depth; On_Location : Positive := Next_On_Flag_Location (Current_Location); Off_Location : Positive := Next_Off_Flag_Location (Current_Location); Final : Unbounded_String := Null_Unbounded_String; begin loop if On_Location > Source'Last and then Off_Location > Source'Last then Assert (Check => Current_Depth = 0, Message => "Unexpectedly at Current_Depth " & Current_Depth'Image); Append (Final, Source (Current_Location .. Source'Last)); return To_String (Final); elsif On_Location < Off_Location then declare Next_Location : constant Positive := On_Location + On_Flag'Length; Last : constant Positive := (if Current_Depth = 0 then Next_Location - 1 else On_Location - 1); begin Current_Depth := Current_Depth + 1; Append (Final, Source (Current_Location .. Last)); Current_Location := Next_Location; Assert (Check => Current_Location <= Off_Location, Message => "Invariant violated"); On_Location := Next_On_Flag_Location (Current_Location); end; else Assert (Check => Off_Location < On_Location, Message => "On and Off token can't occur at same location"); declare Next_Location : constant Positive := Off_Location + Off_Flag'Length; Last : constant Positive := (if Current_Depth = 1 then Next_Location - 1 else Off_Location - 1); begin Assert (Check => Current_Depth > 0, Message => "Current_Depth is zero at offset " & Off_Location'Image); Current_Depth := Current_Depth - 1; Append (Final, Source (Current_Location .. Last)); Current_Location := Next_Location; Assert (Check => Current_Location <= On_Location, Message => "Invariant violated"); Off_Location := Next_Off_Flag_Location (Current_Location); end; end if; end loop; end Remove_Nested_Flags; end Rejuvenation.Nested;
------------------------------------------------------------------------------ -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with System; use System; with HAL; use HAL; with STM32.DMA; use STM32.DMA; with STM32.Device; use STM32.Device; with Ada.Interrupts; with Ada.Interrupts.Names; package Audio_Stream is protected type Double_Buffer_Controller (Controller : not null access DMA_Controller; Stream : DMA_Stream_Selector; ID : Ada.Interrupts.Interrupt_ID) is procedure Start (Destination : Address; Source_0 : Address; Source_1 : Address; Data_Count : UInt16); entry Wait_For_Transfer_Complete; function Not_In_Transfer return Address; private procedure Interrupt_Handler; pragma Attach_Handler (Interrupt_Handler, ID); Interrupt_Triggered : Boolean := False; Buffer_0 : Address := Null_Address; Buffer_1 : Address := Null_Address; end Double_Buffer_Controller; Audio_TX_DMA : STM32.DMA.DMA_Controller renames DMA_1; Audio_TX_DMA_Chan : STM32.DMA.DMA_Channel_Selector renames STM32.DMA.Channel_0; Audio_TX_DMA_Stream : STM32.DMA.DMA_Stream_Selector renames STM32.DMA.Stream_5; Audio_TX_DMA_Int : Double_Buffer_Controller (Audio_TX_DMA'Access, Audio_TX_DMA_Stream, Ada.Interrupts.Names.DMA1_Stream5_Interrupt); end Audio_Stream;
-- This spec has been automatically generated from STM32F427x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; with System; with HAL; package STM32_SVD.Ethernet is pragma Preelaborate; --------------- -- Registers -- --------------- -------------------- -- MACCR_Register -- -------------------- subtype MACCR_BL_Field is HAL.UInt2; subtype MACCR_IFG_Field is HAL.UInt3; -- Ethernet MAC configuration register type MACCR_Register is record -- unspecified Reserved_0_1 : HAL.UInt2 := 16#0#; -- RE RE : Boolean := False; -- TE TE : Boolean := False; -- DC DC : Boolean := False; -- BL BL : MACCR_BL_Field := 16#0#; -- APCS APCS : Boolean := False; -- unspecified Reserved_8_8 : HAL.Bit := 16#0#; -- RD RD : Boolean := False; -- IPCO IPCO : Boolean := False; -- DM DM : Boolean := False; -- LM LM : Boolean := False; -- ROD ROD : Boolean := False; -- FES FES : Boolean := False; -- unspecified Reserved_15_15 : HAL.Bit := 16#1#; -- CSD CSD : Boolean := False; -- IFG IFG : MACCR_IFG_Field := 16#0#; -- unspecified Reserved_20_21 : HAL.UInt2 := 16#0#; -- JD JD : Boolean := False; -- WD WD : Boolean := False; -- unspecified Reserved_24_24 : HAL.Bit := 16#0#; -- CSTF CSTF : Boolean := False; -- unspecified Reserved_26_31 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACCR_Register use record Reserved_0_1 at 0 range 0 .. 1; RE at 0 range 2 .. 2; TE at 0 range 3 .. 3; DC at 0 range 4 .. 4; BL at 0 range 5 .. 6; APCS at 0 range 7 .. 7; Reserved_8_8 at 0 range 8 .. 8; RD at 0 range 9 .. 9; IPCO at 0 range 10 .. 10; DM at 0 range 11 .. 11; LM at 0 range 12 .. 12; ROD at 0 range 13 .. 13; FES at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; CSD at 0 range 16 .. 16; IFG at 0 range 17 .. 19; Reserved_20_21 at 0 range 20 .. 21; JD at 0 range 22 .. 22; WD at 0 range 23 .. 23; Reserved_24_24 at 0 range 24 .. 24; CSTF at 0 range 25 .. 25; Reserved_26_31 at 0 range 26 .. 31; end record; --------------------- -- MACFFR_Register -- --------------------- -- Ethernet MAC frame filter register type MACFFR_Register is record -- no description available PM : Boolean := False; -- no description available HU : Boolean := False; -- no description available HM : Boolean := False; -- no description available DAIF : Boolean := False; -- no description available RAM : Boolean := False; -- no description available BFD : Boolean := False; -- no description available PCF : Boolean := False; -- no description available SAIF : Boolean := False; -- no description available SAF : Boolean := False; -- no description available HPF : Boolean := False; -- unspecified Reserved_10_30 : HAL.UInt21 := 16#0#; -- no description available RA : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACFFR_Register use record PM at 0 range 0 .. 0; HU at 0 range 1 .. 1; HM at 0 range 2 .. 2; DAIF at 0 range 3 .. 3; RAM at 0 range 4 .. 4; BFD at 0 range 5 .. 5; PCF at 0 range 6 .. 6; SAIF at 0 range 7 .. 7; SAF at 0 range 8 .. 8; HPF at 0 range 9 .. 9; Reserved_10_30 at 0 range 10 .. 30; RA at 0 range 31 .. 31; end record; ----------------------- -- MACMIIAR_Register -- ----------------------- subtype MACMIIAR_CR_Field is HAL.UInt3; subtype MACMIIAR_MR_Field is HAL.UInt5; subtype MACMIIAR_PA_Field is HAL.UInt5; -- Ethernet MAC MII address register type MACMIIAR_Register is record -- no description available MB : Boolean := False; -- no description available MW : Boolean := False; -- no description available CR : MACMIIAR_CR_Field := 16#0#; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- no description available MR : MACMIIAR_MR_Field := 16#0#; -- no description available PA : MACMIIAR_PA_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACMIIAR_Register use record MB at 0 range 0 .. 0; MW at 0 range 1 .. 1; CR at 0 range 2 .. 4; Reserved_5_5 at 0 range 5 .. 5; MR at 0 range 6 .. 10; PA at 0 range 11 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; ----------------------- -- MACMIIDR_Register -- ----------------------- subtype MACMIIDR_TD_Field is HAL.Short; -- Ethernet MAC MII data register type MACMIIDR_Register is record -- no description available TD : MACMIIDR_TD_Field := 16#0#; -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACMIIDR_Register use record TD at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; --------------------- -- MACFCR_Register -- --------------------- subtype MACFCR_PLT_Field is HAL.UInt2; subtype MACFCR_PT_Field is HAL.Short; -- Ethernet MAC flow control register type MACFCR_Register is record -- no description available FCB : Boolean := False; -- no description available TFCE : Boolean := False; -- no description available RFCE : Boolean := False; -- no description available UPFD : Boolean := False; -- no description available PLT : MACFCR_PLT_Field := 16#0#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- no description available ZQPD : Boolean := False; -- unspecified Reserved_8_15 : HAL.Byte := 16#0#; -- no description available PT : MACFCR_PT_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACFCR_Register use record FCB at 0 range 0 .. 0; TFCE at 0 range 1 .. 1; RFCE at 0 range 2 .. 2; UPFD at 0 range 3 .. 3; PLT at 0 range 4 .. 5; Reserved_6_6 at 0 range 6 .. 6; ZQPD at 0 range 7 .. 7; Reserved_8_15 at 0 range 8 .. 15; PT at 0 range 16 .. 31; end record; ------------------------ -- MACVLANTR_Register -- ------------------------ subtype MACVLANTR_VLANTI_Field is HAL.Short; -- Ethernet MAC VLAN tag register type MACVLANTR_Register is record -- no description available VLANTI : MACVLANTR_VLANTI_Field := 16#0#; -- no description available VLANTC : Boolean := False; -- unspecified Reserved_17_31 : HAL.UInt15 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACVLANTR_Register use record VLANTI at 0 range 0 .. 15; VLANTC at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; ------------------------ -- MACPMTCSR_Register -- ------------------------ -- Ethernet MAC PMT control and status register type MACPMTCSR_Register is record -- no description available PD : Boolean := False; -- no description available MPE : Boolean := False; -- no description available WFE : Boolean := False; -- unspecified Reserved_3_4 : HAL.UInt2 := 16#0#; -- no description available MPR : Boolean := False; -- no description available WFR : Boolean := False; -- unspecified Reserved_7_8 : HAL.UInt2 := 16#0#; -- no description available GU : Boolean := False; -- unspecified Reserved_10_30 : HAL.UInt21 := 16#0#; -- no description available WFFRPR : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACPMTCSR_Register use record PD at 0 range 0 .. 0; MPE at 0 range 1 .. 1; WFE at 0 range 2 .. 2; Reserved_3_4 at 0 range 3 .. 4; MPR at 0 range 5 .. 5; WFR at 0 range 6 .. 6; Reserved_7_8 at 0 range 7 .. 8; GU at 0 range 9 .. 9; Reserved_10_30 at 0 range 10 .. 30; WFFRPR at 0 range 31 .. 31; end record; ---------------------- -- MACDBGR_Register -- ---------------------- -- Ethernet MAC debug register type MACDBGR_Register is record -- Read-only. CR CR : Boolean; -- Read-only. CSR CSR : Boolean; -- Read-only. ROR ROR : Boolean; -- Read-only. MCF MCF : Boolean; -- Read-only. MCP MCP : Boolean; -- Read-only. MCFHP MCFHP : Boolean; -- unspecified Reserved_6_31 : HAL.UInt26; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACDBGR_Register use record CR at 0 range 0 .. 0; CSR at 0 range 1 .. 1; ROR at 0 range 2 .. 2; MCF at 0 range 3 .. 3; MCP at 0 range 4 .. 4; MCFHP at 0 range 5 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; -------------------- -- MACSR_Register -- -------------------- -- Ethernet MAC interrupt status register type MACSR_Register is record -- unspecified Reserved_0_2 : HAL.UInt3 := 16#0#; -- Read-only. no description available PMTS : Boolean := False; -- Read-only. no description available MMCS : Boolean := False; -- Read-only. no description available MMCRS : Boolean := False; -- Read-only. no description available MMCTS : Boolean := False; -- unspecified Reserved_7_8 : HAL.UInt2 := 16#0#; -- no description available TSTS : Boolean := False; -- unspecified Reserved_10_31 : HAL.UInt22 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACSR_Register use record Reserved_0_2 at 0 range 0 .. 2; PMTS at 0 range 3 .. 3; MMCS at 0 range 4 .. 4; MMCRS at 0 range 5 .. 5; MMCTS at 0 range 6 .. 6; Reserved_7_8 at 0 range 7 .. 8; TSTS at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; --------------------- -- MACIMR_Register -- --------------------- -- Ethernet MAC interrupt mask register type MACIMR_Register is record -- unspecified Reserved_0_2 : HAL.UInt3 := 16#0#; -- no description available PMTIM : Boolean := False; -- unspecified Reserved_4_8 : HAL.UInt5 := 16#0#; -- no description available TSTIM : Boolean := False; -- unspecified Reserved_10_31 : HAL.UInt22 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACIMR_Register use record Reserved_0_2 at 0 range 0 .. 2; PMTIM at 0 range 3 .. 3; Reserved_4_8 at 0 range 4 .. 8; TSTIM at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; ---------------------- -- MACA0HR_Register -- ---------------------- subtype MACA0HR_MACA0H_Field is HAL.Short; -- Ethernet MAC address 0 high register type MACA0HR_Register is record -- MAC address0 high MACA0H : MACA0HR_MACA0H_Field := 16#FFFF#; -- unspecified Reserved_16_30 : HAL.UInt15 := 16#10#; -- Read-only. Always 1 MO : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACA0HR_Register use record MACA0H at 0 range 0 .. 15; Reserved_16_30 at 0 range 16 .. 30; MO at 0 range 31 .. 31; end record; ---------------------- -- MACA1HR_Register -- ---------------------- subtype MACA1HR_MACA1H_Field is HAL.Short; subtype MACA1HR_MBC_Field is HAL.UInt6; -- Ethernet MAC address 1 high register type MACA1HR_Register is record -- no description available MACA1H : MACA1HR_MACA1H_Field := 16#FFFF#; -- unspecified Reserved_16_23 : HAL.Byte := 16#0#; -- no description available MBC : MACA1HR_MBC_Field := 16#0#; -- no description available SA : Boolean := False; -- no description available AE : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACA1HR_Register use record MACA1H at 0 range 0 .. 15; Reserved_16_23 at 0 range 16 .. 23; MBC at 0 range 24 .. 29; SA at 0 range 30 .. 30; AE at 0 range 31 .. 31; end record; ---------------------- -- MACA2HR_Register -- ---------------------- subtype MACA2HR_MAC2AH_Field is HAL.Short; subtype MACA2HR_MBC_Field is HAL.UInt6; -- Ethernet MAC address 2 high register type MACA2HR_Register is record -- no description available MAC2AH : MACA2HR_MAC2AH_Field := 16#FFFF#; -- unspecified Reserved_16_23 : HAL.Byte := 16#0#; -- no description available MBC : MACA2HR_MBC_Field := 16#0#; -- no description available SA : Boolean := False; -- no description available AE : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACA2HR_Register use record MAC2AH at 0 range 0 .. 15; Reserved_16_23 at 0 range 16 .. 23; MBC at 0 range 24 .. 29; SA at 0 range 30 .. 30; AE at 0 range 31 .. 31; end record; ---------------------- -- MACA2LR_Register -- ---------------------- subtype MACA2LR_MACA2L_Field is HAL.UInt31; -- Ethernet MAC address 2 low register type MACA2LR_Register is record -- no description available MACA2L : MACA2LR_MACA2L_Field := 16#7FFFFFFF#; -- unspecified Reserved_31_31 : HAL.Bit := 16#1#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACA2LR_Register use record MACA2L at 0 range 0 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; ---------------------- -- MACA3HR_Register -- ---------------------- subtype MACA3HR_MACA3H_Field is HAL.Short; subtype MACA3HR_MBC_Field is HAL.UInt6; -- Ethernet MAC address 3 high register type MACA3HR_Register is record -- no description available MACA3H : MACA3HR_MACA3H_Field := 16#FFFF#; -- unspecified Reserved_16_23 : HAL.Byte := 16#0#; -- no description available MBC : MACA3HR_MBC_Field := 16#0#; -- no description available SA : Boolean := False; -- no description available AE : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MACA3HR_Register use record MACA3H at 0 range 0 .. 15; Reserved_16_23 at 0 range 16 .. 23; MBC at 0 range 24 .. 29; SA at 0 range 30 .. 30; AE at 0 range 31 .. 31; end record; -------------------- -- MMCCR_Register -- -------------------- -- Ethernet MMC control register type MMCCR_Register is record -- no description available CR : Boolean := False; -- no description available CSR : Boolean := False; -- no description available ROR : Boolean := False; -- no description available MCF : Boolean := False; -- no description available MCP : Boolean := False; -- no description available MCFHP : Boolean := False; -- unspecified Reserved_6_31 : HAL.UInt26 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MMCCR_Register use record CR at 0 range 0 .. 0; CSR at 0 range 1 .. 1; ROR at 0 range 2 .. 2; MCF at 0 range 3 .. 3; MCP at 0 range 4 .. 4; MCFHP at 0 range 5 .. 5; Reserved_6_31 at 0 range 6 .. 31; end record; --------------------- -- MMCRIR_Register -- --------------------- -- Ethernet MMC receive interrupt register type MMCRIR_Register is record -- unspecified Reserved_0_4 : HAL.UInt5 := 16#0#; -- no description available RFCES : Boolean := False; -- no description available RFAES : Boolean := False; -- unspecified Reserved_7_16 : HAL.UInt10 := 16#0#; -- no description available RGUFS : Boolean := False; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MMCRIR_Register use record Reserved_0_4 at 0 range 0 .. 4; RFCES at 0 range 5 .. 5; RFAES at 0 range 6 .. 6; Reserved_7_16 at 0 range 7 .. 16; RGUFS at 0 range 17 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; --------------------- -- MMCTIR_Register -- --------------------- -- Ethernet MMC transmit interrupt register type MMCTIR_Register is record -- unspecified Reserved_0_13 : HAL.UInt14; -- Read-only. no description available TGFSCS : Boolean; -- Read-only. no description available TGFMSCS : Boolean; -- unspecified Reserved_16_20 : HAL.UInt5; -- Read-only. no description available TGFS : Boolean; -- unspecified Reserved_22_31 : HAL.UInt10; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MMCTIR_Register use record Reserved_0_13 at 0 range 0 .. 13; TGFSCS at 0 range 14 .. 14; TGFMSCS at 0 range 15 .. 15; Reserved_16_20 at 0 range 16 .. 20; TGFS at 0 range 21 .. 21; Reserved_22_31 at 0 range 22 .. 31; end record; ---------------------- -- MMCRIMR_Register -- ---------------------- -- Ethernet MMC receive interrupt mask register type MMCRIMR_Register is record -- unspecified Reserved_0_4 : HAL.UInt5 := 16#0#; -- no description available RFCEM : Boolean := False; -- no description available RFAEM : Boolean := False; -- unspecified Reserved_7_16 : HAL.UInt10 := 16#0#; -- no description available RGUFM : Boolean := False; -- unspecified Reserved_18_31 : HAL.UInt14 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MMCRIMR_Register use record Reserved_0_4 at 0 range 0 .. 4; RFCEM at 0 range 5 .. 5; RFAEM at 0 range 6 .. 6; Reserved_7_16 at 0 range 7 .. 16; RGUFM at 0 range 17 .. 17; Reserved_18_31 at 0 range 18 .. 31; end record; ---------------------- -- MMCTIMR_Register -- ---------------------- -- Ethernet MMC transmit interrupt mask register type MMCTIMR_Register is record -- unspecified Reserved_0_13 : HAL.UInt14 := 16#0#; -- no description available TGFSCM : Boolean := False; -- no description available TGFMSCM : Boolean := False; -- no description available TGFM : Boolean := False; -- unspecified Reserved_17_31 : HAL.UInt15 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MMCTIMR_Register use record Reserved_0_13 at 0 range 0 .. 13; TGFSCM at 0 range 14 .. 14; TGFMSCM at 0 range 15 .. 15; TGFM at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; ---------------------- -- PTPTSCR_Register -- ---------------------- subtype PTPTSCR_TSCNT_Field is HAL.UInt2; -- Ethernet PTP time stamp control register type PTPTSCR_Register is record -- no description available TSE : Boolean := False; -- no description available TSFCU : Boolean := False; -- no description available TSSTI : Boolean := False; -- no description available TSSTU : Boolean := False; -- no description available TSITE : Boolean := False; -- no description available TTSARU : Boolean := False; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; -- no description available TSSARFE : Boolean := False; -- no description available TSSSR : Boolean := False; -- no description available TSPTPPSV2E : Boolean := False; -- no description available TSSPTPOEFE : Boolean := False; -- no description available TSSIPV6FE : Boolean := False; -- no description available TSSIPV4FE : Boolean := True; -- no description available TSSEME : Boolean := False; -- no description available TSSMRME : Boolean := False; -- no description available TSCNT : PTPTSCR_TSCNT_Field := 16#0#; -- no description available TSPFFMAE : Boolean := False; -- unspecified Reserved_19_31 : HAL.UInt13 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PTPTSCR_Register use record TSE at 0 range 0 .. 0; TSFCU at 0 range 1 .. 1; TSSTI at 0 range 2 .. 2; TSSTU at 0 range 3 .. 3; TSITE at 0 range 4 .. 4; TTSARU at 0 range 5 .. 5; Reserved_6_7 at 0 range 6 .. 7; TSSARFE at 0 range 8 .. 8; TSSSR at 0 range 9 .. 9; TSPTPPSV2E at 0 range 10 .. 10; TSSPTPOEFE at 0 range 11 .. 11; TSSIPV6FE at 0 range 12 .. 12; TSSIPV4FE at 0 range 13 .. 13; TSSEME at 0 range 14 .. 14; TSSMRME at 0 range 15 .. 15; TSCNT at 0 range 16 .. 17; TSPFFMAE at 0 range 18 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; ---------------------- -- PTPSSIR_Register -- ---------------------- subtype PTPSSIR_STSSI_Field is HAL.Byte; -- Ethernet PTP subsecond increment register type PTPSSIR_Register is record -- no description available STSSI : PTPSSIR_STSSI_Field := 16#0#; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PTPSSIR_Register use record STSSI at 0 range 0 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ---------------------- -- PTPTSLR_Register -- ---------------------- subtype PTPTSLR_STSS_Field is HAL.UInt31; -- Ethernet PTP time stamp low register type PTPTSLR_Register is record -- Read-only. no description available STSS : PTPTSLR_STSS_Field; -- Read-only. no description available STPNS : Boolean; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PTPTSLR_Register use record STSS at 0 range 0 .. 30; STPNS at 0 range 31 .. 31; end record; ----------------------- -- PTPTSLUR_Register -- ----------------------- subtype PTPTSLUR_TSUSS_Field is HAL.UInt31; -- Ethernet PTP time stamp low update register type PTPTSLUR_Register is record -- no description available TSUSS : PTPTSLUR_TSUSS_Field := 16#0#; -- no description available TSUPNS : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PTPTSLUR_Register use record TSUSS at 0 range 0 .. 30; TSUPNS at 0 range 31 .. 31; end record; ---------------------- -- PTPTSSR_Register -- ---------------------- -- Ethernet PTP time stamp status register type PTPTSSR_Register is record -- Read-only. no description available TSSO : Boolean; -- Read-only. no description available TSTTR : Boolean; -- unspecified Reserved_2_31 : HAL.UInt30; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PTPTSSR_Register use record TSSO at 0 range 0 .. 0; TSTTR at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; ----------------------- -- PTPPPSCR_Register -- ----------------------- -- Ethernet PTP PPS control register type PTPPPSCR_Register is record -- Read-only. TSSO TSSO : Boolean; -- Read-only. TSTTR TSTTR : Boolean; -- unspecified Reserved_2_31 : HAL.UInt30; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PTPPPSCR_Register use record TSSO at 0 range 0 .. 0; TSTTR at 0 range 1 .. 1; Reserved_2_31 at 0 range 2 .. 31; end record; --------------------- -- DMABMR_Register -- --------------------- subtype DMABMR_DSL_Field is HAL.UInt5; subtype DMABMR_PBL_Field is HAL.UInt6; subtype DMABMR_RTPR_Field is HAL.UInt2; subtype DMABMR_RDP_Field is HAL.UInt6; -- Ethernet DMA bus mode register type DMABMR_Register is record -- no description available SR : Boolean := True; -- no description available DA : Boolean := False; -- no description available DSL : DMABMR_DSL_Field := 16#0#; -- no description available EDFE : Boolean := False; -- no description available PBL : DMABMR_PBL_Field := 16#21#; -- no description available RTPR : DMABMR_RTPR_Field := 16#0#; -- no description available FB : Boolean := False; -- no description available RDP : DMABMR_RDP_Field := 16#0#; -- no description available USP : Boolean := False; -- no description available FPM : Boolean := False; -- no description available AAB : Boolean := False; -- no description available MB : Boolean := False; -- unspecified Reserved_27_31 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DMABMR_Register use record SR at 0 range 0 .. 0; DA at 0 range 1 .. 1; DSL at 0 range 2 .. 6; EDFE at 0 range 7 .. 7; PBL at 0 range 8 .. 13; RTPR at 0 range 14 .. 15; FB at 0 range 16 .. 16; RDP at 0 range 17 .. 22; USP at 0 range 23 .. 23; FPM at 0 range 24 .. 24; AAB at 0 range 25 .. 25; MB at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -------------------- -- DMASR_Register -- -------------------- subtype DMASR_RPS_Field is HAL.UInt3; subtype DMASR_TPS_Field is HAL.UInt3; subtype DMASR_EBS_Field is HAL.UInt3; -- Ethernet DMA status register type DMASR_Register is record -- no description available TS : Boolean := False; -- no description available TPSS : Boolean := False; -- no description available TBUS : Boolean := False; -- no description available TJTS : Boolean := False; -- no description available ROS : Boolean := False; -- no description available TUS : Boolean := False; -- no description available RS : Boolean := False; -- no description available RBUS : Boolean := False; -- no description available RPSS : Boolean := False; -- no description available PWTS : Boolean := False; -- no description available ETS : Boolean := False; -- unspecified Reserved_11_12 : HAL.UInt2 := 16#0#; -- no description available FBES : Boolean := False; -- no description available ERS : Boolean := False; -- no description available AIS : Boolean := False; -- no description available NIS : Boolean := False; -- Read-only. no description available RPS : DMASR_RPS_Field := 16#0#; -- Read-only. no description available TPS : DMASR_TPS_Field := 16#0#; -- Read-only. no description available EBS : DMASR_EBS_Field := 16#0#; -- unspecified Reserved_26_26 : HAL.Bit := 16#0#; -- Read-only. no description available MMCS : Boolean := False; -- Read-only. no description available PMTS : Boolean := False; -- Read-only. no description available TSTS : Boolean := False; -- unspecified Reserved_30_31 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DMASR_Register use record TS at 0 range 0 .. 0; TPSS at 0 range 1 .. 1; TBUS at 0 range 2 .. 2; TJTS at 0 range 3 .. 3; ROS at 0 range 4 .. 4; TUS at 0 range 5 .. 5; RS at 0 range 6 .. 6; RBUS at 0 range 7 .. 7; RPSS at 0 range 8 .. 8; PWTS at 0 range 9 .. 9; ETS at 0 range 10 .. 10; Reserved_11_12 at 0 range 11 .. 12; FBES at 0 range 13 .. 13; ERS at 0 range 14 .. 14; AIS at 0 range 15 .. 15; NIS at 0 range 16 .. 16; RPS at 0 range 17 .. 19; TPS at 0 range 20 .. 22; EBS at 0 range 23 .. 25; Reserved_26_26 at 0 range 26 .. 26; MMCS at 0 range 27 .. 27; PMTS at 0 range 28 .. 28; TSTS at 0 range 29 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; --------------------- -- DMAOMR_Register -- --------------------- subtype DMAOMR_RTC_Field is HAL.UInt2; subtype DMAOMR_TTC_Field is HAL.UInt3; -- Ethernet DMA operation mode register type DMAOMR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- SR SR : Boolean := False; -- OSF OSF : Boolean := False; -- RTC RTC : DMAOMR_RTC_Field := 16#0#; -- unspecified Reserved_5_5 : HAL.Bit := 16#0#; -- FUGF FUGF : Boolean := False; -- FEF FEF : Boolean := False; -- unspecified Reserved_8_12 : HAL.UInt5 := 16#0#; -- ST ST : Boolean := False; -- TTC TTC : DMAOMR_TTC_Field := 16#0#; -- unspecified Reserved_17_19 : HAL.UInt3 := 16#0#; -- FTF FTF : Boolean := False; -- TSF TSF : Boolean := False; -- unspecified Reserved_22_23 : HAL.UInt2 := 16#0#; -- DFRF DFRF : Boolean := False; -- RSF RSF : Boolean := False; -- DTCEFD DTCEFD : Boolean := False; -- unspecified Reserved_27_31 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DMAOMR_Register use record Reserved_0_0 at 0 range 0 .. 0; SR at 0 range 1 .. 1; OSF at 0 range 2 .. 2; RTC at 0 range 3 .. 4; Reserved_5_5 at 0 range 5 .. 5; FUGF at 0 range 6 .. 6; FEF at 0 range 7 .. 7; Reserved_8_12 at 0 range 8 .. 12; ST at 0 range 13 .. 13; TTC at 0 range 14 .. 16; Reserved_17_19 at 0 range 17 .. 19; FTF at 0 range 20 .. 20; TSF at 0 range 21 .. 21; Reserved_22_23 at 0 range 22 .. 23; DFRF at 0 range 24 .. 24; RSF at 0 range 25 .. 25; DTCEFD at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; --------------------- -- DMAIER_Register -- --------------------- -- Ethernet DMA interrupt enable register type DMAIER_Register is record -- no description available TIE : Boolean := False; -- no description available TPSIE : Boolean := False; -- no description available TBUIE : Boolean := False; -- no description available TJTIE : Boolean := False; -- no description available ROIE : Boolean := False; -- no description available TUIE : Boolean := False; -- no description available RIE : Boolean := False; -- no description available RBUIE : Boolean := False; -- no description available RPSIE : Boolean := False; -- no description available RWTIE : Boolean := False; -- no description available ETIE : Boolean := False; -- unspecified Reserved_11_12 : HAL.UInt2 := 16#0#; -- no description available FBEIE : Boolean := False; -- no description available ERIE : Boolean := False; -- no description available AISE : Boolean := False; -- no description available NISE : Boolean := False; -- unspecified Reserved_17_31 : HAL.UInt15 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DMAIER_Register use record TIE at 0 range 0 .. 0; TPSIE at 0 range 1 .. 1; TBUIE at 0 range 2 .. 2; TJTIE at 0 range 3 .. 3; ROIE at 0 range 4 .. 4; TUIE at 0 range 5 .. 5; RIE at 0 range 6 .. 6; RBUIE at 0 range 7 .. 7; RPSIE at 0 range 8 .. 8; RWTIE at 0 range 9 .. 9; ETIE at 0 range 10 .. 10; Reserved_11_12 at 0 range 11 .. 12; FBEIE at 0 range 13 .. 13; ERIE at 0 range 14 .. 14; AISE at 0 range 15 .. 15; NISE at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; ------------------------ -- DMAMFBOCR_Register -- ------------------------ subtype DMAMFBOCR_MFC_Field is HAL.Short; subtype DMAMFBOCR_MFA_Field is HAL.UInt11; -- Ethernet DMA missed frame and buffer overflow counter register type DMAMFBOCR_Register is record -- no description available MFC : DMAMFBOCR_MFC_Field := 16#0#; -- no description available OMFC : Boolean := False; -- no description available MFA : DMAMFBOCR_MFA_Field := 16#0#; -- no description available OFOC : Boolean := False; -- unspecified Reserved_29_31 : HAL.UInt3 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DMAMFBOCR_Register use record MFC at 0 range 0 .. 15; OMFC at 0 range 16 .. 16; MFA at 0 range 17 .. 27; OFOC at 0 range 28 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; ----------------------- -- DMARSWTR_Register -- ----------------------- subtype DMARSWTR_RSWTC_Field is HAL.Byte; -- Ethernet DMA receive status watchdog timer register type DMARSWTR_Register is record -- RSWTC RSWTC : DMARSWTR_RSWTC_Field := 16#0#; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DMARSWTR_Register use record RSWTC at 0 range 0 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Ethernet: media access control (MAC) type Ethernet_MAC_Peripheral is record -- Ethernet MAC configuration register MACCR : MACCR_Register; -- Ethernet MAC frame filter register MACFFR : MACFFR_Register; -- Ethernet MAC hash table high register MACHTHR : HAL.Word; -- Ethernet MAC hash table low register MACHTLR : HAL.Word; -- Ethernet MAC MII address register MACMIIAR : MACMIIAR_Register; -- Ethernet MAC MII data register MACMIIDR : MACMIIDR_Register; -- Ethernet MAC flow control register MACFCR : MACFCR_Register; -- Ethernet MAC VLAN tag register MACVLANTR : MACVLANTR_Register; -- Ethernet MAC PMT control and status register MACPMTCSR : MACPMTCSR_Register; -- Ethernet MAC debug register MACDBGR : MACDBGR_Register; -- Ethernet MAC interrupt status register MACSR : MACSR_Register; -- Ethernet MAC interrupt mask register MACIMR : MACIMR_Register; -- Ethernet MAC address 0 high register MACA0HR : MACA0HR_Register; -- Ethernet MAC address 0 low register MACA0LR : HAL.Word; -- Ethernet MAC address 1 high register MACA1HR : MACA1HR_Register; -- Ethernet MAC address1 low register MACA1LR : HAL.Word; -- Ethernet MAC address 2 high register MACA2HR : MACA2HR_Register; -- Ethernet MAC address 2 low register MACA2LR : MACA2LR_Register; -- Ethernet MAC address 3 high register MACA3HR : MACA3HR_Register; -- Ethernet MAC address 3 low register MACA3LR : HAL.Word; end record with Volatile; for Ethernet_MAC_Peripheral use record MACCR at 0 range 0 .. 31; MACFFR at 4 range 0 .. 31; MACHTHR at 8 range 0 .. 31; MACHTLR at 12 range 0 .. 31; MACMIIAR at 16 range 0 .. 31; MACMIIDR at 20 range 0 .. 31; MACFCR at 24 range 0 .. 31; MACVLANTR at 28 range 0 .. 31; MACPMTCSR at 44 range 0 .. 31; MACDBGR at 52 range 0 .. 31; MACSR at 56 range 0 .. 31; MACIMR at 60 range 0 .. 31; MACA0HR at 64 range 0 .. 31; MACA0LR at 68 range 0 .. 31; MACA1HR at 72 range 0 .. 31; MACA1LR at 76 range 0 .. 31; MACA2HR at 80 range 0 .. 31; MACA2LR at 84 range 0 .. 31; MACA3HR at 88 range 0 .. 31; MACA3LR at 92 range 0 .. 31; end record; -- Ethernet: media access control (MAC) Ethernet_MAC_Periph : aliased Ethernet_MAC_Peripheral with Import, Address => Ethernet_MAC_Base; -- Ethernet: MAC management counters type Ethernet_MMC_Peripheral is record -- Ethernet MMC control register MMCCR : MMCCR_Register; -- Ethernet MMC receive interrupt register MMCRIR : MMCRIR_Register; -- Ethernet MMC transmit interrupt register MMCTIR : MMCTIR_Register; -- Ethernet MMC receive interrupt mask register MMCRIMR : MMCRIMR_Register; -- Ethernet MMC transmit interrupt mask register MMCTIMR : MMCTIMR_Register; -- Ethernet MMC transmitted good frames after a single collision counter MMCTGFSCCR : HAL.Word; -- Ethernet MMC transmitted good frames after more than a single -- collision MMCTGFMSCCR : HAL.Word; -- Ethernet MMC transmitted good frames counter register MMCTGFCR : HAL.Word; -- Ethernet MMC received frames with CRC error counter register MMCRFCECR : HAL.Word; -- Ethernet MMC received frames with alignment error counter register MMCRFAECR : HAL.Word; -- MMC received good unicast frames counter register MMCRGUFCR : HAL.Word; end record with Volatile; for Ethernet_MMC_Peripheral use record MMCCR at 0 range 0 .. 31; MMCRIR at 4 range 0 .. 31; MMCTIR at 8 range 0 .. 31; MMCRIMR at 12 range 0 .. 31; MMCTIMR at 16 range 0 .. 31; MMCTGFSCCR at 76 range 0 .. 31; MMCTGFMSCCR at 80 range 0 .. 31; MMCTGFCR at 104 range 0 .. 31; MMCRFCECR at 148 range 0 .. 31; MMCRFAECR at 152 range 0 .. 31; MMCRGUFCR at 196 range 0 .. 31; end record; -- Ethernet: MAC management counters Ethernet_MMC_Periph : aliased Ethernet_MMC_Peripheral with Import, Address => Ethernet_MMC_Base; -- Ethernet: Precision time protocol type Ethernet_PTP_Peripheral is record -- Ethernet PTP time stamp control register PTPTSCR : PTPTSCR_Register; -- Ethernet PTP subsecond increment register PTPSSIR : PTPSSIR_Register; -- Ethernet PTP time stamp high register PTPTSHR : HAL.Word; -- Ethernet PTP time stamp low register PTPTSLR : PTPTSLR_Register; -- Ethernet PTP time stamp high update register PTPTSHUR : HAL.Word; -- Ethernet PTP time stamp low update register PTPTSLUR : PTPTSLUR_Register; -- Ethernet PTP time stamp addend register PTPTSAR : HAL.Word; -- Ethernet PTP target time high register PTPTTHR : HAL.Word; -- Ethernet PTP target time low register PTPTTLR : HAL.Word; -- Ethernet PTP time stamp status register PTPTSSR : PTPTSSR_Register; -- Ethernet PTP PPS control register PTPPPSCR : PTPPPSCR_Register; end record with Volatile; for Ethernet_PTP_Peripheral use record PTPTSCR at 0 range 0 .. 31; PTPSSIR at 4 range 0 .. 31; PTPTSHR at 8 range 0 .. 31; PTPTSLR at 12 range 0 .. 31; PTPTSHUR at 16 range 0 .. 31; PTPTSLUR at 20 range 0 .. 31; PTPTSAR at 24 range 0 .. 31; PTPTTHR at 28 range 0 .. 31; PTPTTLR at 32 range 0 .. 31; PTPTSSR at 40 range 0 .. 31; PTPPPSCR at 44 range 0 .. 31; end record; -- Ethernet: Precision time protocol Ethernet_PTP_Periph : aliased Ethernet_PTP_Peripheral with Import, Address => Ethernet_PTP_Base; -- Ethernet: DMA controller operation type Ethernet_DMA_Peripheral is record -- Ethernet DMA bus mode register DMABMR : DMABMR_Register; -- Ethernet DMA transmit poll demand register DMATPDR : HAL.Word; -- EHERNET DMA receive poll demand register DMARPDR : HAL.Word; -- Ethernet DMA receive descriptor list address register DMARDLAR : HAL.Word; -- Ethernet DMA transmit descriptor list address register DMATDLAR : HAL.Word; -- Ethernet DMA status register DMASR : DMASR_Register; -- Ethernet DMA operation mode register DMAOMR : DMAOMR_Register; -- Ethernet DMA interrupt enable register DMAIER : DMAIER_Register; -- Ethernet DMA missed frame and buffer overflow counter register DMAMFBOCR : DMAMFBOCR_Register; -- Ethernet DMA receive status watchdog timer register DMARSWTR : DMARSWTR_Register; -- Ethernet DMA current host transmit descriptor register DMACHTDR : HAL.Word; -- Ethernet DMA current host receive descriptor register DMACHRDR : HAL.Word; -- Ethernet DMA current host transmit buffer address register DMACHTBAR : HAL.Word; -- Ethernet DMA current host receive buffer address register DMACHRBAR : HAL.Word; end record with Volatile; for Ethernet_DMA_Peripheral use record DMABMR at 0 range 0 .. 31; DMATPDR at 4 range 0 .. 31; DMARPDR at 8 range 0 .. 31; DMARDLAR at 12 range 0 .. 31; DMATDLAR at 16 range 0 .. 31; DMASR at 20 range 0 .. 31; DMAOMR at 24 range 0 .. 31; DMAIER at 28 range 0 .. 31; DMAMFBOCR at 32 range 0 .. 31; DMARSWTR at 36 range 0 .. 31; DMACHTDR at 72 range 0 .. 31; DMACHRDR at 76 range 0 .. 31; DMACHTBAR at 80 range 0 .. 31; DMACHRBAR at 84 range 0 .. 31; end record; -- Ethernet: DMA controller operation Ethernet_DMA_Periph : aliased Ethernet_DMA_Peripheral with Import, Address => Ethernet_DMA_Base; end STM32_SVD.Ethernet;
-- ----------------------------------------------------------------- -- -- AdaSDL_Framebuffer -- -- Copyright (C) 2001 A.M.F.Vargas -- -- Antonio M. F. Vargas -- -- Ponta Delgada - Azores - Portugal -- -- http://www.adapower.net/~avargas -- -- E-mail: avargas@adapower.net -- -- ----------------------------------------------------------------- -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public -- -- License as published by the Free Software Foundation; either -- -- version 2 of the License, or (at your option) any later version. -- -- -- -- This 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 -- -- General Public License for more details. -- -- -- -- You should have received a copy of the GNU General Public -- -- License along with this library; if not, write to the -- -- Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- -- Boston, MA 02111-1307, USA. -- -- -- -- 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. -- -- ----------------------------------------------------------------- -- -- ########################################################################## -- ### These are new extensions to the SDL API in order to improve the -- ### Ada code and to isolate the pointer arithmetic inside the library. -- ########################################################################## with Interfaces.C; with Lib_C; package body SDL_Framebuffer is use type C.int; -- =========================================================== function Go_XY_24b_Unchecked ( Surface : Vd.Surface_ptr; X : Natural; Y : Natural) return Framebuffer_8bPointer is begin return Go_XY_Unchecked (Surface, Natural (3 * X), Natural (Y)); end Go_XY_24b_Unchecked; -- =========================================================== procedure Set_24b_Value_Unchecked ( Surface : Vd.Surface_ptr; Location : Framebuffer_8bPointer; Value : Uint32) is use Uint8_Ptrs; use Uint8_PtrOps; use Interfaces; Shift : C.int; Pix : Framebuffer_8bPointer := Location; begin Shift := C.int (Surface.format.Rshift); Uint8_Ptrs.Object_Pointer ( Uint8_PtrOps.Pointer (Pix) + C.ptrdiff_t (Shift / 8) ).all := Uint8 (Shift_Right (Value, Integer (Shift))); Shift := C.int (Surface.format.Gshift); Uint8_Ptrs.Object_Pointer ( Uint8_PtrOps.Pointer (Pix) + C.ptrdiff_t (Shift / 8) ).all := Uint8 (Shift_Right (Value, Integer (Shift))); Shift := C.int (Surface.format.Bshift); Uint8_Ptrs.Object_Pointer ( Uint8_PtrOps.Pointer (Pix) + C.ptrdiff_t (Shift / 8) ).all := Uint8 (Shift_Right (Value, Integer (Shift))); end Set_24b_Value_Unchecked; -- ======================================= procedure Copy_Colors ( Source : Surface_ptr; Dest : Color_PtrOps.Pointer; Num_Colors : Natural) is begin Color_PtrOps.Copy_Array ( Color_PtrOps.Pointer (Source.format.palette.colors), Dest, C.ptrdiff_t (Num_Colors)); end Copy_Colors; -- ======================================= function Copy_Colors ( Surface : Surface_ptr; Num_Colors : Natural) return Colors_Array is begin return Color_PtrOps.Value ( Color_PtrOps.Pointer (Surface.format.palette.colors), C.ptrdiff_t (Num_Colors)); end Copy_Colors; -- =================================================================== function Pitch_Gap (Surface : Surface_ptr) return Uint16 is begin return Surface.pitch - Uint16 (Surface.w)* Uint16 (Surface.format.BytesPerPixel); end Pitch_Gap; -- ================================================================== function Get_Palette_Red ( Surface : Surface_ptr; Color_Index : Uint8) return Uint8 is use Color_PtrOps; begin return Color_ptr ( Color_PtrOps.Pointer (Surface.format.palette.colors) + C.ptrdiff_t (Color_Index) ).all.r; end Get_Palette_Red; -- ============================================= function Get_Palette_Green ( Surface : Surface_ptr; Color_Index : Uint8) return Uint8 is use Color_PtrOps; begin return Color_ptr ( Color_PtrOps.Pointer (Surface.format.palette.colors) + C.ptrdiff_t (Color_Index) ).all.g; end Get_Palette_Green; -- ============================================= function Get_Palette_Blue ( Surface : Surface_ptr; Color_Index : Uint8) return Uint8 is use Color_PtrOps; begin return Color_ptr ( Color_PtrOps.Pointer (Surface.format.palette.colors) + C.ptrdiff_t (Color_Index) ).all.b; end Get_Palette_Blue; -- ####################################################################### end SDL_Framebuffer;
<?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>call_Loop_LB2D_shift</name> <ret_bitwidth>0</ret_bitwidth> <ports class_id="2" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="3" tracking_level="1" version="0" object_id="_1"> <Value class_id="4" tracking_level="0" version="0"> <Obj class_id="5" tracking_level="0" version="0"> <type>1</type> <id>1</id> <name>slice_stream_V_value_V</name> <fileName></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>in_stream.V.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <direction>0</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs class_id="7" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> <item class_id_reference="3" object_id="_2"> <Value> <Obj> <type>1</type> <id>2</id> <name>out_stream_V_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>out_stream.V.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>72</bitwidth> </Value> <direction>1</direction> <if_type>3</if_type> <array_size>0</array_size> <bit_vecs> <count>0</count> <item_version>0</item_version> </bit_vecs> </item> </ports> <nodes class_id="8" tracking_level="0" version="0"> <count>36</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_3"> <Value> <Obj> <type>0</type> <id>3</id> <name>buffer_1_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>buffer[1].value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>62</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_4"> <Value> <Obj> <type>0</type> <id>4</id> <name>buffer_0_value_V</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>buffer[0].value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>63</item> </oprand_edges> <opcode>alloca</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_5"> <Value> <Obj> <type>0</type> <id>9</id> <name></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>64</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>11</id> <name>n1</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>n1</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>65</item> <item>66</item> <item>68</item> <item>69</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>12</id> <name>tmp_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second class_id="12" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="13" tracking_level="0" version="0"> <first class_id="14" tracking_level="0" version="0"> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>1</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>70</item> <item>72</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_8"> <Value> <Obj> <type>0</type> <id>14</id> <name>n1_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName>n1</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>2</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>73</item> <item>75</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_9"> <Value> <Obj> <type>0</type> <id>15</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>76</item> <item>77</item> <item>78</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_10"> <Value> <Obj> <type>0</type> <id>19</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>94</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_11"> <Value> <Obj> <type>0</type> <id>21</id> <name>i_0_i_i</name> <fileName></fileName> <fileDirectory></fileDirectory> <lineNumber>0</lineNumber> <contextFuncName></contextFuncName> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>i</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>81</item> <item>82</item> <item>83</item> <item>84</item> </oprand_edges> <opcode>phi</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_12"> <Value> <Obj> <type>0</type> <id>22</id> <name>tmp_3</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>85</item> <item>87</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_13"> <Value> <Obj> <type>0</type> <id>24</id> <name>i</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName>i</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>3</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>88</item> <item>90</item> </oprand_edges> <opcode>add</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_14"> <Value> <Obj> <type>0</type> <id>25</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>91</item> <item>92</item> <item>93</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_15"> <Value> <Obj> <type>0</type> <id>30</id> <name>tmp_value_V_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>40</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>2</count> <item_version>0</item_version> <item>102</item> <item>103</item> </oprand_edges> <opcode>read</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_16"> <Value> <Obj> <type>0</type> <id>31</id> <name>tmp</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>42</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>105</item> <item>106</item> <item>107</item> <item>109</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_17"> <Value> <Obj> <type>0</type> <id>32</id> <name>icmp</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>42</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>110</item> <item>111</item> </oprand_edges> <opcode>icmp</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_18"> <Value> <Obj> <type>0</type> <id>33</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>42</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>42</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>112</item> <item>113</item> <item>114</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_19"> <Value> <Obj> <type>0</type> <id>35</id> <name>buffer_1_value_V_lo_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>115</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_20"> <Value> <Obj> <type>0</type> <id>36</id> <name>buffer_0_value_V_lo</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>116</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_21"> <Value> <Obj> <type>0</type> <id>37</id> <name>tmp_6</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>117</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_22"> <Value> <Obj> <type>0</type> <id>38</id> <name>tmp_7</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>118</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_23"> <Value> <Obj> <type>0</type> <id>39</id> <name>tmp_9</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>119</item> </oprand_edges> <opcode>trunc</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_24"> <Value> <Obj> <type>0</type> <id>40</id> <name>p_Result_6_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>121</item> <item>122</item> <item>124</item> <item>126</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_25"> <Value> <Obj> <type>0</type> <id>41</id> <name>p_Result_6_1_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>127</item> <item>128</item> <item>129</item> <item>130</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_26"> <Value> <Obj> <type>0</type> <id>42</id> <name>p_Result_6_1_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>131</item> <item>132</item> <item>133</item> <item>134</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_27"> <Value> <Obj> <type>0</type> <id>43</id> <name>p_Result_6_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>135</item> <item>136</item> <item>138</item> <item>140</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_28"> <Value> <Obj> <type>0</type> <id>44</id> <name>p_Result_6_2_1</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>141</item> <item>142</item> <item>143</item> <item>144</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_29"> <Value> <Obj> <type>0</type> <id>45</id> <name>p_Result_6_2_2</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>8</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>145</item> <item>146</item> <item>147</item> <item>148</item> </oprand_edges> <opcode>partselect</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_30"> <Value> <Obj> <type>0</type> <id>46</id> <name>tmp_value_V</name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>50</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>50</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName>tmp.value.V</originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>72</bitwidth> </Value> <oprand_edges> <count>10</count> <item_version>0</item_version> <item>150</item> <item>151</item> <item>152</item> <item>153</item> <item>154</item> <item>155</item> <item>156</item> <item>157</item> <item>158</item> <item>159</item> </oprand_edges> <opcode>bitconcatenate</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_31"> <Value> <Obj> <type>0</type> <id>47</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>52</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>52</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>161</item> <item>162</item> <item>163</item> </oprand_edges> <opcode>write</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_32"> <Value> <Obj> <type>0</type> <id>48</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>53</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>53</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>164</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_33"> <Value> <Obj> <type>0</type> <id>50</id> <name>buffer_1_value_V_lo</name> <fileName>../../../lib_files/Stencil.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>75</lineNumber> <contextFuncName>operator=</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>3</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>37</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> <item> <first> <first>../../../lib_files/Stencil.h</first> <second>operator=</second> </first> <second>75</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>24</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>95</item> </oprand_edges> <opcode>load</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_34"> <Value> <Obj> <type>0</type> <id>52</id> <name></name> <fileName>../../../lib_files/Stencil.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>75</lineNumber> <contextFuncName>operator=</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>3</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>37</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> <item> <first> <first>../../../lib_files/Stencil.h</first> <second>operator=</second> </first> <second>75</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>3</count> <item_version>0</item_version> <item>96</item> <item>97</item> <item>278</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_35"> <Value> <Obj> <type>0</type> <id>53</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>40</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>40</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>98</item> <item>99</item> <item>276</item> <item>277</item> </oprand_edges> <opcode>store</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_36"> <Value> <Obj> <type>0</type> <id>54</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>32</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>2</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>32</second> </item> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>linebuffer_1D&amp;lt;4, 3, 1, 1, 1, 3, unsigned char&amp;gt;</second> </first> <second>143</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>100</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_37"> <Value> <Obj> <type>0</type> <id>57</id> <name></name> <fileName>../../../lib_files/Linebuffer.h</fileName> <fileDirectory>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</fileDirectory> <lineNumber>216</lineNumber> <contextFuncName>call</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/paper_apps_8_shifts/conv2d_b2b</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>../../../lib_files/Linebuffer.h</first> <second>call</second> </first> <second>216</second> </item> </second> </item> </inlineStackInfo> <originalName></originalName> <rtlName></rtlName> <coreName></coreName> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>1</count> <item_version>0</item_version> <item>79</item> </oprand_edges> <opcode>br</opcode> <m_Display>0</m_Display> </item> <item class_id_reference="9" object_id="_38"> <Value> <Obj> <type>0</type> <id>59</id> <name></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>12</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_39"> <Value> <Obj> <type>2</type> <id>61</id> <name>empty</name> <fileName></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>1</content> </item> <item class_id_reference="16" object_id="_40"> <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>2</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_41"> <Value> <Obj> <type>2</type> <id>71</id> <name>empty</name> <fileName></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>2</content> </item> <item class_id_reference="16" object_id="_42"> <Value> <Obj> <type>2</type> <id>74</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>1</content> </item> <item class_id_reference="16" object_id="_43"> <Value> <Obj> <type>2</type> <id>80</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>3</bitwidth> </Value> <const_type>0</const_type> <content>0</content> </item> <item class_id_reference="16" object_id="_44"> <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>3</bitwidth> </Value> <const_type>0</const_type> <content>4</content> </item> <item class_id_reference="16" object_id="_45"> <Value> <Obj> <type>2</type> <id>89</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>3</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>108</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="_47"> <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>32</bitwidth> </Value> <const_type>0</const_type> <content>8</content> </item> <item class_id_reference="16" object_id="_48"> <Value> <Obj> <type>2</type> <id>125</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>15</content> </item> <item class_id_reference="16" object_id="_49"> <Value> <Obj> <type>2</type> <id>137</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>16</content> </item> <item class_id_reference="16" object_id="_50"> <Value> <Obj> <type>2</type> <id>139</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>23</content> </item> </consts> <blocks class_id="17" tracking_level="0" version="0"> <count>9</count> <item_version>0</item_version> <item class_id="18" tracking_level="1" version="0" object_id="_51"> <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>3</count> <item_version>0</item_version> <item>3</item> <item>4</item> <item>9</item> </node_objs> </item> <item class_id_reference="18" object_id="_52"> <Obj> <type>3</type> <id>16</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>4</count> <item_version>0</item_version> <item>11</item> <item>12</item> <item>14</item> <item>15</item> </node_objs> </item> <item class_id_reference="18" object_id="_53"> <Obj> <type>3</type> <id>20</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> <node_objs> <count>1</count> <item_version>0</item_version> <item>19</item> </node_objs> </item> <item class_id_reference="18" object_id="_54"> <Obj> <type>3</type> <id>26</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> <node_objs> <count>4</count> <item_version>0</item_version> <item>21</item> <item>22</item> <item>24</item> <item>25</item> </node_objs> </item> <item class_id_reference="18" object_id="_55"> <Obj> <type>3</type> <id>34</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> <node_objs> <count>4</count> <item_version>0</item_version> <item>30</item> <item>31</item> <item>32</item> <item>33</item> </node_objs> </item> <item class_id_reference="18" object_id="_56"> <Obj> <type>3</type> <id>49</id> <name>.preheader.i.i.preheader.0</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>14</count> <item_version>0</item_version> <item>35</item> <item>36</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>43</item> <item>44</item> <item>45</item> <item>46</item> <item>47</item> <item>48</item> </node_objs> </item> <item class_id_reference="18" object_id="_57"> <Obj> <type>3</type> <id>55</id> <name>._crit_edge.i.i</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>4</count> <item_version>0</item_version> <item>50</item> <item>52</item> <item>53</item> <item>54</item> </node_objs> </item> <item class_id_reference="18" object_id="_58"> <Obj> <type>3</type> <id>58</id> <name>linebuffer_1D&lt;4ul, 3ul, 1ul, 1ul, 1ul, 3ul, unsigned char&gt;.exit</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>57</item> </node_objs> </item> <item class_id_reference="18" object_id="_59"> <Obj> <type>3</type> <id>60</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>59</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>91</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_60"> <id>62</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>3</sink_obj> </item> <item class_id_reference="20" object_id="_61"> <id>63</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>4</sink_obj> </item> <item class_id_reference="20" object_id="_62"> <id>64</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>9</sink_obj> </item> <item class_id_reference="20" object_id="_63"> <id>65</id> <edge_type>1</edge_type> <source_obj>14</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_64"> <id>66</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_65"> <id>68</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_66"> <id>69</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>11</sink_obj> </item> <item class_id_reference="20" object_id="_67"> <id>70</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_68"> <id>72</id> <edge_type>1</edge_type> <source_obj>71</source_obj> <sink_obj>12</sink_obj> </item> <item class_id_reference="20" object_id="_69"> <id>73</id> <edge_type>1</edge_type> <source_obj>11</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_70"> <id>75</id> <edge_type>1</edge_type> <source_obj>74</source_obj> <sink_obj>14</sink_obj> </item> <item class_id_reference="20" object_id="_71"> <id>76</id> <edge_type>1</edge_type> <source_obj>12</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_72"> <id>77</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_73"> <id>78</id> <edge_type>2</edge_type> <source_obj>60</source_obj> <sink_obj>15</sink_obj> </item> <item class_id_reference="20" object_id="_74"> <id>79</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>57</sink_obj> </item> <item class_id_reference="20" object_id="_75"> <id>81</id> <edge_type>1</edge_type> <source_obj>80</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_76"> <id>82</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_77"> <id>83</id> <edge_type>1</edge_type> <source_obj>24</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_78"> <id>84</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>21</sink_obj> </item> <item class_id_reference="20" object_id="_79"> <id>85</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_80"> <id>87</id> <edge_type>1</edge_type> <source_obj>86</source_obj> <sink_obj>22</sink_obj> </item> <item class_id_reference="20" object_id="_81"> <id>88</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_82"> <id>90</id> <edge_type>1</edge_type> <source_obj>89</source_obj> <sink_obj>24</sink_obj> </item> <item class_id_reference="20" object_id="_83"> <id>91</id> <edge_type>1</edge_type> <source_obj>22</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_84"> <id>92</id> <edge_type>2</edge_type> <source_obj>34</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_85"> <id>93</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>25</sink_obj> </item> <item class_id_reference="20" object_id="_86"> <id>94</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>19</sink_obj> </item> <item class_id_reference="20" object_id="_87"> <id>95</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>50</sink_obj> </item> <item class_id_reference="20" object_id="_88"> <id>96</id> <edge_type>1</edge_type> <source_obj>50</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_89"> <id>97</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>52</sink_obj> </item> <item class_id_reference="20" object_id="_90"> <id>98</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_91"> <id>99</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_92"> <id>100</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>54</sink_obj> </item> <item class_id_reference="20" object_id="_93"> <id>103</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>30</sink_obj> </item> <item class_id_reference="20" object_id="_94"> <id>106</id> <edge_type>1</edge_type> <source_obj>21</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_95"> <id>107</id> <edge_type>1</edge_type> <source_obj>61</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_96"> <id>109</id> <edge_type>1</edge_type> <source_obj>108</source_obj> <sink_obj>31</sink_obj> </item> <item class_id_reference="20" object_id="_97"> <id>110</id> <edge_type>1</edge_type> <source_obj>31</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_98"> <id>111</id> <edge_type>1</edge_type> <source_obj>67</source_obj> <sink_obj>32</sink_obj> </item> <item class_id_reference="20" object_id="_99"> <id>112</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_100"> <id>113</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_101"> <id>114</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>33</sink_obj> </item> <item class_id_reference="20" object_id="_102"> <id>115</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>35</sink_obj> </item> <item class_id_reference="20" object_id="_103"> <id>116</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>36</sink_obj> </item> <item class_id_reference="20" object_id="_104"> <id>117</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>37</sink_obj> </item> <item class_id_reference="20" object_id="_105"> <id>118</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>38</sink_obj> </item> <item class_id_reference="20" object_id="_106"> <id>119</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>39</sink_obj> </item> <item class_id_reference="20" object_id="_107"> <id>122</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>40</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>40</sink_obj> </item> <item class_id_reference="20" object_id="_109"> <id>126</id> <edge_type>1</edge_type> <source_obj>125</source_obj> <sink_obj>40</sink_obj> </item> <item class_id_reference="20" object_id="_110"> <id>128</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_111"> <id>129</id> <edge_type>1</edge_type> <source_obj>123</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_112"> <id>130</id> <edge_type>1</edge_type> <source_obj>125</source_obj> <sink_obj>41</sink_obj> </item> <item class_id_reference="20" object_id="_113"> <id>132</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_114"> <id>133</id> <edge_type>1</edge_type> <source_obj>123</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_115"> <id>134</id> <edge_type>1</edge_type> <source_obj>125</source_obj> <sink_obj>42</sink_obj> </item> <item class_id_reference="20" object_id="_116"> <id>136</id> <edge_type>1</edge_type> <source_obj>36</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_117"> <id>138</id> <edge_type>1</edge_type> <source_obj>137</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_118"> <id>140</id> <edge_type>1</edge_type> <source_obj>139</source_obj> <sink_obj>43</sink_obj> </item> <item class_id_reference="20" object_id="_119"> <id>142</id> <edge_type>1</edge_type> <source_obj>35</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_120"> <id>143</id> <edge_type>1</edge_type> <source_obj>137</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_121"> <id>144</id> <edge_type>1</edge_type> <source_obj>139</source_obj> <sink_obj>44</sink_obj> </item> <item class_id_reference="20" object_id="_122"> <id>146</id> <edge_type>1</edge_type> <source_obj>30</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_123"> <id>147</id> <edge_type>1</edge_type> <source_obj>137</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_124"> <id>148</id> <edge_type>1</edge_type> <source_obj>139</source_obj> <sink_obj>45</sink_obj> </item> <item class_id_reference="20" object_id="_125"> <id>151</id> <edge_type>1</edge_type> <source_obj>45</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_126"> <id>152</id> <edge_type>1</edge_type> <source_obj>44</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_127"> <id>153</id> <edge_type>1</edge_type> <source_obj>43</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_128"> <id>154</id> <edge_type>1</edge_type> <source_obj>42</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_129"> <id>155</id> <edge_type>1</edge_type> <source_obj>41</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_130"> <id>156</id> <edge_type>1</edge_type> <source_obj>40</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_131"> <id>157</id> <edge_type>1</edge_type> <source_obj>39</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_132"> <id>158</id> <edge_type>1</edge_type> <source_obj>38</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_133"> <id>159</id> <edge_type>1</edge_type> <source_obj>37</source_obj> <sink_obj>46</sink_obj> </item> <item class_id_reference="20" object_id="_134"> <id>162</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_135"> <id>163</id> <edge_type>1</edge_type> <source_obj>46</source_obj> <sink_obj>47</sink_obj> </item> <item class_id_reference="20" object_id="_136"> <id>164</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>48</sink_obj> </item> <item class_id_reference="20" object_id="_137"> <id>265</id> <edge_type>2</edge_type> <source_obj>10</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_138"> <id>266</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>60</sink_obj> </item> <item class_id_reference="20" object_id="_139"> <id>267</id> <edge_type>2</edge_type> <source_obj>16</source_obj> <sink_obj>20</sink_obj> </item> <item class_id_reference="20" object_id="_140"> <id>268</id> <edge_type>2</edge_type> <source_obj>20</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_141"> <id>269</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>58</sink_obj> </item> <item class_id_reference="20" object_id="_142"> <id>270</id> <edge_type>2</edge_type> <source_obj>26</source_obj> <sink_obj>34</sink_obj> </item> <item class_id_reference="20" object_id="_143"> <id>271</id> <edge_type>2</edge_type> <source_obj>34</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_144"> <id>272</id> <edge_type>2</edge_type> <source_obj>34</source_obj> <sink_obj>49</sink_obj> </item> <item class_id_reference="20" object_id="_145"> <id>273</id> <edge_type>2</edge_type> <source_obj>49</source_obj> <sink_obj>55</sink_obj> </item> <item class_id_reference="20" object_id="_146"> <id>274</id> <edge_type>2</edge_type> <source_obj>55</source_obj> <sink_obj>26</sink_obj> </item> <item class_id_reference="20" object_id="_147"> <id>275</id> <edge_type>2</edge_type> <source_obj>58</source_obj> <sink_obj>16</sink_obj> </item> <item class_id_reference="20" object_id="_148"> <id>276</id> <edge_type>4</edge_type> <source_obj>50</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_149"> <id>277</id> <edge_type>4</edge_type> <source_obj>35</source_obj> <sink_obj>53</sink_obj> </item> <item class_id_reference="20" object_id="_150"> <id>278</id> <edge_type>4</edge_type> <source_obj>36</source_obj> <sink_obj>52</sink_obj> </item> </edges> </cdfg> <cdfg_regions class_id="21" tracking_level="0" version="0"> <count>7</count> <item_version>0</item_version> <item class_id="22" tracking_level="1" version="0" object_id="_151"> <mId>1</mId> <mTag>call_Loop_LB2D_shift</mTag> <mType>0</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>2</item> <item>3</item> <item>7</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>15</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_152"> <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="_153"> <mId>3</mId> <mTag>LB2D_shift</mTag> <mType>1</mType> <sub_regions> <count>3</count> <item_version>0</item_version> <item>4</item> <item>5</item> <item>6</item> </sub_regions> <basic_blocks> <count>0</count> <item_version>0</item_version> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>2</mMinTripCount> <mMaxTripCount>2</mMaxTripCount> <mMinLatency>14</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_154"> <mId>4</mId> <mTag>Region 1</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>2</count> <item_version>0</item_version> <item>16</item> <item>20</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_155"> <mId>5</mId> <mTag>LB1D_shiftreg</mTag> <mType>1</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>4</count> <item_version>0</item_version> <item>26</item> <item>34</item> <item>49</item> <item>55</item> </basic_blocks> <mII>1</mII> <mDepth>2</mDepth> <mMinTripCount>4</mMinTripCount> <mMaxTripCount>4</mMaxTripCount> <mMinLatency>4</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_156"> <mId>6</mId> <mTag>Region 2</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>58</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></mDfPipe> </item> <item class_id_reference="22" object_id="_157"> <mId>7</mId> <mTag>Return</mTag> <mType>0</mType> <sub_regions> <count>0</count> <item_version>0</item_version> </sub_regions> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>60</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>0</mMinLatency> <mMaxLatency>-1</mMaxLatency> <mIsDfPipe>0</mIsDfPipe> <mDfPipe class_id="-1"></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>36</count> <item_version>0</item_version> <item class_id="27" tracking_level="0" version="0"> <first>3</first> <second class_id="28" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>4</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>9</first> <second> <first>0</first> <second>0</second> </second> </item> <item> <first>11</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>12</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>14</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>15</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>19</first> <second> <first>1</first> <second>0</second> </second> </item> <item> <first>21</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>22</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>24</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>30</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>31</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>32</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>33</first> <second> <first>2</first> <second>0</second> </second> </item> <item> <first>35</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>36</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>37</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>38</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>39</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>40</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>41</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>42</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>43</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>44</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>45</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>46</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>47</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>48</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>50</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>52</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>53</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>54</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>57</first> <second> <first>3</first> <second>0</second> </second> </item> <item> <first>59</first> <second> <first>1</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="29" tracking_level="0" version="0"> <count>9</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>16</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>20</first> <second> <first>1</first> <second>1</second> </second> </item> <item> <first>26</first> <second> <first>2</first> <second>2</second> </second> </item> <item> <first>34</first> <second> <first>2</first> <second>3</second> </second> </item> <item> <first>49</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>55</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>58</first> <second> <first>3</first> <second>3</second> </second> </item> <item> <first>60</first> <second> <first>1</first> <second>1</second> </second> </item> </bblk_ent_exit> <regions class_id="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="_158"> <region_name>LB1D_shiftreg</region_name> <basic_blocks> <count>4</count> <item_version>0</item_version> <item>26</item> <item>34</item> <item>49</item> <item>55</item> </basic_blocks> <nodes> <count>0</count> <item_version>0</item_version> </nodes> <anchor_node>-1</anchor_node> <region_type>8</region_type> <interval>1</interval> <pipe_depth>2</pipe_depth> </item> </regions> <dp_fu_nodes class_id="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>
------------------------------------------------------------------------------ -- -- -- Giza -- -- -- -- Copyright (C) 2015 Fabien Chouteau (chouteau@adacore.com) -- -- -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package body Giza.Widget.Tiles is --------------- -- Set_Dirty -- --------------- overriding procedure Set_Dirty (This : in out Instance; Dirty : Boolean := True) is begin Set_Dirty (Parent (This), Dirty); for Index in This.Widgs'Range loop if This.Widgs (Index) /= null then This.Widgs (Index).Set_Dirty (Dirty); end if; end loop; end Set_Dirty; ---------- -- Draw -- ---------- overriding procedure Draw (This : in out Instance; Ctx : in out Context.Class; Force : Boolean := True) is W, H : Integer; Margin : constant Integer := 1; procedure Draw_Tile (Index : Integer); --------------- -- Draw_Tile -- --------------- procedure Draw_Tile (Index : Integer) is begin if Index in This.Widgs'Range and then This.Widgs (Index) /= null then -- Ctx.Set_Bounds ((My_Bounds.Org + Ref.Pos, Ref.Widg.Get_Size)); This.Widgs (Index).Set_Size ((W, H)); Ctx.Set_Position ((0, 0)); Ctx.Save; Ctx.Set_Bounds (((0, 0), (W, H))); Draw (This.Widgs (Index).all, Ctx, Force); Ctx.Restore; -- Translate for next tile case This.Dir is when Top_Down | Bottom_Up => Ctx.Translate ((0, This.Spacing + H)); when Left_Right | Right_Left => Ctx.Translate ((This.Spacing + W, 0)); end case; end if; end Draw_Tile; begin if This.Dirty or else Force then Draw (Parent (This), Ctx, Force); end if; case This.Dir is when Top_Down | Bottom_Up => H := This.Get_Size.H; H := H - 2 * This.Margin; H := H - (This.Number_Of_Widget - 1) * This.Spacing; H := H / This.Number_Of_Widget; W := This.Get_Size.W - 2 * This.Margin; when Left_Right | Right_Left => W := This.Get_Size.W; W := W - 2 * This.Margin; W := W - (This.Number_Of_Widget - 1) * This.Spacing; W := W / This.Number_Of_Widget; H := This.Get_Size.H - 2 * This.Margin; end case; Ctx.Save; Ctx.Translate ((Margin, Margin)); if This.Dir = Left_Right or else This.Dir = Top_Down then for Index in This.Widgs'Range loop Draw_Tile (Index); end loop; else for Index in reverse This.Widgs'Range loop Draw_Tile (Index); end loop; end if; Ctx.Restore; end Draw; ----------------------- -- On_Position_Event -- ----------------------- overriding function On_Position_Event (This : in out Instance; Evt : Position_Event_Ref; Pos : Point_T) return Boolean is W, H : Integer; begin case This.Dir is when Top_Down | Bottom_Up => H := This.Get_Size.H / This.Number_Of_Widget; when Left_Right | Right_Left => W := This.Get_Size.W / This.Number_Of_Widget; end case; for Index in This.Widgs'Range loop case This.Dir is when Top_Down => if Pos.Y in (Index - 1) * H .. Index * H then return On_Position_Event (This.Widgs (Index).all, Evt, Pos - (0, (Index - 1) * H)); end if; when Bottom_Up => if Pos.Y in (This.Widgs'Last - Index) * H .. (This.Widgs'Last - Index + 1) * H then return On_Position_Event (This.Widgs (Index).all, Evt, Pos - (0, (This.Widgs'Last - Index) * H)); end if; when Left_Right => if Pos.X in (Index - 1) * W .. Index * W then return On_Position_Event (This.Widgs (Index).all, Evt, Pos - ((Index - 1) * W, 0)); end if; when Right_Left => if Pos.X in (This.Widgs'Last - Index) * W .. (This.Widgs'Last - Index + 1) * W then return On_Position_Event (This.Widgs (Index).all, Evt, Pos - ((Index - 1) * W, 0)); end if; end case; end loop; return False; end On_Position_Event; -------------- -- On_Event -- -------------- overriding function On_Event (This : in out Instance; Evt : Event_Not_Null_Ref) return Boolean is Handled : Boolean := False; begin for W of This.Widgs loop if W /= null then Handled := Handled or W.On_Event (Evt); end if; end loop; return Handled; end On_Event; --------------- -- Set_Child -- --------------- procedure Set_Child (This : in out Instance; Index : Positive; Child : Widget.Reference) is begin if Index in This.Widgs'Range then This.Widgs (Index) := Child; end if; end Set_Child; ----------------- -- Set_Spacing -- ----------------- procedure Set_Spacing (This : in out Instance; Spacing : Natural) is begin This.Spacing := Spacing; end Set_Spacing; ---------------- -- Set_Margin -- ---------------- procedure Set_Margin (This : in out Instance; Margin : Natural) is begin This.Margin := Margin; end Set_Margin; end Giza.Widget.Tiles;
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.UNBOUNDED.HASH_CASE_INSENSITIVE -- -- -- -- S p e c -- -- -- -- Copyright (C) 2011, 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/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ with Ada.Containers; function Ada.Strings.Unbounded.Hash_Case_Insensitive (Key : Unbounded.Unbounded_String) return Containers.Hash_Type; pragma Preelaborate (Ada.Strings.Unbounded.Hash_Case_Insensitive);
-- C64103D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT THE APPROPRIATE EXCEPTION IS RAISED FOR TYPE CONVERSIONS -- ON OUT ARRAY PARAMETERS. IN PARTICULAR: -- (A) CONSTRAINT_ERROR IS RAISED BEFORE THE CALL WHEN THE ACTUAL -- COMPONENT'S CONSTRAINTS DIFFER FROM THE FORMAL COMPONENT'S -- CONSTRAINTS. -- (B) CONSTRAINT_ERROR IS RAISED BEFORE THE CALL WHEN CONVERSION TO -- AN UNCONSTRAINED ARRAY TYPE CAUSES AN ACTUAL INDEX BOUND TO LIE -- OUTSIDE OF A FORMAL INDEX SUBTYPE. -- (C) CONSTRAINT_ERROR IS RAISED BEFORE THE CALL FOR CONVERSION TO A -- CONSTRAINED ARRAY TYPE WHEN THE NUMBER OF COMPONENTS PER -- DIMENSION OF THE ACTUAL DIFFERS FROM THAT OF THE FORMAL. -- (D) CONSTRAINT_ERROR IS RAISED BEFORE THE CALL WHEN CONVERSION TO AN -- UNCONSTRAINED ARRAY TYPE CAUSES AN ACTUAL INDEX BOUND TO LIE -- OUTSIDE OF THE BASE INDEX TYPE OF THE FORMAL. -- *** NOTE: This test has been modified since ACVC version 1.11 to -- 9X -- *** remove incompatibilities associated with the transition -- 9X -- *** to Ada 9X. -- 9X -- *** -- 9X -- CPP 07/19/84 -- EG 10/29/85 FIX NUMERIC_ERROR/CONSTRAINT_ERROR ACCORDING TO -- AI-00387. -- MRM 03/30/93 REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY -- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X. WITH SYSTEM; WITH REPORT; USE REPORT; PROCEDURE C64103D IS BEGIN TEST ("C64103D", "CHECK THAT APPROPRIATE EXCEPTION IS RAISED ON " & "TYPE CONVERSIONS OF OUT ARRAY PARAMETERS"); ----------------------------------------------- DECLARE -- (A) BEGIN -- (A) DECLARE TYPE SUBINT IS RANGE 0..8; TYPE ARRAY_TYPE IS ARRAY (SUBINT RANGE <>) OF BOOLEAN; A0 : ARRAY_TYPE (0..3) := (0..3 => TRUE); PROCEDURE P2 (X : OUT ARRAY_TYPE) IS BEGIN NULL; END P2; BEGIN P2 (ARRAY_TYPE (A0)); -- OK. EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED -P2 (A)"); END; END; -- (A) ----------------------------------------------- DECLARE -- (B) TYPE SUBINT IS RANGE 0..8; TYPE ARRAY_TYPE IS ARRAY (SUBINT RANGE <>) OF BOOLEAN; TYPE AR1 IS ARRAY (INTEGER RANGE <>) OF BOOLEAN; A1 : AR1 (-1..7) := (-1..7 => TRUE); A2 : AR1 (1..9) := (1..9 => TRUE); PROCEDURE P1 (X : OUT ARRAY_TYPE) IS BEGIN FAILED ("EXCEPTION NOT RAISED BEFORE CALL -P1 (B)"); END P1; BEGIN -- (B) BEGIN COMMENT ("CALL TO P1 (B) ON A1"); P1 (ARRAY_TYPE (A1)); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED -P1 (B)"); END; BEGIN COMMENT ("CALL TO P1 (B) ON A2"); P1 (ARRAY_TYPE (A2)); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED -P1 (B)"); END; END; -- (B) ----------------------------------------------- DECLARE -- (C) BEGIN -- (C) DECLARE TYPE INDEX1 IS RANGE 1..3; TYPE INDEX2 IS RANGE 1..4; TYPE AR_TYPE IS ARRAY (INDEX1, INDEX2) OF BOOLEAN; A0 : AR_TYPE := (1..3 => (1..4 => FALSE)); TYPE I1 IS RANGE 1..4; TYPE I2 IS RANGE 1..3; TYPE ARRAY_TYPE IS ARRAY (I1, I2) OF BOOLEAN; PROCEDURE P1 (X : OUT ARRAY_TYPE) IS BEGIN FAILED ("EXCEPTION NOT RAISED BEFORE CALL -P1 (C)"); END P1; BEGIN P1 (ARRAY_TYPE (A0)); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED -P1 (C)"); END; END; -- (C) ----------------------------------------------- DECLARE -- (D) BEGIN -- (D) DECLARE TYPE SM_INT IS RANGE 0..2; TYPE LG_INT IS RANGE SYSTEM.MIN_INT..SYSTEM.MAX_INT; TYPE AR_SMALL IS ARRAY (SM_INT RANGE <>) OF BOOLEAN; TYPE AR_LARGE IS ARRAY (LG_INT RANGE <>) OF BOOLEAN; A0 : AR_LARGE (SYSTEM.MAX_INT - 2..SYSTEM.MAX_INT) := (SYSTEM.MAX_INT - 2..SYSTEM.MAX_INT => TRUE); PROCEDURE P1 (X : OUT AR_SMALL) IS BEGIN FAILED ("EXCEPTION NOT RAISED BEFORE CALL -P1 (D)"); END P1; BEGIN IF LG_INT (SM_INT'BASE'LAST) < LG_INT'BASE'LAST THEN P1 (AR_SMALL (A0)); ELSE COMMENT ("NOT APPLICABLE -P1 (D)"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => COMMENT ("CONSTRAINT_ERROR RAISED - P1 (D)"); WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - P1 (D)"); END; END; -- (D) ----------------------------------------------- RESULT; END C64103D;
-- -- Copyright (C) 2017 Nico Huber <nico.h@gmx.de> -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- with HW.Config; package body HW.PCI.MMConf with Refined_State => (Address_State => (MM8.Base_Address, MM16.Base_Address, MM32.Base_Address), PCI_State => (MM8.State, MM16.State, MM32.State)) is Default_Base_Address : constant Word64 := Calc_Base_Address (Config.Default_MMConf_Base, Dev); type Index16 is new Index range 0 .. Index'Last / 2; type Index32 is new Index range 0 .. Index'Last / 4; type Array8 is array (Index) of Byte with Atomic_Components; type Array16 is array (Index16) of Word16 with Atomic_Components; type Array32 is array (Index32) of Word32 with Atomic_Components; package MM8 is new HW.MMIO_Range (Default_Base_Address, Word8, Index, Array8); package MM16 is new HW.MMIO_Range (Default_Base_Address, Word16, Index16, Array16); package MM32 is new HW.MMIO_Range (Default_Base_Address, Word32, Index32, Array32); procedure Read8 (Value : out Word8; Offset : Index) renames MM8.Read; procedure Read16 (Value : out Word16; Offset : Index) is begin MM16.Read (Value, Index16 (Offset / 2)); end Read16; procedure Read32 (Value : out Word32; Offset : Index) is begin MM32.Read (Value, Index32 (Offset / 4)); end Read32; procedure Write8 (Offset : Index; Value : Word8) renames MM8.Write; procedure Write16 (Offset : Index; Value : Word16) is begin MM16.Write (Index16 (Offset / 2), Value); end Write16; procedure Write32 (Offset : Index; Value : Word32) is begin MM32.Write (Index32 (Offset / 4), Value); end Write32; procedure Set_Base_Address (Base : Word64) is Base_Address : constant Word64 := Calc_Base_Address (Base, Dev); begin MM8.Set_Base_Address (Base_Address); MM16.Set_Base_Address (Base_Address); MM32.Set_Base_Address (Base_Address); end Set_Base_Address; end HW.PCI.MMConf;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 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 Ada.Containers.Hashed_Maps; with Ada.Strings.Hash; package body Web_Services.SOAP.Handler_Registry is function Hash (Item : Ada.Tags.Tag) return Ada.Containers.Hash_Type; package Tag_Handler_Maps is new Ada.Containers.Hashed_Maps (Ada.Tags.Tag, Web_Services.SOAP.Handlers.SOAP_Message_Handler, Hash, Ada.Tags."=", Web_Services.SOAP.Handlers."="); Registry : Tag_Handler_Maps.Map; ---------- -- Hash -- ---------- function Hash (Item : Ada.Tags.Tag) return Ada.Containers.Hash_Type is use type Ada.Tags.Tag; begin if Item = Ada.Tags.No_Tag then return 0; else return Ada.Strings.Hash (Ada.Tags.External_Tag (Item)); end if; end Hash; -------------- -- Register -- -------------- procedure Register (Tag : Ada.Tags.Tag; Handler : not null Web_Services.SOAP.Handlers.SOAP_Message_Handler) is begin Registry.Insert (Tag, Handler); end Register; -------------- -- Register -- -------------- procedure Register (Handler : not null Web_Services.SOAP.Handlers.SOAP_RPC_Handler) is begin RPC_Registry.Append (Handler); end Register; ------------- -- Resolve -- ------------- function Resolve (Tag : Ada.Tags.Tag) return Web_Services.SOAP.Handlers.SOAP_Message_Handler is Position : constant Tag_Handler_Maps.Cursor := Registry.Find (Tag); begin if Tag_Handler_Maps.Has_Element (Position) then return Tag_Handler_Maps.Element (Position); else return null; end if; end Resolve; end Web_Services.SOAP.Handler_Registry;
with Ada.Text_IO; use Ada.Text_IO; with Sf.Config; use Sf.Config; with Sf.System.Thread; use Sf.System.Thread; with Sf.System.Sleep; use Sf.System.Sleep; with Sf.System.Types; use Sf.System.Types; procedure Main is procedure Thread_Func (Arg : sfVoid_Ptr) is begin for I in 1 .. 10 loop Put_Line ("I'm thread 1"); sfSleep (0.001); end loop; end Thread_Func; Thread : sfThread_Ptr; TFunc : sfThreadFunc_Ptr := Thread_Func'UNRESTRICTED_ACCESS; UData : sfVoid_Ptr; begin Thread := sfThread_Create (TFunc, UData); sfThread_Launch (Thread); for I in 1 .. 10 loop Put_Line ("I'm main thread"); sfSleep (0.001); end loop; sfThread_Destroy (Thread); end Main;
with Ada.Text_IO; package body Sets.IO is procedure Put (Set : in Set_Type) is use Ada.Text_IO; begin if Set = Null_Set then Put ("<null>"); else for Bit of Set.all loop if Bit then Put ("1"); else Put (" "); end if; end loop; end if; end Put; end Sets.IO;
with Ada.Integer_Text_IO; with Ada.Text_IO; with PrimeInstances; package body Problem_27 is package IO renames Ada.Text_IO; package I_IO renames Ada.Integer_Text_IO; procedure Solve is subtype Parameter is Integer range -999 .. 999; subtype Output is Integer range -(Parameter'Last**2) .. Parameter'Last**2; package Integer_Primes renames PrimeInstances.Integer_Primes; primes : constant Integer_Primes.Sieve := Integer_Primes.Generate_Sieve(79*79 + 999*79 + 999); function Is_Prime(n : Integer) return Boolean is subtype Sieve_Index is Positive range primes'Range; lower : Sieve_Index := primes'First; upper : Sieve_Index := primes'Last; midPoint : Sieve_Index; begin if n <= 1 then return False; end if; -- Basic binary search while lower <= upper loop midPoint := (lower + upper) / 2; if n = primes(midPoint) then return True; elsif n < primes(midPoint) then upper := midPoint - 1; else lower := midPoint + 1; end if; end loop; return False; end Is_Prime; function doQuad(n : Natural; a,b : parameter) return Integer is begin return n*n + a*n + b; end doQuad; highest_count : Natural := 0; best_output : Output; begin for a in Parameter'Range loop for prime_index in primes'Range loop exit when primes(prime_index) > Parameter'Last; declare b : constant Parameter := Parameter(primes(prime_index)); n : Natural := 0; begin while Is_Prime(doQuad(n, a, b)) loop n := n + 1; end loop; if n > highest_count then highest_count := n; best_output := a * b; end if; end; end loop; end loop; I_IO.Put(best_output); IO.New_Line; end Solve; end Problem_27;
----------------------------------------------------------------------- -- gen-artifacts-query -- Query artifact for Code Generator -- Copyright (C) 2011, 2012 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with DOM.Core; with Gen.Model.Packages; -- The <b>Gen.Artifacts.Query</b> package is an artifact for the generation of -- data structures returned by queries. package Gen.Artifacts.Query is -- ------------------------------ -- Query artifact -- ------------------------------ type Artifact is new Gen.Artifacts.Artifact with private; -- After the configuration file is read, processes the node whose root -- is passed in <b>Node</b> and initializes the <b>Model</b> with the information. overriding procedure Initialize (Handler : in out Artifact; Path : in String; Node : in DOM.Core.Node; Model : in out Gen.Model.Packages.Model_Definition'Class; Context : in out Generator'Class); -- Prepare the model after all the configuration files have been read and before -- actually invoking the generation. overriding procedure Prepare (Handler : in out Artifact; Model : in out Gen.Model.Packages.Model_Definition'Class; Context : in out Generator'Class); private type Artifact is new Gen.Artifacts.Artifact with null record; end Gen.Artifacts.Query;
-- C97201A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT A RENDEZVOUS REQUESTED BY A CONDITIONAL_ENTRY_CALL -- IS PERFORMED ONLY IF IMMEDIATELY POSSIBLE. -- CASE A: THE TASK TO BE CALLED IS NOT YET ACTIVE AS OF THE -- MOMENT OF CALL (CONDITIONAL_ENTRY_CALL), -- AND THIS FACT CAN BE DETERMINED STATICALLY. -- RM 4/20/82 WITH REPORT; USE REPORT; PROCEDURE C97201A IS ELSE_BRANCH_TAKEN : INTEGER := 3 ; BEGIN TEST ("C97201A", "CHECK THAT NO RENDEZVOUS REQUESTED BY" & " A CONDITIONAL_ENTRY_CALL CAN OCCUR WHILE" & " THE CALLED TASK IS NOT YET ACTIVE" ); ------------------------------------------------------------------- DECLARE TASK T IS ENTRY DO_IT_NOW_ORELSE ( AUTHORIZED : IN BOOLEAN ) ; END T ; TASK BODY T IS PACKAGE SECOND_ATTEMPT IS END SECOND_ATTEMPT ; PACKAGE BODY SECOND_ATTEMPT IS BEGIN SELECT DO_IT_NOW_ORELSE (FALSE) ;--CALLING (OWN) ENTRY ELSE -- (I.E. CALLER ADOPTS A NO-WAIT POLICY) -- THEREFORE THIS BRANCH MUST BE CHOSEN ELSE_BRANCH_TAKEN := 2 * ELSE_BRANCH_TAKEN ; COMMENT( "ELSE_BRANCH TAKEN (#2)" ); END SELECT; END SECOND_ATTEMPT ; BEGIN ACCEPT DO_IT_NOW_ORELSE ( AUTHORIZED : IN BOOLEAN ) DO IF AUTHORIZED THEN COMMENT( "AUTHORIZED ENTRY_CALL" ); ELSE FAILED( "UNAUTHORIZED ENTRY_CALL" ); END IF; END DO_IT_NOW_ORELSE ; END T ; PACKAGE FIRST_ATTEMPT IS END FIRST_ATTEMPT ; PACKAGE BODY FIRST_ATTEMPT IS BEGIN SELECT T.DO_IT_NOW_ORELSE (FALSE) ; ELSE -- (I.E. CALLER ADOPTS A NO-WAIT POLICY) -- THEREFORE THIS BRANCH MUST BE CHOSEN ELSE_BRANCH_TAKEN := 1 + ELSE_BRANCH_TAKEN ; COMMENT( "ELSE_BRANCH TAKEN (#1)" ); END SELECT; END FIRST_ATTEMPT ; BEGIN T.DO_IT_NOW_ORELSE ( TRUE ); -- TO SATISFY THE SERVER'S -- WAIT FOR SUCH A CALL EXCEPTION WHEN TASKING_ERROR => FAILED( "TASKING ERROR" ); END ; ------------------------------------------------------------------- -- BY NOW, THE TASK IS TERMINATED (AND THE NONLOCALS UPDATED) CASE ELSE_BRANCH_TAKEN IS WHEN 3 => FAILED( "NO 'ELSE'; BOTH (?) RENDEZVOUS ATTEMPTED?" ); WHEN 4 => FAILED( "'ELSE' #1 ONLY; RENDEZVOUS (#2) ATTEMPTED?" ); WHEN 6 => FAILED( "'ELSE' #2 ONLY; RENDEZVOUS (#1) ATTEMPTED?" ); WHEN 7 => FAILED( "WRONG ORDER FOR 'ELSE': #2,#1 " ); WHEN 8 => NULL ; WHEN OTHERS => FAILED( "WRONG CASE_VALUE" ); END CASE; RESULT; END C97201A ;
-- 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. -- ------------ EDIT NOTE ------------ -- This file was generated with swagger-codegen. You can modify it to implement -- the server. After you modify this file, you should add the following line -- to the .swagger-codegen-ignore file: -- -- src/samples-petstore.ads -- -- Then, you can drop this edit note comment. -- ------------ EDIT NOTE ------------ package Samples.Petstore is end Samples.Petstore;
with lace.Observer, lace.Subject, lace.Response, lace.Event.Logger, ada.Tags; package lace.Event.utility -- -- Provides convenience subprograms for working with events. -- is -------------- -- Event Kinds -- function Name_of (Kind : in Event.Kind) return String; function to_Kind (From : in ada.Tags.Tag) return Event.Kind; function "+" (From : in ada.Tags.Tag) return Event.Kind renames to_Kind; --------- -- Events -- function Name_of (the_Event : in Event.item'Class) return String; function Kind_of (the_Event : in Event.item'Class) return Event.Kind; -------------- -- Connections -- procedure connect (the_Observer : in Observer.view; to_Subject : in Subject .view; with_Response : in Response.view; to_Event_Kind : in Event.Kind); procedure disconnect (the_Observer : in Observer.view; from_Subject : in Subject .view; for_Response : in Response.view; to_Event_Kind : in Event.Kind; subject_Name : in String); ---------- -- Logging -- procedure use_text_Logger (log_Filename : in String); -- -- Requests activation of the default text file logger. function Logger return lace.Event.Logger.view; -- -- Returns the Logger currently in use. -- Returns null, if no Logger is in use. -------------- -- Termination -- procedure close; -- -- Ensures any registered event logger is destroyed. end lace.Event.utility;
----------------------------------------------------------------------- -- security-oauth -- OAuth Security -- Copyright (C) 2012, 2016, 2017, 2018, 2019, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; -- = OAuth = -- The <b>Security.OAuth</b> package defines and implements the OAuth 2.0 authorization -- framework as defined by the IETF working group in RFC 6749: -- The OAuth 2.0 Authorization Framework. -- -- @include security-oauth-clients.ads -- @include security-oauth-servers.ads package Security.OAuth is -- OAuth 2.0: Section 10.2.2. Initial Registry Contents -- RFC 6749: 11.2.2. Initial Registry Contents CLIENT_ID : constant String := "client_id"; CLIENT_SECRET : constant String := "client_secret"; RESPONSE_TYPE : constant String := "response_type"; REDIRECT_URI : constant String := "redirect_uri"; SCOPE : constant String := "scope"; STATE : constant String := "state"; CODE : constant String := "code"; ERROR_DESCRIPTION : constant String := "error_description"; ERROR_URI : constant String := "error_uri"; GRANT_TYPE : constant String := "grant_type"; ACCESS_TOKEN : constant String := "access_token"; TOKEN_TYPE : constant String := "token_type"; EXPIRES_IN : constant String := "expires_in"; USERNAME : constant String := "username"; PASSWORD : constant String := "password"; REFRESH_TOKEN : constant String := "refresh_token"; NONCE_TOKEN : constant String := "nonce"; -- RFC 6749: 5.2. Error Response INVALID_REQUEST : aliased constant String := "invalid_request"; INVALID_CLIENT : aliased constant String := "invalid_client"; INVALID_GRANT : aliased constant String := "invalid_grant"; UNAUTHORIZED_CLIENT : aliased constant String := "unauthorized_client"; UNSUPPORTED_GRANT_TYPE : aliased constant String := "unsupported_grant_type"; INVALID_SCOPE : aliased constant String := "invalid_scope"; -- RFC 6749: 4.1.2.1. Error Response ACCESS_DENIED : aliased constant String := "access_denied"; UNSUPPORTED_RESPONSE_TYPE : aliased constant String := "unsupported_response_type"; SERVER_ERROR : aliased constant String := "server_error"; TEMPORARILY_UNAVAILABLE : aliased constant String := "temporarily_unavailable"; type Client_Authentication_Type is (AUTH_NONE, AUTH_BASIC); -- ------------------------------ -- Application -- ------------------------------ -- The <b>Application</b> holds the necessary information to let a user -- grant access to its protected resources on the resource server. It contains -- information that allows the OAuth authorization server to identify the -- application (client id and secret key). type Application is tagged private; -- Get the application identifier. function Get_Application_Identifier (App : in Application) return String; -- Set the application identifier used by the OAuth authorization server -- to identify the application (for example, the App ID in Facebook). procedure Set_Application_Identifier (App : in out Application; Client : in String); -- Set the application secret defined in the OAuth authorization server -- for the application (for example, the App Secret in Facebook). procedure Set_Application_Secret (App : in out Application; Secret : in String); -- Set the redirection callback that will be used to redirect the user -- back to the application after the OAuth authorization is finished. procedure Set_Application_Callback (App : in out Application; URI : in String); -- Set the client authentication method used when doing OAuth calls for this application. -- See RFC 6749, 2.3. Client Authentication procedure Set_Client_Authentication (App : in out Application; Method : in Client_Authentication_Type); private type Application is tagged record Client_Id : Ada.Strings.Unbounded.Unbounded_String; Secret : Ada.Strings.Unbounded.Unbounded_String; Callback : Ada.Strings.Unbounded.Unbounded_String; Client_Auth : Client_Authentication_Type := AUTH_NONE; end record; end Security.OAuth;
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE boost_serialization> <boost_serialization signature="serialization::archive" version="15"> <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>flashModel</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>rdCmdIn_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>rdCmdIn.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>48</bitwidth> </Value> <direction>0</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>rdDataOut_V_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>rdDataOut.V.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>64</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>wrCmdIn_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>wrCmdIn.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>48</bitwidth> </Value> <direction>0</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="_4"> <Value> <Obj> <type>1</type> <id>4</id> <name>wrDataIn_V_V</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName>wrDataIn.V.V</originalName> <rtlName/> <coreName/> </Obj> <bitwidth>64</bitwidth> </Value> <direction>0</direction> <if_type>0</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>3</count> <item_version>0</item_version> <item class_id="9" tracking_level="1" version="0" object_id="_5"> <Value> <Obj> <type>0</type> <id>24</id> <name/> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName>flashCmdAggregator_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>4</count> <item_version>0</item_version> <item>29</item> <item>30</item> <item>31</item> <item>36</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_delay>2.39</m_delay> </item> <item class_id_reference="9" object_id="_6"> <Value> <Obj> <type>0</type> <id>25</id> <name/> <fileName>sources/otherModules/flashModel/flashModel.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>118</lineNumber> <contextFuncName>flashModel</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item class_id="11" tracking_level="0" version="0"> <first>/home/pratik0509/Projects/HLx_Examples/Acceleration/memcached/hls</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>sources/otherModules/flashModel/flashModel.cpp</first> <second>flashModel</second> </first> <second>118</second> </item> </second> </item> </inlineStackInfo> <originalName/> <rtlName>flashMemAccess_U0</rtlName> <coreName/> </Obj> <bitwidth>0</bitwidth> </Value> <oprand_edges> <count>11</count> <item_version>0</item_version> <item>33</item> <item>34</item> <item>35</item> <item>37</item> <item>38</item> <item>39</item> <item>40</item> <item>41</item> <item>42</item> <item>184</item> <item>185</item> </oprand_edges> <opcode>call</opcode> <m_Display>0</m_Display> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_delay>0.00</m_delay> </item> <item class_id_reference="9" object_id="_7"> <Value> <Obj> <type>0</type> <id>26</id> <name/> <fileName>sources/otherModules/flashModel/flashModel.cpp</fileName> <fileDirectory>..</fileDirectory> <lineNumber>119</lineNumber> <contextFuncName>flashModel</contextFuncName> <inlineStackInfo> <count>1</count> <item_version>0</item_version> <item> <first>/home/pratik0509/Projects/HLx_Examples/Acceleration/memcached/hls</first> <second> <count>1</count> <item_version>0</item_version> <item> <first> <first>sources/otherModules/flashModel/flashModel.cpp</first> <second>flashModel</second> </first> <second>119</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> <m_isOnCriticalPath>0</m_isOnCriticalPath> <m_isLCDNode>0</m_isLCDNode> <m_delay>0.00</m_delay> </item> </nodes> <consts class_id="15" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="16" tracking_level="1" version="0" object_id="_8"> <Value> <Obj> <type>2</type> <id>28</id> <name>flashCmdAggregator</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:flashCmdAggregator&gt;</content> </item> <item class_id_reference="16" object_id="_9"> <Value> <Obj> <type>2</type> <id>32</id> <name>flashMemAccess</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:flashMemAccess&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="_10"> <Obj> <type>3</type> <id>27</id> <name>flashModel</name> <fileName/> <fileDirectory/> <lineNumber>0</lineNumber> <contextFuncName/> <inlineStackInfo> <count>0</count> <item_version>0</item_version> </inlineStackInfo> <originalName/> <rtlName/> <coreName/> </Obj> <node_objs> <count>3</count> <item_version>0</item_version> <item>24</item> <item>25</item> <item>26</item> </node_objs> </item> </blocks> <edges class_id="19" tracking_level="0" version="0"> <count>15</count> <item_version>0</item_version> <item class_id="20" tracking_level="1" version="0" object_id="_11"> <id>29</id> <edge_type>1</edge_type> <source_obj>28</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_12"> <id>30</id> <edge_type>1</edge_type> <source_obj>1</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_13"> <id>31</id> <edge_type>1</edge_type> <source_obj>3</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_14"> <id>33</id> <edge_type>1</edge_type> <source_obj>32</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_15"> <id>34</id> <edge_type>1</edge_type> <source_obj>2</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_16"> <id>35</id> <edge_type>1</edge_type> <source_obj>4</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_17"> <id>36</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>24</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_18"> <id>37</id> <edge_type>1</edge_type> <source_obj>6</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_19"> <id>38</id> <edge_type>1</edge_type> <source_obj>7</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_20"> <id>39</id> <edge_type>1</edge_type> <source_obj>8</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_21"> <id>40</id> <edge_type>1</edge_type> <source_obj>9</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_22"> <id>41</id> <edge_type>1</edge_type> <source_obj>5</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_23"> <id>42</id> <edge_type>1</edge_type> <source_obj>10</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_24"> <id>184</id> <edge_type>4</edge_type> <source_obj>24</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </item> <item class_id_reference="20" object_id="_25"> <id>185</id> <edge_type>4</edge_type> <source_obj>24</source_obj> <sink_obj>25</sink_obj> <is_back_edge>0</is_back_edge> </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="_26"> <mId>1</mId> <mTag>flashModel</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>27</item> </basic_blocks> <mII>-1</mII> <mDepth>-1</mDepth> <mMinTripCount>-1</mMinTripCount> <mMaxTripCount>-1</mMaxTripCount> <mMinLatency>3</mMinLatency> <mMaxLatency>3</mMaxLatency> <mIsDfPipe>1</mIsDfPipe> <mDfPipe class_id="23" tracking_level="1" version="0" object_id="_27"> <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>2</count> <item_version>0</item_version> <item class_id="26" tracking_level="1" version="0" object_id="_28"> <type>0</type> <name>flashCmdAggregator_U0</name> <ssdmobj_id>24</ssdmobj_id> <pins class_id="27" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="28" tracking_level="1" version="0" object_id="_29"> <port class_id="29" tracking_level="1" version="0" object_id="_30"> <name>rdCmdIn_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id="30" tracking_level="1" version="0" object_id="_31"> <type>0</type> <name>flashCmdAggregator_U0</name> <ssdmobj_id>24</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_32"> <port class_id_reference="29" object_id="_33"> <name>wrCmdIn_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_31"/> </item> <item class_id_reference="28" object_id="_34"> <port class_id_reference="29" object_id="_35"> <name>flashAggregateMemCmd_1</name> <dir>0</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_31"/> </item> </pins> </item> <item class_id_reference="26" object_id="_36"> <type>0</type> <name>flashMemAccess_U0</name> <ssdmobj_id>25</ssdmobj_id> <pins> <count>8</count> <item_version>0</item_version> <item class_id_reference="28" object_id="_37"> <port class_id_reference="29" object_id="_38"> <name>rdDataOut_V_V</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id="_39"> <type>0</type> <name>flashMemAccess_U0</name> <ssdmobj_id>25</ssdmobj_id> </inst> </item> <item class_id_reference="28" object_id="_40"> <port class_id_reference="29" object_id="_41"> <name>wrDataIn_V_V</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> <item class_id_reference="28" object_id="_42"> <port class_id_reference="29" object_id="_43"> <name>memState</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> <item class_id_reference="28" object_id="_44"> <port class_id_reference="29" object_id="_45"> <name>inputWord_address_V</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> <item class_id_reference="28" object_id="_46"> <port class_id_reference="29" object_id="_47"> <name>inputWord_count_V</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> <item class_id_reference="28" object_id="_48"> <port class_id_reference="29" object_id="_49"> <name>inputWord_rdOrWr_V</name> <dir>3</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> <item class_id_reference="28" object_id="_50"> <port class_id_reference="29" object_id="_51"> <name>flashAggregateMemCmd_1</name> <dir>0</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> <item class_id_reference="28" object_id="_52"> <port class_id_reference="29" object_id="_53"> <name>memArray_V</name> <dir>2</dir> <type>2</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </item> </pins> </item> </process_list> <channel_list class_id="31" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="32" tracking_level="1" version="0" object_id="_54"> <type>1</type> <name>flashAggregateMemCmd_1</name> <ssdmobj_id>5</ssdmobj_id> <ctype>0</ctype> <depth>16</depth> <bitwidth>46</bitwidth> <source class_id_reference="28" object_id="_55"> <port class_id_reference="29" object_id="_56"> <name>in</name> <dir>3</dir> <type>0</type> </port> <inst class_id_reference="30" object_id_reference="_31"/> </source> <sink class_id_reference="28" object_id="_57"> <port class_id_reference="29" object_id="_58"> <name>out</name> <dir>3</dir> <type>1</type> </port> <inst class_id_reference="30" object_id_reference="_39"/> </sink> </item> </channel_list> <net_list class_id="33" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </net_list> </mDfPipe> </item> </cdfg_regions> <fsm class_id="34" tracking_level="1" version="0" object_id="_59"> <states class_id="35" tracking_level="0" version="0"> <count>5</count> <item_version>0</item_version> <item class_id="36" tracking_level="1" version="0" object_id="_60"> <id>1</id> <operations class_id="37" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="38" tracking_level="1" version="0" object_id="_61"> <id>24</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_62"> <id>2</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_63"> <id>25</id> <stage>3</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_64"> <id>3</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_65"> <id>25</id> <stage>2</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_66"> <id>4</id> <operations> <count>1</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_67"> <id>25</id> <stage>1</stage> <latency>3</latency> </item> </operations> </item> <item class_id_reference="36" object_id="_68"> <id>5</id> <operations> <count>14</count> <item_version>0</item_version> <item class_id_reference="38" object_id="_69"> <id>11</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_70"> <id>12</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_71"> <id>13</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_72"> <id>14</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_73"> <id>15</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_74"> <id>16</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_75"> <id>17</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_76"> <id>18</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_77"> <id>19</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_78"> <id>20</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_79"> <id>21</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_80"> <id>22</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_81"> <id>23</id> <stage>1</stage> <latency>1</latency> </item> <item class_id_reference="38" object_id="_82"> <id>26</id> <stage>1</stage> <latency>1</latency> </item> </operations> </item> </states> <transitions class_id="39" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="40" tracking_level="1" version="0" object_id="_83"> <inState>1</inState> <outState>2</outState> <condition class_id="41" tracking_level="0" version="0"> <id>0</id> <sop class_id="42" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="43" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_84"> <inState>2</inState> <outState>3</outState> <condition> <id>1</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_85"> <inState>3</inState> <outState>4</outState> <condition> <id>2</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> <item class_id_reference="40" object_id="_86"> <inState>4</inState> <outState>5</outState> <condition> <id>3</id> <sop> <count>1</count> <item_version>0</item_version> <item> <count>0</count> <item_version>0</item_version> </item> </sop> </condition> </item> </transitions> </fsm> <res class_id="44" tracking_level="1" version="0" object_id="_87"> <dp_component_resource class_id="45" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="46" tracking_level="0" version="0"> <first>flashCmdAggregator_U0 (flashCmdAggregator)</first> <second class_id="47" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="48" tracking_level="0" version="0"> <first>FF</first> <second>2</second> </item> <item> <first>LUT</first> <second>57</second> </item> </second> </item> <item> <first>flashMemAccess_U0 (flashMemAccess)</first> <second> <count>3</count> <item_version>0</item_version> <item> <first>BRAM</first> <second>256</second> </item> <item> <first>FF</first> <second>189</second> </item> <item> <first>LUT</first> <second>221</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>1</count> <item_version>0</item_version> <item> <first>flashAggregateMemCmd_1_U</first> <second> <count>6</count> <item_version>0</item_version> <item> <first>(0Depth)</first> <second>16</second> </item> <item> <first>(1Bits)</first> <second>46</second> </item> <item> <first>(2Size:D*B)</first> <second>736</second> </item> <item> <first>BRAM</first> <second>3</second> </item> <item> <first>FF</first> <second>62</second> </item> <item> <first>LUT</first> <second>47</second> </item> </second> </item> </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_dsp_resource> <count>2</count> <item_version>0</item_version> <item> <first>flashCmdAggregator_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> <item> <first>flashMemAccess_U0</first> <second> <count>0</count> <item_version>0</item_version> </second> </item> </dp_dsp_resource> <dp_component_map class_id="49" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="50" tracking_level="0" version="0"> <first>flashCmdAggregator_U0 (flashCmdAggregator)</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>flashMemAccess_U0 (flashMemAccess)</first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> </dp_component_map> <dp_expression_map> <count>0</count> <item_version>0</item_version> </dp_expression_map> <dp_fifo_map> <count>1</count> <item_version>0</item_version> <item> <first>flashAggregateMemCmd_1_U</first> <second> <count>1</count> <item_version>0</item_version> <item>52</item> </second> </item> </dp_fifo_map> <dp_memory_map> <count>0</count> <item_version>0</item_version> </dp_memory_map> </res> <node_label_latency class_id="51" tracking_level="0" version="0"> <count>3</count> <item_version>0</item_version> <item class_id="52" tracking_level="0" version="0"> <first>24</first> <second class_id="53" tracking_level="0" version="0"> <first>0</first> <second>0</second> </second> </item> <item> <first>25</first> <second> <first>1</first> <second>2</second> </second> </item> <item> <first>26</first> <second> <first>4</first> <second>0</second> </second> </item> </node_label_latency> <bblk_ent_exit class_id="54" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="55" tracking_level="0" version="0"> <first>27</first> <second class_id="56" tracking_level="0" version="0"> <first>0</first> <second>4</second> </second> </item> </bblk_ent_exit> <regions class_id="57" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="58" tracking_level="1" version="0" object_id="_88"> <region_name>flashModel</region_name> <basic_blocks> <count>1</count> <item_version>0</item_version> <item>27</item> </basic_blocks> <nodes> <count>16</count> <item_version>0</item_version> <item>11</item> <item>12</item> <item>13</item> <item>14</item> <item>15</item> <item>16</item> <item>17</item> <item>18</item> <item>19</item> <item>20</item> <item>21</item> <item>22</item> <item>23</item> <item>24</item> <item>25</item> <item>26</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="59" tracking_level="0" version="0"> <count>2</count> <item_version>0</item_version> <item class_id="60" tracking_level="0" version="0"> <first>58</first> <second> <count>3</count> <item_version>0</item_version> <item>25</item> <item>25</item> <item>25</item> </second> </item> <item> <first>78</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> </dp_fu_nodes> <dp_fu_nodes_expression class_id="62" tracking_level="0" version="0"> <count>0</count> <item_version>0</item_version> </dp_fu_nodes_expression> <dp_fu_nodes_module> <count>2</count> <item_version>0</item_version> <item class_id="63" tracking_level="0" version="0"> <first>StgValue_6_flashCmdAggregator_fu_78</first> <second> <count>1</count> <item_version>0</item_version> <item>24</item> </second> </item> <item> <first>grp_flashMemAccess_fu_58</first> <second> <count>3</count> <item_version>0</item_version> <item>25</item> <item>25</item> <item>25</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="64" tracking_level="0" version="0"> <count>1</count> <item_version>0</item_version> <item class_id="65" tracking_level="0" version="0"> <first class_id="66" tracking_level="0" version="0"> <first>memArray_V</first> <second>100</second> </first> <second> <count>1</count> <item_version>0</item_version> <item>25</item> </second> </item> </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="67" tracking_level="0" version="0"> <count>4</count> <item_version>0</item_version> <item class_id="68" tracking_level="0" version="0"> <first>rdCmdIn_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>24</item> </second> </item> </second> </item> <item> <first>rdDataOut_V_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>25</item> </second> </item> </second> </item> <item> <first>wrCmdIn_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>24</item> </second> </item> </second> </item> <item> <first>wrDataIn_V_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>25</item> </second> </item> </second> </item> </dp_port_io_nodes> <port2core class_id="69" 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>
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . T A S K _ L O C K -- -- -- -- S p e c -- -- -- -- Copyright (C) 1998-2020, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Simple task lock and unlock routines -- A small package containing a task lock and unlock routines for creating -- a critical region. The lock involved is a global lock, shared by all -- tasks, and by all calls to these routines, so these routines should be -- used with care to avoid unnecessary reduction of concurrency. -- These routines may be used in a non-tasking program, and in that case -- they have no effect (they do NOT cause the tasking runtime to be loaded). -- Note: this package is in the System hierarchy so that it can be directly -- be used by other predefined packages. User access to this package is via -- a renaming of this package in GNAT.Task_Lock (file g-tasloc.ads). package System.Task_Lock is pragma Preelaborate; procedure Lock; pragma Inline (Lock); -- Acquires the global lock, starts the execution of a critical region -- which no other task can enter until the locking task calls Unlock procedure Unlock; pragma Inline (Unlock); -- Releases the global lock, allowing another task to successfully -- complete a Lock operation. Terminates the critical region. -- -- The recommended protocol for using these two procedures is as -- follows: -- -- Locked_Processing : begin -- Lock; -- ... -- TSL.Unlock; -- -- exception -- when others => -- Unlock; -- raise; -- end Locked_Processing; -- -- This ensures that the lock is not left set if an exception is raised -- explicitly or implicitly during the critical locked region. -- -- Note on multiple calls to Lock: It is permissible to call Lock -- more than once with no intervening Unlock from a single task, -- and the lock will not be released until the corresponding number -- of Unlock operations has been performed. For example: -- -- System.Task_Lock.Lock; -- acquires lock -- System.Task_Lock.Lock; -- no effect -- System.Task_Lock.Lock; -- no effect -- System.Task_Lock.Unlock; -- no effect -- System.Task_Lock.Unlock; -- no effect -- System.Task_Lock.Unlock; -- releases lock -- -- However, as previously noted, the Task_Lock facility should only -- be used for very local locks where the probability of conflict is -- low, so usually this kind of nesting is not a good idea in any case. -- In more complex locking situations, it is more appropriate to define -- an appropriate protected type to provide the required locking. -- -- It is an error to call Unlock when there has been no prior call to -- Lock. The effect of such an erroneous call is undefined, and may -- result in deadlock, or other malfunction of the run-time system. end System.Task_Lock;
with aIDE.GUI, AdaM.exception_Handler, glib, glib.Error, gtk.Builder, gdk.Event; package body aIDE.Editor.of_block is use gtk.Builder, gtk.Widget, glib, glib.Error; function exception_Button_Press (Self : access Gtk_Widget_Record'Class; Event : Gdk.Event.Gdk_Event_Button) return Boolean is Expander : constant my_Expander := my_Expander (Self); begin case Event.Button is when 1 => return False; when 2 => declare new_Handler : constant AdaM.exception_Handler.view := AdaM.exception_Handler.new_Handler (--"constraint_Error", Expander.Editor.Block); begin Expander.Editor.Block.add (new_Handler); Expander.Editor.exception_Handler := aIDE.Editor.of_exception_handler.new_Editor (new_Handler); Expander.Editor.exception_Handler.top_Widget.reparent (Expander.Editor.exception_Box); end; when others => null; end case; return True; end exception_Button_Press; function Button_Press (Self : access Gtk_Widget_Record'Class; Event : Gdk.Event.Gdk_Event_Button) return Boolean is Expander : constant my_Expander := my_Expander (Self); begin case Event.Button is when 1 => return False; when 2 => aIDE.GUI.show_source_entities_Palette (Invoked_by => Expander.Editor.all'Access, Target => Expander.Target); when others => null; end case; return True; end Button_Press; package body Forge is function to_block_Editor (the_Block : in AdaM.Block.view) return View is Self : constant Editor.of_block.view := new Editor.of_block.item; the_Builder : Gtk_Builder; Error : aliased GError; Result : Guint; pragma Unreferenced (Result); use gdk.Event; begin Gtk_New (the_Builder); Result := the_Builder.Add_From_File ("glade/editor/block_editor.glade", Error'Access); if Error /= null then Error_Free (Error); end if; Self.block_editor_Frame := gtk_Frame (the_Builder.get_Object ("block_editor_Frame")); Self.top_Box := gtk_Box (the_Builder.get_Object ("top_Box")); -- declare region -- Self.declare_Expander := new my_Expander_Record; Self.declare_Expander.Target := the_Block.my_Declarations; Self.declare_Expander.Editor := Self; gtk.Expander.Initialize (Self.declare_Expander, "declare"); Self.declare_Expander.On_Button_Press_Event (Button_Press'Access); Self.top_Box.Pack_Start (Self.declare_Expander); Self.declare_Label := Gtk_Label (the_Builder.get_Object ("declare_Label")); Gtk_New_Vbox (Self.declare_Box); Self.declare_Expander.Add (Self.declare_Box); -- begin region -- Self.begin_Expander := new my_Expander_Record; Self.begin_Expander.Target := the_Block.my_Statements; Self.begin_Expander.Editor := Self; gtk.Expander.Initialize (Self.begin_Expander, "begin"); Self.begin_Expander.On_Button_Press_Event (Button_Press'Access); Self.top_Box.Pack_Start (Self.begin_Expander); Gtk_New_Vbox (Self.begin_Box); Self.begin_Expander.Add (Self.begin_Box); -- exception region -- Self.exception_Expander := new my_Expander_Record; Self.exception_Expander.Target := the_Block.my_Handlers; Self.exception_Expander.Editor := Self; gtk.Expander.Initialize (Self.exception_Expander, "exception"); Self.exception_Expander.On_Button_Press_Event (exception_Button_Press'Access); Self.top_Box.Pack_Start (Self.exception_Expander); Gtk_New_Vbox (Self.exception_Box); Self.exception_Expander.Add (Self.exception_Box); Self.Block := the_Block; Self.top_Widget.Show_All; Self.freshen; return Self; end to_block_Editor; end Forge; overriding procedure freshen (Self : in out Item) is use AdaM; begin -- 'declare' Region -- -- Destroy all prior 'declare' entity widgets. -- loop declare the_Child : constant gtk_Widget := Self.declare_Box.get_Child (0); begin exit when the_Child = null; the_Child.destroy; end; end loop; -- Create all 'declare' entity widgets. -- declare -- the_Entities : constant AdaM.Source.Entities_View := Self.Block.my_Declarations; the_Entities : constant AdaM.Entity.Entities_View := Self.Block.my_Declarations; begin for i in 1 .. Integer (the_Entities.Length) loop declare -- the_Entity : AdaM.Source.Entity_view renames the_Entities.Element (i); the_Entity : AdaM.Entity.view renames the_Entities.Element (i); the_Editor : constant aIDE.Editor.view := aIDE.Editor.to_Editor (the_Entity); begin the_Editor.top_Widget.reparent (Self.declare_Box); end; end loop; end; -- 'begin' Region -- -- Destroy all prior 'begin' entity widgets. -- loop declare the_Child : constant gtk_Widget := Self.begin_Box.get_Child (0); begin exit when the_Child = null; the_Child.destroy; end; end loop; -- Create all 'begin' entity widgets. -- declare -- the_Entities : constant access AdaM.Source.Entities := Self.Block.my_Statements; the_Entities : constant access AdaM.Entity.Entities := Self.Block.my_Statements; begin for i in 1 .. Integer (the_Entities.Length) loop declare -- the_Entity : AdaM.Source.Entity_view renames the_Entities.Element (i); the_Entity : AdaM.Entity.view renames the_Entities.Element (i); the_Editor : constant aIDE.Editor.view := aIDE.Editor.to_Editor (the_Entity); begin the_Editor.top_Widget.reparent (Self.begin_Box); end; end loop; end; -- Exceptions -- loop declare use gtk.Widget; the_Child : constant gtk_Widget := Self.exception_Box.Get_Child (0); begin exit when the_Child = null; the_Child.destroy; end; end loop; for i in 1 .. Integer (Self.Block.my_Handlers.Length) loop declare -- the_Entity : constant AdaM.Source.Entity_View := Self.Block.my_Handlers.Element (i); the_Entity : constant AdaM.Entity.view := Self.Block.my_Handlers.Element (i); the_Exception : constant AdaM.exception_Handler.view := AdaM.exception_Handler.view (the_Entity); begin Self.exception_Handler := aIDE.Editor.of_exception_handler.new_Editor (the_Exception); Self.exception_Handler.top_Widget.reparent (Self.exception_Box); end; end loop; end freshen; procedure Target_is (Self : in out Item; Now : AdaM.Block.view) is Unused : Boolean; begin Self.Block := Now; Self.freshen; end Target_is; function Target (Self : in Item) return AdaM.Block.view is begin return Self.Block; end Target; overriding function top_Widget (Self : in Item) return gtk.Widget.Gtk_Widget is begin return gtk.Widget.Gtk_Widget (Self.block_editor_Frame); end top_Widget; end aIDE.Editor.of_block;
-- Copyright (C) 2019 Thierry Rascle <thierr26@free.fr> -- MIT license. Please refer to the LICENSE file. generic with function Allocate return Instance_Type_Access; with procedure CB is null; Just_Pretend : Boolean := False; package Apsepp.Generic_Shared_Instance.Creator is function Has_Actually_Created return Boolean; end Apsepp.Generic_Shared_Instance.Creator;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . T E X T _ I O . B O U N D E D _ I O -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.Strings.Bounded; generic with package Bounded is new Ada.Strings.Bounded.Generic_Bounded_Length (<>); package Ada.Text_IO.Bounded_IO is function Get_Line return Bounded.Bounded_String; function Get_Line (File : File_Type) return Bounded.Bounded_String; procedure Get_Line (Item : out Bounded.Bounded_String); procedure Get_Line (File : File_Type; Item : out Bounded.Bounded_String); procedure Put (Item : Bounded.Bounded_String); procedure Put (File : File_Type; Item : Bounded.Bounded_String); procedure Put_Line (Item : Bounded.Bounded_String); procedure Put_Line (File : File_Type; Item : Bounded.Bounded_String); end Ada.Text_IO.Bounded_IO;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-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$ ------------------------------------------------------------------------------ package Parser.Goto_Table is type Small_Integer is range -32_000 .. 32_000; type Goto_Entry is record Nonterm : Small_Integer; Newstate : Small_Integer; end record; --pragma suppress(index_check); subtype Row is Integer range -1 .. Integer'Last; type Goto_Parse_Table is array (Row range <>) of Goto_Entry; Goto_Matrix : constant Goto_Parse_Table := ((-1,-1) -- Dummy Entry. -- State 0 ,(-5, 2),(-3, 1),(-2, 3) -- State 1 ,(-10, 4) ,(-4, 5) -- State 2 ,(-7, 6),(-6, 11) -- State 3 -- State 4 ,(-11, 16) ,(-8, 13) -- State 5 -- State 6 ,(-8, 17) -- State 7 ,(-9, 19),(-7, 18) -- State 8 ,(-9, 20),(-7, 18) -- State 9 -- State 10 -- State 11 -- State 12 -- State 13 ,(-12, 22) -- State 14 -- State 15 -- State 16 -- State 17 -- State 18 -- State 19 ,(-7, 24) -- State 20 ,(-7, 24) -- State 21 -- State 22 -- State 23 -- State 24 -- State 25 ); -- The offset vector GOTO_OFFSET : constant array (0.. 25) of Integer := ( 0, 3, 5, 7, 7, 9, 9, 10, 12, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 17, 17, 17, 17, 17); subtype Rule is Natural; subtype Nonterminal is Integer; Rule_Length : constant array (Rule range 0 .. 16) of Natural := ( 2, 2, 2, 0, 2, 2, 3, 3, 1, 2, 2, 0, 2, 2, 1, 1, 1); Get_LHS_Rule : constant array (Rule range 0 .. 16) of Nonterminal := (-1, -2,-3,-5,-5,-6,-6,-6,-9, -9,-4,-10,-10,-11,-7,-8,-12); end Parser.Goto_Table;
-- C64109H.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 SLICES OF ARRAYS WHICH ARE COMPONENTS OF RECORDS ARE -- PASSED CORRECTLY TO SUBPROGRAMS. SPECIFICALLY, -- (A) CHECK ALL PARAMETER MODES. -- HISTORY: -- TBN 07/11/86 CREATED ORIGINAL TEST. -- JET 08/04/87 MODIFIED REC.A REFERENCES. WITH REPORT; USE REPORT; PROCEDURE C64109H IS BEGIN TEST ("C64109H", "CHECK THAT SLICES OF ARRAYS WHICH ARE " & "COMPONENTS OF RECORDS ARE PASSED CORRECTLY " & "TO SUBPROGRAMS"); DECLARE -- (A) TYPE ARRAY_TYPE IS ARRAY (POSITIVE RANGE <>) OF INTEGER; SUBTYPE ARRAY_SUBTYPE IS ARRAY_TYPE(1..IDENT_INT(5)); TYPE RECORD_TYPE IS RECORD I : INTEGER; A : ARRAY_SUBTYPE; END RECORD; REC : RECORD_TYPE := (I => 23, A => (1..3 => IDENT_INT(7), 4..5 => 9)); BOOL : BOOLEAN; PROCEDURE P1 (ARR : ARRAY_TYPE) IS BEGIN IF ARR /= (7, 9, 9) THEN FAILED ("IN PARAMETER NOT PASSED CORRECTLY"); END IF; IF ARR'FIRST /= IDENT_INT(3) OR ARR'LAST /= IDENT_INT(5) THEN FAILED ("WRONG BOUNDS FOR IN PARAMETER"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN PROCEDURE P1"); END P1; FUNCTION F1 (ARR : ARRAY_TYPE) RETURN BOOLEAN IS BEGIN IF ARR /= (7, 7, 9) THEN FAILED ("IN PARAMETER NOT PASSED CORRECTLY TO FN"); END IF; IF ARR'FIRST /= IDENT_INT(2) OR ARR'LAST /= IDENT_INT(4) THEN FAILED ("WRONG BOUNDS FOR IN PARAMETER FOR FN"); END IF; RETURN TRUE; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN FUNCTION F1"); END F1; PROCEDURE P2 (ARR : IN OUT ARRAY_TYPE) IS BEGIN IF ARR /= (7, 7, 7, 9) THEN FAILED ("IN OUT PARAMETER NOT PASSED " & "CORRECTLY"); END IF; IF ARR'FIRST /= IDENT_INT(1) OR ARR'LAST /= IDENT_INT(4) THEN FAILED ("WRONG BOUNDS FOR IN OUT PARAMETER"); END IF; ARR := (ARR'RANGE => 5); EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN PROCEDURE P2"); END P2; PROCEDURE P3 (ARR : OUT ARRAY_TYPE) IS BEGIN IF ARR'FIRST /= IDENT_INT(3) OR ARR'LAST /= IDENT_INT(4) THEN FAILED ("WRONG BOUNDS FOR OUT PARAMETER"); END IF; ARR := (ARR'RANGE => 3); EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED IN PROCEDURE P3"); END P3; BEGIN -- (A) BEGIN -- (B) P1 (REC.A (3..5)); IF REC.A /= (7, 7, 7, 9, 9) THEN FAILED ("IN PARAM CHANGED BY PROCEDURE"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED DURING CALL OF P1"); END; -- (B) BEGIN -- (C) BOOL := F1 (REC.A (2..4)); IF REC.A /= (7, 7, 7, 9, 9) THEN FAILED ("IN PARAM CHANGED BY FUNCTION"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED DURING CALL OF F1"); END; -- (C) BEGIN -- (D) P2 (REC.A (1..4)); IF REC.A /= (5, 5, 5, 5, 9) THEN FAILED ("IN OUT PARAM RETURNED INCORRECTLY"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED DURING CALL OF P2"); END; -- (D) BEGIN -- (E) P3 (REC.A (3..4)); IF REC.A /= (5, 5, 3, 3, 9) THEN FAILED ("OUT PARAM RETURNED INCORRECTLY"); END IF; EXCEPTION WHEN OTHERS => FAILED ("EXCEPTION RAISED DURING CALL OF P3"); END; -- (E) END; -- (A) RESULT; END C64109H;