CombinedText
stringlengths 4
3.42M
|
|---|
------------------------------------------------------------------------------
-- --
-- Ada binding for OpenGL/WebGL --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-2021, 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. --
-- --
------------------------------------------------------------------------------
with System;
with Interfaces;
private with Ada.Finalization;
private with Web.GL.Framebuffers;
private with Web.GL.Renderbuffers;
private with Web.GL.Textures;
--with OpenGL.Renderbuffers;
--with OpenGL.Textures;
package OpenGL.Framebuffers is
pragma Preelaborate;
type OpenGL_Framebuffer is tagged limited private;
function Create
(Self : in out OpenGL_Framebuffer'Class;
Width : Natural;
Height : Natural) return Boolean;
procedure Create
(Self : in out OpenGL_Framebuffer'Class;
Width : Natural;
Height : Natural);
procedure Delete (Self : in out OpenGL_Framebuffer'Class);
-- function Bind (Self : in out OpenGL_Framebuffer'Class) return Boolean;
-- procedure Bind (Self : in out OpenGL_Framebuffer'Class);
--
-- procedure Release (Self : in out OpenGL_Framebuffer'Class);
procedure Read_Pixels
(Self : in out OpenGL_Framebuffer'Class;
X : OpenGL.GLint;
Y : OpenGL.GLint;
Width : OpenGL.GLsizei;
Height : OpenGL.GLsizei;
Pixels : System.Address;
Size : Interfaces.Unsigned_32);
-- Data : out OpenGL.GLubyte_Vector_4_Array);
-- procedure Set_Renderbuffer
-- (Self : in out OpenGL_Framebuffer'Class;
-- Renderbuffer : OpenGL.Renderbuffers.OpenGL_Renderbuffer'Class;
-- Attachment : OpenGL.GLenum);
--
-- procedure Set_Texture
-- (Self : in out OpenGL_Framebuffer'Class;
-- Texture : OpenGL.Textures.OpenGL_Texture'Class;
-- Attachment : OpenGL.GLenum);
private
type OpenGL_Framebuffer is
new Ada.Finalization.Limited_Controlled with record
Framebuffer : Web.GL.Framebuffers.WebGL_Framebuffer;
Texture : Web.GL.Textures.WebGL_Texture;
Renderbuffer : Web.GL.Renderbuffers.WebGL_Renderbuffer;
Context : Web.GL.Rendering_Contexts.WebGL_Rendering_Context;
end record;
overriding procedure Finalize (Self : in out OpenGL_Framebuffer);
end OpenGL.Framebuffers;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Elements.Generic_Hash;
function AMF.UMLDI.UML_Styles.Hash is
new AMF.Elements.Generic_Hash (UMLDI_UML_Style, UMLDI_UML_Style_Access);
|
with Ada.Containers.Vectors,
Ada.Exceptions,
Ada.Integer_Text_IO,
Ada.Strings.Unbounded,
Ada.Text_IO;
with Utils;
procedure Main is
use Ada.Containers, Ada.Strings.Unbounded, Ada.Text_IO;
use Utils;
subtype Binary_Values is Natural range 0 .. 1;
package Unbounded_String_Vectors is new Ada.Containers.Vectors (Natural, Unbounded_String);
use Unbounded_String_Vectors;
package Unbounded_String_Cursor_Vectors is new Ada.Containers.Vectors (Natural, Cursor);
type Rate_Arrays is array (Binary_Values'Range) of Natural;
type Binary_Maps is array (Binary_Values'Range) of Unbounded_String_Cursor_Vectors.Vector;
type Strategies is (Most_Common, Least_Common);
-- Given a String which represents a Natural in binary format, it returns the corresponding Natural.
-- @param Str A String which represents a Natural in binary format
-- @retuns Returns the corresponding Natural
function Binary_String_To_Number (Str : String) return Natural;
function Binary_String_To_Number (Str : String) return Natural
is
Exponent : Natural := Natural'First;
Result : Natural := Natural'First;
begin
for Elt of reverse Str loop
if Elt = '1' then
Result := Result + 2 ** Exponent;
end if;
Exponent := Exponent + 1;
end loop;
return Result;
end Binary_String_To_Number;
-- Find the result in a set of String which represents a Natural in binary format according to criteria.
-- @param Values Contains all values (String which represents a Natural in binary format) extracted from a file.
-- @param Rate Indicate how many 0s and 1s there are at index "Index".
-- @param Map An array (Called Map because each index corresponds to a filter) that contains for each index (0 and
-- 1) each values of Values that contain a 0 (for index 0 of Map) or a 1 (for index 1 of Map) at index "Index" in
-- the the value in Values.
-- @param Index This index denote the position in the binary string representation of a Natural.
-- @param Strategy The strategy to apply (Most Common, Least Common).
-- @retuns Return the value that match the criteria (Strategy)
function Find_Value_According_To_Criteria (Values : Vector;
Rate : Rate_Arrays;
Map : Binary_Maps;
Index : in out Positive;
Strategy : Strategies)
return Natural;
function Find_Value_According_To_Criteria (Values : Vector;
Rate : Rate_Arrays;
Map : Binary_Maps;
Index : in out Positive;
Strategy : Strategies)
return Natural
is
-- Filter the result for the next recursive call of Find_Value_According_To_Criteria.
-- @param Previous_Filtered_Values List of Cursor (pointing to value in Values) that match the previous
-- criteria.
-- @param Rate Indicate how many 0s and 1s there are at index "Index".
-- @param Map An array (Called Map because each index corresponds to a filter) that contains for each index (0
-- and 1) each values of Values that contain a 0 (for index 0 of Map) or a 1 (for index 1 of Map) at index
-- "Index" in the the value in Values.
procedure Filter (Previous_Filtered_Values : Unbounded_String_Cursor_Vectors.Vector;
Rate : in out Rate_Arrays;
Map : in out Binary_Maps);
procedure Filter (Previous_Filtered_Values : Unbounded_String_Cursor_Vectors.Vector;
Rate : in out Rate_Arrays;
Map : in out Binary_Maps)
is
Current_Value : Unbounded_String;
Binary_Value : Binary_Values;
begin
for Curs : Cursor of Previous_Filtered_Values loop
Current_Value := Element (Curs);
declare
Str : constant String := To_String (Current_Value);
begin
Binary_Value := Binary_Values'Value (Str (Index .. Index));
Map (Binary_Value).Append (Curs);
Rate (Binary_Value) := Rate (Binary_Value) + 1;
end;
end loop;
end Filter;
New_Rate : Rate_Arrays;
New_Map : Binary_Maps;
Filtered_Map_Index : Natural;
begin
-- Short-circuit in the case where before having gone through the whole bit chain, there is only one solution.
if Values.Length = 1 then
return Binary_String_To_Number (To_String (Values.First_Element));
end if;
-- Apply the bit criteria strategy
case Strategy is
when Most_Common =>
if Rate (1) > Rate (0) or else Rate (0) = Rate (1) then
-- Take in account values which contains a 1 at index "Index"
Filtered_Map_Index := 1;
else
-- Take in account values which contains a 0 at index "Index"
Filtered_Map_Index := 0;
end if;
when Least_Common =>
if Rate (1) > Rate (0) or else Rate (0) = Rate (1) then
-- Take in account values which contains a 0 at index "Index"
Filtered_Map_Index := 0;
else
-- Take in account values which contains a 0 at index "Index"
Filtered_Map_Index := 1;
end if;
end case;
Index := Index + 1;
-- If there is only one remaining value, is that it is the desired solution
if Map (Filtered_Map_Index).Length = 1 then
return Binary_String_To_Number (To_String (Element (Map (Filtered_Map_Index).First_Element)));
end if;
-- Apply the filter to the next Index
Filter (Previous_Filtered_Values => Map (Filtered_Map_Index),
Rate => New_Rate,
Map => New_Map);
return Find_Value_According_To_Criteria (Values => Values,
Rate => New_Rate,
Map => New_Map,
Index => Index,
Strategy => Strategy);
end Find_Value_According_To_Criteria;
File : File_Type;
Values : Vector;
Rate : Rate_Arrays := (others => Natural'First);
Bin_Map_Sort : Binary_Maps := (others => Unbounded_String_Cursor_Vectors.Empty_Vector);
Current_Index : Positive := Positive'First;
begin
Get_File (File);
-- Get all values
while not End_Of_File (File) loop
declare
Line : constant String := Get_Line (File);
First_Value : constant Binary_Values := Binary_Values'Value (Line (Line'First .. Line'First));
begin
Values.Append (To_Unbounded_String (Line));
Bin_Map_Sort (First_Value).Append (Values.Last);
Rate (First_Value) := Rate (First_Value) + 1;
end;
end loop;
Put_Result : declare
Oxygen_Generator_Rating : constant Natural := Find_Value_According_To_Criteria (Values => Values,
Rate => Rate,
Map => Bin_Map_Sort,
Index => Current_Index,
Strategy => Most_Common);
CO2_Scrubber_Rating : Natural;
begin
Current_Index := Positive'First;
CO2_Scrubber_Rating := Find_Value_According_To_Criteria (Values => Values,
Rate => Rate,
Map => Bin_Map_Sort,
Index => Current_Index,
Strategy => Least_Common);
Put ("Result: ");
Ada.Integer_Text_IO.Put (Item => Oxygen_Generator_Rating * CO2_Scrubber_Rating,
Width => 0);
New_Line;
end Put_Result;
Close_If_Open (File);
exception
when Occur : others =>
Put_Line ("Error: " & Ada.Exceptions.Exception_Message (Occur));
Close_If_Open (File);
end Main;
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2016, 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 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 Aarch64 is
pragma Elaborate_Body (Aarch64);
end Aarch64;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 3 9 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
with System.Unsigned_Types;
with Unchecked_Conversion;
package body System.Pack_39 is
subtype Ofs is System.Storage_Elements.Storage_Offset;
subtype Uns is System.Unsigned_Types.Unsigned;
subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
use type System.Storage_Elements.Storage_Offset;
use type System.Unsigned_Types.Unsigned;
type Cluster is record
E0, E1, E2, E3, E4, E5, E6, E7 : Bits_39;
end record;
for Cluster use record
E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
end record;
for Cluster'Size use Bits * 8;
for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment,
1 +
1 * Boolean'Pos (Bits mod 2 = 0) +
2 * Boolean'Pos (Bits mod 4 = 0));
-- Use maximum possible alignment, given the bit field size, since this
-- will result in the most efficient code possible for the field.
type Cluster_Ref is access Cluster;
function To_Ref is new
Unchecked_Conversion (System.Address, Cluster_Ref);
------------
-- Get_39 --
------------
function Get_39 (Arr : System.Address; N : Natural) return Bits_39 is
C : constant Cluster_Ref := To_Ref (Arr + Bits * Ofs (Uns (N) / 8));
begin
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end Get_39;
------------
-- Set_39 --
------------
procedure Set_39 (Arr : System.Address; N : Natural; E : Bits_39) is
C : constant Cluster_Ref := To_Ref (Arr + Bits * Ofs (Uns (N) / 8));
begin
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end Set_39;
end System.Pack_39;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . C O M P L E X _ A U X --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This package contains the routines for Ada.Wide_Text_IO.Complex_IO that
-- are shared among separate instantiations of this package. The routines
-- in this package are identical semantically to those in Complex_IO itself,
-- except that the generic parameter Complex has been replaced by separate
-- real and imaginary values of type Long_Long_Float, and default parameters
-- have been removed because they are supplied explicitly by the calls from
-- within the generic template.
package Ada.Wide_Text_IO.Complex_Aux is
procedure Get
(File : File_Type;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Width : Field);
procedure Gets
(From : String;
ItemR : out Long_Long_Float;
ItemI : out Long_Long_Float;
Last : out Positive);
procedure Put
(File : File_Type;
ItemR : Long_Long_Float;
ItemI : Long_Long_Float;
Fore : Field;
Aft : Field;
Exp : Field);
procedure Puts
(To : out String;
ItemR : Long_Long_Float;
ItemI : Long_Long_Float;
Aft : Field;
Exp : Field);
end Ada.Wide_Text_IO.Complex_Aux;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C S T A N D --
-- --
-- S p e c --
-- --
-- $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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the procedure that is used to create the tree for
-- package Standard and initialize the entities in package Stand.
with Types; use Types;
package CStand is
procedure Create_Standard;
-- This procedure creates the tree for package standard, and initializes
-- the Standard_Entities array and Standard_Package_Node. First the
-- syntactic representation is created (as though the parser had parsed
-- a copy of the source of Standard) and then semantic information is
-- added as it would be by the semantic phases of the compiler. The
-- tree is in the standard format defined by Syntax_Info, except that
-- all Sloc values are set to Standard_Location except for nodes that
-- are part of package ASCII, which have Sloc = Standard_ASCII_Location.
-- The semantics info is in the format given by Entity_Info. The global
-- variables Last_Standard_Node_Id and Last_Standard_List_Id are also set.
procedure Set_Float_Bounds (Id : Entity_Id);
-- Procedure to set bounds for float type or subtype. Id is the entity
-- whose bounds and type are to be set (a floating-point type).
end CStand;
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Statements;
with Program.Lexical_Elements;
with Program.Elements.Expressions;
package Program.Elements.Exit_Statements is
pragma Pure (Program.Elements.Exit_Statements);
type Exit_Statement is
limited interface and Program.Elements.Statements.Statement;
type Exit_Statement_Access is access all Exit_Statement'Class
with Storage_Size => 0;
not overriding function Exit_Loop_Name
(Self : Exit_Statement)
return Program.Elements.Expressions.Expression_Access is abstract;
not overriding function Condition
(Self : Exit_Statement)
return Program.Elements.Expressions.Expression_Access is abstract;
type Exit_Statement_Text is limited interface;
type Exit_Statement_Text_Access is access all Exit_Statement_Text'Class
with Storage_Size => 0;
not overriding function To_Exit_Statement_Text
(Self : in out Exit_Statement)
return Exit_Statement_Text_Access is abstract;
not overriding function Exit_Token
(Self : Exit_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function When_Token
(Self : Exit_Statement_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Exit_Statement_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Exit_Statements;
|
-----------------------------------------------------------------------
-- css-printer -- CSS printer tools
-- Copyright (C) 2017, 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 CSS.Core.Selectors;
with CSS.Core.Vectors;
with CSS.Core.Medias;
with CSS.Core.Refs;
package body CSS.Printer is
procedure Print (Stream : in out File_Type'Class;
Rule : in CSS.Core.Medias.CSSMediaRule'Class);
procedure Do_Indent (Stream : in out File_Type'Class) is
begin
if Stream.Need_Semi then
Stream.Print (';');
if not Stream.Compress then
Stream.New_Line;
end if;
end if;
if not Stream.Compress then
for I in 1 .. Stream.Indent loop
Stream.Print (' ');
end loop;
end if;
end Do_Indent;
procedure Print (Stream : in out File_Type'Class;
Prop : in CSS.Core.Properties.CSSProperty) is
begin
Do_Indent (Stream);
Stream.Print (Prop.Name.all);
Stream.Print (':');
if not Stream.Compress then
Stream.Print (' ');
end if;
Stream.Print (Prop.Value.To_String);
Stream.Need_Semi := True;
end Print;
procedure Print (Stream : in out File_Type'Class;
Rule : in CSS.Core.Medias.CSSMediaRule'Class) is
procedure Process (Pos : in CSS.Core.Vectors.Cursor);
procedure Process (Pos : in CSS.Core.Vectors.Cursor) is
Rule : constant CSS.Core.Styles.CSSStyleRule_Access := CSS.Core.Styles.Element (Pos);
begin
Print (Stream, Rule.all);
end Process;
Need_Comma : Boolean := False;
begin
Stream.Print ("@media");
if not Stream.Compress or not Rule.Medias.Is_Empty then
Stream.Print (' ');
end if;
for S of Rule.Medias loop
if Need_Comma then
Stream.Print (',');
if not Stream.Compress then
Stream.Print (' ');
end if;
end if;
Stream.Print (S);
Need_Comma := True;
end loop;
if not Stream.Compress then
Stream.Print (' ');
end if;
Stream.Print ('{');
if not Stream.Compress then
Stream.New_Line;
end if;
Stream.Indent := Stream.Indent + Stream.Indent_Level;
Stream.Need_Semi := False;
Rule.Rules.Iterate (Process'Access);
Stream.Need_Semi := False;
Stream.Indent := Stream.Indent - Stream.Indent_Level;
if not Stream.Compress then
Stream.New_Line;
end if;
Stream.Print ('}');
if not Stream.Compress then
Stream.New_Line;
end if;
end Print;
procedure Print (Stream : in out File_Type'Class;
Rule : in CSS.Core.Styles.CSSStyleRule'Class) is
procedure Print (Prop : in CSS.Core.Properties.CSSProperty);
procedure Print_Selector (Sel : in CSS.Core.Selectors.CSSSelector);
Need_Comma : Boolean := False;
procedure Print (Prop : in CSS.Core.Properties.CSSProperty) is
begin
Stream.Print (Prop);
end Print;
procedure Print_Selector (Sel : in CSS.Core.Selectors.CSSSelector) is
begin
if Need_Comma then
Stream.Print (',');
if not Stream.Compress then
Stream.Print (' ');
end if;
end if;
Need_Comma := True;
Stream.Print (CSS.Core.Selectors.To_String (Sel));
end Print_Selector;
Sel : constant String := CSS.Core.Selectors.To_String (Rule.Selectors);
begin
Do_Indent (Stream);
CSS.Core.Selectors.Iterate (Rule.Selectors, Print_Selector'Access);
if not Stream.Compress then
Stream.Print (' ');
end if;
Stream.Print ('{');
if not Stream.Compress then
Stream.New_Line;
end if;
Stream.Indent := Stream.Indent + Stream.Indent_Level;
Stream.Need_Semi := False;
Rule.Style.Iterate (Print'Access);
Stream.Need_Semi := False;
Stream.Indent := Stream.Indent - Stream.Indent_Level;
if not Stream.Compress then
if Stream.Full_Semi then
Stream.Print (';');
end if;
Stream.New_Line;
Do_Indent (Stream);
end if;
Stream.Print ('}');
if not Stream.Compress then
Stream.New_Line;
end if;
end Print;
procedure Print (Stream : in out File_Type'Class;
Sheet : in CSS.Core.Sheets.CSSStylesheet) is
procedure Process (Pos : in CSS.Core.Vectors.Cursor);
procedure Process (Pos : in CSS.Core.Vectors.Cursor) is
Rule : constant CSS.Core.Refs.Element_Accessor
:= CSS.Core.Vectors.Element (Pos).Value;
begin
case Rule.Get_Type is
when CSS.Core.STYLE_RULE =>
Print (Stream, CSS.Core.Styles.Element (Pos).all);
when CSS.Core.MEDIA_RULE =>
Print (Stream, CSS.Core.Medias.CSSMediaRule'Class (Rule.Element.all));
when others =>
null;
end case;
end Process;
begin
Sheet.Rules.Iterate (Process'Access);
end Print;
end CSS.Printer;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY COMPONENTS --
-- --
-- S Y S T E M . C O M P A R E _ A R R A Y _ S I G N E D _ 3 2 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains functions for runtime comparisons on arrays whose
-- elements are 32-bit discrete type values to be treated as signed.
package System.Compare_Array_Signed_32 is
-- Note: although the functions in this package are in a sense Pure, the
-- package cannot be declared as Pure, since the arguments are addresses,
-- not the data, and the result is not pure wrt the address values.
function Compare_Array_S32
(Left : System.Address;
Right : System.Address;
Left_Len : Natural;
Right_Len : Natural)
return Integer;
-- Compare the array starting at address Left of length Left_Len
-- with the array starting at address Right of length Right_Len.
-- The comparison is in the normal Ada semantic sense of array
-- comparison. The result is -1,0,+1 for Left<Right, Left=Right,
-- Left>Right respectively.
end System.Compare_Array_Signed_32;
|
-- Copyright 2008-2015 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
package body Homonym is
type Integer_Range is new Integer range -100 .. 100;
type Positive_Range is new Positive range 1 .. 19740804;
---------------
-- Get_Value --
---------------
function Get_Value return Integer_Range
is
subtype Local_Type is Integer_Range;
subtype Local_Type_Subtype is Local_Type;
subtype Int_Type is Integer_Range;
Lcl : Local_Type := 29;
Some_Local_Type_Subtype : Local_Type_Subtype := Lcl;
I : Int_Type := 1;
begin
Do_Nothing (Some_Local_Type_Subtype'Address);
Do_Nothing (I'Address);
return Lcl; -- BREAK_1
end Get_Value;
---------------
-- Get_Value --
---------------
function Get_Value return Positive_Range
is
subtype Local_Type is Positive_Range;
subtype Local_Type_Subtype is Local_Type;
subtype Pos_Type is Positive_Range;
Lcl : Local_Type := 17;
Some_Local_Type_Subtype : Local_Type_Subtype := Lcl;
P : Pos_Type := 2;
begin
Do_Nothing (Some_Local_Type_Subtype'Address);
Do_Nothing (P'Address);
return Lcl; -- BREAK_2
end Get_Value;
----------------
-- Start_Test --
----------------
procedure Start_Test is
Int : Integer_Range;
Pos : Positive_Range;
begin
Int := Get_Value;
Pos := Get_Value;
end Start_Test;
end Homonym;
|
------------------------------------------------------------------------------
-- AGAR CORE LIBRARY --
-- A G A R . E R R O R --
-- B o d y --
-- --
-- Copyright (c) 2018-2019, Julien Nadeau Carriere (vedge@csoft.net) --
-- Copyright (c) 2010, coreland (mark@coreland.ath.cx) --
-- --
-- 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 body Agar.Error is
function Get_Error return String is
begin
return C.To_Ada (CS.Value (AG_GetError));
end;
procedure Set_Error (Message : in String) is
Ch_Message : aliased C.char_array := C.To_C (Message);
begin
AG_SetErrorS
(Message => CS.To_Chars_Ptr (Ch_Message'Unchecked_Access));
end;
procedure Fatal_Error (Message : in String) is
Ch_Message : aliased C.char_array := C.To_C (Message);
begin
AG_FatalError
(Message => CS.To_Chars_Ptr (Ch_Message'Unchecked_Access));
end;
--
-- Proxy procedure to call error callback from C code.
--
Error_Callback_Fn : Error_Callback_Access := null;
procedure Error_Callback_Proxy (Message : CS.chars_ptr) with Convention => C;
procedure Error_Callback_Proxy (Message : CS.chars_ptr) is
begin
if Error_Callback_Fn /= null then
Error_Callback_Fn.all (C.To_Ada (CS.Value (Message)));
end if;
end;
procedure Set_Fatal_Callback (Callback : Error_Callback_Access) is
begin
Error_Callback_Fn := Callback;
AG_SetFatalCallback (Error_Callback_Proxy'Access);
end;
end Agar.Error;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ W I D E _ U N B O U N D E D . A U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This child package of Ada.Strings.Wide_Wide_Unbounded provides some
-- specialized access functions which are intended to allow more efficient
-- use of the facilities of Ada.Strings.Wide_Wide_Unbounded, particularly by
-- other layered utilities.
package Ada.Strings.Wide_Wide_Unbounded.Aux is
pragma Preelaborate;
procedure Get_Wide_Wide_String
(U : Unbounded_Wide_Wide_String;
S : out Wide_Wide_String_Access;
L : out Natural);
pragma Inline (Get_Wide_Wide_String);
-- This procedure returns the internal string pointer used in the
-- representation of an unbounded string as well as the actual current
-- length (which may be less than S.all'Length because in general there
-- can be extra space assigned). The characters of this string may be
-- not be modified via the returned pointer, and are valid only as
-- long as the original unbounded string is not accessed or modified.
--
-- This procedure is more efficient than the use of To_Wide_Wide_String
-- since it avoids the need to copy the string. The lower bound of the
-- referenced string returned by this call is always one, so the actual
-- string data is always accessible as S (1 .. L).
procedure Set_Wide_Wide_String
(UP : in out Unbounded_Wide_Wide_String;
S : Wide_Wide_String);
pragma Inline (Set_Wide_Wide_String);
-- This function sets the string contents of the referenced unbounded
-- string to the given string value. It is significantly more efficient
-- than the use of To_Unbounded_Wide_Wide_String with an assignment, since
-- it avoids the necessity of messing with finalization chains. The lower
-- bound of the string S is not required to be one.
procedure Set_Wide_Wide_String
(UP : in out Unbounded_Wide_Wide_String;
S : Wide_Wide_String_Access);
pragma Inline (Set_Wide_Wide_String);
-- This version of Set_Wide_Wide_String takes a string access value, rather
-- than string. The lower bound of the string value is required to be one,
-- and this requirement is not checked.
end Ada.Strings.Wide_Wide_Unbounded.Aux;
|
-- Swaggy Jenkins
-- Jenkins API clients generated from Swagger / Open API specification
-- ------------ EDIT NOTE ------------
-- This file was generated with openapi-generator. You can modify it to implement
-- the server. After you modify this file, you should add the following line
-- to the .openapi-generator-ignore file:
--
-- src/-servers.adb
--
-- Then, you can drop this edit note comment.
-- ------------ EDIT NOTE ------------
package body .Servers is
--
-- Retrieve CSRF protection token
overriding
procedure Get_Crumb
(Server : in out Server_Type
;
Result : out .Models.DefaultCrumbIssuer_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Crumb;
--
-- Delete queue item from an organization pipeline queue
overriding
procedure Delete_Pipeline_Queue_Item
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Queue : in Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Delete_Pipeline_Queue_Item;
--
-- Retrieve authenticated user details for an organization
overriding
procedure Get_Authenticated_User
(Server : in out Server_Type;
Organization : in Swagger.UString;
Result : out .Models.User_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Authenticated_User;
--
-- Get a list of class names supported by a given class
overriding
procedure Get_Classes
(Server : in out Server_Type;
Class : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Classes;
--
-- Retrieve JSON Web Key
overriding
procedure Get_Json_Web_Key
(Server : in out Server_Type;
Key : in Integer;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Json_Web_Key;
--
-- Retrieve JSON Web Token
overriding
procedure Get_Json_Web_Token
(Server : in out Server_Type;
Expiry_Time_In_Mins : in Swagger.Nullable_Integer;
Max_Expiry_Time_In_Mins : in Swagger.Nullable_Integer;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Json_Web_Token;
--
-- Retrieve organization details
overriding
procedure Get_Organisation
(Server : in out Server_Type;
Organization : in Swagger.UString;
Result : out .Models.Organisation_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Organisation;
--
-- Retrieve all organizations details
overriding
procedure Get_Organisations
(Server : in out Server_Type
;
Result : out .Models.Organisations_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Organisations;
--
-- Retrieve pipeline details for an organization
overriding
procedure Get_Pipeline
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Result : out .Models.Pipeline_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline;
--
-- Retrieve all activities details for an organization pipeline
overriding
procedure Get_Pipeline_Activities
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Result : out .Models.PipelineActivities_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Activities;
--
-- Retrieve branch details for an organization pipeline
overriding
procedure Get_Pipeline_Branch
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Branch : in Swagger.UString;
Result : out .Models.BranchImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Branch;
--
-- Retrieve branch run details for an organization pipeline
overriding
procedure Get_Pipeline_Branch_Run
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Branch : in Swagger.UString;
Run : in Swagger.UString;
Result : out .Models.PipelineRun_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Branch_Run;
--
-- Retrieve all branches details for an organization pipeline
overriding
procedure Get_Pipeline_Branches
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Result : out .Models.MultibranchPipeline_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Branches;
--
-- Retrieve pipeline folder for an organization
overriding
procedure Get_Pipeline_Folder
(Server : in out Server_Type;
Organization : in Swagger.UString;
Folder : in Swagger.UString;
Result : out .Models.PipelineFolderImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Folder;
--
-- Retrieve pipeline details for an organization folder
overriding
procedure Get_Pipeline_Folder_Pipeline
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Folder : in Swagger.UString;
Result : out .Models.PipelineImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Folder_Pipeline;
--
-- Retrieve queue details for an organization pipeline
overriding
procedure Get_Pipeline_Queue
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Result : out .Models.PipelineQueue_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Queue;
--
-- Retrieve run details for an organization pipeline
overriding
procedure Get_Pipeline_Run
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Result : out .Models.PipelineRun_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run;
--
-- Get log for a pipeline run
overriding
procedure Get_Pipeline_Run_Log
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Start : in Swagger.Nullable_Integer;
Download : in Swagger.Nullable_Boolean;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run_Log;
--
-- Retrieve run node details for an organization pipeline
overriding
procedure Get_Pipeline_Run_Node
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Node : in Swagger.UString;
Result : out .Models.PipelineRunNode_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run_Node;
--
-- Retrieve run node details for an organization pipeline
overriding
procedure Get_Pipeline_Run_Node_Step
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Node : in Swagger.UString;
Step : in Swagger.UString;
Result : out .Models.PipelineStepImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run_Node_Step;
--
-- Get log for a pipeline run node step
overriding
procedure Get_Pipeline_Run_Node_Step_Log
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Node : in Swagger.UString;
Step : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run_Node_Step_Log;
--
-- Retrieve run node steps details for an organization pipeline
overriding
procedure Get_Pipeline_Run_Node_Steps
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Node : in Swagger.UString;
Result : out .Models.PipelineRunNodeSteps_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run_Node_Steps;
--
-- Retrieve run nodes details for an organization pipeline
overriding
procedure Get_Pipeline_Run_Nodes
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Result : out .Models.PipelineRunNodes_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Run_Nodes;
--
-- Retrieve all runs details for an organization pipeline
overriding
procedure Get_Pipeline_Runs
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Result : out .Models.PipelineRuns_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipeline_Runs;
--
-- Retrieve all pipelines details for an organization
overriding
procedure Get_Pipelines
(Server : in out Server_Type;
Organization : in Swagger.UString;
Result : out .Models.Pipelines_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Pipelines;
--
-- Retrieve SCM details for an organization
overriding
procedure Get_S_C_M
(Server : in out Server_Type;
Organization : in Swagger.UString;
Scm : in Swagger.UString;
Result : out .Models.GithubScm_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_S_C_M;
--
-- Retrieve SCM organization repositories details for an organization
overriding
procedure Get_S_C_M_Organisation_Repositories
(Server : in out Server_Type;
Organization : in Swagger.UString;
Scm : in Swagger.UString;
Scm_Organisation : in Swagger.UString;
Credential_Id : in Swagger.Nullable_UString;
Page_Size : in Swagger.Nullable_Integer;
Page_Number : in Swagger.Nullable_Integer;
Result : out .Models.ScmOrganisations_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_S_C_M_Organisation_Repositories;
--
-- Retrieve SCM organization repository details for an organization
overriding
procedure Get_S_C_M_Organisation_Repository
(Server : in out Server_Type;
Organization : in Swagger.UString;
Scm : in Swagger.UString;
Scm_Organisation : in Swagger.UString;
Repository : in Swagger.UString;
Credential_Id : in Swagger.Nullable_UString;
Result : out .Models.ScmOrganisations_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_S_C_M_Organisation_Repository;
--
-- Retrieve SCM organizations details for an organization
overriding
procedure Get_S_C_M_Organisations
(Server : in out Server_Type;
Organization : in Swagger.UString;
Scm : in Swagger.UString;
Credential_Id : in Swagger.Nullable_UString;
Result : out .Models.ScmOrganisations_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_S_C_M_Organisations;
--
-- Retrieve user details for an organization
overriding
procedure Get_User
(Server : in out Server_Type;
Organization : in Swagger.UString;
User : in Swagger.UString;
Result : out .Models.User_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_User;
--
-- Retrieve user favorites details for an organization
overriding
procedure Get_User_Favorites
(Server : in out Server_Type;
User : in Swagger.UString;
Result : out .Models.UserFavorites_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_User_Favorites;
--
-- Retrieve users details for an organization
overriding
procedure Get_Users
(Server : in out Server_Type;
Organization : in Swagger.UString;
Result : out .Models.User_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Users;
--
-- Replay an organization pipeline run
overriding
procedure Post_Pipeline_Run
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Result : out .Models.QueueItemImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Pipeline_Run;
--
-- Start a build for an organization pipeline
overriding
procedure Post_Pipeline_Runs
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Result : out .Models.QueueItemImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Pipeline_Runs;
--
-- Favorite/unfavorite a pipeline
overriding
procedure Put_Pipeline_Favorite
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Body_Type : in Body_Type;
Result : out .Models.FavoriteImpl_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Put_Pipeline_Favorite;
--
-- Stop a build of an organization pipeline
overriding
procedure Put_Pipeline_Run
(Server : in out Server_Type;
Organization : in Swagger.UString;
Pipeline : in Swagger.UString;
Run : in Swagger.UString;
Blocking : in Swagger.Nullable_UString;
Time_Out_In_Secs : in Swagger.Nullable_Integer;
Result : out .Models.PipelineRun_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Put_Pipeline_Run;
--
-- Search for any resource details
overriding
procedure Search
(Server : in out Server_Type;
Q : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Search;
--
-- Get classes details
overriding
procedure Search_Classes
(Server : in out Server_Type;
Q : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Search_Classes;
--
-- Retrieve computer details
overriding
procedure Get_Computer
(Server : in out Server_Type;
Depth : in Integer;
Result : out .Models.ComputerSet_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Computer;
--
-- Retrieve Jenkins details
overriding
procedure Get_Jenkins
(Server : in out Server_Type
;
Result : out .Models.Hudson_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Jenkins;
--
-- Retrieve job details
overriding
procedure Get_Job
(Server : in out Server_Type;
Name : in Swagger.UString;
Result : out .Models.FreeStyleProject_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Job;
--
-- Retrieve job configuration
overriding
procedure Get_Job_Config
(Server : in out Server_Type;
Name : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Job_Config;
--
-- Retrieve job's last build details
overriding
procedure Get_Job_Last_Build
(Server : in out Server_Type;
Name : in Swagger.UString;
Result : out .Models.FreeStyleBuild_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Job_Last_Build;
--
-- Retrieve job's build progressive text output
overriding
procedure Get_Job_Progressive_Text
(Server : in out Server_Type;
Name : in Swagger.UString;
Number : in Swagger.UString;
Start : in Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Job_Progressive_Text;
--
-- Retrieve queue details
overriding
procedure Get_Queue
(Server : in out Server_Type
;
Result : out .Models.Queue_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Queue;
--
-- Retrieve queued item details
overriding
procedure Get_Queue_Item
(Server : in out Server_Type;
Number : in Swagger.UString;
Result : out .Models.Queue_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_Queue_Item;
--
-- Retrieve view details
overriding
procedure Get_View
(Server : in out Server_Type;
Name : in Swagger.UString;
Result : out .Models.ListView_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_View;
--
-- Retrieve view configuration
overriding
procedure Get_View_Config
(Server : in out Server_Type;
Name : in Swagger.UString;
Result : out Swagger.UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Get_View_Config;
--
-- Retrieve Jenkins headers
overriding
procedure Head_Jenkins
(Server : in out Server_Type
;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Head_Jenkins;
--
-- Create a new job using job configuration, or copied from an existing job
overriding
procedure Post_Create_Item
(Server : in out Server_Type;
Name : in Swagger.UString;
From : in Swagger.Nullable_UString;
Mode : in Swagger.Nullable_UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Content_Type : in Swagger.Nullable_UString;
P_Body : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Create_Item;
--
-- Create a new view using view configuration
overriding
procedure Post_Create_View
(Server : in out Server_Type;
Name : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Content_Type : in Swagger.Nullable_UString;
P_Body : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Create_View;
--
-- Build a job
overriding
procedure Post_Job_Build
(Server : in out Server_Type;
Name : in Swagger.UString;
Json : in Swagger.UString;
Token : in Swagger.Nullable_UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Job_Build;
--
-- Update job configuration
overriding
procedure Post_Job_Config
(Server : in out Server_Type;
Name : in Swagger.UString;
P_Body : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Job_Config;
--
-- Delete a job
overriding
procedure Post_Job_Delete
(Server : in out Server_Type;
Name : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Job_Delete;
--
-- Disable a job
overriding
procedure Post_Job_Disable
(Server : in out Server_Type;
Name : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Job_Disable;
--
-- Enable a job
overriding
procedure Post_Job_Enable
(Server : in out Server_Type;
Name : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Job_Enable;
--
-- Stop a job
overriding
procedure Post_Job_Last_Build_Stop
(Server : in out Server_Type;
Name : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_Job_Last_Build_Stop;
--
-- Update view configuration
overriding
procedure Post_View_Config
(Server : in out Server_Type;
Name : in Swagger.UString;
P_Body : in Swagger.UString;
Jenkins_Crumb : in Swagger.Nullable_UString;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
end Post_View_Config;
end .Servers;
|
-----------------------------------------------------------------------
-- awa-workspaces-module -- Module workspaces
-- Copyright (C) 2011, 2012, 2013, 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.Calendar;
with AWA.Modules.Beans;
with AWA.Modules.Get;
with ADO.SQL;
with ADO.Sessions.Entities;
with ADO.Queries;
with ADO.Statements;
with Security.Policies.Roles;
with Util.Log.Loggers;
with Util.Mail;
with AWA.Users.Modules;
with AWA.Workspaces.Beans;
package body AWA.Workspaces.Modules is
use type ADO.Identifier;
package APS renames AWA.Permissions.Services;
package ASC renames AWA.Services.Contexts;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AWA.Workspaces.Module");
package Register is new AWA.Modules.Beans (Module => Workspace_Module,
Module_Access => Workspace_Module_Access);
-- ------------------------------
-- Initialize the workspaces module.
-- ------------------------------
overriding
procedure Initialize (Plugin : in out Workspace_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config) is
Sec_Manager : constant Security.Policies.Policy_Manager_Access
:= Plugin.Get_Application.Get_Security_Manager;
begin
Log.Info ("Initializing the workspaces module");
-- Register here any bean class, servlet, filter.
Register.Register (Plugin => Plugin,
Name => "AWA.Workspaces.Beans.Workspaces_Bean",
Handler => AWA.Workspaces.Beans.Create_Workspaces_Bean'Access);
Register.Register (Plugin => Plugin,
Name => "AWA.Workspaces.Beans.Member_List_Bean",
Handler => AWA.Workspaces.Beans.Create_Member_List_Bean'Access);
Register.Register (Plugin => Plugin,
Name => "AWA.Workspaces.Beans.Invitation_Bean",
Handler => AWA.Workspaces.Beans.Create_Invitation_Bean'Access);
Register.Register (Plugin => Plugin,
Name => "AWA.Workspaces.Beans.Member_Bean",
Handler => AWA.Workspaces.Beans.Create_Member_Bean'Access);
AWA.Modules.Module (Plugin).Initialize (App, Props);
Plugin.User_Manager := AWA.Users.Modules.Get_User_Manager;
Plugin.Perm_Manager := APS.Permission_Manager'Class (Sec_Manager.all)'Access;
Plugin.Add_Listener (AWA.Users.Modules.NAME, Plugin'Unchecked_Access);
end Initialize;
-- ------------------------------
-- Configures the module after its initialization and after having read its XML configuration.
-- ------------------------------
overriding
procedure Configure (Plugin : in out Workspace_Module;
Props : in ASF.Applications.Config) is
pragma Unreferenced (Props);
List : constant String := Plugin.Get_Config (PARAM_PERMISSIONS_LIST);
begin
Plugin.Owner_Permissions := Ada.Strings.Unbounded.To_Unbounded_String (List);
Plugin.Allow_WS_Create := Plugin.Get_Config (PARAM_ALLOW_WORKSPACE_CREATE);
end Configure;
-- ------------------------------
-- Get the list of permissions for the workspace owner.
-- ------------------------------
function Get_Owner_Permissions (Manager : in Workspace_Module) return Permission_Index_Array is
use Ada.Strings.Unbounded;
begin
return Security.Permissions.Get_Permission_Array (To_String (Manager.Owner_Permissions));
end Get_Owner_Permissions;
-- ------------------------------
-- Get the workspace module.
-- ------------------------------
function Get_Workspace_Module return Workspace_Module_Access is
function Get is new AWA.Modules.Get (Workspace_Module, Workspace_Module_Access, NAME);
begin
return Get;
end Get_Workspace_Module;
-- ------------------------------
-- Get the current workspace associated with the current user.
-- If the user has not workspace, create one.
-- ------------------------------
procedure Get_Workspace (Session : in out ADO.Sessions.Master_Session;
Context : in AWA.Services.Contexts.Service_Context_Access;
Workspace : out AWA.Workspaces.Models.Workspace_Ref) is
User : constant AWA.Users.Models.User_Ref := Context.Get_User;
WS : AWA.Workspaces.Models.Workspace_Ref;
Member : AWA.Workspaces.Models.Workspace_Member_Ref;
Query : ADO.SQL.Query;
Found : Boolean;
Plugin : constant Workspace_Module_Access := Get_Workspace_Module;
begin
if User.Is_Null then
Log.Error ("There is no current user. The workspace cannot be identified");
Workspace := AWA.Workspaces.Models.Null_Workspace;
return;
end if;
-- Find the workspace associated with the current user.
Query.Add_Param (User.Get_Id);
Query.Set_Filter ("o.owner_id = ?");
WS.Find (Session, Query, Found);
if Found then
Workspace := WS;
return;
end if;
-- Check that the user has the permission to create a new workspace.
AWA.Permissions.Check (Permission => ACL_Create_Workspace.Permission,
Entity => User);
-- Create a workspace for this user.
WS.Set_Owner (User);
WS.Set_Create_Date (Ada.Calendar.Clock);
WS.Save (Session);
-- Create the member instance for this user.
Member.Set_Workspace (WS);
Member.Set_Member (User);
Member.Set_Role ("Owner");
Member.Set_Join_Date (ADO.Nullable_Time '(Is_Null => False, Value => WS.Get_Create_Date));
Member.Save (Session);
-- And give full control of the workspace for this user
Add_Permission (Session => Session,
User => User.Get_Id,
Entity => WS,
Workspace => WS.Get_Id,
List => Plugin.Get_Owner_Permissions);
Workspace := WS;
end Get_Workspace;
-- ------------------------------
-- Create a workspace for the user.
-- ------------------------------
procedure Create_Workspace (Module : in Workspace_Module;
Workspace : out AWA.Workspaces.Models.Workspace_Ref) is
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
WS : AWA.Workspaces.Models.Workspace_Ref;
Member : AWA.Workspaces.Models.Workspace_Member_Ref;
begin
if User.Is_Null then
Log.Error ("There is no current user. The workspace cannot be identified");
Workspace := AWA.Workspaces.Models.Null_Workspace;
return;
end if;
-- Check that the user has the permission to create a new workspace.
AWA.Permissions.Check (Permission => ACL_Create_Workspace.Permission,
Entity => User);
DB.Begin_Transaction;
-- Create a workspace for this user.
WS.Set_Owner (User);
WS.Set_Create_Date (Ada.Calendar.Clock);
WS.Save (DB);
-- Create the member instance for this user.
Member.Set_Workspace (WS);
Member.Set_Member (User);
Member.Set_Role ("Owner");
Member.Set_Join_Date (ADO.Nullable_Time '(Is_Null => False, Value => WS.Get_Create_Date));
Member.Save (DB);
-- And give full control of the workspace for this user
Add_Permission (Session => DB,
User => User.Get_Id,
Entity => WS,
Workspace => WS.Get_Id,
List => Module.Get_Owner_Permissions);
Workspace := WS;
DB.Commit;
end Create_Workspace;
-- ------------------------------
-- Load the invitation from the access key and verify that the key is still valid.
-- ------------------------------
procedure Load_Invitation (Module : in Workspace_Module;
Key : in String;
Invitation : in out AWA.Workspaces.Models.Invitation_Ref'Class;
Inviter : in out AWA.Users.Models.User_Ref) is
pragma Unreferenced (Module);
use type Ada.Calendar.Time;
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Query : ADO.SQL.Query;
DB_Key : AWA.Users.Models.Access_Key_Ref;
Found : Boolean;
begin
Log.Debug ("Loading invitation from key {0}", Key);
Query.Set_Filter ("o.access_key = :key");
Query.Bind_Param ("key", Key);
DB_Key.Find (DB, Query, Found);
if not Found then
Log.Info ("Invitation key {0} does not exist");
raise Not_Found;
end if;
if DB_Key.Get_Expire_Date < Ada.Calendar.Clock then
Log.Info ("Invitation key {0} has expired");
raise Not_Found;
end if;
Query.Set_Filter ("o.invitee_id = :user");
Query.Bind_Param ("user", DB_Key.Get_User.Get_Id);
Invitation.Find (DB, Query, Found);
if not Found then
Log.Warn ("Invitation key {0} has been withdawn");
raise Not_Found;
end if;
Inviter := AWA.Users.Models.User_Ref (Invitation.Get_Inviter);
end Load_Invitation;
-- ------------------------------
-- Accept the invitation identified by the access key.
-- ------------------------------
procedure Accept_Invitation (Module : in Workspace_Module;
Key : in String) is
use type Ada.Calendar.Time;
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
Query : ADO.SQL.Query;
DB_Key : AWA.Users.Models.Access_Key_Ref;
Found : Boolean;
Invitation : AWA.Workspaces.Models.Invitation_Ref;
Invitee_Id : ADO.Identifier;
Workspace_Id : ADO.Identifier;
Member : AWA.Workspaces.Models.Workspace_Member_Ref;
User_Member : AWA.Workspaces.Models.Workspace_Member_Ref;
Now : constant Ada.Calendar.Time := Ada.Calendar.Clock;
begin
Log.Debug ("Accept invitation with key {0}", Key);
Ctx.Start;
-- Get the access key and verify its validity.
Query.Set_Filter ("o.access_key = :key");
Query.Bind_Param ("key", Key);
DB_Key.Find (DB, Query, Found);
if not Found then
Log.Info ("Invitation key {0} does not exist", Key);
raise Not_Found;
end if;
if DB_Key.Get_Expire_Date < Now then
Log.Info ("Invitation key {0} has expired", Key);
raise Not_Found;
end if;
-- Find the invitation associated with the access key.
Invitee_Id := DB_Key.Get_User.Get_Id;
Query.Set_Filter ("o.invitee_id = :user");
Query.Bind_Param ("user", Invitee_Id);
Invitation.Find (DB, Query, Found);
if not Found then
Log.Warn ("Invitation key {0} has been withdawn", Key);
raise Not_Found;
end if;
Member := AWA.Workspaces.Models.Workspace_Member_Ref (Invitation.Get_Member);
Workspace_Id := Invitation.Get_Workspace.Get_Id;
-- Update the workspace member relation.
Member.Set_Join_Date (ADO.Nullable_Time '(Is_Null => False,
Value => Now));
Invitation.Set_Acceptance_Date (ADO.Nullable_Time '(Is_Null => False,
Value => Now));
-- The user who received the invitation is different from the user who is
-- logged and accepted the validation. Since the key is verified, this is
-- the same user but the user who accepted the invitation registered using
-- another email address.
if Invitee_Id /= User.Get_Id then
-- Check whether the user is not already part of the workspace.
Query.Clear;
Query.Set_Filter ("o.member_id = ? AND o.workspace_id = ?");
Query.Add_Param (User.Get_Id);
Query.Add_Param (Workspace_Id);
User_Member.Find (DB, Query, Found);
if Found then
Member.Delete (DB);
Invitation.Delete (DB);
Log.Info ("Invitation accepted by user who is already a member");
else
Member.Set_Member (User);
Log.Info ("Invitation accepted by user with another email address");
Invitation.Set_Invitee (User);
end if;
end if;
if not Member.Is_Null then
Member.Save (DB);
end if;
DB_Key.Delete (DB);
if not Invitation.Is_Null then
Invitation.Save (DB);
-- Send the accepted invitation event.
declare
Event : AWA.Events.Module_Event;
begin
Event.Set_Parameter ("invitee_email", User.Get_Email.Get_Email);
Event.Set_Parameter ("invitee_name", User.Get_Name);
Event.Set_Parameter ("message", Invitation.Get_Message);
Event.Set_Parameter ("inviter_email", Invitation.Get_Inviter.Get_Email.Get_Email);
Event.Set_Parameter ("inviter_name", Invitation.Get_Inviter.Get_Name);
Event.Set_Event_Kind (Accept_Invitation_Event.Kind);
Module.Send_Event (Event);
end;
end if;
Ctx.Commit;
end Accept_Invitation;
-- ------------------------------
-- Send the invitation to the user.
-- ------------------------------
procedure Send_Invitation (Module : in Workspace_Module;
Invitation : in out AWA.Workspaces.Models.Invitation_Ref'Class) is
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
WS : AWA.Workspaces.Models.Workspace_Ref;
Query : ADO.SQL.Query;
Found : Boolean;
Key : AWA.Users.Models.Access_Key_Ref;
Email : AWA.Users.Models.Email_Ref;
Invitee : AWA.Users.Models.User_Ref;
Invit : AWA.Workspaces.Models.Invitation_Ref;
Member : AWA.Workspaces.Models.Workspace_Member_Ref;
Invite_Address : constant String := Invitation.Get_Email;
Email_Address : constant Util.Mail.Email_Address
:= Util.Mail.Parse_Address (Invite_Address);
begin
Log.Info ("Sending invitation to {0}", Invite_Address);
if User.Is_Null then
Log.Error ("There is no current user. The workspace cannot be identified");
return;
end if;
-- Find the workspace associated with the current user.
Query.Set_Join ("INNER JOIN awa_workspace_member AS m ON m.workspace_id = o.id");
Query.Set_Filter ("m.member_id = ?");
Query.Add_Param (User.Get_Id);
WS.Find (DB, Query, Found);
if not Found then
Log.Error ("The current user has no associated workspace");
return;
end if;
-- Check that the user has the permission to invite users in the workspace.
AWA.Permissions.Check (Permission => ACL_Invite_User.Permission,
Entity => WS);
Ctx.Start;
Query.Clear;
Query.Set_Filter ("LOWER(o.email) = LOWER(?)");
Query.Add_Param (Email_Address.Address);
Email.Find (DB, Query, Found);
if not Found then
Email.Set_User_Id (0);
Email.Set_Email (Email_Address.Address);
Email.Save (DB);
Invitee.Set_Email (Email);
Invitee.Set_Name (Email_Address.Name);
Invitee.Set_First_Name (Util.Mail.Get_First_Name (Email_Address));
Invitee.Set_Last_Name (Util.Mail.Get_Last_Name (Email_Address));
Invitee.Save (DB);
Email.Set_User_Id (Invitee.Get_Id);
Email.Save (DB);
elsif Email.Get_User_Id /= ADO.NO_IDENTIFIER then
Invitee.Load (DB, Email.Get_User_Id);
else
Invitee.Set_Email (Email);
Invitee.Set_Name (Email_Address.Name);
Invitee.Set_First_Name (Util.Mail.Get_First_Name (Email_Address));
Invitee.Set_Last_Name (Util.Mail.Get_Last_Name (Email_Address));
Invitee.Save (DB);
Email.Set_User_Id (Invitee.Get_Id);
Email.Save (DB);
end if;
-- Create the workspace member relation.
Query.Clear;
Query.Set_Filter ("o.member_id = ? AND o.workspace_id = ?");
Query.Add_Param (Invitee.Get_Id);
Query.Add_Param (WS.Get_Id);
Member.Find (DB, Query, Found);
if not Found then
Member.Set_Member (Invitee);
Member.Set_Workspace (WS);
Member.Set_Role ("Invited");
Member.Save (DB);
end if;
-- Check for a previous invitation for the user and delete it.
Query.Set_Filter ("o.invitee_id = ? AND o.workspace_id = ?");
Invit.Find (DB, Query, Found);
if Found then
Key := AWA.Users.Models.Access_Key_Ref (Invit.Get_Access_Key);
Key.Delete (DB);
if not Invitation.Is_Inserted or else Invit.Get_Id /= Invitation.Get_Id then
Invit.Delete (DB);
end if;
end if;
Key := AWA.Users.Models.Access_Key_Ref (Invitation.Get_Access_Key);
Module.User_Manager.Create_Access_Key (Invitee, Key, AWA.Users.Models.INVITATION_KEY,
365 * 86400.0, DB);
Key.Save (DB);
Invitation.Set_Access_Key (Key);
Invitation.Set_Inviter (User);
Invitation.Set_Invitee (Invitee);
Invitation.Set_Workspace (WS);
Invitation.Set_Create_Date (Ada.Calendar.Clock);
Invitation.Set_Member (Member);
Invitation.Save (DB);
-- Send the email with the reset password key
declare
Event : AWA.Events.Module_Event;
begin
Event.Set_Parameter ("key", Key.Get_Access_Key);
Event.Set_Parameter ("email", Ada.Strings.Unbounded.To_String (Email_Address.Address));
Event.Set_Parameter ("name", Invitee.Get_Name);
Event.Set_Parameter ("message", Invitation.Get_Message);
Event.Set_Parameter ("inviter", User.Get_Name);
Event.Set_Event_Kind (Invite_User_Event.Kind);
Module.Send_Event (Event);
end;
Ctx.Commit;
end Send_Invitation;
-- ------------------------------
-- Delete the member from the workspace. Remove the invitation if there is one.
-- ------------------------------
procedure Delete_Member (Module : in Workspace_Module;
Member_Id : in ADO.Identifier) is
pragma Unreferenced (Module);
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
User : constant AWA.Users.Models.User_Ref := Ctx.Get_User;
Query : ADO.SQL.Query;
Found : Boolean;
Key : AWA.Users.Models.Access_Key_Ref;
Member : AWA.Workspaces.Models.Workspace_Member_Ref;
Invitation : AWA.Workspaces.Models.Invitation_Ref;
User_Id : ADO.Identifier;
Workspace_Id : ADO.Identifier;
User_Image : constant String := ADO.Identifier'Image (Member_Id);
begin
Log.Info ("Delete user member {0}", User_Image);
-- Get the workspace member instance for the user and remove it.
Member.Load (DB, Member_Id, Found);
if not Found then
Log.Error ("User member {0} does not exist", User_Image);
return;
end if;
User_Id := Member.Get_Member.Get_Id;
Workspace_Id := Member.Get_Workspace.Get_Id;
if User.Get_Id = User_Id then
Log.Warn ("Refusing to delete the current user {0}", User_Image);
return;
end if;
-- Check that the user has the permission to delete users from the workspace.
AWA.Permissions.Check (Permission => ACL_Delete_User.Permission,
Entity => Workspace_Id);
Ctx.Start;
Member.Delete (DB);
-- Get the invitation and remove it.
Query.Set_Filter ("o.member_id = ?");
Query.Add_Param (Member_Id);
Invitation.Find (DB, Query, Found);
if Found then
Key := AWA.Users.Models.Access_Key_Ref (Invitation.Get_Access_Key);
Key.Delete (DB);
Invitation.Delete (DB);
end if;
-- Remove all permissions assigned to the user in the workspace.
AWA.Permissions.Services.Delete_Permissions (DB, User_Id, Workspace_Id);
Ctx.Commit;
end Delete_Member;
-- ------------------------------
-- Add a list of permissions for all the users of the workspace that have the appropriate
-- role. Workspace members will be able to access the given database entity for the
-- specified list of permissions.
-- ------------------------------
procedure Add_Permission (Session : in out ADO.Sessions.Master_Session;
User : in ADO.Identifier;
Entity : in ADO.Objects.Object_Ref'Class;
Workspace : in ADO.Identifier;
List : in Security.Permissions.Permission_Index_Array) is
Ctx : constant ASC.Service_Context_Access := AWA.Services.Contexts.Current;
Key : constant ADO.Objects.Object_Key := Entity.Get_Key;
Id : constant ADO.Identifier := ADO.Objects.Get_Value (Key);
Kind : constant ADO.Entity_Type
:= ADO.Sessions.Entities.Find_Entity_Type (Session => Session,
Object => Key);
Manager : constant AWA.Permissions.Services.Permission_Manager_Access
:= AWA.Permissions.Services.Get_Permission_Manager (Ctx);
begin
for Perm of List loop
declare
Member : ADO.Identifier;
Query : ADO.Queries.Context;
Names : constant Security.Policies.Roles.Role_Name_Array
:= Manager.Get_Role_Names (Perm);
Need_Sep : Boolean := False;
User_Added : Boolean := False;
begin
if Names'Length > 0 then
Query.Set_Query (AWA.Workspaces.Models.Query_Member_In_Role);
ADO.SQL.Append (Query.Filter, "user_member.workspace_id = :workspace_id");
ADO.SQL.Append (Query.Filter, " AND user_member.role IN (");
for Name of Names loop
ADO.SQL.Append (Query.Filter, (if Need_Sep then ",?" else "?"));
Query.Add_Param (Name.all);
Need_Sep := True;
end loop;
Query.Bind_Param ("workspace_id", Workspace);
ADO.SQL.Append (Query.Filter, ")");
declare
Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Query);
begin
Stmt.Execute;
while Stmt.Has_Elements loop
Member := Stmt.Get_Identifier (0);
if Member = User then
User_Added := True;
end if;
Manager.Add_Permission (Session => Session,
User => Member,
Entity => Id,
Kind => Kind,
Workspace => Workspace,
Permission => Perm);
Stmt.Next;
end loop;
end;
end if;
if not User_Added then
Manager.Add_Permission (Session => Session,
User => User,
Entity => Id,
Kind => Kind,
Workspace => Workspace,
Permission => Perm);
end if;
end;
end loop;
end Add_Permission;
-- ------------------------------
-- The `On_Create` procedure is called by `Notify_Create` to notify the creation of the user.
-- ------------------------------
overriding
procedure On_Create (Module : in Workspace_Module;
User : in AWA.Users.Models.User_Ref'Class) is
Ctx : constant ASC.Service_Context_Access := ASC.Current;
Kind : ADO.Entity_Type;
begin
if Module.Allow_WS_Create then
declare
DB : ADO.Sessions.Master_Session := ASC.Get_Master_Session (Ctx);
begin
Ctx.Start;
Kind := ADO.Sessions.Entities.Find_Entity_Type (DB, Models.WORKSPACE_TABLE);
Module.Perm_Manager.Add_Permission (Session => DB,
User => User.Get_Id,
Entity => ADO.NO_IDENTIFIER,
Kind => Kind,
Workspace => ADO.NO_IDENTIFIER,
Permission => ACL_Create_Workspace.Permission);
Ctx.Commit;
end;
end if;
end On_Create;
end AWA.Workspaces.Modules;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- L I B . X R E F --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-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 Atree; use Atree;
with Csets; use Csets;
with Elists; use Elists;
with Errout; use Errout;
with Lib.Util; use Lib.Util;
with Namet; use Namet;
with Nlists; use Nlists;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Sem; use Sem;
with Sem_Prag; use Sem_Prag;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Snames; use Snames;
with Stringt; use Stringt;
with Stand; use Stand;
with Table; use Table;
with Widechar; use Widechar;
with GNAT.Heap_Sort_A;
package body Lib.Xref is
------------------
-- Declarations --
------------------
-- The Xref table is used to record references. The Loc field is set
-- to No_Location for a definition entry.
subtype Xref_Entry_Number is Int;
type Xref_Entry is record
Ent : Entity_Id;
-- Entity referenced (E parameter to Generate_Reference)
Def : Source_Ptr;
-- Original source location for entity being referenced. Note that
-- these values are used only during the output process, they are
-- not set when the entries are originally built. This is because
-- private entities can be swapped when the initial call is made.
Loc : Source_Ptr;
-- Location of reference (Original_Location (Sloc field of N parameter
-- to Generate_Reference). Set to No_Location for the case of a
-- defining occurrence.
Typ : Character;
-- Reference type (Typ param to Generate_Reference)
Eun : Unit_Number_Type;
-- Unit number corresponding to Ent
Lun : Unit_Number_Type;
-- Unit number corresponding to Loc. Value is undefined and not
-- referenced if Loc is set to No_Location.
end record;
package Xrefs is new Table.Table (
Table_Component_Type => Xref_Entry,
Table_Index_Type => Xref_Entry_Number,
Table_Low_Bound => 1,
Table_Initial => Alloc.Xrefs_Initial,
Table_Increment => Alloc.Xrefs_Increment,
Table_Name => "Xrefs");
-------------------------
-- Generate_Definition --
-------------------------
procedure Generate_Definition (E : Entity_Id) is
Loc : Source_Ptr;
Indx : Nat;
begin
pragma Assert (Nkind (E) in N_Entity);
-- Note that we do not test Xref_Entity_Letters here. It is too
-- early to do so, since we are often called before the entity
-- is fully constructed, so that the Ekind is still E_Void.
if Opt.Xref_Active
-- Definition must come from source
-- We make an exception for subprogram child units that have no
-- spec. For these we generate a subprogram declaration for library
-- use, and the corresponding entity does not come from source.
-- Nevertheless, all references will be attached to it and we have
-- to treat is as coming from user code.
and then (Comes_From_Source (E) or else Is_Child_Unit (E))
-- And must have a reasonable source location that is not
-- within an instance (all entities in instances are ignored)
and then Sloc (E) > No_Location
and then Instantiation_Location (Sloc (E)) = No_Location
-- And must be a non-internal name from the main source unit
and then In_Extended_Main_Source_Unit (E)
and then not Is_Internal_Name (Chars (E))
then
Xrefs.Increment_Last;
Indx := Xrefs.Last;
Loc := Original_Location (Sloc (E));
Xrefs.Table (Indx).Ent := E;
Xrefs.Table (Indx).Loc := No_Location;
Xrefs.Table (Indx).Eun := Get_Source_Unit (Loc);
Xrefs.Table (Indx).Lun := No_Unit;
Set_Has_Xref_Entry (E);
if In_Inlined_Body then
Set_Referenced (E);
end if;
end if;
end Generate_Definition;
---------------------------------
-- Generate_Operator_Reference --
---------------------------------
procedure Generate_Operator_Reference
(N : Node_Id;
T : Entity_Id)
is
begin
if not In_Extended_Main_Source_Unit (N) then
return;
end if;
-- If the operator is not a Standard operator, then we generate
-- a real reference to the user defined operator.
if Sloc (Entity (N)) /= Standard_Location then
Generate_Reference (Entity (N), N);
-- A reference to an implicit inequality operator is a also a
-- reference to the user-defined equality.
if Nkind (N) = N_Op_Ne
and then not Comes_From_Source (Entity (N))
and then Present (Corresponding_Equality (Entity (N)))
then
Generate_Reference (Corresponding_Equality (Entity (N)), N);
end if;
-- For the case of Standard operators, we mark the result type
-- as referenced. This ensures that in the case where we are
-- using a derived operator, we mark an entity of the unit that
-- implicitly defines this operator as used. Otherwise we may
-- think that no entity of the unit is used. The actual entity
-- marked as referenced is the first subtype, which is the user
-- defined entity that is relevant.
-- Note: we only do this for operators that come from source.
-- The generated code sometimes reaches for entities that do
-- not need to be explicitly visible (for example, when we
-- expand the code for comparing two record types, the fields
-- of the record may not be visible).
elsif Comes_From_Source (N) then
Set_Referenced (First_Subtype (T));
end if;
end Generate_Operator_Reference;
------------------------
-- Generate_Reference --
------------------------
procedure Generate_Reference
(E : Entity_Id;
N : Node_Id;
Typ : Character := 'r';
Set_Ref : Boolean := True;
Force : Boolean := False)
is
Indx : Nat;
Nod : Node_Id;
Ref : Source_Ptr;
Def : Source_Ptr;
Ent : Entity_Id;
function Is_On_LHS (Node : Node_Id) return Boolean;
-- Used to check if a node is on the left hand side of an
-- assignment. The following cases are handled:
--
-- Variable Node is a direct descendant of an assignment
-- statement.
--
-- Prefix Of an indexed or selected component that is
-- present in a subtree rooted by an assignment
-- statement. There is no restriction of nesting
-- of components, thus cases such as A.B(C).D are
-- handled properly.
---------------
-- Is_On_LHS --
---------------
-- Couldn't we use Is_Lvalue or whatever it is called ???
function Is_On_LHS (Node : Node_Id) return Boolean is
N : Node_Id := Node;
begin
-- Only identifiers are considered, is this necessary???
if Nkind (N) /= N_Identifier then
return False;
end if;
-- Reach the assignment statement subtree root. In the
-- case of a variable being a direct descendant of an
-- assignment statement, the loop is skiped.
while Nkind (Parent (N)) /= N_Assignment_Statement loop
-- Check whether the parent is a component and the
-- current node is its prefix.
if (Nkind (Parent (N)) = N_Selected_Component
or else
Nkind (Parent (N)) = N_Indexed_Component)
and then Prefix (Parent (N)) = N
then
N := Parent (N);
else
return False;
end if;
end loop;
-- Parent (N) is assignment statement, check whether N is its name
return Name (Parent (N)) = N;
end Is_On_LHS;
-- Start of processing for Generate_Reference
begin
pragma Assert (Nkind (E) in N_Entity);
-- Check for obsolescent reference to ASCII
if E = Standard_ASCII then
Check_Restriction (No_Obsolescent_Features, N);
end if;
-- Warn if reference to Ada 2005 entity not in Ada 2005 mode. We only
-- detect real explicit references (modifications and references).
if Is_Ada_2005 (E)
and then Ada_Version < Ada_05
and then Warn_On_Ada_2005_Compatibility
and then (Typ = 'm' or else Typ = 'r')
then
Error_Msg_NE ("& is only defined in Ada 2005?", N, E);
end if;
-- Never collect references if not in main source unit. However, we omit
-- this test if Typ is 'e' or 'k', since these entries are structural,
-- and it is useful to have them in units that reference packages as
-- well as units that define packages. We also omit the test for the
-- case of 'p' since we want to include inherited primitive operations
-- from other packages.
if not In_Extended_Main_Source_Unit (N)
and then Typ /= 'e'
and then Typ /= 'p'
and then Typ /= 'k'
then
return;
end if;
-- For reference type p, the entity must be in main source unit
if Typ = 'p' and then not In_Extended_Main_Source_Unit (E) then
return;
end if;
-- Unless the reference is forced, we ignore references where
-- the reference itself does not come from Source.
if not Force and then not Comes_From_Source (N) then
return;
end if;
-- Deal with setting entity as referenced, unless suppressed.
-- Note that we still do Set_Referenced on entities that do not
-- come from source. This situation arises when we have a source
-- reference to a derived operation, where the derived operation
-- itself does not come from source, but we still want to mark it
-- as referenced, since we really are referencing an entity in the
-- corresponding package (this avoids incorrect complaints that the
-- package contains no referenced entities).
if Set_Ref then
-- For a variable that appears on the left side of an
-- assignment statement, we set the Referenced_As_LHS
-- flag since this is indeed a left hand side.
-- We also set the Referenced_As_LHS flag of a prefix
-- of selected or indexed component.
if Ekind (E) = E_Variable
and then Is_On_LHS (N)
then
Set_Referenced_As_LHS (E);
-- Check for a reference in a pragma that should not count as a
-- making the variable referenced for warning purposes.
elsif Is_Non_Significant_Pragma_Reference (N) then
null;
-- A reference in an attribute definition clause does not
-- count as a reference except for the case of Address.
-- The reason that 'Address is an exception is that it
-- creates an alias through which the variable may be
-- referenced.
elsif Nkind (Parent (N)) = N_Attribute_Definition_Clause
and then Chars (Parent (N)) /= Name_Address
and then N = Name (Parent (N))
then
null;
-- Constant completion does not count as a reference
elsif Typ = 'c'
and then Ekind (E) = E_Constant
then
null;
-- Record representation clause does not count as a reference
elsif Nkind (N) = N_Identifier
and then Nkind (Parent (N)) = N_Record_Representation_Clause
then
null;
-- Discriminants do not need to produce a reference to record type
elsif Typ = 'd'
and then Nkind (Parent (N)) = N_Discriminant_Specification
then
null;
-- Any other occurrence counts as referencing the entity
else
Set_Referenced (E);
end if;
-- Check for pragma Unreferenced given and reference is within
-- this source unit (occasion for possible warning to be issued)
if Has_Pragma_Unreferenced (E)
and then In_Same_Extended_Unit (E, N)
then
-- A reference as a named parameter in a call does not count
-- as a violation of pragma Unreferenced for this purpose.
if Nkind (N) = N_Identifier
and then Nkind (Parent (N)) = N_Parameter_Association
and then Selector_Name (Parent (N)) = N
then
null;
-- Neither does a reference to a variable on the left side
-- of an assignment.
elsif Is_On_LHS (N) then
null;
-- For entry formals, we want to place the warning on the
-- corresponding entity in the accept statement. The current
-- scope is the body of the accept, so we find the formal
-- whose name matches that of the entry formal (there is no
-- link between the two entities, and the one in the accept
-- statement is only used for conformance checking).
elsif Ekind (Scope (E)) = E_Entry then
declare
BE : Entity_Id;
begin
BE := First_Entity (Current_Scope);
while Present (BE) loop
if Chars (BE) = Chars (E) then
Error_Msg_NE
("?pragma Unreferenced given for&", N, BE);
exit;
end if;
Next_Entity (BE);
end loop;
end;
-- Here we issue the warning, since this is a real reference
else
Error_Msg_NE ("?pragma Unreferenced given for&", N, E);
end if;
end if;
-- If this is a subprogram instance, mark as well the internal
-- subprogram in the wrapper package, which may be a visible
-- compilation unit.
if Is_Overloadable (E)
and then Is_Generic_Instance (E)
and then Present (Alias (E))
then
Set_Referenced (Alias (E));
end if;
end if;
-- Generate reference if all conditions are met:
if
-- Cross referencing must be active
Opt.Xref_Active
-- The entity must be one for which we collect references
and then Xref_Entity_Letters (Ekind (E)) /= ' '
-- Both Sloc values must be set to something sensible
and then Sloc (E) > No_Location
and then Sloc (N) > No_Location
-- We ignore references from within an instance
and then Instantiation_Location (Sloc (N)) = No_Location
-- Ignore dummy references
and then Typ /= ' '
then
if Nkind (N) = N_Identifier
or else
Nkind (N) = N_Defining_Identifier
or else
Nkind (N) in N_Op
or else
Nkind (N) = N_Defining_Operator_Symbol
or else
Nkind (N) = N_Operator_Symbol
or else
(Nkind (N) = N_Character_Literal
and then Sloc (Entity (N)) /= Standard_Location)
or else
Nkind (N) = N_Defining_Character_Literal
then
Nod := N;
elsif Nkind (N) = N_Expanded_Name
or else
Nkind (N) = N_Selected_Component
then
Nod := Selector_Name (N);
else
return;
end if;
-- Normal case of source entity comes from source
if Comes_From_Source (E) then
Ent := E;
-- Entity does not come from source, but is a derived subprogram
-- and the derived subprogram comes from source (after one or more
-- derivations) in which case the reference is to parent subprogram.
elsif Is_Overloadable (E)
and then Present (Alias (E))
then
Ent := Alias (E);
loop
if Comes_From_Source (Ent) then
exit;
elsif No (Alias (Ent)) then
return;
else
Ent := Alias (Ent);
end if;
end loop;
-- The internally created defining entity for a child subprogram
-- that has no previous spec has valid references.
elsif Is_Overloadable (E)
and then Is_Child_Unit (E)
then
Ent := E;
-- Record components of discriminated subtypes or derived types
-- must be treated as references to the original component.
elsif Ekind (E) = E_Component
and then Comes_From_Source (Original_Record_Component (E))
then
Ent := Original_Record_Component (E);
-- Ignore reference to any other entity that is not from source
else
return;
end if;
-- Record reference to entity
Ref := Original_Location (Sloc (Nod));
Def := Original_Location (Sloc (Ent));
Xrefs.Increment_Last;
Indx := Xrefs.Last;
Xrefs.Table (Indx).Loc := Ref;
-- Overriding operations are marked with 'P'
if Typ = 'p'
and then Is_Subprogram (N)
and then Is_Overriding_Operation (N)
then
Xrefs.Table (Indx).Typ := 'P';
else
Xrefs.Table (Indx).Typ := Typ;
end if;
Xrefs.Table (Indx).Eun := Get_Source_Unit (Def);
Xrefs.Table (Indx).Lun := Get_Source_Unit (Ref);
Xrefs.Table (Indx).Ent := Ent;
Set_Has_Xref_Entry (Ent);
end if;
end Generate_Reference;
-----------------------------------
-- Generate_Reference_To_Formals --
-----------------------------------
procedure Generate_Reference_To_Formals (E : Entity_Id) is
Formal : Entity_Id;
begin
if Is_Generic_Subprogram (E) then
Formal := First_Entity (E);
while Present (Formal)
and then not Is_Formal (Formal)
loop
Next_Entity (Formal);
end loop;
else
Formal := First_Formal (E);
end if;
while Present (Formal) loop
if Ekind (Formal) = E_In_Parameter then
if Nkind (Parameter_Type (Parent (Formal)))
= N_Access_Definition
then
Generate_Reference (E, Formal, '^', False);
else
Generate_Reference (E, Formal, '>', False);
end if;
elsif Ekind (Formal) = E_In_Out_Parameter then
Generate_Reference (E, Formal, '=', False);
else
Generate_Reference (E, Formal, '<', False);
end if;
Next_Formal (Formal);
end loop;
end Generate_Reference_To_Formals;
-------------------------------------------
-- Generate_Reference_To_Generic_Formals --
-------------------------------------------
procedure Generate_Reference_To_Generic_Formals (E : Entity_Id) is
Formal : Entity_Id;
begin
Formal := First_Entity (E);
while Present (Formal) loop
if Comes_From_Source (Formal) then
Generate_Reference (E, Formal, 'z', False);
end if;
Next_Entity (Formal);
end loop;
end Generate_Reference_To_Generic_Formals;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Xrefs.Init;
end Initialize;
-----------------------
-- Output_References --
-----------------------
procedure Output_References is
procedure Get_Type_Reference
(Ent : Entity_Id;
Tref : out Entity_Id;
Left : out Character;
Right : out Character);
-- Given an entity id Ent, determines whether a type reference is
-- required. If so, Tref is set to the entity for the type reference
-- and Left and Right are set to the left/right brackets to be
-- output for the reference. If no type reference is required, then
-- Tref is set to Empty, and Left/Right are set to space.
procedure Output_Import_Export_Info (Ent : Entity_Id);
-- Ouput language and external name information for an interfaced
-- entity, using the format <language, external_name>,
------------------------
-- Get_Type_Reference --
------------------------
procedure Get_Type_Reference
(Ent : Entity_Id;
Tref : out Entity_Id;
Left : out Character;
Right : out Character)
is
Sav : Entity_Id;
begin
-- See if we have a type reference
Tref := Ent;
Left := '{';
Right := '}';
loop
Sav := Tref;
-- Processing for types
if Is_Type (Tref) then
-- Case of base type
if Base_Type (Tref) = Tref then
-- If derived, then get first subtype
if Tref /= Etype (Tref) then
Tref := First_Subtype (Etype (Tref));
-- Set brackets for derived type, but don't
-- override pointer case since the fact that
-- something is a pointer is more important
if Left /= '(' then
Left := '<';
Right := '>';
end if;
-- If non-derived ptr, get directly designated type.
-- If the type has a full view, all references are
-- on the partial view, that is seen first.
elsif Is_Access_Type (Tref) then
Tref := Directly_Designated_Type (Tref);
Left := '(';
Right := ')';
elsif Is_Private_Type (Tref)
and then Present (Full_View (Tref))
then
if Is_Access_Type (Full_View (Tref)) then
Tref := Directly_Designated_Type (Full_View (Tref));
Left := '(';
Right := ')';
-- If the full view is an array type, we also retrieve
-- the corresponding component type, because the ali
-- entry already indicates that this is an array.
elsif Is_Array_Type (Full_View (Tref)) then
Tref := Component_Type (Full_View (Tref));
Left := '(';
Right := ')';
end if;
-- If non-derived array, get component type.
-- Skip component type for case of String
-- or Wide_String, saves worthwhile space.
elsif Is_Array_Type (Tref)
and then Tref /= Standard_String
and then Tref /= Standard_Wide_String
then
Tref := Component_Type (Tref);
Left := '(';
Right := ')';
-- For other non-derived base types, nothing
else
exit;
end if;
-- For a subtype, go to ancestor subtype
else
Tref := Ancestor_Subtype (Tref);
-- If no ancestor subtype, go to base type
if No (Tref) then
Tref := Base_Type (Sav);
end if;
end if;
-- For objects, functions, enum literals,
-- just get type from Etype field.
elsif Is_Object (Tref)
or else Ekind (Tref) = E_Enumeration_Literal
or else Ekind (Tref) = E_Function
or else Ekind (Tref) = E_Operator
then
Tref := Etype (Tref);
-- For anything else, exit
else
exit;
end if;
-- Exit if no type reference, or we are stuck in
-- some loop trying to find the type reference, or
-- if the type is standard void type (the latter is
-- an implementation artifact that should not show
-- up in the generated cross-references).
exit when No (Tref)
or else Tref = Sav
or else Tref = Standard_Void_Type;
-- If we have a usable type reference, return, otherwise
-- keep looking for something useful (we are looking for
-- something that either comes from source or standard)
if Sloc (Tref) = Standard_Location
or else Comes_From_Source (Tref)
then
-- If the reference is a subtype created for a generic
-- actual, go to actual directly, the inner subtype is
-- not user visible.
if Nkind (Parent (Tref)) = N_Subtype_Declaration
and then not Comes_From_Source (Parent (Tref))
and then
(Is_Wrapper_Package (Scope (Tref))
or else Is_Generic_Instance (Scope (Tref)))
then
Tref := First_Subtype (Base_Type (Tref));
end if;
return;
end if;
end loop;
-- If we fall through the loop, no type reference
Tref := Empty;
Left := ' ';
Right := ' ';
end Get_Type_Reference;
-------------------------------
-- Output_Import_Export_Info --
-------------------------------
procedure Output_Import_Export_Info (Ent : Entity_Id) is
Language_Name : Name_Id;
Conv : constant Convention_Id := Convention (Ent);
begin
if Conv = Convention_C then
Language_Name := Name_C;
elsif Conv = Convention_CPP then
Language_Name := Name_CPP;
elsif Conv = Convention_Ada then
Language_Name := Name_Ada;
else
-- These are the only languages that GPS knows about
return;
end if;
Write_Info_Char ('<');
Get_Unqualified_Name_String (Language_Name);
for J in 1 .. Name_Len loop
Write_Info_Char (Name_Buffer (J));
end loop;
if Present (Interface_Name (Ent)) then
Write_Info_Char (',');
String_To_Name_Buffer (Strval (Interface_Name (Ent)));
for J in 1 .. Name_Len loop
Write_Info_Char (Name_Buffer (J));
end loop;
end if;
Write_Info_Char ('>');
end Output_Import_Export_Info;
-- Start of processing for Output_References
begin
if not Opt.Xref_Active then
return;
end if;
-- Before we go ahead and output the references we have a problem
-- that needs dealing with. So far we have captured things that are
-- definitely referenced by the main unit, or defined in the main
-- unit. That's because we don't want to clutter up the ali file
-- for this unit with definition lines for entities in other units
-- that are not referenced.
-- But there is a glitch. We may reference an entity in another unit,
-- and it may have a type reference to an entity that is not directly
-- referenced in the main unit, which may mean that there is no xref
-- entry for this entity yet in the list of references.
-- If we don't do something about this, we will end with an orphan
-- type reference, i.e. it will point to an entity that does not
-- appear within the generated references in the ali file. That is
-- not good for tools using the xref information.
-- To fix this, we go through the references adding definition
-- entries for any unreferenced entities that can be referenced
-- in a type reference. There is a recursion problem here, and
-- that is dealt with by making sure that this traversal also
-- traverses any entries that get added by the traversal.
declare
J : Nat;
Tref : Entity_Id;
L, R : Character;
Indx : Nat;
Ent : Entity_Id;
Loc : Source_Ptr;
begin
-- Note that this is not a for loop for a very good reason. The
-- processing of items in the table can add new items to the
-- table, and they must be processed as well
J := 1;
while J <= Xrefs.Last loop
Ent := Xrefs.Table (J).Ent;
Get_Type_Reference (Ent, Tref, L, R);
if Present (Tref)
and then not Has_Xref_Entry (Tref)
and then Sloc (Tref) > No_Location
then
Xrefs.Increment_Last;
Indx := Xrefs.Last;
Loc := Original_Location (Sloc (Tref));
Xrefs.Table (Indx).Ent := Tref;
Xrefs.Table (Indx).Loc := No_Location;
Xrefs.Table (Indx).Eun := Get_Source_Unit (Loc);
Xrefs.Table (Indx).Lun := No_Unit;
Set_Has_Xref_Entry (Tref);
end if;
-- Collect inherited primitive operations that may be
-- declared in another unit and have no visible reference
-- in the current one.
if Is_Type (Ent)
and then Is_Tagged_Type (Ent)
and then Is_Derived_Type (Ent)
and then Ent = Base_Type (Ent)
and then In_Extended_Main_Source_Unit (Ent)
then
declare
Op_List : constant Elist_Id := Primitive_Operations (Ent);
Op : Elmt_Id;
Prim : Entity_Id;
function Parent_Op (E : Entity_Id) return Entity_Id;
-- Find original operation, which may be inherited
-- through several derivations.
function Parent_Op (E : Entity_Id) return Entity_Id is
Orig_Op : constant Entity_Id := Alias (E);
begin
if No (Orig_Op) then
return Empty;
elsif not Comes_From_Source (E)
and then not Has_Xref_Entry (Orig_Op)
and then Comes_From_Source (Orig_Op)
then
return Orig_Op;
else
return Parent_Op (Orig_Op);
end if;
end Parent_Op;
begin
Op := First_Elmt (Op_List);
while Present (Op) loop
Prim := Parent_Op (Node (Op));
if Present (Prim) then
Xrefs.Increment_Last;
Indx := Xrefs.Last;
Loc := Original_Location (Sloc (Prim));
Xrefs.Table (Indx).Ent := Prim;
Xrefs.Table (Indx).Loc := No_Location;
Xrefs.Table (Indx).Eun :=
Get_Source_Unit (Sloc (Prim));
Xrefs.Table (Indx).Lun := No_Unit;
Set_Has_Xref_Entry (Prim);
end if;
Next_Elmt (Op);
end loop;
end;
end if;
J := J + 1;
end loop;
end;
-- Now we have all the references, including those for any embedded
-- type references, so we can sort them, and output them.
Output_Refs : declare
Nrefs : Nat := Xrefs.Last;
-- Number of references in table. This value may get reset
-- (reduced) when we eliminate duplicate reference entries.
Rnums : array (0 .. Nrefs) of Nat;
-- This array contains numbers of references in the Xrefs table.
-- This list is sorted in output order. The extra 0'th entry is
-- convenient for the call to sort. When we sort the table, we
-- move the entries in Rnums around, but we do not move the
-- original table entries.
Curxu : Unit_Number_Type;
-- Current xref unit
Curru : Unit_Number_Type;
-- Current reference unit for one entity
Cursrc : Source_Buffer_Ptr;
-- Current xref unit source text
Curent : Entity_Id;
-- Current entity
Curnam : String (1 .. Name_Buffer'Length);
Curlen : Natural;
-- Simple name and length of current entity
Curdef : Source_Ptr;
-- Original source location for current entity
Crloc : Source_Ptr;
-- Current reference location
Ctyp : Character;
-- Entity type character
Tref : Entity_Id;
-- Type reference
Rref : Node_Id;
-- Renaming reference
Trunit : Unit_Number_Type;
-- Unit number for type reference
function Lt (Op1, Op2 : Natural) return Boolean;
-- Comparison function for Sort call
function Name_Change (X : Entity_Id) return Boolean;
-- Determines if entity X has a different simple name from Curent
procedure Move (From : Natural; To : Natural);
-- Move procedure for Sort call
--------
-- Lt --
--------
function Lt (Op1, Op2 : Natural) return Boolean is
T1 : Xref_Entry renames Xrefs.Table (Rnums (Nat (Op1)));
T2 : Xref_Entry renames Xrefs.Table (Rnums (Nat (Op2)));
begin
-- First test. If entity is in different unit, sort by unit
if T1.Eun /= T2.Eun then
return Dependency_Num (T1.Eun) < Dependency_Num (T2.Eun);
-- Second test, within same unit, sort by entity Sloc
elsif T1.Def /= T2.Def then
return T1.Def < T2.Def;
-- Third test, sort definitions ahead of references
elsif T1.Loc = No_Location then
return True;
elsif T2.Loc = No_Location then
return False;
-- Fourth test, for same entity, sort by reference location unit
elsif T1.Lun /= T2.Lun then
return Dependency_Num (T1.Lun) < Dependency_Num (T2.Lun);
-- Fifth test order of location within referencing unit
elsif T1.Loc /= T2.Loc then
return T1.Loc < T2.Loc;
-- Finally, for two locations at the same address, we prefer
-- the one that does NOT have the type 'r' so that a modification
-- or extension takes preference, when there are more than one
-- reference at the same location.
else
return T2.Typ = 'r';
end if;
end Lt;
----------
-- Move --
----------
procedure Move (From : Natural; To : Natural) is
begin
Rnums (Nat (To)) := Rnums (Nat (From));
end Move;
-----------------
-- Name_Change --
-----------------
function Name_Change (X : Entity_Id) return Boolean is
begin
Get_Unqualified_Name_String (Chars (X));
if Name_Len /= Curlen then
return True;
else
return Name_Buffer (1 .. Curlen) /= Curnam (1 .. Curlen);
end if;
end Name_Change;
-- Start of processing for Output_Refs
begin
-- Capture the definition Sloc values. We delay doing this till now,
-- since at the time the reference or definition is made, private
-- types may be swapped, and the Sloc value may be incorrect. We
-- also set up the pointer vector for the sort.
for J in 1 .. Nrefs loop
Rnums (J) := J;
Xrefs.Table (J).Def :=
Original_Location (Sloc (Xrefs.Table (J).Ent));
end loop;
-- Sort the references
GNAT.Heap_Sort_A.Sort
(Integer (Nrefs),
Move'Unrestricted_Access,
Lt'Unrestricted_Access);
-- Eliminate duplicate entries
declare
NR : constant Nat := Nrefs;
begin
-- We need this test for NR because if we force ALI file
-- generation in case of errors detected, it may be the case
-- that Nrefs is 0, so we should not reset it here
if NR >= 2 then
Nrefs := 1;
for J in 2 .. NR loop
if Xrefs.Table (Rnums (J)) /=
Xrefs.Table (Rnums (Nrefs))
then
Nrefs := Nrefs + 1;
Rnums (Nrefs) := Rnums (J);
end if;
end loop;
end if;
end;
-- Initialize loop through references
Curxu := No_Unit;
Curent := Empty;
Curdef := No_Location;
Curru := No_Unit;
Crloc := No_Location;
-- Loop to output references
for Refno in 1 .. Nrefs loop
Output_One_Ref : declare
P2 : Source_Ptr;
WC : Char_Code;
Err : Boolean;
Ent : Entity_Id;
XE : Xref_Entry renames Xrefs.Table (Rnums (Refno));
-- The current entry to be accessed
P : Source_Ptr;
-- Used to index into source buffer to get entity name
Left : Character;
Right : Character;
-- Used for {} or <> or () for type reference
procedure Output_Instantiation_Refs (Loc : Source_Ptr);
-- Recursive procedure to output instantiation references for
-- the given source ptr in [file|line[...]] form. No output
-- if the given location is not a generic template reference.
procedure Output_Overridden_Op (Old_E : Entity_Id);
-- For a subprogram that is overriding, display information
-- about the inherited operation that it overrides.
-------------------------------
-- Output_Instantiation_Refs --
-------------------------------
procedure Output_Instantiation_Refs (Loc : Source_Ptr) is
Iloc : constant Source_Ptr := Instantiation_Location (Loc);
Lun : Unit_Number_Type;
Cu : constant Unit_Number_Type := Curru;
begin
-- Nothing to do if this is not an instantiation
if Iloc = No_Location then
return;
end if;
-- Output instantiation reference
Write_Info_Char ('[');
Lun := Get_Source_Unit (Iloc);
if Lun /= Curru then
Curru := Lun;
Write_Info_Nat (Dependency_Num (Curru));
Write_Info_Char ('|');
end if;
Write_Info_Nat (Int (Get_Logical_Line_Number (Iloc)));
-- Recursive call to get nested instantiations
Output_Instantiation_Refs (Iloc);
-- Output final ] after call to get proper nesting
Write_Info_Char (']');
Curru := Cu;
return;
end Output_Instantiation_Refs;
--------------------------
-- Output_Overridden_Op --
--------------------------
procedure Output_Overridden_Op (Old_E : Entity_Id) is
begin
if Present (Old_E)
and then Sloc (Old_E) /= Standard_Location
then
declare
Loc : constant Source_Ptr := Sloc (Old_E);
Par_Unit : constant Unit_Number_Type :=
Get_Source_Unit (Loc);
begin
Write_Info_Char ('<');
if Par_Unit /= Curxu then
Write_Info_Nat (Dependency_Num (Par_Unit));
Write_Info_Char ('|');
end if;
Write_Info_Nat (Int (Get_Logical_Line_Number (Loc)));
Write_Info_Char ('p');
Write_Info_Nat (Int (Get_Column_Number (Loc)));
Write_Info_Char ('>');
end;
end if;
end Output_Overridden_Op;
-- Start of processing for Output_One_Ref
begin
Ent := XE.Ent;
Ctyp := Xref_Entity_Letters (Ekind (Ent));
-- Skip reference if it is the only reference to an entity,
-- and it is an end-line reference, and the entity is not in
-- the current extended source. This prevents junk entries
-- consisting only of packages with end lines, where no
-- entity from the package is actually referenced.
if XE.Typ = 'e'
and then Ent /= Curent
and then (Refno = Nrefs or else
Ent /= Xrefs.Table (Rnums (Refno + 1)).Ent)
and then
not In_Extended_Main_Source_Unit (Ent)
then
goto Continue;
end if;
-- For private type, get full view type
if Ctyp = '+'
and then Present (Full_View (XE.Ent))
then
Ent := Underlying_Type (Ent);
if Present (Ent) then
Ctyp := Xref_Entity_Letters (Ekind (Ent));
end if;
end if;
-- Special exception for Boolean
if Ctyp = 'E' and then Is_Boolean_Type (Ent) then
Ctyp := 'B';
end if;
-- For variable reference, get corresponding type
if Ctyp = '*' then
Ent := Etype (XE.Ent);
Ctyp := Fold_Lower (Xref_Entity_Letters (Ekind (Ent)));
-- If variable is private type, get full view type
if Ctyp = '+'
and then Present (Full_View (Etype (XE.Ent)))
then
Ent := Underlying_Type (Etype (XE.Ent));
if Present (Ent) then
Ctyp := Fold_Lower (Xref_Entity_Letters (Ekind (Ent)));
end if;
elsif Is_Generic_Type (Ent) then
-- If the type of the entity is a generic private type
-- there is no usable full view, so retain the indication
-- that this is an object.
Ctyp := '*';
end if;
-- Special handling for access parameter
declare
K : constant Entity_Kind := Ekind (Etype (XE.Ent));
begin
if (K = E_Anonymous_Access_Type
or else
K = E_Anonymous_Access_Subprogram_Type
or else K =
E_Anonymous_Access_Protected_Subprogram_Type)
and then Is_Formal (XE.Ent)
then
Ctyp := 'p';
-- Special handling for Boolean
elsif Ctyp = 'e' and then Is_Boolean_Type (Ent) then
Ctyp := 'b';
end if;
end;
end if;
-- Special handling for abstract types and operations
if Is_Abstract (XE.Ent) then
if Ctyp = 'U' then
Ctyp := 'x'; -- abstract procedure
elsif Ctyp = 'V' then
Ctyp := 'y'; -- abstract function
elsif Ctyp = 'R' then
Ctyp := 'H'; -- abstract type
end if;
end if;
-- Only output reference if interesting type of entity,
-- and suppress self references, except for bodies that
-- act as specs. Also suppress definitions of body formals
-- (we only treat these as references, and the references
-- were separately recorded).
if Ctyp = ' '
or else (XE.Loc = XE.Def
and then
(XE.Typ /= 'b'
or else not Is_Subprogram (XE.Ent)))
or else (Is_Formal (XE.Ent)
and then Present (Spec_Entity (XE.Ent)))
then
null;
else
-- Start new Xref section if new xref unit
if XE.Eun /= Curxu then
if Write_Info_Col > 1 then
Write_Info_EOL;
end if;
Curxu := XE.Eun;
Cursrc := Source_Text (Source_Index (Curxu));
Write_Info_Initiate ('X');
Write_Info_Char (' ');
Write_Info_Nat (Dependency_Num (XE.Eun));
Write_Info_Char (' ');
Write_Info_Name (Reference_Name (Source_Index (XE.Eun)));
end if;
-- Start new Entity line if new entity. Note that we
-- consider two entities the same if they have the same
-- name and source location. This causes entities in
-- instantiations to be treated as though they referred
-- to the template.
if No (Curent)
or else
(XE.Ent /= Curent
and then
(Name_Change (XE.Ent) or else XE.Def /= Curdef))
then
Curent := XE.Ent;
Curdef := XE.Def;
Get_Unqualified_Name_String (Chars (XE.Ent));
Curlen := Name_Len;
Curnam (1 .. Curlen) := Name_Buffer (1 .. Curlen);
if Write_Info_Col > 1 then
Write_Info_EOL;
end if;
-- Write column number information
Write_Info_Nat (Int (Get_Logical_Line_Number (XE.Def)));
Write_Info_Char (Ctyp);
Write_Info_Nat (Int (Get_Column_Number (XE.Def)));
-- Write level information
Write_Level_Info : declare
function Is_Visible_Generic_Entity
(E : Entity_Id) return Boolean;
-- Check whether E is declared in the visible part
-- of a generic package. For source navigation
-- purposes, treat this as a visible entity.
function Is_Private_Record_Component
(E : Entity_Id) return Boolean;
-- Check whether E is a non-inherited component of a
-- private extension. Even if the enclosing record is
-- public, we want to treat the component as private
-- for navigation purposes.
---------------------------------
-- Is_Private_Record_Component --
---------------------------------
function Is_Private_Record_Component
(E : Entity_Id) return Boolean
is
S : constant Entity_Id := Scope (E);
begin
return
Ekind (E) = E_Component
and then Nkind (Declaration_Node (S)) =
N_Private_Extension_Declaration
and then Original_Record_Component (E) = E;
end Is_Private_Record_Component;
-------------------------------
-- Is_Visible_Generic_Entity --
-------------------------------
function Is_Visible_Generic_Entity
(E : Entity_Id) return Boolean
is
Par : Node_Id;
begin
if Ekind (Scope (E)) /= E_Generic_Package then
return False;
end if;
Par := Parent (E);
while Present (Par) loop
if
Nkind (Par) = N_Generic_Package_Declaration
then
-- Entity is a generic formal
return False;
elsif
Nkind (Parent (Par)) = N_Package_Specification
then
return
Is_List_Member (Par)
and then List_Containing (Par) =
Visible_Declarations (Parent (Par));
else
Par := Parent (Par);
end if;
end loop;
return False;
end Is_Visible_Generic_Entity;
-- Start of processing for Write_Level_Info
begin
if Is_Hidden (Curent)
or else Is_Private_Record_Component (Curent)
then
Write_Info_Char (' ');
elsif
Is_Public (Curent)
or else Is_Visible_Generic_Entity (Curent)
then
Write_Info_Char ('*');
else
Write_Info_Char (' ');
end if;
end Write_Level_Info;
-- Output entity name. We use the occurrence from the
-- actual source program at the definition point
P := Original_Location (Sloc (XE.Ent));
-- Entity is character literal
if Cursrc (P) = ''' then
Write_Info_Char (Cursrc (P));
Write_Info_Char (Cursrc (P + 1));
Write_Info_Char (Cursrc (P + 2));
-- Entity is operator symbol
elsif Cursrc (P) = '"' or else Cursrc (P) = '%' then
Write_Info_Char (Cursrc (P));
P2 := P;
loop
P2 := P2 + 1;
Write_Info_Char (Cursrc (P2));
exit when Cursrc (P2) = Cursrc (P);
end loop;
-- Entity is identifier
else
loop
if Is_Start_Of_Wide_Char (Cursrc, P) then
Scan_Wide (Cursrc, P, WC, Err);
elsif not Identifier_Char (Cursrc (P)) then
exit;
else
P := P + 1;
end if;
end loop;
for J in
Original_Location (Sloc (XE.Ent)) .. P - 1
loop
Write_Info_Char (Cursrc (J));
end loop;
end if;
-- See if we have a renaming reference
if Is_Object (XE.Ent)
and then Present (Renamed_Object (XE.Ent))
then
Rref := Renamed_Object (XE.Ent);
elsif Is_Overloadable (XE.Ent)
and then Nkind (Parent (Declaration_Node (XE.Ent))) =
N_Subprogram_Renaming_Declaration
then
Rref := Name (Parent (Declaration_Node (XE.Ent)));
elsif Ekind (XE.Ent) = E_Package
and then Nkind (Declaration_Node (XE.Ent)) =
N_Package_Renaming_Declaration
then
Rref := Name (Declaration_Node (XE.Ent));
else
Rref := Empty;
end if;
if Present (Rref) then
if Nkind (Rref) = N_Expanded_Name then
Rref := Selector_Name (Rref);
end if;
if Nkind (Rref) = N_Identifier
or else Nkind (Rref) = N_Operator_Symbol
then
null;
-- For renamed array components, use the array name
-- for the renamed entity, which reflect the fact that
-- in general the whole array is aliased.
elsif Nkind (Rref) = N_Indexed_Component then
if Nkind (Prefix (Rref)) = N_Identifier then
Rref := Prefix (Rref);
elsif Nkind (Prefix (Rref)) = N_Expanded_Name then
Rref := Selector_Name (Prefix (Rref));
else
Rref := Empty;
end if;
else
Rref := Empty;
end if;
end if;
-- Write out renaming reference if we have one
if Present (Rref) then
Write_Info_Char ('=');
Write_Info_Nat
(Int (Get_Logical_Line_Number (Sloc (Rref))));
Write_Info_Char (':');
Write_Info_Nat
(Int (Get_Column_Number (Sloc (Rref))));
end if;
-- Indicate that the entity is in the unit
-- of the current xref xection.
Curru := Curxu;
-- Write out information about generic parent,
-- if entity is an instance.
if Is_Generic_Instance (XE.Ent) then
declare
Gen_Par : constant Entity_Id :=
Generic_Parent
(Specification
(Unit_Declaration_Node (XE.Ent)));
Loc : constant Source_Ptr := Sloc (Gen_Par);
Gen_U : constant Unit_Number_Type :=
Get_Source_Unit (Loc);
begin
Write_Info_Char ('[');
if Curru /= Gen_U then
Write_Info_Nat (Dependency_Num (Gen_U));
Write_Info_Char ('|');
end if;
Write_Info_Nat
(Int (Get_Logical_Line_Number (Loc)));
Write_Info_Char (']');
end;
end if;
-- See if we have a type reference and if so output
Get_Type_Reference (XE.Ent, Tref, Left, Right);
if Present (Tref) then
-- Case of standard entity, output name
if Sloc (Tref) = Standard_Location then
Write_Info_Char (Left);
Write_Info_Name (Chars (Tref));
Write_Info_Char (Right);
-- Case of source entity, output location
else
Write_Info_Char (Left);
Trunit := Get_Source_Unit (Sloc (Tref));
if Trunit /= Curxu then
Write_Info_Nat (Dependency_Num (Trunit));
Write_Info_Char ('|');
end if;
Write_Info_Nat
(Int (Get_Logical_Line_Number (Sloc (Tref))));
declare
Ent : Entity_Id := Tref;
Kind : constant Entity_Kind := Ekind (Ent);
Ctyp : Character := Xref_Entity_Letters (Kind);
begin
if Ctyp = '+'
and then Present (Full_View (Ent))
then
Ent := Underlying_Type (Ent);
if Present (Ent) then
Ctyp := Xref_Entity_Letters (Ekind (Ent));
end if;
end if;
Write_Info_Char (Ctyp);
end;
Write_Info_Nat
(Int (Get_Column_Number (Sloc (Tref))));
-- If the type comes from an instantiation,
-- add the corresponding info.
Output_Instantiation_Refs (Sloc (Tref));
Write_Info_Char (Right);
end if;
end if;
-- If the entity is an overriding operation, write
-- info on operation that was overridden.
if Is_Subprogram (XE.Ent)
and then Is_Overriding_Operation (XE.Ent)
then
Output_Overridden_Op (Overridden_Operation (XE.Ent));
end if;
-- End of processing for entity output
Crloc := No_Location;
end if;
-- Output the reference
if XE.Loc /= No_Location
and then XE.Loc /= Crloc
then
Crloc := XE.Loc;
-- Start continuation if line full, else blank
if Write_Info_Col > 72 then
Write_Info_EOL;
Write_Info_Initiate ('.');
end if;
Write_Info_Char (' ');
-- Output file number if changed
if XE.Lun /= Curru then
Curru := XE.Lun;
Write_Info_Nat (Dependency_Num (Curru));
Write_Info_Char ('|');
end if;
Write_Info_Nat (Int (Get_Logical_Line_Number (XE.Loc)));
Write_Info_Char (XE.Typ);
if Is_Overloadable (XE.Ent)
and then Is_Imported (XE.Ent)
and then XE.Typ = 'b'
then
Output_Import_Export_Info (XE.Ent);
end if;
Write_Info_Nat (Int (Get_Column_Number (XE.Loc)));
Output_Instantiation_Refs (Sloc (XE.Ent));
end if;
end if;
end Output_One_Ref;
<<Continue>>
null;
end loop;
Write_Info_EOL;
end Output_Refs;
end Output_References;
end Lib.Xref;
|
with Ada.Unchecked_Conversion;
with C_String;
with Interfaces.C;
with System;
package body Agar.Core.DSO is
package C renames Interfaces.C;
use type C.int;
function Load
(Name : in String;
Path : in String) return DSO_Access_t
is
Ch_Name : aliased C.char_array := C.To_C (Name);
Ch_Path : aliased C.char_array := C.To_C (Path);
begin
return Thin.DSO.Load
(Name => C_String.To_C_String (Ch_Name'Unchecked_Access),
Path => C_String.To_C_String (Ch_Path'Unchecked_Access),
Flags => 0);
end Load;
function Unload (DSO : DSO_Not_Null_Access_t) return Boolean is
begin
return 1 = Thin.DSO.Unload (DSO);
end Unload;
function Lookup (Name : in String) return DSO_Access_t is
Ch_Name : aliased C.char_array := C.To_C (Name);
begin
return Thin.DSO.Lookup (C_String.To_C_String (Ch_Name'Unchecked_Access));
end Lookup;
function Generic_Symbol_Lookup
(DSO : in DSO_Not_Null_Access_t;
Name : in String) return Subprogram_Access_Type
is
Ch_Name : aliased C.char_array := C.To_C (Name);
Result : aliased System.Address;
-- XXX: Risky...
function Convert is new Ada.Unchecked_Conversion
(Source => System.Address,
Target => Subprogram_Access_Type);
begin
if 1 = Thin.DSO.Symbol
(DSO => DSO,
Name => C_String.To_C_String (Ch_Name'Unchecked_Access),
Value => Result'Unchecked_Access) then
return Convert (Result);
else
return Convert (System.Null_Address);
end if;
end Generic_Symbol_Lookup;
end Agar.Core.DSO;
|
--
-- Copyright (C) 2016 secunet Security Networks AG
--
-- 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.
--
private package HW.GFX.GMA.Power_And_Clocks_Ironlake is
procedure Initialize;
procedure Pre_All_Off is null;
procedure Post_All_Off is null;
procedure Power_Set_To (Configs : Pipe_Configs) is null;
procedure Power_Up (Old_Configs, New_Configs : Pipe_Configs) is null;
procedure Power_Down (Old_Configs, Tmp_Configs, New_Configs : Pipe_Configs)
is null;
end HW.GFX.GMA.Power_And_Clocks_Ironlake;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 3 0 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 30
package System.Pack_30 is
pragma Preelaborate;
Bits : constant := 30;
type Bits_30 is mod 2 ** Bits;
for Bits_30'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_30
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_30 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_30
(Arr : System.Address;
N : Natural;
E : Bits_30;
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.
function GetU_30
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_30 with Inline;
-- 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_30
(Arr : System.Address;
N : Natural;
E : Bits_30;
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. This version
-- is used when Arr may represent an unaligned address
end System.Pack_30;
|
-- Copyright 2015,2016,2017 Steven Stewart-Gallus
--
-- 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 Linted.Controls;
with Linted.Errors;
with Linted.KOs;
with Linted.Triggers;
package Linted.Controls_Reader is
pragma Elaborate_Body;
type Event is record
Data : Controls.Packet;
Err : Errors.Error := 0;
end record;
type Future is limited private with
Preelaborable_Initialization;
function Is_Live (F : Future) return Boolean;
procedure Read
(Object : KOs.KO;
Signaller : Triggers.Signaller;
F : out Future) with
Post => Is_Live (F);
procedure Read_Wait (F : in out Future; E : out Event) with
Pre => Is_Live (F),
Post => not Is_Live (F);
procedure Read_Poll
(F : in out Future;
E : out Event;
Init : out Boolean) with
Pre => Is_Live (F),
Post => (if Init then not Is_Live (F) else Is_Live (F));
private
Max_Nodes : constant := 2;
type Future is range 0 .. Max_Nodes + 1 with
Default_Value => 0;
end Linted.Controls_Reader;
|
-- Mojang Authentication API
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
-- ------------ EDIT NOTE ------------
-- This file was generated with openapi-generator. You can modify it to implement
-- the server. After you modify this file, you should add the following line
-- to the .openapi-generator-ignore file:
--
-- src/com-github-asyncmc-mojang-authentication-ada-server-model.ads
--
-- Then, you can drop this edit note comment.
-- ------------ EDIT NOTE ------------
package com.github is
end com.github;
|
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . O S _ I N T E R F A C E --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1998-2001, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 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. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the SGI Pthreads version of this package.
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
-- PLEASE DO NOT add any with-clauses to this package
-- or remove the pragma Elaborate_Body.
-- It is designed to be a bottom-level (leaf) package.
with Interfaces.C;
package System.OS_Interface is
pragma Preelaborate;
pragma Linker_Options ("-lpthread");
subtype int is Interfaces.C.int;
subtype short is Interfaces.C.short;
subtype long is Interfaces.C.long;
subtype unsigned is Interfaces.C.unsigned;
subtype unsigned_short is Interfaces.C.unsigned_short;
subtype unsigned_long is Interfaces.C.unsigned_long;
subtype unsigned_char is Interfaces.C.unsigned_char;
subtype plain_char is Interfaces.C.plain_char;
subtype size_t is Interfaces.C.size_t;
-----------
-- Errno --
-----------
function errno return int;
pragma Import (C, errno, "__get_errno");
EINTR : constant := 4; -- interrupted system call
EAGAIN : constant := 11; -- No more processes
ENOMEM : constant := 12; -- Not enough core
EINVAL : constant := 22; -- Invalid argument
ETIMEDOUT : constant := 145; -- Connection timed out
-------------
-- Signals --
-------------
Max_Interrupt : constant := 64;
type Signal is new int range 0 .. Max_Interrupt;
for Signal'Size use int'Size;
SIGHUP : constant := 1; -- hangup
SIGINT : constant := 2; -- interrupt (rubout)
SIGQUIT : constant := 3; -- quit (ASCD FS)
SIGILL : constant := 4; -- illegal instruction (not reset)
SIGTRAP : constant := 5; -- trace trap (not reset)
SIGIOT : constant := 6; -- IOT instruction
SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the
-- future
SIGEMT : constant := 7; -- EMT instruction
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 10; -- bus error
SIGSEGV : constant := 11; -- segmentation violation
SIGSYS : constant := 12; -- bad argument to system call
SIGPIPE : constant := 13; -- write on a pipe with no one to read it
SIGALRM : constant := 14; -- alarm clock
SIGTERM : constant := 15; -- software termination signal from kill
SIGUSR1 : constant := 16; -- user defined signal 1
SIGUSR2 : constant := 17; -- user defined signal 2
SIGCLD : constant := 18; -- alias for SIGCHLD
SIGCHLD : constant := 18; -- child status change
SIGPWR : constant := 19; -- power-fail restart
SIGWINCH : constant := 20; -- window size change
SIGURG : constant := 21; -- urgent condition on IO channel
SIGPOLL : constant := 22; -- pollable event occurred
SIGIO : constant := 22; -- I/O possible (Solaris SIGPOLL alias)
SIGSTOP : constant := 23; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 24; -- user stop requested from tty
SIGCONT : constant := 25; -- stopped process has been continued
SIGTTIN : constant := 26; -- background tty read attempted
SIGTTOU : constant := 27; -- background tty write attempted
SIGVTALRM : constant := 28; -- virtual timer expired
SIGPROF : constant := 29; -- profiling timer expired
SIGXCPU : constant := 30; -- CPU time limit exceeded
SIGXFSZ : constant := 31; -- filesize limit exceeded
SIGK32 : constant := 32; -- reserved for kernel (IRIX)
SIGCKPT : constant := 33; -- Checkpoint warning
SIGRESTART : constant := 34; -- Restart warning
SIGUME : constant := 35; -- Uncorrectable memory error
-- Signals defined for Posix 1003.1c.
SIGPTINTR : constant := 47;
SIGPTRESCHED : constant := 48;
-- Posix 1003.1b signals
SIGRTMIN : constant := 49; -- Posix 1003.1b signals
SIGRTMAX : constant := 64; -- Posix 1003.1b signals
type sigset_t is private;
type sigset_t_ptr is access all sigset_t;
function sigaddset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigaddset, "sigaddset");
function sigdelset (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigdelset, "sigdelset");
function sigfillset (set : access sigset_t) return int;
pragma Import (C, sigfillset, "sigfillset");
function sigismember (set : access sigset_t; sig : Signal) return int;
pragma Import (C, sigismember, "sigismember");
function sigemptyset (set : access sigset_t) return int;
pragma Import (C, sigemptyset, "sigemptyset");
type array_type_2 is array (Integer range 0 .. 1) of int;
type struct_sigaction is record
sa_flags : int;
sa_handler : System.Address;
sa_mask : sigset_t;
sa_resv : array_type_2;
end record;
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
SIG_DFL : constant := 0;
SIG_IGN : constant := 1;
function sigaction
(sig : Signal;
act : struct_sigaction_ptr;
oact : struct_sigaction_ptr := null) return int;
pragma Import (C, sigaction, "sigaction");
----------
-- Time --
----------
type timespec is private;
type timespec_ptr is access all timespec;
type clockid_t is private;
CLOCK_REALTIME : constant clockid_t;
CLOCK_SGI_FAST : constant clockid_t;
CLOCK_SGI_CYCLE : constant clockid_t;
SGI_CYCLECNTR_SIZE : constant := 165;
function syssgi (request : Interfaces.C.int) return Interfaces.C.ptrdiff_t;
pragma Import (C, syssgi, "syssgi");
function clock_gettime
(clock_id : clockid_t;
tp : access timespec) return int;
pragma Import (C, clock_gettime, "clock_gettime");
function clock_getres
(clock_id : clockid_t;
tp : access timespec) return int;
pragma Import (C, clock_getres, "clock_getres");
function To_Duration (TS : timespec) return Duration;
pragma Inline (To_Duration);
function To_Timespec (D : Duration) return timespec;
pragma Inline (To_Timespec);
type struct_timeval is private;
function To_Duration (TV : struct_timeval) return Duration;
pragma Inline (To_Duration);
function To_Timeval (D : Duration) return struct_timeval;
pragma Inline (To_Timeval);
-------------------------
-- Priority Scheduling --
-------------------------
SCHED_FIFO : constant := 1;
SCHED_RR : constant := 2;
SCHED_TS : constant := 3;
SCHED_OTHER : constant := 3;
SCHED_NP : constant := 4;
function sched_get_priority_min (Policy : int) return int;
pragma Import (C, sched_get_priority_min, "sched_get_priority_min");
function sched_get_priority_max (Policy : int) return int;
pragma Import (C, sched_get_priority_max, "sched_get_priority_max");
-------------
-- Process --
-------------
type pid_t is private;
function kill (pid : pid_t; sig : Signal) return int;
pragma Import (C, kill, "kill");
function getpid return pid_t;
pragma Import (C, getpid, "getpid");
-------------
-- Threads --
-------------
type Thread_Body is access
function (arg : System.Address) return System.Address;
type pthread_t is private;
subtype Thread_Id is pthread_t;
type pthread_mutex_t is limited private;
type pthread_cond_t is limited private;
type pthread_attr_t is limited private;
type pthread_mutexattr_t is limited private;
type pthread_condattr_t is limited private;
type pthread_key_t is private;
PTHREAD_CREATE_DETACHED : constant := 1;
---------------------------------------
-- Nonstandard Thread Initialization --
---------------------------------------
procedure pthread_init;
pragma Inline (pthread_init);
-- This is a dummy procedure to share some GNULLI files
-------------------------
-- POSIX.1c Section 3 --
-------------------------
function sigwait
(set : access sigset_t;
sig : access Signal) return int;
pragma Import (C, sigwait, "sigwait");
function pthread_kill
(thread : pthread_t;
sig : Signal) return int;
pragma Import (C, pthread_kill, "pthread_kill");
function pthread_sigmask
(how : int;
set : sigset_t_ptr;
oset : sigset_t_ptr) return int;
pragma Import (C, pthread_sigmask, "pthread_sigmask");
--------------------------
-- POSIX.1c Section 11 --
--------------------------
function pthread_mutexattr_init
(attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
function pthread_mutexattr_destroy
(attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
function pthread_mutex_init
(mutex : access pthread_mutex_t;
attr : access pthread_mutexattr_t) return int;
pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
function pthread_condattr_init
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
function pthread_condattr_destroy
(attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
function pthread_cond_init
(cond : access pthread_cond_t;
attr : access pthread_condattr_t) return int;
pragma Import (C, pthread_cond_init, "pthread_cond_init");
function pthread_cond_destroy (cond : access pthread_cond_t) return int;
pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
function pthread_cond_signal (cond : access pthread_cond_t) return int;
pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
function pthread_cond_wait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t) return int;
pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
function pthread_cond_timedwait
(cond : access pthread_cond_t;
mutex : access pthread_mutex_t;
abstime : access timespec) return int;
pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
--------------------------
-- POSIX.1c Section 13 --
--------------------------
PTHREAD_PRIO_NONE : constant := 0;
PTHREAD_PRIO_PROTECT : constant := 2;
PTHREAD_PRIO_INHERIT : constant := 1;
function pthread_mutexattr_setprotocol
(attr : access pthread_mutexattr_t;
protocol : int) return int;
pragma Import (C, pthread_mutexattr_setprotocol);
function pthread_mutexattr_setprioceiling
(attr : access pthread_mutexattr_t;
prioceiling : int) return int;
pragma Import (C, pthread_mutexattr_setprioceiling);
type struct_sched_param is record
sched_priority : int;
end record;
pragma Convention (C, struct_sched_param);
function pthread_setschedparam
(thread : pthread_t;
policy : int;
param : access struct_sched_param)
return int;
pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
function pthread_attr_setscope
(attr : access pthread_attr_t;
contentionscope : int) return int;
pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
function pthread_attr_setinheritsched
(attr : access pthread_attr_t;
inheritsched : int) return int;
pragma Import
(C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
function pthread_attr_setschedpolicy
(attr : access pthread_attr_t;
policy : int) return int;
pragma Import (C, pthread_attr_setschedpolicy);
function pthread_attr_setschedparam
(attr : access pthread_attr_t;
sched_param : access struct_sched_param)
return int;
pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
function sched_yield return int;
pragma Import (C, sched_yield, "sched_yield");
---------------------------
-- P1003.1c - Section 16 --
---------------------------
function pthread_attr_init (attributes : access pthread_attr_t) return int;
pragma Import (C, pthread_attr_init, "pthread_attr_init");
function pthread_attr_destroy
(attributes : access pthread_attr_t) return int;
pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
function pthread_attr_setdetachstate
(attr : access pthread_attr_t;
detachstate : int) return int;
pragma Import (C, pthread_attr_setdetachstate);
function pthread_attr_setstacksize
(attr : access pthread_attr_t;
stacksize : size_t) return int;
pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
function pthread_create
(thread : access pthread_t;
attributes : access pthread_attr_t;
start_routine : Thread_Body;
arg : System.Address) return int;
pragma Import (C, pthread_create, "pthread_create");
procedure pthread_exit (status : System.Address);
pragma Import (C, pthread_exit, "pthread_exit");
function pthread_self return pthread_t;
pragma Import (C, pthread_self, "pthread_self");
--------------------------
-- POSIX.1c Section 17 --
--------------------------
function pthread_setspecific
(key : pthread_key_t;
value : System.Address) return int;
pragma Import (C, pthread_setspecific, "pthread_setspecific");
function pthread_getspecific (key : pthread_key_t) return System.Address;
pragma Import (C, pthread_getspecific, "pthread_getspecific");
type destructor_pointer is access procedure (arg : System.Address);
function pthread_key_create
(key : access pthread_key_t;
destructor : destructor_pointer) return int;
pragma Import (C, pthread_key_create, "pthread_key_create");
---------------------------------------------------------------
-- Non portable SGI 6.5 additions to the pthread interface --
-- must be executed from within the context of a system --
-- scope task --
---------------------------------------------------------------
function pthread_setrunon_np (cpu : int) return int;
pragma Import (C, pthread_setrunon_np, "pthread_setrunon_np");
private
type array_type_1 is array (Integer range 0 .. 3) of unsigned;
type sigset_t is record
X_X_sigbits : array_type_1;
end record;
pragma Convention (C, sigset_t);
type pid_t is new long;
type time_t is new long;
type timespec is record
tv_sec : time_t;
tv_nsec : long;
end record;
pragma Convention (C, timespec);
type clockid_t is new int;
CLOCK_REALTIME : constant clockid_t := 1;
CLOCK_SGI_CYCLE : constant clockid_t := 2;
CLOCK_SGI_FAST : constant clockid_t := 3;
type struct_timeval is record
tv_sec : time_t;
tv_usec : time_t;
end record;
pragma Convention (C, struct_timeval);
type array_type_9 is array (Integer range 0 .. 4) of long;
type pthread_attr_t is record
X_X_D : array_type_9;
end record;
pragma Convention (C, pthread_attr_t);
type array_type_8 is array (Integer range 0 .. 1) of long;
type pthread_condattr_t is record
X_X_D : array_type_8;
end record;
pragma Convention (C, pthread_condattr_t);
type array_type_7 is array (Integer range 0 .. 1) of long;
type pthread_mutexattr_t is record
X_X_D : array_type_7;
end record;
pragma Convention (C, pthread_mutexattr_t);
type pthread_t is new unsigned;
type array_type_10 is array (Integer range 0 .. 7) of long;
type pthread_mutex_t is record
X_X_D : array_type_10;
end record;
pragma Convention (C, pthread_mutex_t);
type array_type_11 is array (Integer range 0 .. 7) of long;
type pthread_cond_t is record
X_X_D : array_type_11;
end record;
pragma Convention (C, pthread_cond_t);
type pthread_key_t is new int;
end System.OS_Interface;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . A D D R E S S _ I M A G E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2003 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. --
-- --
------------------------------------------------------------------------------
-- This is a GNAT specific addition which provides a useful debugging
-- procedure that gives an (implementation dependent) string which
-- identifies an address.
-- This unit may be used directly from an application program by providing
-- an appropriate WITH, and the interface can be expected to remain stable.
function System.Address_Image (A : Address) return String;
pragma Pure (System.Address_Image);
-- Returns string (hexadecimal digits with upper case letters) representing
-- the address (string is 8/16 bytes for 32/64-bit machines).
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Named_Elements;
with AMF.UML.Activities;
with AMF.UML.Activity_Edges.Collections;
with AMF.UML.Activity_Groups.Collections;
with AMF.UML.Activity_Nodes.Collections;
with AMF.UML.Activity_Partitions.Collections;
with AMF.UML.Classifiers.Collections;
with AMF.UML.Constraints.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Exception_Handlers.Collections;
with AMF.UML.Input_Pins.Collections;
with AMF.UML.Interruptible_Activity_Regions.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Output_Pins.Collections;
with AMF.UML.Packages.Collections;
with AMF.UML.Ports;
with AMF.UML.Redefinable_Elements.Collections;
with AMF.UML.Start_Object_Behavior_Actions;
with AMF.UML.String_Expressions;
with AMF.UML.Structured_Activity_Nodes;
with AMF.Visitors;
package AMF.Internals.UML_Start_Object_Behavior_Actions is
type UML_Start_Object_Behavior_Action_Proxy is
limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy
and AMF.UML.Start_Object_Behavior_Actions.UML_Start_Object_Behavior_Action with null record;
overriding function Get_Object
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Input_Pins.UML_Input_Pin_Access;
-- Getter of StartObjectBehaviorAction::object.
--
-- Holds the object which is either a behavior to be started or has a
-- classifier behavior to be started.
overriding procedure Set_Object
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : AMF.UML.Input_Pins.UML_Input_Pin_Access);
-- Setter of StartObjectBehaviorAction::object.
--
-- Holds the object which is either a behavior to be started or has a
-- classifier behavior to be started.
overriding function Get_Is_Synchronous
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return Boolean;
-- Getter of CallAction::isSynchronous.
--
-- If true, the call is synchronous and the caller waits for completion of
-- the invoked behavior. If false, the call is asynchronous and the caller
-- proceeds immediately and does not expect a return values.
overriding procedure Set_Is_Synchronous
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : Boolean);
-- Setter of CallAction::isSynchronous.
--
-- If true, the call is synchronous and the caller waits for completion of
-- the invoked behavior. If false, the call is asynchronous and the caller
-- proceeds immediately and does not expect a return values.
overriding function Get_Result
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin;
-- Getter of CallAction::result.
--
-- A list of output pins where the results of performing the invocation
-- are placed.
overriding function Get_Argument
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin;
-- Getter of InvocationAction::argument.
--
-- Specification of the ordered set of argument values that appears during
-- execution.
overriding function Get_On_Port
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Ports.UML_Port_Access;
-- Getter of InvocationAction::onPort.
--
-- A optional port of the receiver object on which the behavioral feature
-- is invoked.
overriding procedure Set_On_Port
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : AMF.UML.Ports.UML_Port_Access);
-- Setter of InvocationAction::onPort.
--
-- A optional port of the receiver object on which the behavioral feature
-- is invoked.
overriding function Get_Context
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access;
-- Getter of Action::context.
--
-- The classifier that owns the behavior of which this action is a part.
overriding function Get_Input
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin;
-- Getter of Action::input.
--
-- The ordered set of input pins connected to the Action. These are among
-- the total set of inputs.
overriding function Get_Is_Locally_Reentrant
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return Boolean;
-- Getter of Action::isLocallyReentrant.
--
-- If true, the action can begin a new, concurrent execution, even if
-- there is already another execution of the action ongoing. If false, the
-- action cannot begin a new execution until any previous execution has
-- completed.
overriding procedure Set_Is_Locally_Reentrant
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : Boolean);
-- Setter of Action::isLocallyReentrant.
--
-- If true, the action can begin a new, concurrent execution, even if
-- there is already another execution of the action ongoing. If false, the
-- action cannot begin a new execution until any previous execution has
-- completed.
overriding function Get_Local_Postcondition
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Action::localPostcondition.
--
-- Constraint that must be satisfied when executed is completed.
overriding function Get_Local_Precondition
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Action::localPrecondition.
--
-- Constraint that must be satisfied when execution is started.
overriding function Get_Output
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin;
-- Getter of Action::output.
--
-- The ordered set of output pins connected to the Action. The action
-- places its results onto pins in this set.
overriding function Get_Handler
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler;
-- Getter of ExecutableNode::handler.
--
-- A set of exception handlers that are examined if an uncaught exception
-- propagates to the outer level of the executable node.
overriding function Get_Activity
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Activities.UML_Activity_Access;
-- Getter of ActivityNode::activity.
--
-- Activity containing the node.
overriding procedure Set_Activity
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : AMF.UML.Activities.UML_Activity_Access);
-- Setter of ActivityNode::activity.
--
-- Activity containing the node.
overriding function Get_In_Group
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group;
-- Getter of ActivityNode::inGroup.
--
-- Groups containing the node.
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region;
-- Getter of ActivityNode::inInterruptibleRegion.
--
-- Interruptible regions containing the node.
overriding function Get_In_Partition
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition;
-- Getter of ActivityNode::inPartition.
--
-- Partitions containing the node.
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access;
-- Getter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access);
-- Setter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding function Get_Incoming
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::incoming.
--
-- Edges that have the node as target.
overriding function Get_Outgoing
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::outgoing.
--
-- Edges that have the node as source.
overriding function Get_Redefined_Node
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node;
-- Getter of ActivityNode::redefinedNode.
--
-- Inherited nodes replaced by this node in a specialization of the
-- activity.
overriding function Get_Is_Leaf
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return Boolean;
-- Getter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding procedure Set_Is_Leaf
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : Boolean);
-- Setter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding function Get_Redefined_Element
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
-- Getter of RedefinableElement::redefinedElement.
--
-- The redefinable element that is being redefined by this element.
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of RedefinableElement::redefinitionContext.
--
-- References the contexts that this element may be redefined from.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Start_Object_Behavior_Action_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Context
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access;
-- Operation Action::context.
--
-- Missing derivation for Action::/context : Classifier
overriding function Is_Consistent_With
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two RedefinableElements
-- in a context in which redefinition is possible, whether redefinition
-- would be logically consistent. By default, this is false; this
-- operation must be overridden for subclasses of RedefinableElement to
-- define the consistency conditions.
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isRedefinitionContextValid.
--
-- The query isRedefinitionContextValid() specifies whether the
-- redefinition contexts of this RedefinableElement are properly related
-- to the redefinition contexts of the specified RedefinableElement to
-- allow this element to redefine the other. By default at least one of
-- the redefinition contexts of this element must be a specialization of
-- at least one of the redefinition contexts of the specified element.
overriding function All_Owning_Packages
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding procedure Enter_Element
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Start_Object_Behavior_Action_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Start_Object_Behavior_Actions;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . B U B B L E _ S O R T _ G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-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. --
-- --
------------------------------------------------------------------------------
-- Bubblesort generic package using formal procedures
-- This package provides a generic bubble sort routine that can be used with
-- different types of data.
-- See also GNAT.Bubble_Sort, a version that works with subprogram access
-- parameters, allowing code sharing. The generic version is slightly more
-- efficient but does not allow code sharing and has an interface that is
-- more awkward to use.
-- There is also GNAT.Bubble_Sort_A, which is now considered obsolete, but
-- was an older version working with subprogram parameters. This version
-- is retained for backwards compatibility with old versions of GNAT.
generic
-- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the
-- index value zero is used for a temporary location used during the sort.
with procedure Move (From : Natural; To : Natural);
-- A procedure that moves the data item with index value From to the data
-- item with index value To (the old value in To being lost). An index
-- value of zero is used for moves from and to a single temporary location
-- used by the sort.
with function Lt (Op1, Op2 : Natural) return Boolean;
-- A function that compares two items and returns True if the item with
-- index Op1 is less than the item with Index Op2, and False if the Op2
-- item is greater than or equal to the Op1 item.
package GNAT.Bubble_Sort_G is
pragma Pure;
procedure Sort (N : Natural);
-- This procedures sorts items in the range from 1 to N into ascending
-- order making calls to Lt to do required comparisons, and Move to move
-- items around. Note that, as described above, both Move and Lt use a
-- single temporary location with index value zero. This sort is stable,
-- that is the order of equal elements in the input is preserved.
end GNAT.Bubble_Sort_G;
|
-- Suggestions for packages which might be useful:
with Ada.Real_Time; use Ada.Real_Time;
with Vectors_3D; use Vectors_3D;
with Swarm_Structures_Base; use Swarm_Structures_Base;
with Vehicle_Task_Type; use Vehicle_Task_Type;
-- Author : Wenjun Yang
-- u_id : u6251843
package Vehicle_Message_Type is
-- Replace this record definition by what your vehicles need to communicate.
type Inter_Vehicle_Messages is
record
-- Vehicle_ID in the message, for recognizing the source of message
ID : Positive;
-- The message sent time
Message_Send_Time : Time;
-- Record whether the drone finds the globe or not
Energy_Globe_Find : Boolean;
-- Record the position of energy globe
Energy_Globe_Pos : Vector_3D;
-- Record the current energy level of corresponding drone
My_Energy : Vehicle_Charges;
-- Message of all the live drones' vehicle_No
Exist_Neighbours_No : No_Set;
-- Message of all the dead drones' vehicle_No
Delete_Neighbours_No : No_Set;
end record;
end Vehicle_Message_Type;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . U T F _ E N C O D I N G --
-- --
-- B o d y --
-- --
-- Copyright (C) 2010, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package body Ada.Strings.UTF_Encoding is
use Interfaces;
--------------
-- Encoding --
--------------
function Encoding
(Item : UTF_String;
Default : Encoding_Scheme := UTF_8) return Encoding_Scheme
is
begin
if Item'Length >= 2 then
if Item (Item'First .. Item'First + 1) = BOM_16BE then
return UTF_16BE;
elsif Item (Item'First .. Item'First + 1) = BOM_16LE then
return UTF_16LE;
elsif Item'Length >= 3
and then Item (Item'First .. Item'First + 2) = BOM_8
then
return UTF_8;
end if;
end if;
return Default;
end Encoding;
-----------------
-- From_UTF_16 --
-----------------
function From_UTF_16
(Item : UTF_16_Wide_String;
Output_Scheme : UTF_XE_Encoding;
Output_BOM : Boolean := False) return UTF_String
is
BSpace : constant Natural := 2 * Boolean'Pos (Output_BOM);
Result : UTF_String (1 .. 2 * Item'Length + BSpace);
Len : Natural;
C : Unsigned_16;
Iptr : Natural;
begin
if Output_BOM then
Result (1 .. 2) :=
(if Output_Scheme = UTF_16BE then BOM_16BE else BOM_16LE);
Len := 2;
else
Len := 0;
end if;
-- Skip input BOM
Iptr := Item'First;
if Iptr <= Item'Last and then Item (Iptr) = BOM_16 (1) then
Iptr := Iptr + 1;
end if;
-- UTF-16BE case
if Output_Scheme = UTF_16BE then
while Iptr <= Item'Last loop
C := To_Unsigned_16 (Item (Iptr));
Result (Len + 1) := Character'Val (Shift_Right (C, 8));
Result (Len + 2) := Character'Val (C and 16#00_FF#);
Len := Len + 2;
Iptr := Iptr + 1;
end loop;
-- UTF-16LE case
else
while Iptr <= Item'Last loop
C := To_Unsigned_16 (Item (Iptr));
Result (Len + 1) := Character'Val (C and 16#00_FF#);
Result (Len + 2) := Character'Val (Shift_Right (C, 8));
Len := Len + 2;
Iptr := Iptr + 1;
end loop;
end if;
return Result (1 .. Len);
end From_UTF_16;
--------------------------
-- Raise_Encoding_Error --
--------------------------
procedure Raise_Encoding_Error (Index : Natural) is
Val : constant String := Index'Img;
begin
raise Encoding_Error with
"bad input at Item (" & Val (Val'First + 1 .. Val'Last) & ')';
end Raise_Encoding_Error;
---------------
-- To_UTF_16 --
---------------
function To_UTF_16
(Item : UTF_String;
Input_Scheme : UTF_XE_Encoding;
Output_BOM : Boolean := False) return UTF_16_Wide_String
is
Result : UTF_16_Wide_String (1 .. Item'Length / 2 + 1);
Len : Natural;
Iptr : Natural;
begin
if Item'Length mod 2 /= 0 then
raise Encoding_Error with "UTF-16BE/LE string has odd length";
end if;
-- Deal with input BOM, skip if OK, error if bad BOM
Iptr := Item'First;
if Item'Length >= 2 then
if Item (Iptr .. Iptr + 1) = BOM_16BE then
if Input_Scheme = UTF_16BE then
Iptr := Iptr + 2;
else
Raise_Encoding_Error (Iptr);
end if;
elsif Item (Iptr .. Iptr + 1) = BOM_16LE then
if Input_Scheme = UTF_16LE then
Iptr := Iptr + 2;
else
Raise_Encoding_Error (Iptr);
end if;
elsif Item'Length >= 3 and then Item (Iptr .. Iptr + 2) = BOM_8 then
Raise_Encoding_Error (Iptr);
end if;
end if;
-- Output BOM if specified
if Output_BOM then
Result (1) := BOM_16 (1);
Len := 1;
else
Len := 0;
end if;
-- UTF-16BE case
if Input_Scheme = UTF_16BE then
while Iptr < Item'Last loop
Len := Len + 1;
Result (Len) :=
Wide_Character'Val
(Character'Pos (Item (Iptr)) * 256 +
Character'Pos (Item (Iptr + 1)));
Iptr := Iptr + 2;
end loop;
-- UTF-16LE case
else
while Iptr < Item'Last loop
Len := Len + 1;
Result (Len) :=
Wide_Character'Val
(Character'Pos (Item (Iptr)) +
Character'Pos (Item (Iptr + 1)) * 256);
Iptr := Iptr + 2;
end loop;
end if;
return Result (1 .. Len);
end To_UTF_16;
end Ada.Strings.UTF_Encoding;
|
with Metric.Kasner; use Metric.Kasner;
with ADMBase.Coords; use ADMBase.Coords;
package body ADMBase.Initial is
procedure create_data is
t, x, y, z : Real;
begin
t := beg_time;
for i in 1..num_x loop
for j in 1..num_y loop
for k in 1..num_z loop
x := x_coord (i);
y := y_coord (j);
z := z_coord (k);
N (i,j,k) := set_3d_lapse (t,x,y,z);
gab (i,j,k) := set_3d_metric (t,x,y,z);
Kab (i,j,k) := set_3d_extcurv (t,x,y,z);
end loop;
end loop;
end loop;
end create_data;
procedure create_grid is
a, b, c : Integer := 0;
p, q, r, s, u, v : Integer := 0;
x, y, z : Real;
begin
for i in 1..num_x loop
for j in 1..num_y loop
for k in 1..num_z loop
x := x_coord (i);
y := y_coord (j);
z := z_coord (k);
a := a + 1;
grid_point_list (a) := (i,j,k,x,y,z);
if (i>1) and (i<num_x) and
(j>1) and (j<num_y) and
(k>1) and (k<num_z)
then
b := b+1;
interior (b) := a;
else
c := c+1;
boundary (c) := a;
if k = num_z then
p := p + 1;
north_bndry (p) := a;
else
if k = 1 then
q := q + 1;
south_bndry (q) := a;
else
if j = num_y then
r := r + 1;
east_bndry (r) := a;
else
if j = 1 then
s := s + 1;
west_bndry (s) := a;
else
if i = num_x then
u := u + 1;
front_bndry (u) := a;
else
if i = 1 then
v := v + 1;
back_bndry (v) := a;
end if;
end if;
end if;
end if;
end if;
end if;
end if;
end loop;
end loop;
end loop;
interior_num := b;
boundary_num := c;
north_bndry_num := p;
south_bndry_num := q;
east_bndry_num := r;
west_bndry_num := s;
front_bndry_num := u;
back_bndry_num := v;
if boundary_num /= (north_bndry_num + south_bndry_num + east_bndry_num + west_bndry_num + front_bndry_num + back_bndry_num) then
put_line ("> Error in create_grid: boundary not equal sum of parts");
halt (1);
end if;
if grid_point_num /= interior_num + boundary_num then
put_line ("> Error in create_grid: boundary + interior not equal to whole");
halt (1);
end if;
if a /= grid_point_num then
put_line ("> Error in create_grid: incorrect number of grid points");
halt (1);
end if;
end create_grid;
end ADMBase.Initial;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T A G S --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System;
with System.Storage_Elements;
package Ada.Tags is
pragma Elaborate_Body;
type Tag is private;
function Expanded_Name (T : Tag) return String;
function External_Tag (T : Tag) return String;
function Internal_Tag (External : String) return Tag;
Tag_Error : exception;
private
----------------------------------------------------------------
-- Abstract procedural interface for the GNAT dispatch table --
----------------------------------------------------------------
-- GNAT's Dispatch Table format is customizable in order to match the
-- format used in another language. GNAT supports programs that use
-- two different dispatch table format at the same time: the native
-- format that supports Ada 95 tagged types and which is described in
-- Ada.Tags and a foreign format for types that are imported from some
-- other language (typically C++) which is described in interfaces.cpp.
-- The runtime information kept for each tagged type is separated into
-- two objects: the Dispatch Table and the Type Specific Data record.
-- These two objects are allocated statically using the constants:
-- DT Size = DT_Prologue_Size + Nb_Prim * DT_Entry_Size
-- TSD Size = TSD_Prologue_Size + (1 + Idepth) * TSD_Entry_Size
-- where Nb_prim is the number of primitive operations of the given
-- type and Idepth its inheritance depth.
-- The compiler generates calls to the following SET routines to
-- initialize those structures and uses the GET functions to
-- retreive the information when needed
package S renames System;
package SSE renames System.Storage_Elements;
function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean;
-- Given the tag of an object and the tag associated to a type, return
-- true if Obj is in Typ'Class.
function Get_Expanded_Name (T : Tag) return S.Address;
-- Retrieve the address of a null terminated string containing
-- the expanded name
function Get_External_Tag (T : Tag) return S.Address;
-- Retrieve the address of a null terminated string containing
-- the external name
function Get_Prim_Op_Address
(T : Tag;
Position : Positive)
return S.Address;
-- Given a pointer to a dispatch Table (T) and a position in the DT
-- this function returns the address of the virtual function stored
-- in it (used for dispatching calls)
function Get_Inheritance_Depth (T : Tag) return Natural;
-- Given a pointer to a dispatch Table, retrieves the value representing
-- the depth in the inheritance tree (used for membership).
function Get_RC_Offset (T : Tag) return SSE.Storage_Offset;
-- Return the Offset of the implicit record controller when the object
-- has controlled components. O otherwise.
pragma Export (Ada, Get_RC_Offset, "ada__tags__get_rc_offset");
-- This procedure is used in s-finimp to compute the deep routines
-- it is exported manually in order to avoid changing completely the
-- organization of the run time.
function Get_Remotely_Callable (T : Tag) return Boolean;
-- Return the value previously set by Set_Remotely_Callable
function Get_TSD (T : Tag) return S.Address;
-- Given a pointer T to a dispatch Table, retreives the address of the
-- record containing the Type Specific Data generated by GNAT
procedure Inherit_DT
(Old_T : Tag;
New_T : Tag;
Entry_Count : Natural);
-- Entry point used to initialize the DT of a type knowing the tag
-- of the direct ancestor and the number of primitive ops that are
-- inherited (Entry_Count).
procedure Inherit_TSD (Old_TSD : S.Address; New_Tag : Tag);
-- Entry point used to initialize the TSD of a type knowing the
-- TSD of the direct ancestor.
function Parent_Size (Obj : S.Address) return SSE.Storage_Count;
-- Computes the size of field _Parent of a tagged extension object
-- whose address is 'obj' by calling the indirectly _size function of
-- the parent. This function assumes that _size is always in slot 1 of
-- the dispatch table.
pragma Export (Ada, Parent_Size, "ada__tags__parent_size");
-- This procedure is used in s-finimp and is thus exported manually
procedure Register_Tag (T : Tag);
-- Insert the Tag and its associated external_tag in a table for the
-- sake of Internal_Tag
procedure Set_Inheritance_Depth
(T : Tag;
Value : Natural);
-- Given a pointer to a dispatch Table, stores the value representing
-- the depth in the inheritance tree (the second parameter). Used during
-- elaboration of the tagged type.
procedure Set_Prim_Op_Address
(T : Tag;
Position : Positive;
Value : S.Address);
-- Given a pointer to a dispatch Table (T) and a position in the
-- dispatch Table put the address of the virtual function in it
-- (used for overriding)
procedure Set_TSD (T : Tag; Value : S.Address);
-- Given a pointer T to a dispatch Table, stores the address of the record
-- containing the Type Specific Data generated by GNAT
procedure Set_Expanded_Name (T : Tag; Value : S.Address);
-- Set the address of the string containing the expanded name
-- in the Dispatch table
procedure Set_External_Tag (T : Tag; Value : S.Address);
-- Set the address of the string containing the external tag
-- in the Dispatch table
procedure Set_RC_Offset (T : Tag; Value : SSE.Storage_Offset);
-- Sets the Offset of the implicit record controller when the object
-- has controlled components. Set to O otherwise.
procedure Set_Remotely_Callable (T : Tag; Value : Boolean);
-- Set to true if the type has been declared in a context described
-- in E.4 (18)
DT_Prologue_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(Standard'Address_Size / S.Storage_Unit);
-- Size of the first part of the dispatch table
DT_Entry_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(Standard'Address_Size / S.Storage_Unit);
-- Size of each primitive operation entry in the Dispatch Table.
TSD_Prologue_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(6 * Standard'Address_Size / S.Storage_Unit);
-- Size of the first part of the type specific data
TSD_Entry_Size : constant SSE.Storage_Count :=
SSE.Storage_Count (Standard'Address_Size / S.Storage_Unit);
-- Size of each ancestor tag entry in the TSD
type Address_Array is array (Natural range <>) of S.Address;
type Dispatch_Table;
type Tag is access all Dispatch_Table;
type Type_Specific_Data;
type Type_Specific_Data_Ptr is access all Type_Specific_Data;
pragma Inline_Always (CW_Membership);
pragma Inline_Always (Get_Expanded_Name);
pragma Inline_Always (Get_Inheritance_Depth);
pragma Inline_Always (Get_Prim_Op_Address);
pragma Inline_Always (Get_RC_Offset);
pragma Inline_Always (Get_Remotely_Callable);
pragma Inline_Always (Get_TSD);
pragma Inline_Always (Inherit_DT);
pragma Inline_Always (Inherit_TSD);
pragma Inline_Always (Register_Tag);
pragma Inline_Always (Set_Expanded_Name);
pragma Inline_Always (Set_External_Tag);
pragma Inline_Always (Set_Inheritance_Depth);
pragma Inline_Always (Set_Prim_Op_Address);
pragma Inline_Always (Set_RC_Offset);
pragma Inline_Always (Set_Remotely_Callable);
pragma Inline_Always (Set_TSD);
end Ada.Tags;
|
package Debug2_Pkg is
type String_Ptr is access all String;
function To_Heap return String_Ptr;
type String_List(Chars_Length: Positive) is private;
type String_List_Ptr is access constant String_List;
function Singleton return String_List;
private
type String_List(Chars_Length: Positive) is record
Chars: String(1..Chars_Length);
end record;
end Debug2_Pkg;
|
-----------------------------------------------------------------------
-- mat-readers-tests -- Unit tests for MAT readers
-- Copyright (C) 2014, 2015, 2019, 2021 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with MAT.Readers.Streams.Files;
package body MAT.Targets.Tests is
package Caller is new Util.Test_Caller (Test, "Files");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test MAT.Targets.Read_File",
Test_Read_File'Access);
Caller.Add_Test (Suite, "Test MAT.Types.Tick_Value",
Test_Conversions'Access);
end Add_Tests;
-- ------------------------------
-- Test reading a file into a string
-- Reads this ada source file and checks we have read it correctly
-- ------------------------------
procedure Test_Read_File (T : in out Test) is
pragma Unreferenced (T);
Path : constant String := Util.Tests.Get_Path ("regtests/files/file-v1.dat");
Target : MAT.Targets.Target_Type;
Reader : MAT.Readers.Streams.Files.File_Reader_Type;
begin
Target.Initialize (Reader);
Reader.Open (Path);
Reader.Read_All;
end Test_Read_File;
-- ------------------------------
-- Test various type conversions.
-- ------------------------------
procedure Test_Conversions (T : in out Test) is
use MAT.Types;
Time : MAT.Types.Target_Tick_Ref;
begin
Time := MAT.Types.Tick_Value ("1.1");
Util.Tests.Assert_Equals (T, 1, Natural (Time / 1_000000), "Invalid Tick_Value conversion");
Util.Tests.Assert_Equals (T, 100_000, Natural (Time mod 1_000000),
"Invalid Tick_Value conversion");
Time := MAT.Types.Tick_Value ("12.001234");
Util.Tests.Assert_Equals (T, 12, Natural (Time / 1_000000), "Invalid Tick_Value conversion");
Util.Tests.Assert_Equals (T, 1_234, Natural (Time mod 1_000000),
"Invalid Tick_Value conversion");
end Test_Conversions;
end MAT.Targets.Tests;
|
-----------------------------------------------------------------------
-- are-generator-c-tests -- Tests for C generator
-- Copyright (C) 2021 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Directories;
with Util.Test_Caller;
package body Are.Generator.C.Tests is
Expect_Dir : constant String := "regtests/expect/c/";
function Tool return String;
package Caller is new Util.Test_Caller (Test, "Are.Generator.C");
function Tool return String is
begin
return "bin/are" & Are.Testsuite.EXE;
end Tool;
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Are.Generate_C1",
Test_Generate_C1'Access);
Caller.Add_Test (Suite, "Test Are.Generate_C2",
Test_Generate_C2'Access);
Caller.Add_Test (Suite, "Test Are.Generate_Lines",
Test_Generate_Lines'Access);
end Add_Tests;
procedure Test_Generate_C1 (T : in out Test) is
Dir : constant String := Util.Tests.Get_Test_Path ("");
Web : constant String := "regtests/files/test-c-1/web";
Result : Ada.Strings.Unbounded.Unbounded_String;
begin
-- Generate the resources.ad[bs] files
T.Execute (Tool & " --lang=c -o " & Dir & " --name-access "
& "--resource=Resources1 --fileset '**/*' "
& Web, Result);
T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources1.h")),
"Resource file 'resources1.h' not generated");
T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources1.c")),
"Resource file 'resources1.c' not generated");
-- Build the test program.
T.Execute ("make -C regtests/files/test-c-1", Result);
T.Assert (Ada.Directories.Exists ("bin/test-c-1" & Are.Testsuite.EXE),
"Binary file 'bin/test-c-1' not created");
T.Execute ("bin/test-c-1" & Are.Testsuite.EXE, Result);
Util.Tests.Assert_Matches (T, "PASS: body { background: #eee; }p"
& " { color: #2a2a2a; }", Result,
"Invalid generation");
end Test_Generate_C1;
procedure Test_Generate_C2 (T : in out Test) is
Dir : constant String := Util.Tests.Get_Test_Path ("");
Web : constant String := "regtests/files/test-c-2/web";
Result : Ada.Strings.Unbounded.Unbounded_String;
begin
-- Generate the resources.ad[bs] files
T.Execute (Tool & " --lang=c -o " & Dir
& " --name-access --var-prefix Id_ --resource=Resources2 --fileset '**/*' "
& Web, Result);
T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources2.h")),
"Resource file 'resources2.h' not generated");
T.Assert (Ada.Directories.Exists (Ada.Directories.Compose (Dir, "resources2.c")),
"Resource file 'resources2.c' not generated");
-- Build the test program.
T.Execute ("make -C regtests/files/test-c-2", Result);
T.Assert (Ada.Directories.Exists ("bin/test-c-2" & Are.Testsuite.EXE),
"Binary file 'bin/test-c-2' not created");
T.Execute ("bin/test-c-2" & Are.Testsuite.EXE, Result);
Util.Tests.Assert_Matches (T, "PASS: body { background: #eee; }p"
& " { color: #2a2a2a; }", Result,
"Invalid generation");
end Test_Generate_C2;
procedure Test_Generate_Lines (T : in out Test) is
Dir : constant String := Util.Tests.Get_Test_Path ("");
Rule : constant String := "regtests/files/package-lines.xml";
Files : constant String := "regtests/files";
Lines_H : constant String := Ada.Directories.Compose (Dir, "lines.h");
Lines_C : constant String := Ada.Directories.Compose (Dir, "lines.c");
Result : Ada.Strings.Unbounded.Unbounded_String;
begin
-- Generate the lines.ads files
T.Execute (Tool & " -o " & Dir & " --lang=c --content-only --var-prefix Id_ --rule="
& Rule & " " & Files & "/lines-empty", Result);
T.Assert (Ada.Directories.Exists (Lines_H),
"Resource file 'lines.h' not generated");
Util.Tests.Assert_Equal_Files
(T => T,
Expect => Util.Tests.Get_Path (Expect_Dir & "lines-empty.h"),
Test => Lines_H,
Message => "Invalid lines-empty.h generation");
T.Assert (Ada.Directories.Exists (Lines_C),
"Resource file 'lines.c' not generated");
Util.Tests.Assert_Equal_Files
(T => T,
Expect => Util.Tests.Get_Path (Expect_Dir & "lines-empty.c"),
Test => Lines_C,
Message => "Invalid lines-empty.c generation");
Ada.Directories.Delete_File (Lines_H);
Ada.Directories.Delete_File (Lines_C);
T.Execute (Tool & " -o " & Dir & " --lang=c --content-only --var-prefix Id_ --rule="
& Rule & " " & Files & "/lines-single", Result);
T.Assert (Ada.Directories.Exists (Lines_H),
"Resource file 'lines.h' not generated");
Util.Tests.Assert_Equal_Files
(T => T,
Expect => Util.Tests.Get_Path (Expect_Dir & "lines-single.h"),
Test => Lines_H,
Message => "Invalid lines-single.h generation");
T.Assert (Ada.Directories.Exists (Lines_C),
"Resource file 'lines.c' not generated");
Util.Tests.Assert_Equal_Files
(T => T,
Expect => Util.Tests.Get_Path (Expect_Dir & "lines-single.c"),
Test => Lines_C,
Message => "Invalid lines-single.c generation");
Ada.Directories.Delete_File (Lines_H);
Ada.Directories.Delete_File (Lines_C);
T.Execute (Tool & " -o " & Dir & " --lang=c --content-only --var-prefix Id_ --rule="
& Rule & " " & Files & "/lines-multiple", Result);
T.Assert (Ada.Directories.Exists (Lines_H),
"Resource file 'lines.h' not generated");
Util.Tests.Assert_Equal_Files
(T => T,
Expect => Util.Tests.Get_Path (Expect_Dir & "lines-multiple.h"),
Test => Lines_H,
Message => "Invalid lines-multiple.h generation");
T.Assert (Ada.Directories.Exists (Lines_C),
"Resource file 'lines.c' not generated");
Util.Tests.Assert_Equal_Files
(T => T,
Expect => Util.Tests.Get_Path (Expect_Dir & "lines-multiple.c"),
Test => Lines_C,
Message => "Invalid lines-multiple.c generation");
end Test_Generate_Lines;
end Are.Generator.C.Tests;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- G N A T . H E A P _ S O R T _ G --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1995-2000 Ada Core Technologies, 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 is maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- Heapsort generic package using formal procedures
-- This package provides a generic heapsort routine that can be used with
-- different types of data. See also GNAT.Heap_Sort_A, a version that works
-- with subprogram parameters, allowing code sharing. The generic version
-- is slightly more efficient but does not allow code sharing. The generic
-- version is also Pure, while the access version can only be Preelaborate.
generic
-- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the
-- index value zero is used for a temporary location used during the sort.
with procedure Move (From : Natural; To : Natural);
-- A procedure that moves the data item with index From to the data item
-- with Index To. An index value of zero is used for moves from and to a
-- single temporary location used by the sort.
with function Lt (Op1, Op2 : Natural) return Boolean;
-- A function that compares two items and returns True if the item with
-- index Op1 is less than the item with Index Op2, and False if the Op1
-- item is greater than or equal to the Op2 item.
package GNAT.Heap_Sort_G is
pragma Pure (Heap_Sort_G);
procedure Sort (N : Natural);
-- This procedures sorts items in the range from 1 to N into ascending
-- order making calls to Lt to do required comparisons, and Move to move
-- items around. Note that, as described above, both Move and Lt use a
-- single temporary location with index value zero. This sort is not
-- stable, i.e. the order of equal elements in the input is not preserved.
end GNAT.Heap_Sort_G;
|
pragma License (Unrestricted);
-- generalized unit of Ada.Strings.UTF_Encoding.Strings
generic
type Character_Type is (<>);
type String_Type is array (Positive range <>) of Character_Type;
Expanding_From_8 : Positive;
Expanding_From_16 : Positive;
Expanding_From_32 : Positive;
Expanding_To_8 : Positive;
Expanding_To_16 : Positive;
Expanding_To_32 : Positive;
with procedure Get (
Item : String_Type;
Last : out Natural;
Value : out Wide_Wide_Character;
Is_Illegal_Sequence : out Boolean);
with procedure Put (
Value : Wide_Wide_Character;
Item : out String_Type;
Last : out Natural);
package Ada.Strings.UTF_Encoding.Generic_Strings is
pragma Pure;
-- Encoding / decoding between String_Type and various encoding schemes
function Encode (
Item : String_Type;
Output_Scheme : Encoding_Scheme;
Output_BOM : Boolean := False)
return UTF_String;
function Encode (Item : String_Type; Output_BOM : Boolean := False)
return UTF_8_String;
function Encode (Item : String_Type; Output_BOM : Boolean := False)
return UTF_16_Wide_String;
-- extended
function Encode (Item : String_Type; Output_BOM : Boolean := False)
return UTF_32_Wide_Wide_String;
function Decode (Item : UTF_String; Input_Scheme : Encoding_Scheme)
return String_Type;
function Decode (Item : UTF_8_String) return String_Type;
function Decode (Item : UTF_16_Wide_String) return String_Type;
-- extended
function Decode (Item : UTF_32_Wide_Wide_String) return String_Type;
end Ada.Strings.UTF_Encoding.Generic_Strings;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- I N T E R F A C E S . V X W O R K S . I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-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 package provides a binding to the functions fileno and ioctl
-- in VxWorks, providing a set of definitions of ioctl function codes
-- and options for the use of these functions.
-- A particular use of this interface is to enable use of Get_Immediate
-- in Ada.Text_IO. There is no way in VxWorks to provide the desired
-- functionality of Get_Immediate (no buffering and no waiting for a
-- line return) without flushing the buffer, which violates the Ada
-- semantic requirements for Ada.Text_IO.
with Interfaces.C_Streams;
package Interfaces.VxWorks.IO is
-------------------------
-- The ioctl Interface --
--------------------------
type FUNCODE is new int;
-- Type of the function codes in ioctl
type IOOPT is mod 2 ** int'Size;
-- Type of the option codes in ioctl
-- ioctl function codes (for more information see ioLib.h)
-- These values could be generated automatically in System.OS_Constants???
FIONREAD : constant FUNCODE := 1;
FIOFLUSH : constant FUNCODE := 2;
FIOOPTIONS : constant FUNCODE := 3;
FIOBAUDRATE : constant FUNCODE := 4;
FIODISKFORMAT : constant FUNCODE := 5;
FIODISKINIT : constant FUNCODE := 6;
FIOSEEK : constant FUNCODE := 7;
FIOWHERE : constant FUNCODE := 8;
FIODIRENTRY : constant FUNCODE := 9;
FIORENAME : constant FUNCODE := 10;
FIOREADYCHANGE : constant FUNCODE := 11;
FIONWRITE : constant FUNCODE := 12;
FIODISKCHANGE : constant FUNCODE := 13;
FIOCANCEL : constant FUNCODE := 14;
FIOSQUEEZE : constant FUNCODE := 15;
FIONBIO : constant FUNCODE := 16;
FIONMSGS : constant FUNCODE := 17;
FIOGETNAME : constant FUNCODE := 18;
FIOGETOPTIONS : constant FUNCODE := 19;
FIOSETOPTIONS : constant FUNCODE := FIOOPTIONS;
FIOISATTY : constant FUNCODE := 20;
FIOSYNC : constant FUNCODE := 21;
FIOPROTOHOOK : constant FUNCODE := 22;
FIOPROTOARG : constant FUNCODE := 23;
FIORBUFSET : constant FUNCODE := 24;
FIOWBUFSET : constant FUNCODE := 25;
FIORFLUSH : constant FUNCODE := 26;
FIOWFLUSH : constant FUNCODE := 27;
FIOSELECT : constant FUNCODE := 28;
FIOUNSELECT : constant FUNCODE := 29;
FIONFREE : constant FUNCODE := 30;
FIOMKDIR : constant FUNCODE := 31;
FIORMDIR : constant FUNCODE := 32;
FIOLABELGET : constant FUNCODE := 33;
FIOLABELSET : constant FUNCODE := 34;
FIOATTRIBSE : constant FUNCODE := 35;
FIOCONTIG : constant FUNCODE := 36;
FIOREADDIR : constant FUNCODE := 37;
FIOFSTATGET : constant FUNCODE := 38;
FIOUNMOUNT : constant FUNCODE := 39;
FIOSCSICOMMAND : constant FUNCODE := 40;
FIONCONTIG : constant FUNCODE := 41;
FIOTRUNC : constant FUNCODE := 42;
FIOGETFL : constant FUNCODE := 43;
FIOTIMESET : constant FUNCODE := 44;
FIOINODETONAM : constant FUNCODE := 45;
FIOFSTATFSGE : constant FUNCODE := 46;
-- ioctl option values
OPT_ECHO : constant IOOPT := 16#0001#;
OPT_CRMOD : constant IOOPT := 16#0002#;
OPT_TANDEM : constant IOOPT := 16#0004#;
OPT_7_BIT : constant IOOPT := 16#0008#;
OPT_MON_TRAP : constant IOOPT := 16#0010#;
OPT_ABORT : constant IOOPT := 16#0020#;
OPT_LINE : constant IOOPT := 16#0040#;
OPT_RAW : constant IOOPT := 16#0000#;
OPT_TERMINAL : constant IOOPT := OPT_ECHO or
OPT_CRMOD or
OPT_TANDEM or
OPT_MON_TRAP or
OPT_7_BIT or
OPT_ABORT or
OPT_LINE;
function fileno (Fp : Interfaces.C_Streams.FILEs) return int;
pragma Import (C, fileno, "fileno");
-- Binding to the C routine fileno
function ioctl (Fd : int; Function_Code : FUNCODE; Arg : IOOPT) return int;
pragma Import (C, ioctl, "ioctl");
-- Binding to the C routine ioctl
--
-- Note: we are taking advantage of the fact that on currently supported
-- VxWorks targets, it is fine to directly bind to a variadic C function.
------------------------------
-- Control of Get_Immediate --
------------------------------
-- The procedures in this section make use of the interface to ioctl
-- and fileno to provide a mechanism for enabling unbuffered behavior
-- for Get_Immediate in VxWorks.
-- The situation is that the RM requires that the use of Get_Immediate
-- be identical to Get except that it is desirable (not required) that
-- there be no buffering or line editing.
-- Unfortunately, in VxWorks, the only way to enable this desired
-- unbuffered behavior involves changing into raw mode. But this
-- transition into raw mode flushes the input buffer, a behavior
-- not permitted by the RM semantics for Get_Immediate.
-- Given that Get_Immediate cannot be accurately implemented in
-- raw mode, it seems best not to enable it by default, and instead
-- to require specific programmer action, with the programmer being
-- aware that input may be lost.
-- The following is an example of the use of the two procedures
-- in this section (Enable_Get_Immediate and Disable_Get_Immediate)
-- with Ada.Text_IO; use Ada.Text_IO;
-- with Ada.Text_IO.C_Streams; use Ada.Text_IO.C_Streams;
-- with Interfaces.VxWorks.IO; use Interfaces.VxWorks.IO;
-- procedure Example_IO is
-- Input : Character;
-- Available : Boolean;
-- Success : Boolean;
-- begin
-- Enable_Get_Immediate (C_Stream (Current_Input), Success);
-- if Success = False then
-- raise Device_Error;
-- end if;
-- -- Example with the first type of Get_Immediate
-- -- Waits for an entry on the input. Immediately returns
-- -- after having received an character on the input
-- Put ("Input -> ");
-- Get_Immediate (Input);
-- New_Line;
-- Put_Line ("Character read: " & Input);
-- -- Example with the second type of Get_Immediate
-- -- This is equivalent to a non blocking read
-- for J in 1 .. 10 loop
-- Put ("Input -> ");
-- Get_Immediate (Input, Available);
-- New_Line;
-- if Available = True then
-- Put_Line ("Character read: " & Input);
-- end if;
-- delay 1.0;
-- end loop;
-- Disable_Get_Immediate (C_Stream (Current_Input), Success);
-- if Success = False then
-- raise Device_Error;
-- end if;
-- exception
-- when Device_Error =>
-- Put_Line ("Device Error. Check your configuration");
-- end Example_IO;
procedure Enable_Get_Immediate
(File : Interfaces.C_Streams.FILEs;
Success : out Boolean);
-- On VxWorks, a call to this procedure is required before subsequent calls
-- to Get_Immediate have the desired effect of not waiting for a line
-- return. The reason that this call is not automatic on this target is
-- that the call flushes the input buffer, discarding any previous input.
-- Note: Following a call to Enable_Get_Immediate, the only permitted
-- operations on the relevant file are Get_Immediate operations. Any
-- other operations have undefined behavior.
procedure Disable_Get_Immediate
(File : Interfaces.C_Streams.FILEs;
Success : out Boolean);
-- This procedure resets File to standard mode, and permits subsequent
-- use of the full range of Ada.Text_IO functions
end Interfaces.VxWorks.IO;
|
M:part4a
F:G$putchar$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$getchar$0$0({2}DF,SC:S),Z,0,0,0,0,0
F:G$main$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$SYSCLK_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$PORT_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$UART0_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$ADC_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$DAC_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$INTERRUPT_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$TIMER_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
F:G$MAC_INIT$0$0({2}DF,SV:S),Z,0,0,0,0,0
S:G$start_conversion$0$0({1}SC:S),E,0,0
S:G$dig_val$0$0({2}SI:U),E,0,0
S:Lpart4a.main$adcValH$1$29({5}DA5d,SC:U),E,0,0
S:Lpart4a.main$adcValL$1$29({5}DA5d,SC:U),E,0,0
S:Lpart4a.main$result$1$29({2}SI:U),R,0,0,[r6,r7]
S:Lpart4a.main$results$1$29({4}DA2d,SI:U),E,0,0
S:Lpart4a.main$analogval$1$29({2}SI:U),R,0,0,[]
S:Lpart4a.main$analoghi$1$29({1}SC:U),R,0,0,[r4]
S:Lpart4a.main$analoglow$1$29({1}SC:U),R,0,0,[r5]
S:Lpart4a.main$VREF$1$29({4}SF:S),R,0,0,[]
S:G$P0$0$0({1}SC:U),I,0,0
S:G$SP$0$0({1}SC:U),I,0,0
S:G$DPL$0$0({1}SC:U),I,0,0
S:G$DPH$0$0({1}SC:U),I,0,0
S:G$SFRPAGE$0$0({1}SC:U),I,0,0
S:G$SFRNEXT$0$0({1}SC:U),I,0,0
S:G$SFRLAST$0$0({1}SC:U),I,0,0
S:G$PCON$0$0({1}SC:U),I,0,0
S:G$P1$0$0({1}SC:U),I,0,0
S:G$P2$0$0({1}SC:U),I,0,0
S:G$IE$0$0({1}SC:U),I,0,0
S:G$P3$0$0({1}SC:U),I,0,0
S:G$PSBANK$0$0({1}SC:U),I,0,0
S:G$IP$0$0({1}SC:U),I,0,0
S:G$PSW$0$0({1}SC:U),I,0,0
S:G$ACC$0$0({1}SC:U),I,0,0
S:G$EIE1$0$0({1}SC:U),I,0,0
S:G$EIE2$0$0({1}SC:U),I,0,0
S:G$B$0$0({1}SC:U),I,0,0
S:G$EIP1$0$0({1}SC:U),I,0,0
S:G$EIP2$0$0({1}SC:U),I,0,0
S:G$WDTCN$0$0({1}SC:U),I,0,0
S:G$TCON$0$0({1}SC:U),I,0,0
S:G$TMOD$0$0({1}SC:U),I,0,0
S:G$TL0$0$0({1}SC:U),I,0,0
S:G$TL1$0$0({1}SC:U),I,0,0
S:G$TH0$0$0({1}SC:U),I,0,0
S:G$TH1$0$0({1}SC:U),I,0,0
S:G$CKCON$0$0({1}SC:U),I,0,0
S:G$PSCTL$0$0({1}SC:U),I,0,0
S:G$SSTA0$0$0({1}SC:U),I,0,0
S:G$SCON0$0$0({1}SC:U),I,0,0
S:G$SCON$0$0({1}SC:U),I,0,0
S:G$SBUF0$0$0({1}SC:U),I,0,0
S:G$SBUF$0$0({1}SC:U),I,0,0
S:G$SPI0CFG$0$0({1}SC:U),I,0,0
S:G$SPI0DAT$0$0({1}SC:U),I,0,0
S:G$SPI0CKR$0$0({1}SC:U),I,0,0
S:G$EMI0TC$0$0({1}SC:U),I,0,0
S:G$EMI0CN$0$0({1}SC:U),I,0,0
S:G$_XPAGE$0$0({1}SC:U),I,0,0
S:G$EMI0CF$0$0({1}SC:U),I,0,0
S:G$SADDR0$0$0({1}SC:U),I,0,0
S:G$FLSCL$0$0({1}SC:U),I,0,0
S:G$SADEN0$0$0({1}SC:U),I,0,0
S:G$AMX0CF$0$0({1}SC:U),I,0,0
S:G$AMX0SL$0$0({1}SC:U),I,0,0
S:G$ADC0CF$0$0({1}SC:U),I,0,0
S:G$ADC0L$0$0({1}SC:U),I,0,0
S:G$ADC0H$0$0({1}SC:U),I,0,0
S:G$SMB0CN$0$0({1}SC:U),I,0,0
S:G$SMB0STA$0$0({1}SC:U),I,0,0
S:G$SMB0DAT$0$0({1}SC:U),I,0,0
S:G$SMB0ADR$0$0({1}SC:U),I,0,0
S:G$ADC0GTL$0$0({1}SC:U),I,0,0
S:G$ADC0GTH$0$0({1}SC:U),I,0,0
S:G$ADC0LTL$0$0({1}SC:U),I,0,0
S:G$ADC0LTH$0$0({1}SC:U),I,0,0
S:G$TMR2CN$0$0({1}SC:U),I,0,0
S:G$TMR2CF$0$0({1}SC:U),I,0,0
S:G$RCAP2L$0$0({1}SC:U),I,0,0
S:G$RCAP2H$0$0({1}SC:U),I,0,0
S:G$TMR2L$0$0({1}SC:U),I,0,0
S:G$TL2$0$0({1}SC:U),I,0,0
S:G$TMR2H$0$0({1}SC:U),I,0,0
S:G$TH2$0$0({1}SC:U),I,0,0
S:G$SMB0CR$0$0({1}SC:U),I,0,0
S:G$REF0CN$0$0({1}SC:U),I,0,0
S:G$DAC0L$0$0({1}SC:U),I,0,0
S:G$DAC0H$0$0({1}SC:U),I,0,0
S:G$DAC0CN$0$0({1}SC:U),I,0,0
S:G$PCA0CN$0$0({1}SC:U),I,0,0
S:G$PCA0MD$0$0({1}SC:U),I,0,0
S:G$PCA0CPM0$0$0({1}SC:U),I,0,0
S:G$PCA0CPM1$0$0({1}SC:U),I,0,0
S:G$PCA0CPM2$0$0({1}SC:U),I,0,0
S:G$PCA0CPM3$0$0({1}SC:U),I,0,0
S:G$PCA0CPM4$0$0({1}SC:U),I,0,0
S:G$PCA0CPM5$0$0({1}SC:U),I,0,0
S:G$PCA0CPL5$0$0({1}SC:U),I,0,0
S:G$PCA0CPH5$0$0({1}SC:U),I,0,0
S:G$ADC0CN$0$0({1}SC:U),I,0,0
S:G$PCA0CPL2$0$0({1}SC:U),I,0,0
S:G$PCA0CPH2$0$0({1}SC:U),I,0,0
S:G$PCA0CPL3$0$0({1}SC:U),I,0,0
S:G$PCA0CPH3$0$0({1}SC:U),I,0,0
S:G$PCA0CPL4$0$0({1}SC:U),I,0,0
S:G$PCA0CPH4$0$0({1}SC:U),I,0,0
S:G$RSTSRC$0$0({1}SC:U),I,0,0
S:G$SPI0CN$0$0({1}SC:U),I,0,0
S:G$PCA0L$0$0({1}SC:U),I,0,0
S:G$PCA0H$0$0({1}SC:U),I,0,0
S:G$PCA0CPL0$0$0({1}SC:U),I,0,0
S:G$PCA0CPH0$0$0({1}SC:U),I,0,0
S:G$PCA0CPL1$0$0({1}SC:U),I,0,0
S:G$PCA0CPH1$0$0({1}SC:U),I,0,0
S:G$CPT0CN$0$0({1}SC:U),I,0,0
S:G$CPT0MD$0$0({1}SC:U),I,0,0
S:G$SCON1$0$0({1}SC:U),I,0,0
S:G$SBUF1$0$0({1}SC:U),I,0,0
S:G$TMR3CN$0$0({1}SC:U),I,0,0
S:G$TMR3CF$0$0({1}SC:U),I,0,0
S:G$RCAP3L$0$0({1}SC:U),I,0,0
S:G$RCAP3H$0$0({1}SC:U),I,0,0
S:G$TMR3L$0$0({1}SC:U),I,0,0
S:G$TMR3H$0$0({1}SC:U),I,0,0
S:G$DAC1L$0$0({1}SC:U),I,0,0
S:G$DAC1H$0$0({1}SC:U),I,0,0
S:G$DAC1CN$0$0({1}SC:U),I,0,0
S:G$CPT1CN$0$0({1}SC:U),I,0,0
S:G$CPT1MD$0$0({1}SC:U),I,0,0
S:G$AMX2CF$0$0({1}SC:U),I,0,0
S:G$AMX2SL$0$0({1}SC:U),I,0,0
S:G$ADC2CF$0$0({1}SC:U),I,0,0
S:G$ADC2$0$0({1}SC:U),I,0,0
S:G$ADC2GT$0$0({1}SC:U),I,0,0
S:G$ADC2LT$0$0({1}SC:U),I,0,0
S:G$TMR4CN$0$0({1}SC:U),I,0,0
S:G$TMR4CF$0$0({1}SC:U),I,0,0
S:G$RCAP4L$0$0({1}SC:U),I,0,0
S:G$RCAP4H$0$0({1}SC:U),I,0,0
S:G$TMR4L$0$0({1}SC:U),I,0,0
S:G$TMR4H$0$0({1}SC:U),I,0,0
S:G$ADC2CN$0$0({1}SC:U),I,0,0
S:G$MAC0BL$0$0({1}SC:U),I,0,0
S:G$MAC0BH$0$0({1}SC:U),I,0,0
S:G$MAC0ACC0$0$0({1}SC:U),I,0,0
S:G$MAC0ACC1$0$0({1}SC:U),I,0,0
S:G$MAC0ACC2$0$0({1}SC:U),I,0,0
S:G$MAC0ACC3$0$0({1}SC:U),I,0,0
S:G$MAC0OVR$0$0({1}SC:U),I,0,0
S:G$MAC0STA$0$0({1}SC:U),I,0,0
S:G$MAC0AL$0$0({1}SC:U),I,0,0
S:G$MAC0AH$0$0({1}SC:U),I,0,0
S:G$MAC0CF$0$0({1}SC:U),I,0,0
S:G$MAC0RNDL$0$0({1}SC:U),I,0,0
S:G$MAC0RNDH$0$0({1}SC:U),I,0,0
S:G$FLSTAT$0$0({1}SC:U),I,0,0
S:G$PLL0CN$0$0({1}SC:U),I,0,0
S:G$OSCICN$0$0({1}SC:U),I,0,0
S:G$OSCICL$0$0({1}SC:U),I,0,0
S:G$OSCXCN$0$0({1}SC:U),I,0,0
S:G$PLL0DIV$0$0({1}SC:U),I,0,0
S:G$PLL0MUL$0$0({1}SC:U),I,0,0
S:G$PLL0FLT$0$0({1}SC:U),I,0,0
S:G$SFRPGCN$0$0({1}SC:U),I,0,0
S:G$CLKSEL$0$0({1}SC:U),I,0,0
S:G$CCH0MA$0$0({1}SC:U),I,0,0
S:G$P4MDOUT$0$0({1}SC:U),I,0,0
S:G$P5MDOUT$0$0({1}SC:U),I,0,0
S:G$P6MDOUT$0$0({1}SC:U),I,0,0
S:G$P7MDOUT$0$0({1}SC:U),I,0,0
S:G$CCH0CN$0$0({1}SC:U),I,0,0
S:G$CCH0TN$0$0({1}SC:U),I,0,0
S:G$CCH0LC$0$0({1}SC:U),I,0,0
S:G$P0MDOUT$0$0({1}SC:U),I,0,0
S:G$P1MDOUT$0$0({1}SC:U),I,0,0
S:G$P2MDOUT$0$0({1}SC:U),I,0,0
S:G$P3MDOUT$0$0({1}SC:U),I,0,0
S:G$P1MDIN$0$0({1}SC:U),I,0,0
S:G$FLACL$0$0({1}SC:U),I,0,0
S:G$P4$0$0({1}SC:U),I,0,0
S:G$P5$0$0({1}SC:U),I,0,0
S:G$XBR0$0$0({1}SC:U),I,0,0
S:G$XBR1$0$0({1}SC:U),I,0,0
S:G$XBR2$0$0({1}SC:U),I,0,0
S:G$P6$0$0({1}SC:U),I,0,0
S:G$P7$0$0({1}SC:U),I,0,0
S:G$TMR0$0$0({2}SI:U),I,0,0
S:G$TMR1$0$0({2}SI:U),I,0,0
S:G$TMR2$0$0({2}SI:U),I,0,0
S:G$RCAP2$0$0({2}SI:U),I,0,0
S:G$ADC0$0$0({2}SI:U),I,0,0
S:G$ADC0GT$0$0({2}SI:U),I,0,0
S:G$ADC0LT$0$0({2}SI:U),I,0,0
S:G$DAC0$0$0({2}SI:U),I,0,0
S:G$PCA0$0$0({2}SI:U),I,0,0
S:G$PCA0CP0$0$0({2}SI:U),I,0,0
S:G$PCA0CP1$0$0({2}SI:U),I,0,0
S:G$PCA0CP2$0$0({2}SI:U),I,0,0
S:G$PCA0CP3$0$0({2}SI:U),I,0,0
S:G$PCA0CP4$0$0({2}SI:U),I,0,0
S:G$PCA0CP5$0$0({2}SI:U),I,0,0
S:G$TMR3$0$0({2}SI:U),I,0,0
S:G$RCAP3$0$0({2}SI:U),I,0,0
S:G$DAC1$0$0({2}SI:U),I,0,0
S:G$TMR4$0$0({2}SI:U),I,0,0
S:G$RCAP4$0$0({2}SI:U),I,0,0
S:G$MAC0A$0$0({2}SI:U),I,0,0
S:G$MAC0ACC$0$0({4}SL:U),I,0,0
S:G$MAC0RND$0$0({2}SI:U),I,0,0
S:G$P0_0$0$0({1}SX:U),J,0,0
S:G$P0_1$0$0({1}SX:U),J,0,0
S:G$P0_2$0$0({1}SX:U),J,0,0
S:G$P0_3$0$0({1}SX:U),J,0,0
S:G$P0_4$0$0({1}SX:U),J,0,0
S:G$P0_5$0$0({1}SX:U),J,0,0
S:G$P0_6$0$0({1}SX:U),J,0,0
S:G$P0_7$0$0({1}SX:U),J,0,0
S:G$IT0$0$0({1}SX:U),J,0,0
S:G$IE0$0$0({1}SX:U),J,0,0
S:G$IT1$0$0({1}SX:U),J,0,0
S:G$IE1$0$0({1}SX:U),J,0,0
S:G$TR0$0$0({1}SX:U),J,0,0
S:G$TF0$0$0({1}SX:U),J,0,0
S:G$TR1$0$0({1}SX:U),J,0,0
S:G$TF1$0$0({1}SX:U),J,0,0
S:G$CP0HYN0$0$0({1}SX:U),J,0,0
S:G$CP0HYN1$0$0({1}SX:U),J,0,0
S:G$CP0HYP0$0$0({1}SX:U),J,0,0
S:G$CP0HYP1$0$0({1}SX:U),J,0,0
S:G$CP0FIF$0$0({1}SX:U),J,0,0
S:G$CP0RIF$0$0({1}SX:U),J,0,0
S:G$CP0OUT$0$0({1}SX:U),J,0,0
S:G$CP0EN$0$0({1}SX:U),J,0,0
S:G$CP1HYN0$0$0({1}SX:U),J,0,0
S:G$CP1HYN1$0$0({1}SX:U),J,0,0
S:G$CP1HYP0$0$0({1}SX:U),J,0,0
S:G$CP1HYP1$0$0({1}SX:U),J,0,0
S:G$CP1FIF$0$0({1}SX:U),J,0,0
S:G$CP1RIF$0$0({1}SX:U),J,0,0
S:G$CP1OUT$0$0({1}SX:U),J,0,0
S:G$CP1EN$0$0({1}SX:U),J,0,0
S:G$FLHBUSY$0$0({1}SX:U),J,0,0
S:G$P1_0$0$0({1}SX:U),J,0,0
S:G$P1_1$0$0({1}SX:U),J,0,0
S:G$P1_2$0$0({1}SX:U),J,0,0
S:G$P1_3$0$0({1}SX:U),J,0,0
S:G$P1_4$0$0({1}SX:U),J,0,0
S:G$P1_5$0$0({1}SX:U),J,0,0
S:G$P1_6$0$0({1}SX:U),J,0,0
S:G$P1_7$0$0({1}SX:U),J,0,0
S:G$RI0$0$0({1}SX:U),J,0,0
S:G$RI$0$0({1}SX:U),J,0,0
S:G$TI0$0$0({1}SX:U),J,0,0
S:G$TI$0$0({1}SX:U),J,0,0
S:G$RB80$0$0({1}SX:U),J,0,0
S:G$TB80$0$0({1}SX:U),J,0,0
S:G$REN0$0$0({1}SX:U),J,0,0
S:G$REN$0$0({1}SX:U),J,0,0
S:G$SM20$0$0({1}SX:U),J,0,0
S:G$SM10$0$0({1}SX:U),J,0,0
S:G$SM00$0$0({1}SX:U),J,0,0
S:G$RI1$0$0({1}SX:U),J,0,0
S:G$TI1$0$0({1}SX:U),J,0,0
S:G$RB81$0$0({1}SX:U),J,0,0
S:G$TB81$0$0({1}SX:U),J,0,0
S:G$REN1$0$0({1}SX:U),J,0,0
S:G$MCE1$0$0({1}SX:U),J,0,0
S:G$S1MODE$0$0({1}SX:U),J,0,0
S:G$P2_0$0$0({1}SX:U),J,0,0
S:G$P2_1$0$0({1}SX:U),J,0,0
S:G$P2_2$0$0({1}SX:U),J,0,0
S:G$P2_3$0$0({1}SX:U),J,0,0
S:G$P2_4$0$0({1}SX:U),J,0,0
S:G$P2_5$0$0({1}SX:U),J,0,0
S:G$P2_6$0$0({1}SX:U),J,0,0
S:G$P2_7$0$0({1}SX:U),J,0,0
S:G$EX0$0$0({1}SX:U),J,0,0
S:G$ET0$0$0({1}SX:U),J,0,0
S:G$EX1$0$0({1}SX:U),J,0,0
S:G$ET1$0$0({1}SX:U),J,0,0
S:G$ES0$0$0({1}SX:U),J,0,0
S:G$ES$0$0({1}SX:U),J,0,0
S:G$ET2$0$0({1}SX:U),J,0,0
S:G$EA$0$0({1}SX:U),J,0,0
S:G$P3_0$0$0({1}SX:U),J,0,0
S:G$P3_1$0$0({1}SX:U),J,0,0
S:G$P3_2$0$0({1}SX:U),J,0,0
S:G$P3_3$0$0({1}SX:U),J,0,0
S:G$P3_4$0$0({1}SX:U),J,0,0
S:G$P3_5$0$0({1}SX:U),J,0,0
S:G$P3_6$0$0({1}SX:U),J,0,0
S:G$P3_7$0$0({1}SX:U),J,0,0
S:G$PX0$0$0({1}SX:U),J,0,0
S:G$PT0$0$0({1}SX:U),J,0,0
S:G$PX1$0$0({1}SX:U),J,0,0
S:G$PT1$0$0({1}SX:U),J,0,0
S:G$PS0$0$0({1}SX:U),J,0,0
S:G$PS$0$0({1}SX:U),J,0,0
S:G$PT2$0$0({1}SX:U),J,0,0
S:G$SMBTOE$0$0({1}SX:U),J,0,0
S:G$SMBFTE$0$0({1}SX:U),J,0,0
S:G$AA$0$0({1}SX:U),J,0,0
S:G$SI$0$0({1}SX:U),J,0,0
S:G$STO$0$0({1}SX:U),J,0,0
S:G$STA$0$0({1}SX:U),J,0,0
S:G$ENSMB$0$0({1}SX:U),J,0,0
S:G$BUSY$0$0({1}SX:U),J,0,0
S:G$MAC0N$0$0({1}SX:U),J,0,0
S:G$MAC0SO$0$0({1}SX:U),J,0,0
S:G$MAC0Z$0$0({1}SX:U),J,0,0
S:G$MAC0HO$0$0({1}SX:U),J,0,0
S:G$CPRL2$0$0({1}SX:U),J,0,0
S:G$CT2$0$0({1}SX:U),J,0,0
S:G$TR2$0$0({1}SX:U),J,0,0
S:G$EXEN2$0$0({1}SX:U),J,0,0
S:G$EXF2$0$0({1}SX:U),J,0,0
S:G$TF2$0$0({1}SX:U),J,0,0
S:G$CPRL3$0$0({1}SX:U),J,0,0
S:G$CT3$0$0({1}SX:U),J,0,0
S:G$TR3$0$0({1}SX:U),J,0,0
S:G$EXEN3$0$0({1}SX:U),J,0,0
S:G$EXF3$0$0({1}SX:U),J,0,0
S:G$TF3$0$0({1}SX:U),J,0,0
S:G$CPRL4$0$0({1}SX:U),J,0,0
S:G$CT4$0$0({1}SX:U),J,0,0
S:G$TR4$0$0({1}SX:U),J,0,0
S:G$EXEN4$0$0({1}SX:U),J,0,0
S:G$EXF4$0$0({1}SX:U),J,0,0
S:G$TF4$0$0({1}SX:U),J,0,0
S:G$P4_0$0$0({1}SX:U),J,0,0
S:G$P4_1$0$0({1}SX:U),J,0,0
S:G$P4_2$0$0({1}SX:U),J,0,0
S:G$P4_3$0$0({1}SX:U),J,0,0
S:G$P4_4$0$0({1}SX:U),J,0,0
S:G$P4_5$0$0({1}SX:U),J,0,0
S:G$P4_6$0$0({1}SX:U),J,0,0
S:G$P4_7$0$0({1}SX:U),J,0,0
S:G$P$0$0({1}SX:U),J,0,0
S:G$F1$0$0({1}SX:U),J,0,0
S:G$OV$0$0({1}SX:U),J,0,0
S:G$RS0$0$0({1}SX:U),J,0,0
S:G$RS1$0$0({1}SX:U),J,0,0
S:G$F0$0$0({1}SX:U),J,0,0
S:G$AC$0$0({1}SX:U),J,0,0
S:G$CY$0$0({1}SX:U),J,0,0
S:G$CCF0$0$0({1}SX:U),J,0,0
S:G$CCF1$0$0({1}SX:U),J,0,0
S:G$CCF2$0$0({1}SX:U),J,0,0
S:G$CCF3$0$0({1}SX:U),J,0,0
S:G$CCF4$0$0({1}SX:U),J,0,0
S:G$CCF5$0$0({1}SX:U),J,0,0
S:G$CR$0$0({1}SX:U),J,0,0
S:G$CF$0$0({1}SX:U),J,0,0
S:G$P5_0$0$0({1}SX:U),J,0,0
S:G$P5_1$0$0({1}SX:U),J,0,0
S:G$P5_2$0$0({1}SX:U),J,0,0
S:G$P5_3$0$0({1}SX:U),J,0,0
S:G$P5_4$0$0({1}SX:U),J,0,0
S:G$P5_5$0$0({1}SX:U),J,0,0
S:G$P5_6$0$0({1}SX:U),J,0,0
S:G$P5_7$0$0({1}SX:U),J,0,0
S:G$AD0LJST$0$0({1}SX:U),J,0,0
S:G$AD0WINT$0$0({1}SX:U),J,0,0
S:G$AD0CM0$0$0({1}SX:U),J,0,0
S:G$AD0CM1$0$0({1}SX:U),J,0,0
S:G$AD0BUSY$0$0({1}SX:U),J,0,0
S:G$AD0INT$0$0({1}SX:U),J,0,0
S:G$AD0TM$0$0({1}SX:U),J,0,0
S:G$AD0EN$0$0({1}SX:U),J,0,0
S:G$AD2WINT$0$0({1}SX:U),J,0,0
S:G$AD2CM0$0$0({1}SX:U),J,0,0
S:G$AD2CM1$0$0({1}SX:U),J,0,0
S:G$AD2CM2$0$0({1}SX:U),J,0,0
S:G$AD2BUSY$0$0({1}SX:U),J,0,0
S:G$AD2INT$0$0({1}SX:U),J,0,0
S:G$AD2TM$0$0({1}SX:U),J,0,0
S:G$AD2EN$0$0({1}SX:U),J,0,0
S:G$P6_0$0$0({1}SX:U),J,0,0
S:G$P6_1$0$0({1}SX:U),J,0,0
S:G$P6_2$0$0({1}SX:U),J,0,0
S:G$P6_3$0$0({1}SX:U),J,0,0
S:G$P6_4$0$0({1}SX:U),J,0,0
S:G$P6_5$0$0({1}SX:U),J,0,0
S:G$P6_6$0$0({1}SX:U),J,0,0
S:G$P6_7$0$0({1}SX:U),J,0,0
S:G$SPIEN$0$0({1}SX:U),J,0,0
S:G$TXBMT$0$0({1}SX:U),J,0,0
S:G$NSSMD0$0$0({1}SX:U),J,0,0
S:G$NSSMD1$0$0({1}SX:U),J,0,0
S:G$RXOVRN$0$0({1}SX:U),J,0,0
S:G$MODF$0$0({1}SX:U),J,0,0
S:G$WCOL$0$0({1}SX:U),J,0,0
S:G$SPIF$0$0({1}SX:U),J,0,0
S:G$P7_0$0$0({1}SX:U),J,0,0
S:G$P7_1$0$0({1}SX:U),J,0,0
S:G$P7_2$0$0({1}SX:U),J,0,0
S:G$P7_3$0$0({1}SX:U),J,0,0
S:G$P7_4$0$0({1}SX:U),J,0,0
S:G$P7_5$0$0({1}SX:U),J,0,0
S:G$P7_6$0$0({1}SX:U),J,0,0
S:G$P7_7$0$0({1}SX:U),J,0,0
S:G$_print_format$0$0({2}DF,SI:S),C,0,0
S:G$printf_small$0$0({2}DF,SV:S),C,0,0
S:G$printf$0$0({2}DF,SI:S),C,0,0
S:G$vprintf$0$0({2}DF,SI:S),C,0,0
S:G$sprintf$0$0({2}DF,SI:S),C,0,0
S:G$vsprintf$0$0({2}DF,SI:S),C,0,0
S:G$puts$0$0({2}DF,SI:S),C,0,0
S:G$gets$0$0({2}DF,DG,SC:S),C,0,0
S:G$printf_fast$0$0({2}DF,SV:S),C,0,0
S:G$printf_fast_f$0$0({2}DF,SV:S),C,0,0
S:G$printf_tiny$0$0({2}DF,SV:S),C,0,0
|
--
-- Copyright (C) 2017 secunet Security Networks AG
--
-- 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.GFX.GMA.DP_Info;
private package HW.GFX.GMA.DDI_Phy is
type T is (BC, A);
procedure Power_On (Phy : T);
procedure Power_Off (Phy : T);
subtype DDI_Phy_Port is GPU_Port range DIGI_A .. DIGI_C;
procedure Pre_PLL (Port_Cfg : Port_Config);
Max_V_Swing : constant DP_Info.DP_Voltage_Swing := DP_Info.VS_Level_3;
type Emph_Array is array (DP_Info.DP_Voltage_Swing) of DP_Info.DP_Pre_Emph;
Max_Pre_Emph : constant Emph_Array :=
(DP_Info.VS_Level_0 => DP_Info.Emph_Level_3,
DP_Info.VS_Level_1 => DP_Info.Emph_Level_2,
DP_Info.VS_Level_2 => DP_Info.Emph_Level_1,
others => DP_Info.Emph_Level_0);
procedure Set_DP_Signal_Levels
(Port : Digital_Port;
Train_Set : DP_Info.Train_Set);
subtype HDMI_Buf_Trans_Range is DDI_HDMI_Buf_Trans_Range range 0 .. 9;
procedure Set_HDMI_Signal_Levels
(Port : DDI_Phy_Port;
Level : HDMI_Buf_Trans_Range);
end HW.GFX.GMA.DDI_Phy;
|
with Some_Package;
procedure main with SPARK_Mode is
begin
Some_Package.bar;
end main;
|
generic
Lower_Bound, Upper_Bound : Integer; -- bounds in which random numbers are generated
-- { Lower_Bound <= Upper_Bound }
package Alea is
-- Compute a random number in the range Lower_Bound..Upper_Bound.
--
-- Notice that Ada advocates the definition of a range type in such a case
-- to ensure that the type reflects the real possible values.
procedure Get_Random_Number (Resultat : out Integer);
end Alea;
|
package body Littlefs is
------------
-- C_Type --
------------
function Kind (Info : Entry_Info) return File_Kind
is (File_Kind'Enum_Val (Info.c_type));
----------
-- Size --
----------
function Size (Info : Entry_Info) return LFS_Size
is (Info.size);
----------
-- Name --
----------
function Name (Info : Entry_Info) return String is
Count : Natural;
From : Positive := Info.name'First;
begin
while Info.name (From) /= ASCII.NUL loop
From := From + 1;
end loop;
Count := Natural (From) - Natural (Info.name'First);
return Info.name (Info.name'First .. Info.name'First + Count - 1);
end Name;
------------
-- Format --
------------
function Format
(LFS : aliased in out LFS_T;
Config : aliased LFS_Config)
return int
is
function Format (lfs : access LFS_T;
config : access constant LFS_Config)
return int
with Import => True, Convention => C, External_Name => "lfs_format";
begin
return Format (LFS'Access, Config'Access);
end Format;
-----------
-- Mount --
-----------
function Mount
(LFS : aliased in out LFS_T; Config : aliased LFS_Config) return int
is
function Mount (lfs : access LFS_T;
config : access constant LFS_Config)
return int
with Import => True, Convention => C, External_Name => "lfs_mount";
begin
return Mount (LFS'Access, Config'Access);
end Mount;
-------------
-- Unmount --
-------------
function Unmount (LFS : aliased in out LFS_T) return int is
function Unmount (lfs : access LFS_T) return int -- lfs.h:443
with Import => True, Convention => C, External_Name => "lfs_unmount";
begin
return Unmount (LFS'Access);
end Unmount;
------------
-- Remove --
------------
function Remove (LFS : aliased in out LFS_T; Path : String) return int is
function Remove (lfs : access LFS_T;
path : System.Address)
return int -- lfs.h:452
with Import => True, Convention => C, External_Name => "lfs_remove";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Remove (LFS'Access, C_Path'Address);
end Remove;
------------
-- Rename --
------------
function Rename
(LFS : aliased in out LFS_T; Oldpath : String; Newpath : String)
return int
is
function Rename (lfs : access LFS_T;
oldpath : System.Address;
newpath : System.Address)
return int
with Import => True, Convention => C, External_Name => "lfs_rename";
C_Oldpath : constant String (1 .. Oldpath'Length + 1) :=
Oldpath & ASCII.NUL;
C_Newpath : constant String (1 .. Newpath'Length + 1) :=
Newpath & ASCII.NUL;
begin
return Rename (LFS'Access, C_Oldpath'Address, C_Newpath'Address);
end Rename;
----------
-- Stat --
----------
function Stat
(LFS : aliased in out LFS_T; Path : String; Info : aliased out Entry_Info)
return int
is
function Stat (lfs : access LFS_T;
path : System.Address;
info : access Entry_Info)
return int -- lfs.h:469
with Import => True, Convention => C, External_Name => "lfs_stat";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Stat (LFS'Access, C_Path'Address, Info'Access);
end Stat;
-------------
-- Setattr --
-------------
function Setattr (LFS : aliased in out LFS_T;
Path : String;
Id : Interfaces.Unsigned_8;
Buffer : System.Address;
Size : LFS_Size)
return int
is
function Setattr (lfs : access LFS_T;
path : System.Address;
c_type : Interfaces.Unsigned_8;
buffer : System.Address;
size : LFS_Size)
return int -- lfs.h:494
with Import => True, Convention => C, External_Name => "lfs_setattr";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Setattr (LFS'Access, C_Path'Address, Id, Buffer, Size);
end Setattr;
----------------
-- Removeattr --
----------------
function Removeattr (LFS : aliased in out LFS_T;
Path : String;
Id : Interfaces.Unsigned_8)
return int
is
function Removeattr (lfs : access LFS_T;
path : System.Address;
c_type : Interfaces.Unsigned_8)
return int -- lfs.h:504
with Import => True, Convention => C,
External_Name => "lfs_removeattr";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Removeattr (LFS'Access, C_Path'Address, Id);
end Removeattr;
----------
-- Open --
----------
function Open (LFS : aliased in out LFS_T;
File : aliased in out LFS_File;
Path : String;
Flags : LFS_Open_Flags)
return int
is
function Open (lfs : access LFS_T;
file : access LFS_File;
path : System.Address;
flags : int)
return int -- lfs.h:516
with Import => True, Convention => C, External_Name => "lfs_file_open";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Open (LFS'Access, File'Access, C_Path'Address, int (Flags));
end Open;
-------------
-- Opencfg --
-------------
function Opencfg (LFS : aliased in out LFS_T;
File : aliased in out LFS_File;
Path : String;
Flags : LFS_Open_Flags;
Config : aliased lfs_file_config)
return int
is
function Opencfg (lfs : access LFS_T;
file : access LFS_File;
path : System.Address;
flags : int;
config : access constant lfs_file_config)
return int
with Import => True,
Convention => C,
External_Name => "lfs_file_opencfg";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Opencfg (LFS'Access, File'Access, C_Path'Address, int (Flags),
Config'Access);
end Opencfg;
-----------
-- Close --
-----------
function Close (LFS : aliased in out LFS_T;
File : aliased in out LFS_File)
return int
is
function Close (lfs : access LFS_T;
file : access LFS_File)
return int -- lfs.h:539
with Import => True, Convention => C,
External_Name => "lfs_file_close";
begin
return Close (LFS'Access, File'Access);
end Close;
----------
-- Sync --
----------
function Sync
(LFS : aliased in out LFS_T;
File : aliased in out LFS_File)
return int
is
function Sync (lfs : access LFS_T;
file : access LFS_File)
return int
with Import => True, Convention => C, External_Name => "lfs_file_sync";
begin
return Sync (LFS'Access, File'Access);
end Sync;
----------
-- Read --
----------
function Read
(LFS : aliased in out LFS_T;
File : aliased in out LFS_File;
Buffer : System.Address;
Size : LFS_Size)
return LFS_Signed_Size
is
function Read (lfs : access LFS_T;
file : access LFS_File;
buffer : System.Address;
size : LFS_Size)
return LFS_Signed_Size
with Import => True, Convention => C, External_Name => "lfs_file_read";
begin
return Read (LFS'Access, File'Access, Buffer, Size);
end Read;
-----------
-- Write --
-----------
function Write
(LFS : aliased in out LFS_T;
File : aliased in out LFS_File;
Buffer : System.Address;
Size : LFS_Size)
return LFS_Signed_Size
is
function Write (lfs : access LFS_T;
file : access LFS_File;
buffer : System.Address;
size : LFS_Size)
return LFS_Signed_Size -- lfs.h:561
with Import => True, Convention => C,
External_Name => "lfs_file_write";
begin
return Write (LFS'Access, File'Access, Buffer, Size);
end Write;
----------
-- Seek --
----------
function Seek
(LFS : aliased in out LFS_T;
File : aliased in out LFS_File;
Off : LFS_Signed_Offset;
Whence : int)
return LFS_Signed_Offset
is
function Seek (lfs : access LFS_T;
file : access LFS_File;
off : LFS_Signed_Offset;
whence : int)
return LFS_Signed_Offset -- lfs.h:569
with Import => True, Convention => C, External_Name => "lfs_file_seek";
begin
return Seek (LFS'Access, File'Access, Off, Whence);
end Seek;
--------------
-- Truncate --
--------------
function Truncate
(LFS : aliased in out LFS_T;
File : aliased in out LFS_File;
Size : LFS_Offset)
return int
is
function Truncate
(lfs : access LFS_T;
file : access LFS_File;
size : LFS_Offset) return int -- lfs.h:576
with Import => True,
Convention => C,
External_Name => "lfs_file_truncate";
begin
return Truncate (LFS'Access, File'Access, Size);
end Truncate;
----------
-- Tell --
----------
function Tell (LFS : aliased in out LFS_T;
File : aliased in out LFS_File)
return LFS_Signed_Offset
is
function Tell (lfs : access LFS_T;
file : access LFS_File)
return LFS_Signed_Offset
with Import => True, Convention => C, External_Name => "lfs_file_tell";
begin
return Tell (LFS'Access, File'Access);
end Tell;
------------
-- Rewind --
------------
function Rewind
(LFS : aliased in out LFS_T; File : aliased in out LFS_File) return int
is
function Rewind (lfs : access LFS_T;
file : access LFS_File)
return int
with Import => True,
Convention => C,
External_Name => "lfs_file_rewind";
begin
return Rewind (LFS'Access, File'Access);
end Rewind;
----------
-- Size --
----------
function Size (LFS : aliased in out LFS_T;
File : aliased in out LFS_File)
return LFS_Signed_Offset
is
function Size (lfs : access LFS_T;
file : access LFS_File)
return LFS_Signed_Offset
with Import => True, Convention => C, External_Name => "lfs_file_tell";
begin
return Size (LFS'Access, File'Access);
end Size;
-----------
-- Mkdir --
-----------
function Mkdir (LFS : aliased in out LFS_T; Path : String) return int is
function Mkdir (lfs : access LFS_T;
path : System.Address)
return int
with Import => True, Convention => C, External_Name => "lfs_mkdir";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Mkdir (LFS'Access, C_Path'Address);
end Mkdir;
----------
-- Open --
----------
function Open (LFS : aliased in out LFS_T;
Dir : aliased in out LFS_Dir;
Path : String)
return int
is
function Open
(lfs : access LFS_T;
dir : access LFS_Dir;
path : System.Address) return int -- lfs.h:611
with Import => True, Convention => C, External_Name => "lfs_dir_open";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Open (LFS'Access, Dir'Access, C_Path'Address);
end Open;
-----------
-- Close --
-----------
function Close (LFS : aliased in out LFS_T;
Dir : aliased in out LFS_Dir)
return int
is
function Close (lfs : access LFS_T; dir : access LFS_Dir) return int
with Import => True, Convention => C, External_Name => "lfs_dir_close";
begin
return Close (LFS'Access, Dir'Access);
end Close;
----------
-- Read --
----------
function Read
(LFS : aliased in out LFS_T; Dir : aliased in out LFS_Dir;
Info : aliased out Entry_Info) return int
is
function Read
(lfs : access LFS_T;
dir : access LFS_Dir;
info : access Entry_Info) return int -- lfs.h:624
with Import => True, Convention => C, External_Name => "lfs_dir_read";
begin
return Read (LFS'Access, Dir'Access, Info'Access);
end Read;
----------
-- Seek --
----------
function Seek (LFS : aliased in out LFS_T;
Dir : aliased in out LFS_Dir;
Off : LFS_Offset)
return int
is
function Seek
(lfs : access LFS_T;
dir : access LFS_Dir;
off : LFS_Offset) return int -- lfs.h:632
with Import => True, Convention => C, External_Name => "lfs_dir_seek";
begin
return Seek (LFS'Access, Dir'Access, Off);
end Seek;
----------
-- Tell --
----------
function Tell (LFS : aliased in out LFS_T;
Dir : aliased in out LFS_Dir)
return LFS_Signed_Offset
is
function Tell (lfs : access LFS_T;
dir : access LFS_Dir)
return LFS_Signed_Offset
with Import => True, Convention => C, External_Name => "lfs_dir_tell";
begin
return Tell (LFS'Access, Dir'Access);
end Tell;
------------
-- Rewind --
------------
function Rewind (LFS : aliased in out LFS_T;
Dir : aliased in out LFS_Dir)
return int
is
function Rewind (lfs : access LFS_T;
dir : access LFS_Dir)
return int
with Import => True, Convention => C,
External_Name => "lfs_dir_rewind";
begin
return Rewind (LFS'Access, Dir'Access);
end Rewind;
----------
-- Size --
----------
function Size (LFS : aliased in out LFS_T) return LFS_Signed_Size is
function Size (lfs : access LFS_T)
return LFS_Signed_Size
with Import => True, Convention => C, External_Name => "lfs_fs_size";
begin
return Size (LFS'Access);
end Size;
--------------
-- Traverse --
--------------
function Traverse
(LFS : aliased in out LFS_T;
CB : access function
(arg1 : System.Address; arg2 : LFS_Block) return int;
Data : System.Address) return int
is
function Traverse
(lfs : access LFS_T;
cb : access function (arg1 : System.Address; arg2 : LFS_Block)
return int;
data : System.Address) return int
with Import => True,
Convention => C,
External_Name => "lfs_fs_traverse";
begin
return Traverse (LFS'Access, CB, Data);
end Traverse;
-- -------------
-- -- Migrate --
-- -------------
--
-- function Migrate (LFS : aliased in out LFS_T;
-- Config : aliased in out LFS_Config)
-- return int
-- is
-- function Migrate (lfs : access LFS_T;
-- config : access constant LFS_Config) return int
-- with Import => True,
-- Convention => C,
-- External_Name => "lfs_migrate";
--
-- begin
-- return Migrate (LFS'Access, Config'Access);
-- end Migrate;
--
-------------
-- Getattr --
-------------
function Getattr (LFS : aliased in out LFS_T;
Path : String;
Id : Interfaces.Unsigned_8;
Buffer : System.Address;
Size : LFS_Size)
return LFS_Signed_Size
is
function Getattr (lfs : access LFS_T;
path : System.Address;
c_type : Interfaces.Unsigned_8;
buffer : System.Address;
size : LFS_Size)
return LFS_Signed_Size -- lfs.h:483
with Import => True, Convention => C, External_Name => "lfs_getattr";
C_Path : constant String (1 .. Path'Length + 1) :=
Path & ASCII.NUL;
begin
return Getattr (LFS'Access, C_Path'Address, Id, Buffer, Size);
end Getattr;
end Littlefs;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2014,2018 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.16 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-- |
-- |=====================================================================
-- | man page form_field_userptr.3x
-- |=====================================================================
-- |
package body Terminal_Interface.Curses.Forms.Field_User_Data is
-- |
-- |
-- |
procedure Set_User_Data (Fld : Field;
Data : User_Access)
is
function Set_Field_Userptr (Fld : Field;
Usr : User_Access) return Eti_Error;
pragma Import (C, Set_Field_Userptr, "set_field_userptr");
begin
Eti_Exception (Set_Field_Userptr (Fld, Data));
end Set_User_Data;
-- |
-- |
-- |
function Get_User_Data (Fld : Field) return User_Access
is
function Field_Userptr (Fld : Field) return User_Access;
pragma Import (C, Field_Userptr, "field_userptr");
begin
return Field_Userptr (Fld);
end Get_User_Data;
procedure Get_User_Data (Fld : Field;
Data : out User_Access)
is
begin
Data := Get_User_Data (Fld);
end Get_User_Data;
end Terminal_Interface.Curses.Forms.Field_User_Data;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . A D D R E S S _ O P E R A T I O N S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2004-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. --
-- --
------------------------------------------------------------------------------
-- This package provides arithmetic and logical operations on type Address.
-- It is intended for use by other packages in the System hierarchy. For
-- applications requiring this capability, see System.Storage_Elements or
-- the operations introduced in System.Aux_DEC;
-- The reason we need this package is that arithmetic operations may not
-- be available in the case where type Address is non-private and the
-- operations have been made abstract in the spec of System (to avoid
-- inappropriate use by applications programs). In addition, the logical
-- operations may not be available if type Address is a signed integer.
pragma Compiler_Unit_Warning;
package System.Address_Operations is
pragma Pure;
-- The semantics of the arithmetic operations are those that apply to
-- a modular type with the same length as Address, i.e. they provide
-- twos complement wrap around arithmetic treating the address value
-- as an unsigned value, with no overflow checking.
-- Note that we do not use the infix names for these operations to
-- avoid problems with ambiguities coming from declarations in package
-- Standard (which may or may not be visible depending on the exact
-- form of the declaration of type System.Address).
-- For addition, subtraction, and multiplication, the effect of overflow
-- is 2's complement wrapping (as though the type Address were unsigned).
-- For division and modulus operations, the caller is responsible for
-- ensuring that the Right argument is non-zero, and the effect of the
-- call is not specified if a zero argument is passed.
function AddA (Left, Right : Address) return Address;
function SubA (Left, Right : Address) return Address;
function MulA (Left, Right : Address) return Address;
function DivA (Left, Right : Address) return Address;
function ModA (Left, Right : Address) return Address;
-- The semantics of the logical operations are those that apply to
-- a modular type with the same length as Address, i.e. they provide
-- bit-wise operations on all bits of the value (including the sign
-- bit if Address is a signed integer type).
function AndA (Left, Right : Address) return Address;
function OrA (Left, Right : Address) return Address;
pragma Inline_Always (AddA);
pragma Inline_Always (SubA);
pragma Inline_Always (MulA);
pragma Inline_Always (DivA);
pragma Inline_Always (ModA);
pragma Inline_Always (AndA);
pragma Inline_Always (OrA);
end System.Address_Operations;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with HAL; use HAL;
with System; use System;
pragma Warnings (Off, "* is an internal GNAT unit");
with System.BB.Parameters;
pragma Warnings (On, "* is an internal GNAT unit");
with STM32_SVD.RCC; use STM32_SVD.RCC;
package body STM32.Device is
------------------
-- Enable_Clock --
------------------
Secure_Code : UInt32;
pragma Import (C, Secure_Code, "secure_code");
RCC : aliased RCC_Peripheral
with Import, Address => S_NS_Periph (RCC_Base);
procedure Enable_Clock (This : aliased in out Digital_To_Analog_Converter)
is
begin
RCC_Periph.APB1ENR1.DAC1EN := True;
end Enable_Clock;
procedure Reset (This : aliased in out Digital_To_Analog_Converter)
is
begin
RCC_Periph.APB1RSTR1.DAC1RST := True;
RCC_Periph.APB1RSTR1.DAC1RST := False;
end Reset;
procedure Enable_Clock (This : aliased in out GPIO_Port) is
begin
if This'Address = S_NS_Periph (GPIOA_Base) then
RCC.AHB2ENR.GPIOAEN := True;
elsif This'Address = S_NS_Periph (GPIOB_Base) then
RCC.AHB2ENR.GPIOBEN := True;
elsif This'Address = S_NS_Periph (GPIOC_Base) then
RCC.AHB2ENR.GPIOCEN := True;
elsif This'Address = S_NS_Periph (GPIOD_Base) then
RCC.AHB2ENR.GPIODEN := True;
elsif This'Address = S_NS_Periph (GPIOE_Base) then
RCC.AHB2ENR.GPIOEEN := True;
elsif This'Address = S_NS_Periph (GPIOF_Base) then
RCC.AHB2ENR.GPIOFEN := True;
elsif This'Address = S_NS_Periph (GPIOG_Base) then
RCC.AHB2ENR.GPIOGEN := True;
elsif This'Address = S_NS_Periph (GPIOH_Base) then
RCC.AHB2ENR.GPIOHEN := True;
else
raise Unknown_Device;
end if;
end Enable_Clock;
procedure Disable_Clock (This : aliased in out GPIO_Port) is
begin
if This'Address = S_NS_Periph (GPIOA_Base) then
RCC.AHB2ENR.GPIOAEN := False;
elsif This'Address = S_NS_Periph (GPIOB_Base) then
RCC.AHB2ENR.GPIOBEN := False;
elsif This'Address = S_NS_Periph (GPIOC_Base) then
RCC.AHB2ENR.GPIOCEN := False;
elsif This'Address = S_NS_Periph (GPIOD_Base) then
RCC.AHB2ENR.GPIODEN := False;
elsif This'Address = S_NS_Periph (GPIOE_Base) then
RCC.AHB2ENR.GPIOEEN := False;
elsif This'Address = S_NS_Periph (GPIOF_Base) then
RCC.AHB2ENR.GPIOFEN := False;
elsif This'Address = S_NS_Periph (GPIOG_Base) then
RCC.AHB2ENR.GPIOGEN := False;
elsif This'Address = S_NS_Periph (GPIOH_Base) then
RCC.AHB2ENR.GPIOHEN := False;
else
raise Unknown_Device;
end if;
end Disable_Clock;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (Point : GPIO_Point)
is
begin
Enable_Clock (Point.Periph.all);
end Enable_Clock;
procedure Disable_Clock (Point : GPIO_Point)
is
begin
Disable_Clock (Point.Periph.all);
end Disable_Clock;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (Points : GPIO_Points)
is
begin
for Point of Points loop
Enable_Clock (Point.Periph.all);
end loop;
end Enable_Clock;
procedure Disable_Clock (Points : GPIO_Points)
is
begin
for Point of Points loop
Disable_Clock (Point.Periph.all);
end loop;
end Disable_Clock;
-----------
-- Reset --
-----------
procedure Reset (This : aliased in out GPIO_Port) is
begin
if This'Address = S_NS_Periph (GPIOA_Base) then
RCC.AHB2RSTR.GPIOARST := True;
RCC.AHB2RSTR.GPIOARST := False;
elsif This'Address = S_NS_Periph (GPIOB_Base) then
RCC.AHB2RSTR.GPIOBRST := True;
RCC.AHB2RSTR.GPIOBRST := False;
elsif This'Address = S_NS_Periph (GPIOC_Base) then
RCC.AHB2RSTR.GPIOCRST := True;
RCC.AHB2RSTR.GPIOCRST := False;
elsif This'Address = S_NS_Periph (GPIOD_Base) then
RCC.AHB2RSTR.GPIODRST := True;
RCC.AHB2RSTR.GPIODRST := False;
elsif This'Address = S_NS_Periph (GPIOE_Base) then
RCC.AHB2RSTR.GPIOERST := True;
RCC.AHB2RSTR.GPIOERST := False;
else
raise Unknown_Device;
end if;
end Reset;
-----------
-- Reset --
-----------
procedure Reset (Point : GPIO_Point) is
begin
Reset (Point.Periph.all);
end Reset;
-----------
-- Reset --
-----------
procedure Reset (Points : GPIO_Points)
is
Do_Reset : Boolean;
begin
for J in Points'Range loop
Do_Reset := True;
for K in Points'First .. J - 1 loop
if Points (K).Periph = Points (J).Periph then
Do_Reset := False;
exit;
end if;
end loop;
if Do_Reset then
Reset (Points (J).Periph.all);
end if;
end loop;
end Reset;
------------------------------
-- GPIO_Port_Representation --
------------------------------
function GPIO_Port_Representation (Port : GPIO_Port) return UInt4 is
begin
-- TODO: rather ugly to have this board-specific range here
if Port'Address = S_NS_Periph (GPIOA_Base) then
return 0;
elsif Port'Address = S_NS_Periph (GPIOB_Base) then
return 1;
elsif Port'Address = S_NS_Periph (GPIOC_Base) then
return 2;
elsif Port'Address = S_NS_Periph (GPIOD_Base) then
return 3;
elsif Port'Address = S_NS_Periph (GPIOE_Base) then
return 4;
else
raise Program_Error;
end if;
end GPIO_Port_Representation;
----------------
-- As_Port_Id --
----------------
function As_Port_Id (Port : I2C_Port) return I2C_Port_Id is
begin
if Port.Periph.all'Address = S_NS_Periph (I2C1_Base) then
return I2C_Id_1;
elsif Port.Periph.all'Address = S_NS_Periph (I2C2_Base) then
return I2C_Id_2;
elsif Port.Periph.all'Address = S_NS_Periph (I2C3_Base) then
return I2C_Id_3;
else
raise Unknown_Device;
end if;
end As_Port_Id;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (This : I2C_Port) is
begin
Enable_Clock (As_Port_Id (This));
end Enable_Clock;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (This : I2C_Port_Id) is
begin
case This is
when I2C_Id_1 =>
RCC_Periph.APB1ENR1.I2C1EN := True;
when I2C_Id_2 =>
RCC_Periph.APB1ENR1.I2C2EN := True;
when I2C_Id_3 =>
RCC_Periph.APB1ENR1.I2C3EN := True;
end case;
end Enable_Clock;
-----------
-- Reset --
-----------
procedure Reset (This : I2C_Port) is
begin
Reset (As_Port_Id (This));
end Reset;
-----------
-- Reset --
-----------
procedure Reset (This : I2C_Port_Id) is
begin
case This is
when I2C_Id_1 =>
RCC_Periph.APB1RSTR1.I2C1RST := True;
RCC_Periph.APB1RSTR1.I2C1RST := False;
when I2C_Id_2 =>
RCC_Periph.APB1RSTR1.I2C2RST := True;
RCC_Periph.APB1RSTR1.I2C2RST := False;
when I2C_Id_3 =>
RCC_Periph.APB1RSTR1.I2C3RST := True;
RCC_Periph.APB1RSTR1.I2C3RST := False;
end case;
end Reset;
------------------
-- Enable_Clock --
------------------
procedure Enable_Clock (This : SPI_Port) is
begin
if This.Periph.all'Address = S_NS_Periph (SPI1_Base) then
RCC.APB2ENR.SPI1EN := True;
elsif This.Periph.all'Address = S_NS_Periph (SPI2_Base) then
RCC.APB1ENR1.SPI2EN := True;
elsif This.Periph.all'Address = S_NS_Periph (SPI3_Base) then
RCC.APB1ENR1.SPI3EN := True;
else
raise Unknown_Device;
end if;
end Enable_Clock;
-----------
-- Reset --
-----------
procedure Reset (This : in out SPI_Port) is
begin
if This.Periph.all'Address = S_NS_Periph (SPI1_Base) then
RCC.APB2RSTR.SPI1RST := True;
RCC.APB2RSTR.SPI1RST := False;
elsif This.Periph.all'Address = S_NS_Periph (SPI2_Base) then
RCC.APB1RSTR1.SPI2RST := True;
RCC.APB1RSTR1.SPI2RST := False;
elsif This.Periph.all'Address = S_NS_Periph (SPI3_Base) then
RCC.APB1RSTR1.SPI3RST := True;
RCC.APB1RSTR1.SPI3RST := False;
else
raise Unknown_Device;
end if;
end Reset;
function S_NS_Periph (Addr : System.Address) return System.Address
is
X : UInt32;
LAddr : System.Address;
for X'Address use LAddr'Address;
begin
LAddr := Addr;
if Secure_Code > 0 then
X := X + 16#1000_0000#;
end if;
return LAddr;
end S_NS_Periph;
end STM32.Device;
|
-- Copyright (C) 2008-2011 Maciej Sobczak
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
package SOCI.PostgreSQL is
--
-- Registers the PostgreSQL backend so that it is ready for use
-- by the dynamic backend loader.
--
procedure Register_Factory_PostgreSQL;
pragma Import (C, Register_Factory_PostgreSQL,
"register_factory_postgresql");
end SOCI.PostgreSQL;
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 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. --
-- --
------------------------------------------------------------------------------
with Ada.Unchecked_Conversion;
with Registers; use Registers;
with STM32F4.GPIO; use STM32F4.GPIO;
package body LEDs is
function As_Word is new Ada.Unchecked_Conversion
(Source => User_LED, Target => Word);
procedure On (This : User_LED) is
begin
GPIOD.BSRR := As_Word (This);
end On;
procedure Off (This : User_LED) is
begin
GPIOD.BSRR := Shift_Left (As_Word (This), 16);
end Off;
All_LEDs_On : constant Word := Green'Enum_Rep or Red'Enum_Rep or
Blue'Enum_Rep or Orange'Enum_Rep;
pragma Compile_Time_Error
(All_LEDs_On /= 16#F000#,
"Invalid representation for All_LEDs_On");
All_LEDs_Off : constant Word := Shift_Left (All_LEDs_On, 16);
procedure All_Off is
begin
GPIOD.BSRR := All_LEDs_Off;
end All_Off;
procedure All_On is
begin
GPIOD.BSRR := All_LEDs_On;
end All_On;
procedure Initialize is
RCC_AHB1ENR_GPIOD : constant Word := 16#08#;
begin
-- Enable clock for GPIO-D
RCC.AHB1ENR := RCC.AHB1ENR or RCC_AHB1ENR_GPIOD;
-- Configure PD12-15
GPIOD.MODER (12 .. 15) := (others => Mode_OUT);
GPIOD.OTYPER (12 .. 15) := (others => Type_PP);
GPIOD.OSPEEDR (12 .. 15) := (others => Speed_100MHz);
GPIOD.PUPDR (12 .. 15) := (others => No_Pull);
end Initialize;
begin
Initialize;
end LEDs;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . S E C U R E _ H A S H E S . M D 5 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-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. --
-- --
------------------------------------------------------------------------------
-- This package provides supporting code for implementation of the MD5
-- Message-Digest Algorithm as described in RFC 1321. The complete text of
-- RFC 1321 can be found at:
-- http://www.ietf.org/rfc/rfc1321.txt
-- This is an internal unit and should not be used directly in applications.
-- Use GNAT.MD5 instead.
with GNAT.Byte_Swapping;
with Interfaces;
package GNAT.Secure_Hashes.MD5 is
package Hash_State is
new GNAT.Secure_Hashes.Hash_Function_State
(Word => Interfaces.Unsigned_32,
Swap => GNAT.Byte_Swapping.Swap4,
Hash_Bit_Order => System.Low_Order_First);
-- MD5 operates on 32-bit little endian words
Block_Words : constant := 16;
-- Messages are processed in chunks of 16 words
procedure Transform
(H : in out Hash_State.State;
M : in out Message_State);
-- Transformation function applied for each block
Initial_State : constant Hash_State.State;
-- Initialization vector
private
Initial_A : constant := 16#67452301#;
Initial_B : constant := 16#EFCDAB89#;
Initial_C : constant := 16#98BADCFE#;
Initial_D : constant := 16#10325476#;
Initial_State : constant Hash_State.State :=
(Initial_A, Initial_B, Initial_C, Initial_D);
-- Initialization vector from RFC 1321
end GNAT.Secure_Hashes.MD5;
|
-------------------------------------------------------------------------------
-- package Disorderly.Basic_Rand.Deviates, Floating point random deviates.
-- 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.Basic_Rand.Deviates
--
-- Generates floating point streams of Random deviates (variates) from
-- the following distributions:
--
-- Uniform, Normal (Gaussian), Exponential, Lorentzian (Cauchy),
-- Poissonian, Binomial, Negative Binomial, Weibull, Rayleigh,
-- Student_t, Beta, Gamma, Chi_Squared, Log_Normal, Multivariate_Normal
--
-- The more complicated deviates are accompanied by routines that
-- calculate their respective probability densities. The test routine,
-- (basic_deviates_demo_1), verifies that the random variables are
-- drawn from these probability distributions, as advertized.
--
-- So basic_deviates_demo_1.adb is a useful demonstration of the
-- random variable generators in this package, as well as the exact
-- distributions they are drawn from.
--
-- The package is pure.
--
-- Most routines would grind to a halt if they had to recalculate
-- certain quantities each call. So these quantities are calculated
-- on the first call, and then placed into a record that's passed
-- as in/out parameter to keep the package pure.
--
-- Uses 53 bits of the 61-bit generator Disorderly.Basic_Rand.
--
-- For most of the routines, the time_per_call is not constant. Most
-- routines call the random number generator an unpredictable number
-- of times each time the routine is called.
--
-- Wikipedia gives extended descriptions of each distribution. The
-- probability density functions generated by the functions declared
-- below are taken directly from the Wikipedia articles on the same,
-- to ensure that the Wikipedia discussions are exactly relevant.
--
-- Uses the integer valued Disorderly.Basic_Rand in the parent package to
-- create a floating point generator (Uniform).
-- Is generic in the floating point type (as long as its 15 digits!).
--
-- Like the other routines in this collection, Deviates is designed
-- to exploit the newer 64-bit CPU's. All of the routines use
-- 15 digit floats, which means 53 bit mantissas in practice.
-- Poisson should be thought of as single precision though.
--
-- References:
--
-- Chandrasekaran and Sheppard,
-- Journal of Pascal, Ada, and Modula2, Vol 5, Num 4, (1986).
--
-- Kemp, C.D. (1986). 'A modal method for generating binomial
-- variables', Commun. Statist. - Theor. Meth. 15(3), 805-813.
--
-- see also Fortran 77 code from the book:
-- Dagpunar, J. 'Principles of random variate generation'
-- Clarendon Press, Oxford, 1988. ISBN 0-19-852202-9
--
-- Many thanks are due to Allan Miller - most routines are based on
-- his Fortran 90 versions of the Dagpunar code.
--
-- Notes on the Distributions:
--
-- The functions approximate in a statistical manner certain continuous
-- probability distributions or densities (except Poisson and the Binomials,
-- which are integer valued here, not continuous). More precisely, if
-- you ran the program a long time, added up the number of points output
-- in each interval (X,X+dX), and plotted the resulting histogram,
-- you would get a function f(X), where f(X) is given as follows.
-- The functions are given in Normalized form.
--
-- The easy ones:
--
-- Random_Real (X, State_Val) samples from a uniform distribution:
-- = 1 for 0.0 <= X < 1.0
-- = 0 otherwise.
--
-- Exponential (Mean) = Exp (-X / Mean) / Mean for X > 0; 0 otherwise.
--
-- Normal (Mean, Sigma) =
-- = Exp (-(X - Mean)**2 / (2*Sigma**2)) / (Sigma*Sqrt(2*Pi))
--
-- Sometimes Normal is called Gaussian if Mean /=0 and Std Dev /= 1.
-- Sometimes Normal is called Std Normal if Mean =0 and Std Dev = 1.
--
-- Poisson (Mean) = Mean**k * Exp (-Mean) / k!
--
-- Output of Poisson is integer valued; Output includes 0.
--
-- The Cauchy probability density has a Lorentzian shape: (a/pi) / (a^2 + X^2).
--
-- The more complicated distribution are described well in their
-- respective Wikipedia articles.
generic
type Real is digits <>;
-- 15 digits required. This is checked.
package Disorderly.Basic_Rand.Deviates is
pragma Pure (Deviates);
procedure Get_Random_Real
(Random_Real : out Real;
Stream : in out State);
--
-- Uniform on [0.0, 1.0).
-- (X starts out on 0..2**53-1; then squeezed onto [0,1) by
-- multiplying X by 2.0**(-53).)
type Normal_Initializer is private;
procedure Get_Normal
(Mean : in Real;
Sigma : in Real;
N_Init : in out Normal_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Normal_Initializer and pass it in.
-- The procedure Get_Normal does everything else for you.
--
-- The Gaussian distribution probability density:
--
-- f(X) = A * Exp (-(X-Mean)**2 / (2*Sigma**2))
--
-- Sigma = Standard_Deviation
-- A = 1.0 / (Sigma*Sqrt(2*Pi)) (normalization constant)
--
-- If Sigma=1, and Mean=0 then its usually called the
-- Standard Normal distribution.
function Normal_Probability
(Mean : in Real; -- Mean of random variable X
Sigma : in Real; -- Std Dev of random variable X
X : in Real)
return Real;
subtype Log_Normal_Initializer is Normal_Initializer;
procedure Get_Log_Normal -- outputs random variable X
(Mean_Z : in Real; -- Mean of random variable Z = Log (X)
Sigma_Z : in Real; -- Std Dev of random variable Z = Log (X)
LN_Init : in out Log_Normal_Initializer;
Stream : in out State;
Result : out Real); -- X
--
-- 1. Must declare variable of type Log_Normal_Initializer and pass it in.
-- The procedure Get_Log_Normal does everything else for you.
--
-- The Log_Normal distribution probability density for X:
--
-- f(X) = A * Exp (-(Log(X) - Mean_Z)**2 / (2*Sigma_Z**2)) / X
--
-- f(X) = 0 (for X <= 0)
--
-- Sigma_Z = Standard_Deviation of Z = Log (X)
-- A = 1.0 / (Sigma_Z * Sqrt (2*Pi))
--
-- If Z is a normally distributed Random Variable with (Mean_Z, Sigma_Z)
-- then X = Exp (Z) is Log_Normal distributed with the distribution given
-- above. In terms of Z's Average and Std Deviation, (Mean_Z, Sigma_Z):
-- Mean_X = Exp (Mean_Z + Sigma_Z**2 / 2)
-- Sigma_X**2 = Mean_X**2 * (Exp (Sigma_Z**2) - 1))
--
-- Suppose you have (Mean_X, Sigma_X) and you want (Mean_Z, Sigma_Z) of
-- Z = Log(X), (the latter is the pair you plug into Get_Log_Normal above).
-- The formula is
-- Sigma_Z**2 = Log (1 + Sigma_X**2 / Mean_X**2))
-- Mean_Z = Log (Mean_X) - 0.5 * Sigma_Z**2
--
function Log_Normal_Probability
(Mean_Z : in Real; -- Mean of random variable Z = Log (X)
Sigma_Z : in Real; -- Std Dev of random variable Z = Log (X)
X : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- The Log_Normal probability density:
--
-- f(X) = A * Exp (-(Log(X) - Mean_Z)**2 / (2*Sigma_Z**2)) / X
--
-- f(X) = 0 (for X <= 0)
--
-- Sigma_Z = Standard_Deviation of Z, (where Z = Log (X)).
-- A = 1.0 / (Sigma_Z * Sqrt (2*Pi))
procedure Get_Cauchy
(A : in Real;
Stream : in out State;
Result : out Real);
--
-- The Cauchy (Lorentzian) distribution probability density:
--
-- f(X) = A / [(A*A + X*X) * Pi] -- normalized and scaled
--
-- Generates random deviates X in range (-inf, inf).
procedure Get_Exponential
(Mean : in Real;
Stream : in out State;
Result : out Real);
--
-- 1. Must have Mean > 0.0.
-- Raises contraint_Error if Mean is <= 0.0.
--
-- The Exponential distribution probability density:
--
-- f(X) = Exp (-X / Mean) / Mean for X > 0; 0 otherwise.
--
-- Generates a random deviate X in [0,inf).
procedure Get_Weibull
(a : in Real;
Stream : in out State;
Result : out Real);
--
-- The Weibull distribution probability density function:
--
-- f(X) = a * X**(a-1) * Exp (-X**a) if X > 0; f(X) = 0 otherwise.
--
-- If a=1 its Get_Exponential with Mean=1. Use Get_Exponential; much faster.
-- If a=2 its Rayleigh distribution. Use Get_Rayleigh; its faster.
-- If a=0, raises contraint_Error.
-- If a is too near 0, (or far from 1 in general) get Nan's or nonsense.
procedure Get_Rayleigh
(Stream : in out State;
Result : out Real);
--
-- The Rayleigh distribution probability density:
--
-- f(X) = 2 * X * Exp (-X**2) if X > 0; f(X) = 0 otherwise.
--
type Binomial_Initializer is private;
procedure Get_Binomial
(n : in Positive;
p : in Real;
B_Init : in out Binomial_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Binomial_Initializer and pass it in.
-- The procedure Get_Binomial does everything else for you.
--
-- 2. Must have: 0 < p < 1. (p = Bernoulli success probability.)
--
-- The Binomial distribution probability density:
--
-- f(X) = (n!/([X]!(n-[X])!)) * p^[X] * (1-p)^(n-[X])
-- if 0 <= X <= n; f(X) = 0 otherwise.
--
-- Result is output as a float, but is always Integer valued.
function Binomial_Probability
(n : in Positive;
k : in Integer;
p : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- Uses Log_Gamma to get:
--
-- [n!/(k!(n-k)!)] * p^k * (1-p)^(n-k)
-- if 0 <= k <= n;
-- returns 0 otherwise.
--
-- k < 0 returns 0
-- k > n returns 0
--
-- p <= 0.0 raises Constraint_Error
-- p >= 1.0 raises Constraint_Error
type Neg_Binomial_Initializer is private;
procedure Get_Neg_Binomial
(r : in Real;
p : in Real;
NB_Init : in out Neg_Binomial_Initializer;
Stream : in out State;
Result : out Real);
--
-- Result is a random deviate from distribution f_r(k) where f_r(k) is
-- the probability of r successes and k failures in n = k+r Bernoulli trials.
-- Assumes that the final trial is a success, and p = success probability.
-- (r is not retricted to integer values; output Result is. Result is k-like.)
--
-- Slow for large r, (r >> 10).
-- Slow for small p, (p < 0.1).
--
-- Must have: r > 0.0
-- r = the number of successes when r integer.
-- The random deviate output (Result) is sampled
-- from a distribution f_r(k) where f_r(k) is the
-- probability that k failures and r successes
-- are observed in a series of uncorrelated Bernoulli trials
-- (with the final trial being a success).
-- Must have: 0 < p < 1
-- p = Bernoulli success probability
--
-- Result is output as a float, but is always Integer valued.
function Neg_Binomial_Probability
(r : in Real;
k : in Integer;
p : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- Uses Log_Gamma to get:
--
-- [Gamma(r + k)/[(Gamma(r)*k!] * p^r * (1-p)^k
--
-- Must have: r > 0.0
-- Must have: 0 < p < 1
-- p = Bernoulli success probability
--
-- Probability of r successes and k failures in n = k+r Bernoulli trials.
-- Assumes that the final trial is a success, and p = success probability.
--
-- If r = 1, the distribution is the probability of success on the (k+1)th
-- trial with k previous failures: geometric distribution, p*(1-p)^k.
-- As r -> inf, keeping the Mean = r*(1-p)/p constant, you get the
-- Poissonian distribution. So its a large p limit, opposite of Binomial.
subtype Poisson_Initializer is Binomial_Initializer;
p_Shift : constant := -20;
-- binomial is used to get Poisson, by setting p~2**(-20) and p*Mean = n.
-- p is the binomial (Bernoulli) success probability: p = 2.0**p_Shift.
-- p = -20 is stnd. If p=-20, then Max allowed Mean is < 2048, and you can
-- sample for 2 days at least without detecting difference between Poisson
-- and binomial. If you set p=-23, then you can sample for 2 wks without
-- problem, but then the maximum allowed Mean is < 256.
procedure Get_Poisson
(Mean : in Real;
P_Init : in out Poisson_Initializer;
Stream : in out State;
Result : out Real);
--
-- The Poisson distribution probability mass function:
--
-- f(k) = Mean^k * Exp (-Mean) / k!
--
-- Output of Poisson is integer valued, but floating point type.
-- Output includes 0.
--
-- Must have Mean > 0
-- Must have Mean < 2047.0 (if p_Shift = -20; ie p = 2**(-20))
-- Must have Mean < 256.0 (if p_Shift = -23; ie p = 2**(-23))
--
-- If mean > 8 then routine uses Binomial with p = 2**(-20) (with large
-- n so that Mean=n*p). The binomial distribution agrees with Poisson
-- with err ~ 5.0e-7 here. This discrepency is hard to
-- measure, but the routine should be thought of as single-precision.
-- This discrepency can be reduced by a factor of 8 by reducing p
-- by a factor of 8, (but max allowed Mean falls by a factor of 8).
function Poisson_Probability
(Mean : in Real;
k : in Integer)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- The Poisson distribution (probability mass function):
--
-- f(k) = Mean^k * Exp (-Mean) / k!
--
-- Negative k input is allowed (for convenience).
-- Output is 0 for k < 0.
type Student_t_Initializer is private;
procedure Get_Student_t
(m : in Positive;
Student_t_Init : in out Student_t_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Student_t_Initializer and pass it in.
-- The procedure Get_Student_t does everything else for you.
--
-- 2. Must have m >= 1. (m = degrees of freedom of distribution.)
--
-- The Student_t distribution probability density:
--
-- f(X) = (1 + X*X/m)^(-(m+1)/2) *
-- Gamma((m+1)/2) / [Sqrt (m*Pi) * Gamma(m/2)]
--
-- generates a random deviate from a t distribution
-- using Kinderman and Monahan's ratio method.
function Student_t_Probability
(m : in Positive;
x : in Real)
return Real;
--
-- A Probability density function.
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- Uses Log_Gamma to get:
--
-- f(X) = Gamma((m+1)/2) * (1 + X*X/m)^(-(m+1)/2) / [Sqrt (m*Pi) * Gamma(m/2)]
type Beta_Initializer is private;
procedure Get_Beta
(aa : in Real;
bb : in Real;
Beta_Init : in out Beta_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Beta_Initializer and pass it in.
-- The procedure Get_Beta does everything else for you.
--
-- 2. Must have aa > 0, bb > 0.
--
-- Get_Beta generates a random deviate in [0,1] from a beta distribution.
-- Uses Cheng's log logistic method.
--
-- The Beta distribution probability density:
--
-- f(X) = X**(aa-1) * (1-X)**(bb-1) *
-- Gamma (aa + bb) / (Gamma (bb)*Gamma (aa))
--
function Beta_Probability
(aa, bb : in Real;
x : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- f(x) = x**(aa-1) * (1-x)**(bb-1) *
-- Gamma (aa + bb) / (Gamma (bb)*Gamma (aa))
--
-- x must be in range (0, 1)
type Gamma_Initializer is private;
procedure Get_Gamma
(s : in Real;
Gamma_Init : in out Gamma_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Gamma_Initializer and pass it in.
-- The procedure Get_Gamma does everything else for you.
--
-- 2. Must have s > 0.
-- s = Shape parameter of Gamma distribution.
--
-- Generates a random deviate in [0,infinity) from a gamma distribution.
function Gamma_Probability
(s : in Real;
x : in Real)
return Real;
--
-- f(x) = x**(s-1) * Exp (-x) / Gamma (s)
-- = 0 if x < 0.
--
-- (where s = Gamma shape parameter).
-- Must have s > 0.
-- NOT a random deviate. (Used for testing mostly.)
subtype Chi_Initializer is Gamma_Initializer;
procedure Get_Chi_Squared
(Degrees_of_Freedom : in Real;
Chi_Init : in out Chi_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Chi_Initializer and pass it in.
-- The procedure Get_Chi_Squared does everything else for you.
--
-- 2. Must have Degrees_of_Freedom > 0.
--
-- Generates a random deviate in [0,infinity) from a Chi-Sq distribution.
function Chi_Squared_Probability
(Degrees_of_Freedom : in Real;
x : in Real)
return Real;
--
-- f(x) = (1 / 2) * (x / 2)**(s-1) * Exp (-x / 2) / Gamma (s)
-- = 0 if x < 0.
--
-- (where s = 0.5 * Degrees_of_Freedom).
-- NOT a random deviate. (Used for testing mostly.)
-- USING Get_Multivariate_Normal:
--
-- procedure Get_Multivariate_Normal is harder to use than the 1-dimensional
-- routines. You have to remember the following:
-- 1. You need a positive definite Covariance matrix.
-- 2. Declare it type Matrix (a..b, a..b) where a and b are type Positive.
-- 3. Declare Means : Vector(a..b), same range as Matrix, and initialize Means.
-- 4. Use procedure Choleski_Decompose to get the LU decomp. of Covariance.
subtype MV_Normal_Initializer is Normal_Initializer;
type Vector is array (Positive range <>) of Real;
type Matrix is array (Positive range <>, Positive range <>) of Real;
procedure Choleski_Decompose
(Covariance : in Matrix;
LU_of_Covariance : out Matrix); -- Choleski Decomp of Covariance matrix.
procedure Get_Multivariate_Normal
(Mean : in Vector;
LU_of_Covariance : in Matrix;
MV_Init : in out MV_Normal_Initializer;
Stream : in out State;
Result : out Vector);
--
-- To use Get_Multivariate_Normal:
-- put a Positive Definite Covariance matrix into
-- Choleski_Decompose to get Sqrt_Covariance.
--
-- Must have
-- Mean'First = Covariance'First(1) = Covariance'First(2)
-- Mean'Last = Covariance'Last(1) = Covariance'Last(2)
-- Mean'Length > 1
-- So use:
-- Mean : Vector (1..n);
-- Covariance : Matrix (1..n, 1..n);
--
-- Must initialize: Mean.
function Multivariate_Normal_Probability
(Mean : in Vector; -- Mean of random variables X
LU_of_Covariance : in Matrix; -- L of LU decomp of Covariance matrix
X : in Vector)
return Real;
procedure Test_Choleski;
private
Half : constant Real := +0.5;
Zero : constant Real := +0.0;
One : constant Real := +1.0;
Two : constant Real := +2.0;
Three : constant Real := +3.0;
Four : constant Real := +4.0;
Five : constant Real := +5.0;
Eight : constant Real := +8.0;
Sixteen : constant Real := +16.0;
Quarter : constant Real := +0.25;
Two_to_the_Ninth : constant Real := +512.0;
type Binomial_Initializer is
record
n : Positive := Positive'First;
r0 : Integer := 0;
p : Real := Half;
p_r : Real := Zero;
odds_ratio : Real := Zero;
Uninitialized : Boolean := True;
end record;
type Student_t_Initializer is
record
m : Positive := Positive'First;
a, f, g : Real := Zero;
Uninitialized : Boolean := True;
end record;
type Beta_Initializer is
record
Alpha, Beta : Real := Zero;
d, f, h, t, c : Real := Zero;
Swap : Boolean := False;
Uninitialized : Boolean := True;
end record;
type Gamma_Initializer is
record
s, p, c, uf, vr, d : Real := Zero;
Uninitialized : Boolean := True;
end record;
type Neg_Binomial_Initializer is
record
Reciprocal_Log_p1 : Real := Zero;
Reciprocal_Log_q1 : Real := Zero;
p : Real := Half;
Uninitialized : Boolean := True;
end record;
type Normal_Initializer is
record
Mean : Real := Zero;
Sigma : Real := Zero;
X2 : Real := Zero;
Uninitialized : Boolean := True;
end record;
Max_Allowed_Real : constant Real := Two**(Real'Machine_Emax-32);
Min_Allowed_Real : constant Real := Two**(Real'Machine_Emin+32);
end Disorderly.Basic_Rand.Deviates;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . M A C H I N E _ C O D E --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides machine code support, both for intrinsic machine
-- operations, and also for machine code statements. See GNAT documentation
-- for full details.
package System.Machine_Code is
pragma No_Elaboration_Code_All;
pragma Pure;
-- All identifiers in this unit are implementation defined
pragma Implementation_Defined;
type Asm_Input_Operand is private;
type Asm_Output_Operand is private;
-- These types are never used directly, they are declared only so that
-- the calls to Asm are type correct according to Ada semantic rules.
No_Input_Operands : constant Asm_Input_Operand;
No_Output_Operands : constant Asm_Output_Operand;
type Asm_Input_Operand_List is
array (Integer range <>) of Asm_Input_Operand;
type Asm_Output_Operand_List is
array (Integer range <>) of Asm_Output_Operand;
type Asm_Insn is private;
-- This type is not used directly. It is declared only so that the
-- aggregates used in code statements are type correct by Ada rules.
procedure Asm (
Template : String;
Outputs : Asm_Output_Operand_List;
Inputs : Asm_Input_Operand_List;
Clobber : String := "";
Volatile : Boolean := False);
procedure Asm (
Template : String;
Outputs : Asm_Output_Operand := No_Output_Operands;
Inputs : Asm_Input_Operand_List;
Clobber : String := "";
Volatile : Boolean := False);
procedure Asm (
Template : String;
Outputs : Asm_Output_Operand_List;
Inputs : Asm_Input_Operand := No_Input_Operands;
Clobber : String := "";
Volatile : Boolean := False);
procedure Asm (
Template : String;
Outputs : Asm_Output_Operand := No_Output_Operands;
Inputs : Asm_Input_Operand := No_Input_Operands;
Clobber : String := "";
Volatile : Boolean := False);
function Asm (
Template : String;
Outputs : Asm_Output_Operand_List;
Inputs : Asm_Input_Operand_List;
Clobber : String := "";
Volatile : Boolean := False) return Asm_Insn;
function Asm (
Template : String;
Outputs : Asm_Output_Operand := No_Output_Operands;
Inputs : Asm_Input_Operand_List;
Clobber : String := "";
Volatile : Boolean := False) return Asm_Insn;
function Asm (
Template : String;
Outputs : Asm_Output_Operand_List;
Inputs : Asm_Input_Operand := No_Input_Operands;
Clobber : String := "";
Volatile : Boolean := False) return Asm_Insn;
function Asm (
Template : String;
Outputs : Asm_Output_Operand := No_Output_Operands;
Inputs : Asm_Input_Operand := No_Input_Operands;
Clobber : String := "";
Volatile : Boolean := False) return Asm_Insn;
pragma Import (Intrinsic, Asm);
private
type Asm_Input_Operand is new Integer;
type Asm_Output_Operand is new Integer;
type Asm_Insn is new Integer;
-- All three of these types are dummy types, to meet the requirements of
-- type consistency. No values of these types are ever referenced.
No_Input_Operands : constant Asm_Input_Operand := 0;
No_Output_Operands : constant Asm_Output_Operand := 0;
end System.Machine_Code;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with swig;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_glx_get_tex_gendv_reply_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
length : aliased Interfaces.Unsigned_32;
pad1 : aliased swig.int8_t_Array (0 .. 3);
n : aliased Interfaces.Unsigned_32;
datum : aliased xcb.xcb_glx_float64_t;
pad2 : aliased swig.int8_t_Array (0 .. 7);
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_tex_gendv_reply_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_tex_gendv_reply_t.Item,
Element_Array => xcb.xcb_glx_get_tex_gendv_reply_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_get_tex_gendv_reply_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_tex_gendv_reply_t.Pointer,
Element_Array => xcb.xcb_glx_get_tex_gendv_reply_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_get_tex_gendv_reply_t;
|
<?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>Block_ZN2xf2cv3MatILi9ELi2160ELi3840ELi1ELi2EEC2Eii_exit1_proc</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>16</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>rows</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>32</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>cols</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>129</coreId>
</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="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>imgInput_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>160</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="8" tracking_level="0" version="0">
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second class_id="9" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first class_id="11" tracking_level="0" version="0">
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>160</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgInput.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>imgInput_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>160</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>160</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgInput.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>rgb2hsv_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>161</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>161</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>rgb2hsv.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>177</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>rgb2hsv_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>161</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>161</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>rgb2hsv.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>imgHelper1_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>163</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>163</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper1.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>3039962777</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>imgHelper1_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>163</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>163</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper1.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>imgHelper2_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>164</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>164</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper2.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>52</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_10">
<Value>
<Obj>
<type>1</type>
<id>10</id>
<name>imgHelper2_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>164</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>164</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper2.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>3040496640</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_11">
<Value>
<Obj>
<type>1</type>
<id>11</id>
<name>imgHelper3_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>165</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>165</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper3.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>3040493776</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_12">
<Value>
<Obj>
<type>1</type>
<id>12</id>
<name>imgHelper3_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>165</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>165</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper3.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_13">
<Value>
<Obj>
<type>1</type>
<id>13</id>
<name>imgHelper4_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>166</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>166</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper4.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>3040709856</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_14">
<Value>
<Obj>
<type>1</type>
<id>14</id>
<name>imgHelper4_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>166</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>166</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgHelper4.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>3040714904</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_15">
<Value>
<Obj>
<type>1</type>
<id>15</id>
<name>imgOutput_rows_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>167</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>167</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgOutput.rows</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>32</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>
<item class_id_reference="3" object_id="_16">
<Value>
<Obj>
<type>1</type>
<id>16</id>
<name>imgOutput_cols_out</name>
<fileName>src/xf_colordetect_accel_stream.cpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>167</lineNumber>
<contextFuncName>colordetect_accel</contextFuncName>
<contextNormFuncName>colordetect_accel</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>src/xf_colordetect_accel_stream.cpp</first>
<second>colordetect_accel</second>
</first>
<second>167</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>imgOutput.cols</originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>32</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="12" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="1" version="0" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>cols_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>50</item>
<item>51</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="13" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>rows_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>52</item>
<item>53</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="13" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>imgInput_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>4034666248</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>55</item>
<item>56</item>
<item>57</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.40</m_delay>
<m_topoIndex>3</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>imgInput_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>58</item>
<item>59</item>
<item>60</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.40</m_delay>
<m_topoIndex>4</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>rgb2hsv_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>4228300630</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>61</item>
<item>62</item>
<item>63</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.40</m_delay>
<m_topoIndex>5</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>rgb2hsv_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>4294967295</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>64</item>
<item>65</item>
<item>66</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.40</m_delay>
<m_topoIndex>6</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>imgHelper1_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>67</item>
<item>68</item>
<item>69</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.36</m_delay>
<m_topoIndex>7</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>imgHelper1_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>70</item>
<item>71</item>
<item>72</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.36</m_delay>
<m_topoIndex>8</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>imgHelper2_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>913</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>73</item>
<item>74</item>
<item>75</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.32</m_delay>
<m_topoIndex>9</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>imgHelper2_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</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>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.32</m_delay>
<m_topoIndex>10</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>imgHelper3_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>79</item>
<item>80</item>
<item>81</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.28</m_delay>
<m_topoIndex>11</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>imgHelper3_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>82</item>
<item>83</item>
<item>84</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.28</m_delay>
<m_topoIndex>12</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>imgHelper4_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>913</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>85</item>
<item>86</item>
<item>87</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.24</m_delay>
<m_topoIndex>13</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>imgHelper4_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>88</item>
<item>89</item>
<item>90</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.24</m_delay>
<m_topoIndex>14</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>imgOutput_rows_out_write_ln614</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>614</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>614</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>0</coreId>
</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>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.26</m_delay>
<m_topoIndex>15</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>imgOutput_cols_out_write_ln615</name>
<fileName>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</fileName>
<fileDirectory>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</fileDirectory>
<lineNumber>615</lineNumber>
<contextFuncName>init</contextFuncName>
<contextNormFuncName>init</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/willychiang/Desktop/PYNQ-HelloWorld/boards/ip/vitis_lib/vision/L1/include/common/xf_structs.hpp</first>
<second>init</second>
</first>
<second>615</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>49</coreId>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>94</item>
<item>95</item>
<item>96</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>3.26</m_delay>
<m_topoIndex>16</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="13" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>_ln0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>132</coreId>
</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>17</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</consts>
<blocks class_id="16" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="17" tracking_level="1" version="0" object_id="_34">
<Obj>
<type>3</type>
<id>48</id>
<name>Block__ZN2xf2cv3MatILi9ELi2160ELi3840ELi1ELi2EEC2Eii.exit1_proc</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<contextNormFuncName></contextNormFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<control></control>
<opType></opType>
<implIndex></implIndex>
<coreName></coreName>
<coreId>1768189039</coreId>
</Obj>
<node_objs>
<count>17</count>
<item_version>0</item_version>
<item>17</item>
<item>18</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>
</node_objs>
</item>
</blocks>
<edges class_id="18" tracking_level="0" version="0">
<count>30</count>
<item_version>0</item_version>
<item class_id="19" tracking_level="1" version="0" object_id="_35">
<id>51</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>17</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_36">
<id>53</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_37">
<id>56</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_38">
<id>57</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_39">
<id>59</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="19" object_id="_40">
<id>60</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_41">
<id>62</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_42">
<id>63</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>35</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_43">
<id>65</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_44">
<id>66</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>36</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_45">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_46">
<id>69</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_47">
<id>71</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_48">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_49">
<id>74</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_50">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_51">
<id>77</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_52">
<id>78</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_53">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_54">
<id>81</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_55">
<id>83</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_56">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_57">
<id>86</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_58">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_59">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_60">
<id>90</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_61">
<id>92</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_62">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_63">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="19" object_id="_64">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="20" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="21" tracking_level="1" version="0" object_id="_65">
<mId>1</mId>
<mTag>Block__ZN2xf2cv3MatILi9ELi2160ELi3840ELi1ELi2EEC2Eii.exit1_proc</mTag>
<mNormTag>Block_ZN2xf2cv3MatILi9ELi2160ELi3840ELi1ELi2EEC2Eii_exit1_proc</mNormTag>
<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>48</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="25" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="0" version="0">
<first>17</first>
<second class_id="27" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</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>42</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="28" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="29" tracking_level="0" version="0">
<first>48</first>
<second class_id="30" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="31" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="32" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="33" 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="34" 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="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core>
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
--------------------------------------------------------------------------------
-- --
-- B B . I D E A L --
-- Ball on Beam Simulator - Ideal interface --
-- --
-- Spec --
-- --
-- Ideal interface to the Ball on Beam system. --
-- --
-- Author: Jorge Real --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: you can use it freely, --
-- provided you preserve this comment at the header of source files and --
-- you clearly indicate the changes made to the original file, if any. --
-- --
--------------------------------------------------------------------------------
package BB.Ideal is
procedure Set_Beam_Angle (Inclination : Angle);
-- Set the beam inclination angle, in degrees.
function Ball_Position return Position;
-- Returns the simulated ball position, in mm.
end BB.Ideal;
|
with Ahven.Framework;
package math_Tests.linear_Algebra_2d
is
type Test is new Ahven.Framework.Test_Case with null record;
overriding
procedure Initialize (T : in out Test);
end math_Tests.linear_Algebra_2d;
|
-- Copyright 2017-2021 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
local url = require("url")
name = "Yahoo"
type = "scrape"
function start()
setratelimit(1)
end
function vertical(ctx, domain)
for i=1,201,10 do
local ok = scrape(ctx, {['url']=buildurl(domain, i)})
if not ok then
break
end
end
end
function buildurl(domain, pagenum)
local query = "site:" .. domain .. " -domain:www." .. domain
local params = {
p=query,
b=pagenum,
pz="10",
bct="0",
xargs="0",
}
return "https://search.yahoo.com/search?" .. url.build_query_string(params)
end
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . A W K --
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2019, 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. --
-- --
------------------------------------------------------------------------------
-- This is an AWK-like unit. It provides an easy interface for parsing one
-- or more files containing formatted data. The file can be viewed seen as
-- a database where each record is a line and a field is a data element in
-- this line. In this implementation an AWK record is a line. This means
-- that a record cannot span multiple lines. The operating procedure is to
-- read files line by line, with each line being presented to the user of
-- the package. The interface provides services to access specific fields
-- in the line. Thus it is possible to control actions taken on a line based
-- on values of some fields. This can be achieved directly or by registering
-- callbacks triggered on programmed conditions.
--
-- The state of an AWK run is recorded in an object of type session.
-- The following is the procedure for using a session to control an
-- AWK run:
--
-- 1) Specify which session is to be used. It is possible to use the
-- default session or to create a new one by declaring an object of
-- type Session_Type. For example:
--
-- Computers : Session_Type;
--
-- 2) Specify how to cut a line into fields. There are two modes: using
-- character fields separators or column width. This is done by using
-- Set_Fields_Separators or Set_Fields_Width. For example by:
--
-- AWK.Set_Field_Separators (";,", Computers);
--
-- or by using iterators' Separators parameter.
--
-- 3) Specify which files to parse. This is done with Add_File/Add_Files
-- services, or by using the iterators' Filename parameter. For
-- example:
--
-- AWK.Add_File ("myfile.db", Computers);
--
-- 4) Run the AWK session using one of the provided iterators.
--
-- Parse
-- This is the most automated iterator. You can gain control on
-- the session only by registering one or more callbacks (see
-- Register).
--
-- Get_Line/End_Of_Data
-- This is a manual iterator to be used with a loop. You have
-- complete control on the session. You can use callbacks but
-- this is not required.
--
-- For_Every_Line
-- This provides a mixture of manual/automated iterator action.
--
-- Examples of these three approaches appear below
--
-- There are many ways to use this package. The following discussion shows
-- three approaches to using this package, using the three iterator forms.
-- All examples will use the following file (computer.db):
--
-- Pluton;Windows-NT;Pentium III
-- Mars;Linux;Pentium Pro
-- Venus;Solaris;Sparc
-- Saturn;OS/2;i486
-- Jupiter;MacOS;PPC
--
-- 1) Using Parse iterator
--
-- Here the first step is to register some action associated to a pattern
-- and then to call the Parse iterator (this is the simplest way to use
-- this unit). The default session is used here. For example to output the
-- second field (the OS) of computer "Saturn".
--
-- procedure Action is
-- begin
-- Put_Line (AWK.Field (2));
-- end Action;
--
-- begin
-- AWK.Register (1, "Saturn", Action'Access);
-- AWK.Parse (";", "computer.db");
--
--
-- 2) Using the Get_Line/End_Of_Data iterator
--
-- Here you have full control. For example to do the same as
-- above but using a specific session, you could write:
--
-- Computer_File : Session_Type;
--
-- begin
-- AWK.Set_Current (Computer_File);
-- AWK.Open (Separators => ";",
-- Filename => "computer.db");
--
-- -- Display Saturn OS
--
-- while not AWK.End_Of_File loop
-- AWK.Get_Line;
--
-- if AWK.Field (1) = "Saturn" then
-- Put_Line (AWK.Field (2));
-- end if;
-- end loop;
--
-- AWK.Close (Computer_File);
--
--
-- 3) Using For_Every_Line iterator
--
-- In this case you use a provided iterator and you pass the procedure
-- that must be called for each record. You could code the previous
-- example could be coded as follows (using the iterator quick interface
-- but without using the current session):
--
-- Computer_File : Session_Type;
--
-- procedure Action (Quit : in out Boolean) is
-- begin
-- if AWK.Field (1, Computer_File) = "Saturn" then
-- Put_Line (AWK.Field (2, Computer_File));
-- end if;
-- end Action;
--
-- procedure Look_For_Saturn is
-- new AWK.For_Every_Line (Action);
--
-- begin
-- Look_For_Saturn (Separators => ";",
-- Filename => "computer.db",
-- Session => Computer_File);
--
-- Integer_Text_IO.Put
-- (Integer (AWK.NR (Session => Computer_File)));
-- Put_Line (" line(s) have been processed.");
--
-- You can also use a regular expression for the pattern. Let us output
-- the computer name for all computer for which the OS has a character
-- O in its name.
--
-- Regexp : String := ".*O.*";
--
-- Matcher : Regpat.Pattern_Matcher := Regpat.Compile (Regexp);
--
-- procedure Action is
-- begin
-- Text_IO.Put_Line (AWK.Field (2));
-- end Action;
--
-- begin
-- AWK.Register (2, Matcher, Action'Unrestricted_Access);
-- AWK.Parse (";", "computer.db");
--
with Ada.Finalization;
with GNAT.Regpat;
package GNAT.AWK is
Session_Error : exception;
-- Raised when a Session is reused but is not closed
File_Error : exception;
-- Raised when there is a file problem (see below)
End_Error : exception;
-- Raised when an attempt is made to read beyond the end of the last
-- file of a session.
Field_Error : exception;
-- Raised when accessing a field value which does not exist
Data_Error : exception;
-- Raised when it is impossible to convert a field value to a specific type
type Count is new Natural;
type Widths_Set is array (Positive range <>) of Positive;
-- Used to store a set of columns widths
Default_Separators : constant String := " " & ASCII.HT;
Use_Current : constant String := "";
-- Value used when no separator or filename is specified in iterators
type Session_Type is limited private;
-- This is the main exported type. A session is used to keep the state of
-- a full AWK run. The state comprises a list of files, the current file,
-- the number of line processed, the current line, the number of fields in
-- the current line... A default session is provided (see Set_Current,
-- Current_Session and Default_Session below).
----------------------------
-- Package initialization --
----------------------------
-- To be thread safe it is not possible to use the default provided
-- session. Each task must used a specific session and specify it
-- explicitly for every services.
procedure Set_Current (Session : Session_Type);
-- Set the session to be used by default. This file will be used when the
-- Session parameter in following services is not specified.
function Current_Session return not null access Session_Type;
-- Returns the session used by default by all services. This is the
-- latest session specified by Set_Current service or the session
-- provided by default with this implementation.
function Default_Session return not null access Session_Type;
-- Returns the default session provided by this package. Note that this is
-- the session return by Current_Session if Set_Current has not been used.
procedure Set_Field_Separators
(Separators : String := Default_Separators;
Session : Session_Type);
procedure Set_Field_Separators
(Separators : String := Default_Separators);
-- Set the field separators. Each character in the string is a field
-- separator. When a line is read it will be split by field using the
-- separators set here. Separators can be changed at any point and in this
-- case the current line is split according to the new separators. In the
-- special case that Separators is a space and a tabulation
-- (Default_Separators), fields are separated by runs of spaces and/or
-- tabs.
procedure Set_FS
(Separators : String := Default_Separators;
Session : Session_Type)
renames Set_Field_Separators;
procedure Set_FS
(Separators : String := Default_Separators)
renames Set_Field_Separators;
-- FS is the AWK abbreviation for above service
procedure Set_Field_Widths
(Field_Widths : Widths_Set;
Session : Session_Type);
procedure Set_Field_Widths
(Field_Widths : Widths_Set);
-- This is another way to split a line by giving the length (in number of
-- characters) of each field in a line. Field widths can be changed at any
-- point and in this case the current line is split according to the new
-- field lengths. A line split with this method must have a length equal or
-- greater to the total of the field widths. All characters remaining on
-- the line after the latest field are added to a new automatically
-- created field.
procedure Add_File
(Filename : String;
Session : Session_Type);
procedure Add_File
(Filename : String);
-- Add Filename to the list of file to be processed. There is no limit on
-- the number of files that can be added. Files are processed in the order
-- they have been added (i.e. the filename list is FIFO). If Filename does
-- not exist or if it is not readable, File_Error is raised.
procedure Add_Files
(Directory : String;
Filenames : String;
Number_Of_Files_Added : out Natural;
Session : Session_Type);
procedure Add_Files
(Directory : String;
Filenames : String;
Number_Of_Files_Added : out Natural);
-- Add all files matching the regular expression Filenames in the specified
-- directory to the list of file to be processed. There is no limit on
-- the number of files that can be added. Each file is processed in
-- the same order they have been added (i.e. the filename list is FIFO).
-- The number of files (possibly 0) added is returned in
-- Number_Of_Files_Added.
-------------------------------------
-- Information about current state --
-------------------------------------
function Number_Of_Fields
(Session : Session_Type) return Count;
function Number_Of_Fields
return Count;
pragma Inline (Number_Of_Fields);
-- Returns the number of fields in the current record. It returns 0 when
-- no file is being processed.
function NF
(Session : Session_Type) return Count
renames Number_Of_Fields;
function NF
return Count
renames Number_Of_Fields;
-- AWK abbreviation for above service
function Number_Of_File_Lines
(Session : Session_Type) return Count;
function Number_Of_File_Lines
return Count;
pragma Inline (Number_Of_File_Lines);
-- Returns the current line number in the processed file. It returns 0 when
-- no file is being processed.
function FNR (Session : Session_Type) return Count
renames Number_Of_File_Lines;
function FNR return Count
renames Number_Of_File_Lines;
-- AWK abbreviation for above service
function Number_Of_Lines
(Session : Session_Type) return Count;
function Number_Of_Lines
return Count;
pragma Inline (Number_Of_Lines);
-- Returns the number of line processed until now. This is equal to number
-- of line in each already processed file plus FNR. It returns 0 when
-- no file is being processed.
function NR (Session : Session_Type) return Count
renames Number_Of_Lines;
function NR return Count
renames Number_Of_Lines;
-- AWK abbreviation for above service
function Number_Of_Files
(Session : Session_Type) return Natural;
function Number_Of_Files
return Natural;
pragma Inline (Number_Of_Files);
-- Returns the number of files associated with Session. This is the total
-- number of files added with Add_File and Add_Files services.
function File (Session : Session_Type) return String;
function File return String;
-- Returns the name of the file being processed. It returns the empty
-- string when no file is being processed.
---------------------
-- Field accessors --
---------------------
function Field
(Rank : Count;
Session : Session_Type) return String;
function Field
(Rank : Count) return String;
-- Returns field number Rank value of the current record. If Rank = 0 it
-- returns the current record (i.e. the line as read in the file). It
-- raises Field_Error if Rank > NF or if Session is not open.
function Field
(Rank : Count;
Session : Session_Type) return Integer;
function Field
(Rank : Count) return Integer;
-- Returns field number Rank value of the current record as an integer. It
-- raises Field_Error if Rank > NF or if Session is not open. It
-- raises Data_Error if the field value cannot be converted to an integer.
function Field
(Rank : Count;
Session : Session_Type) return Float;
function Field
(Rank : Count) return Float;
-- Returns field number Rank value of the current record as a float. It
-- raises Field_Error if Rank > NF or if Session is not open. It
-- raises Data_Error if the field value cannot be converted to a float.
generic
type Discrete is (<>);
function Discrete_Field
(Rank : Count;
Session : Session_Type) return Discrete;
generic
type Discrete is (<>);
function Discrete_Field_Current_Session
(Rank : Count) return Discrete;
-- Returns field number Rank value of the current record as a type
-- Discrete. It raises Field_Error if Rank > NF. It raises Data_Error if
-- the field value cannot be converted to type Discrete.
--------------------
-- Pattern/Action --
--------------------
-- AWK defines rules like "PATTERN { ACTION }". Which means that ACTION
-- will be executed if PATTERN match. A pattern in this implementation can
-- be a simple string (match function is equality), a regular expression,
-- a function returning a boolean. An action is associated to a pattern
-- using the Register services.
--
-- Each procedure Register will add a rule to the set of rules for the
-- session. Rules are examined in the order they have been added.
type Pattern_Callback is access function return Boolean;
-- This is a pattern function pointer. When it returns True the associated
-- action will be called.
type Action_Callback is access procedure;
-- A simple action pointer
type Match_Action_Callback is
access procedure (Matches : GNAT.Regpat.Match_Array);
-- An advanced action pointer used with a regular expression pattern. It
-- returns an array of all the matches. See GNAT.Regpat for further
-- information.
procedure Register
(Field : Count;
Pattern : String;
Action : Action_Callback;
Session : Session_Type);
procedure Register
(Field : Count;
Pattern : String;
Action : Action_Callback);
-- Register an Action associated with a Pattern. The pattern here is a
-- simple string that must match exactly the field number specified.
procedure Register
(Field : Count;
Pattern : GNAT.Regpat.Pattern_Matcher;
Action : Action_Callback;
Session : Session_Type);
procedure Register
(Field : Count;
Pattern : GNAT.Regpat.Pattern_Matcher;
Action : Action_Callback);
-- Register an Action associated with a Pattern. The pattern here is a
-- simple regular expression which must match the field number specified.
procedure Register
(Field : Count;
Pattern : GNAT.Regpat.Pattern_Matcher;
Action : Match_Action_Callback;
Session : Session_Type);
procedure Register
(Field : Count;
Pattern : GNAT.Regpat.Pattern_Matcher;
Action : Match_Action_Callback);
-- Same as above but it pass the set of matches to the action
-- procedure. This is useful to analyze further why and where a regular
-- expression did match.
procedure Register
(Pattern : Pattern_Callback;
Action : Action_Callback;
Session : Session_Type);
procedure Register
(Pattern : Pattern_Callback;
Action : Action_Callback);
-- Register an Action associated with a Pattern. The pattern here is a
-- function that must return a boolean. Action callback will be called if
-- the pattern callback returns True and nothing will happen if it is
-- False. This version is more general, the two other register services
-- trigger an action based on the value of a single field only.
procedure Register
(Action : Action_Callback;
Session : Session_Type);
procedure Register
(Action : Action_Callback);
-- Register an Action that will be called for every line. This is
-- equivalent to a Pattern_Callback function always returning True.
--------------------
-- Parse iterator --
--------------------
procedure Parse
(Separators : String := Use_Current;
Filename : String := Use_Current;
Session : Session_Type);
procedure Parse
(Separators : String := Use_Current;
Filename : String := Use_Current);
-- Launch the iterator, it will read every line in all specified
-- session's files. Registered callbacks are then called if the associated
-- pattern match. It is possible to specify a filename and a set of
-- separators directly. This offer a quick way to parse a single
-- file. These parameters will override those specified by Set_FS and
-- Add_File. The Session will be opened and closed automatically.
-- File_Error is raised if there is no file associated with Session, or if
-- a file associated with Session is not longer readable. It raises
-- Session_Error is Session is already open.
-----------------------------------
-- Get_Line/End_Of_Data Iterator --
-----------------------------------
type Callback_Mode is (None, Only, Pass_Through);
-- These mode are used for Get_Line/End_Of_Data and For_Every_Line
-- iterators. The associated semantic is:
--
-- None
-- callbacks are not active. This is the default mode for
-- Get_Line/End_Of_Data and For_Every_Line iterators.
--
-- Only
-- callbacks are active, if at least one pattern match, the associated
-- action is called and this line will not be passed to the user. In
-- the Get_Line case the next line will be read (if there is some
-- line remaining), in the For_Every_Line case Action will
-- not be called for this line.
--
-- Pass_Through
-- callbacks are active, for patterns which match the associated
-- action is called. Then the line is passed to the user. It means
-- that Action procedure is called in the For_Every_Line case and
-- that Get_Line returns with the current line active.
--
procedure Open
(Separators : String := Use_Current;
Filename : String := Use_Current;
Session : Session_Type);
procedure Open
(Separators : String := Use_Current;
Filename : String := Use_Current);
-- Open the first file and initialize the unit. This must be called once
-- before using Get_Line. It is possible to specify a filename and a set of
-- separators directly. This offer a quick way to parse a single file.
-- These parameters will override those specified by Set_FS and Add_File.
-- File_Error is raised if there is no file associated with Session, or if
-- the first file associated with Session is no longer readable. It raises
-- Session_Error is Session is already open.
procedure Get_Line
(Callbacks : Callback_Mode := None;
Session : Session_Type);
procedure Get_Line
(Callbacks : Callback_Mode := None);
-- Read a line from the current input file. If the file index is at the
-- end of the current input file (i.e. End_Of_File is True) then the
-- following file is opened. If there is no more file to be processed,
-- exception End_Error will be raised. File_Error will be raised if Open
-- has not been called. Next call to Get_Line will return the following
-- line in the file. By default the registered callbacks are not called by
-- Get_Line, this can activated by setting Callbacks (see Callback_Mode
-- description above). File_Error may be raised if a file associated with
-- Session is not readable.
--
-- When Callbacks is not None, it is possible to exhaust all the lines
-- of all the files associated with Session. In this case, File_Error
-- is not raised.
--
-- This procedure can be used from a subprogram called by procedure Parse
-- or by an instantiation of For_Every_Line (see below).
function End_Of_Data
(Session : Session_Type) return Boolean;
function End_Of_Data
return Boolean;
pragma Inline (End_Of_Data);
-- Returns True if there is no more data to be processed in Session. It
-- means that the latest session's file is being processed and that
-- there is no more data to be read in this file (End_Of_File is True).
function End_Of_File
(Session : Session_Type) return Boolean;
function End_Of_File
return Boolean;
pragma Inline (End_Of_File);
-- Returns True when there is no more data to be processed on the current
-- session's file.
procedure Close (Session : Session_Type);
-- Release all associated data with Session. All memory allocated will
-- be freed, the current file will be closed if needed, the callbacks
-- will be unregistered. Close is convenient in reestablishing a session
-- for new use. Get_Line is no longer usable (will raise File_Error)
-- except after a successful call to Open, Parse or an instantiation
-- of For_Every_Line.
-----------------------------
-- For_Every_Line iterator --
-----------------------------
generic
with procedure Action (Quit : in out Boolean);
procedure For_Every_Line
(Separators : String := Use_Current;
Filename : String := Use_Current;
Callbacks : Callback_Mode := None;
Session : Session_Type);
generic
with procedure Action (Quit : in out Boolean);
procedure For_Every_Line_Current_Session
(Separators : String := Use_Current;
Filename : String := Use_Current;
Callbacks : Callback_Mode := None);
-- This is another iterator. Action will be called for each new
-- record. The iterator's termination can be controlled by setting Quit
-- to True. It is by default set to False. It is possible to specify a
-- filename and a set of separators directly. This offer a quick way to
-- parse a single file. These parameters will override those specified by
-- Set_FS and Add_File. By default the registered callbacks are not called
-- by For_Every_Line, this can activated by setting Callbacks (see
-- Callback_Mode description above). The Session will be opened and
-- closed automatically. File_Error is raised if there is no file
-- associated with Session. It raises Session_Error is Session is already
-- open.
private
type Session_Data;
type Session_Data_Access is access Session_Data;
type Session_Type is new Ada.Finalization.Limited_Controlled with record
Data : Session_Data_Access;
Self : not null access Session_Type := Session_Type'Unchecked_Access;
end record;
procedure Initialize (Session : in out Session_Type);
procedure Finalize (Session : in out Session_Type);
end GNAT.AWK;
|
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . C O N T T . S D --
-- --
-- B o d y --
-- --
-- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
-- --
-- ASIS-for-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 --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY 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 ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
with Ada.Exceptions;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with Asis.Errors; use Asis.Errors;
with Asis.Exceptions; use Asis.Exceptions;
with A4G.A_Debug; use A4G.A_Debug;
with A4G.GNAT_Int;
with A4G.A_Output; use A4G.A_Output;
with A4G.Contt.TT; use A4G.Contt.TT;
with A4G.Contt.UT; use A4G.Contt.UT;
with A4G.CU_Info2; use A4G.CU_Info2;
with A4G.Defaults; use A4G.Defaults;
with A4G.Vcheck; use A4G.Vcheck;
with Atree;
with Lib;
with Output; use Output;
with Sinfo; use Sinfo;
package body A4G.Contt.SD is
------------------------------------
-- Local Subprograms (new stuff) --
------------------------------------
-- Do we need some of these local subprograms as the interface
-- subprograms of this package?
-- Is this package the right location for these subprograms?
procedure Scan_Search_Path (C : Context_Id);
-- Scans the tree search path and stores the names of the tree file
-- candidates in the context tree table.
procedure Scan_Tree_List (C : Context_Id);
-- This procedure is supposed to be called for One_tree and N_Trees
-- Context processing modes, therefore the Parameters string associated
-- with C should contain at least one tree name. It scans the list of tree
-- file names which have been extracted from the Parameters string when
-- making the association for C. For each tree file name checks if the
-- file exists and stores existing files in the context tree table. In case
-- if this check fails, raises ASIS_Failed if C was defined as "-C1"
-- ("one tree") context, or generates Asis Warning for "-CN" Context.
-- This procedure does not reset a context.
procedure Read_and_Check_New
(C : Context_Id;
Tree : Tree_Id;
Success : out Boolean);
-- Tries to read in Tree and to check if this tree is compile-only.
-- if both of these attempts are successful, sets Success ON and
-- sets Current_Tree as Tree. If either of these actions fails, then
-- depending on the Context operation mode, either raises ASIS_Failed
-- and forms the Diagnosis string on behalf on Asis.Ada_Environments.Open,
-- or only sets Success OFF, in both cases Current_Context and Current_Tree
-- are set to nil values.
procedure Process_Unit_New (U : Unit_Number_Type);
-- Does the general unit processing in one-pass Context opening. If this
-- unit is "new", it creates the new entry in the unit table and checks,
-- if the unit in the tree is consistent with the unit source (if needed).
-- If U corresponds to a "known" unit, it makes the consistency check.
-- If this procedure raises ASIS_Failed, it forms the Diagnosis string
-- on behalf on Asis.Ada_Environments.Open
-- ????????
procedure Investigate_Unit_New
(C : Context_Id;
U : Unit_Id;
U_N : Unit_Number_Type);
-- Computes the basic unit attributes for U_N and stores them for the
-- ASIS unit U in the ASIS Context C.
procedure Store_Tree (Path : String);
-- Stores the full name of the tree file in the Context Tree table for
-- the current Context. It supposes, that when it is called,
-- Namet.Name_Table contains the name of the tree file to be stored,
-- but without any directory information, and Path contains the path to
-- the tree search directory (followed by directory separator) where this
-- file was found.
---------------------------
-- Investigate_Trees_New --
---------------------------
procedure Investigate_Trees_New (C : Context_Id) is
Success : Boolean := False;
-- flag indicating if the next tree file has been successfully read in
Current_Dir : constant Dir_Name_Str := Get_Current_Dir;
begin
-- here we have all the names of tree files stored in the tree table
-- for C
for T in First_Tree_Id .. Last_Tree (C) loop
Read_and_Check_New (C, T, Success);
if Success then
Get_Name_String (C, T);
Change_Dir (Dir_Name (A_Name_Buffer (1 .. A_Name_Len)));
Register_Units;
Scan_Units_New;
Change_Dir (Current_Dir);
end if;
end loop;
end Investigate_Trees_New;
--------------------------
-- Investigate_Unit_New --
--------------------------
procedure Investigate_Unit_New
(C : Context_Id;
U : Unit_Id;
U_N : Unit_Number_Type)
is
Top : constant Node_Id := Lib.Cunit (U_N);
-- pointer to the N_Compilation_Unit node for U in the currently
-- accessed tree
begin
Set_S_F_Name_and_Origin (C, U, Top);
Check_Source_Consistency (C, U);
Set_Kind_and_Class (C, U, Top);
Get_Ada_Name (Top);
Set_Ada_Name (U);
Set_Is_Main_Unit (C, U, Is_Main (Top, Kind (C, U)));
Set_Is_Body_Required (C, U, Sinfo.Body_Required (Top));
Set_Dependencies (C, U, Top);
end Investigate_Unit_New;
----------------------
-- Process_Unit_New --
----------------------
procedure Process_Unit_New (U : Unit_Number_Type) is
Cont : constant Context_Id := Get_Current_Cont;
Include_Unit : Boolean := False;
Current_Unit : Unit_Id;
begin
Namet.Get_Decoded_Name_String (Lib.Unit_Name (U));
Set_Norm_Ada_Name_String_With_Check (U, Include_Unit);
if not Include_Unit then
return;
end if;
Current_Unit := Name_Find (Cont);
-- all the units in the current tree are already registered, therefore
-- Current_Unit should not be Nil_Unit
if Already_Processed (Cont, Current_Unit) then
Check_Consistency (Cont, Current_Unit, U);
-- Append_Tree_To_Unit (Cont, Current_Unit);
else
Investigate_Unit_New (Cont, Current_Unit, U);
end if;
end Process_Unit_New;
------------------------
-- Read_and_Check_New --
------------------------
procedure Read_and_Check_New
(C : Context_Id;
Tree : Tree_Id;
Success : out Boolean)
is
Tree_File_D : File_Descriptor;
begin
-- Special processing for GNSA mode:
if Tree_Processing_Mode (C) = GNSA then
if Context_Processing_Mode (C) = One_Tree then
Set_Current_Cont (C);
Set_Current_Tree (Tree);
Success := True;
return;
else
-- Other possibilites are not implemented now, so
pragma Assert (False);
null;
end if;
end if;
Get_Name_String (C, Tree);
A_Name_Buffer (A_Name_Len + 1) := ASCII.NUL;
Tree_File_D := Open_Read (A_Name_Buffer'Address, Binary);
A4G.GNAT_Int.Tree_In_With_Version_Check (Tree_File_D, C, Success);
Set_Current_Cont (C);
Set_Current_Tree (Tree);
exception
when Program_Error |
ASIS_Failed =>
Set_Current_Cont (Nil_Context_Id);
Set_Current_Tree (Nil_Tree);
raise;
when Ex : others =>
-- If we are here, we are definitely having a serious problem:
-- we have a tree file which is version-compartible with ASIS,
-- and we can not read it because of some unknown reason.
Set_Current_Cont (Nil_Context_Id);
Set_Current_Tree (Nil_Tree);
-- debug stuff...
if Debug_Flag_O or else
Debug_Lib_Model or else
Debug_Mode
then
Write_Str ("The tree file ");
Write_Str (A_Name_Buffer (1 .. A_Name_Len));
Write_Str (" was not read in and checked successfully");
Write_Eol;
Write_Str (Ada.Exceptions.Exception_Name (Ex));
Write_Str (" was raised");
Write_Eol;
Write_Str ("Exception message: ");
Write_Str (Ada.Exceptions.Exception_Message (Ex));
Write_Eol;
end if;
Report_ASIS_Bug
(Query_Name => "A4G.Contt.SD.Read_and_Check_New" &
" (tree file " &
A_Name_Buffer (1 .. A_Name_Len) & ")",
Ex => Ex);
end Read_and_Check_New;
--------------------
-- Scan_Tree_List --
--------------------
procedure Scan_Tree_List (C : Context_Id) is
Cont_Mode : constant Context_Mode := Context_Processing_Mode (C);
Tree_List : Tree_File_List_Ptr renames
Contexts.Table (C).Context_Tree_Files;
GNSA_Tree_Name : constant String := "GNSA-created tree";
-- Can be used for -C1 COntext only.
-- Success : Boolean;
begin
-- Special processing for GNSA mode:
if Tree_Processing_Mode (C) = GNSA then
if Context_Processing_Mode (C) = One_Tree then
Name_Len := GNSA_Tree_Name'Length;
Name_Buffer (1 .. Name_Len) := GNSA_Tree_Name;
Store_Tree ("");
return;
else
-- Other possibilites are not implemented now, so
pragma Assert (False);
null;
end if;
end if;
for I in Tree_List'Range loop
exit when Tree_List (I) = null;
if not Is_Regular_File (Tree_List (I).all) then
-- -- A loop needed to deal with possible raise conditions
-- Success := False;
-- for J in 1 .. 100 loop
-- if Is_Regular_File (Tree_List (I).all) then
-- Success := True;
-- exit;
-- end if;
-- delay 0.05;
-- end loop;
-- if not Success then
if Cont_Mode = One_Tree then
Set_Error_Status
(Status => Asis.Errors.Use_Error,
Diagnosis => "Asis.Ada_Environments.Open:"
& ASIS_Line_Terminator
& "tree file "
& Tree_List (I).all
& " does not exist");
raise ASIS_Failed;
elsif Cont_Mode = N_Trees then
ASIS_Warning
(Message => "Asis.Ada_Environments.Open: "
& ASIS_Line_Terminator
& "tree file "
& Tree_List (I).all
& " does not exist",
Error => Use_Error);
end if;
-- end if;
else
Name_Len := Tree_List (I)'Length;
Name_Buffer (1 .. Name_Len) := Tree_List (I).all;
Store_Tree ("");
end if;
end loop;
end Scan_Tree_List;
----------------------
-- Scan_Search_Path --
----------------------
procedure Scan_Search_Path (C : Context_Id) is
Curr_Dir : GNAT.Directory_Operations.Dir_Type;
Search_Path : constant Directory_List_Ptr :=
Contexts.Table (C).Tree_Path;
procedure Scan_Dir (Path : String);
-- scans tree files in Curr_Dir. Puts in the Name Table all
-- the files having names of the form *.at?, which have not been
-- scanned before. Sets the global variable Last_Tree_File equal to
-- the Name_Id of the last scanned tree file. The names of the tree
-- files stores in the Name Table are also stored in the ASIS tree
-- table with the directory information passed as the actual for Path
-- parameter
procedure Read_Tree_File
(Dir : in out GNAT.Directory_Operations.Dir_Type;
Str : out String;
Last : out Natural);
-- This procedure is the modification of GNAT.Directory_Operations.Read
-- which reads only tree file entries from the directory. A Tree file
-- is any file having the extension '.[aA][dD][tT]' (We are
-- considering upper case letters because of "semi-case-sensitiveness"
-- of Windows 95/98/NT.)
procedure Read_Tree_File
(Dir : in out GNAT.Directory_Operations.Dir_Type;
Str : out String;
Last : out Natural)
is
function Is_Tree_File return Boolean;
-- Checks if the file name stored in Str is the name of some tree
-- file. This function assumes that Str'First is 1, and that
-- Last > 0
function Is_Tree_File return Boolean is
Result : Boolean := False;
begin
if Last >= 5 and then
Str (Last - 3) = '.' and then
(Str (Last) = 't' or else
Str (Last) = 'T') and then
(Str (Last - 1) = 'd' or else
Str (Last - 1) = 'D') and then
(Str (Last - 2) = 'a' or else
Str (Last - 2) = 'A')
then
Result := True;
end if;
return Result;
end Is_Tree_File;
begin
GNAT.Directory_Operations.Read (Dir, Str, Last);
while Last > 0 loop
exit when Is_Tree_File;
GNAT.Directory_Operations.Read (Dir, Str, Last);
end loop;
end Read_Tree_File;
procedure Scan_Dir (Path : String) is
T_File : Name_Id;
Is_First_Tree : Boolean := True;
begin
-- looking for the first tree file in this directory
Read_Tree_File
(Dir => Curr_Dir,
Str => Namet.Name_Buffer,
Last => Namet.Name_Len);
while Namet.Name_Len > 0 loop
T_File := Name_Find;
if Is_First_Tree then
Is_First_Tree := False;
First_Tree_File := T_File;
end if;
if T_File > Last_Tree_File then
Last_Tree_File := T_File;
Store_Tree (Path);
end if;
Read_Tree_File
(Dir => Curr_Dir,
Str => Namet.Name_Buffer,
Last => Namet.Name_Len);
end loop;
end Scan_Dir;
begin -- Scan_Search_Path
if Search_Path = null then
GNAT.Directory_Operations.Open (Curr_Dir, "." & Directory_Separator);
Scan_Dir ("");
GNAT.Directory_Operations.Close (Curr_Dir);
else
for I in 1 .. Search_Path'Last loop
GNAT.Directory_Operations.Open (Curr_Dir, Search_Path (I).all);
Scan_Dir (Search_Path (I).all);
GNAT.Directory_Operations.Close (Curr_Dir);
end loop;
end if;
if Use_Default_Trees (C) then
for J in First_Dir_Id .. ASIS_Tree_Search_Directories.Last loop
GNAT.Directory_Operations.Open
(Curr_Dir,
ASIS_Tree_Search_Directories.Table (J).all);
Scan_Dir (ASIS_Tree_Search_Directories.Table (J).all);
GNAT.Directory_Operations.Close (Curr_Dir);
end loop;
end if;
end Scan_Search_Path;
-------------------------
-- Scan_Tree_Files_New --
-------------------------
procedure Scan_Tree_Files_New (C : Context_Id) is
C_Mode : constant Context_Mode := Context_Processing_Mode (C);
GNSA_Tree_Name : constant String := "GNSA-created tree";
-- Can be used for -C1 Context only
begin
-- Special processing for GNSA mode:
if Tree_Processing_Mode (C) = GNSA then
if Context_Processing_Mode (C) = One_Tree then
Name_Len := GNSA_Tree_Name'Length;
Name_Buffer (1 .. Name_Len) := GNSA_Tree_Name;
Store_Tree ("");
return;
-- to avoid GNAT Name Table corruption
else
-- Other possibilites are not implemented now, so
pragma Assert (False);
null;
end if;
end if;
-- first, initialization which is (may be?) common for all context
-- modes:
First_Tree_File := First_Name_Id;
Last_Tree_File := First_Name_Id - 1;
Namet.Initialize;
-- now for different context modes we call individual scan procedures.
-- all of them first put names of tree files into the GNAT Name table
-- and then transfer them into Context tree table, but we cannot
-- factor this out because of the differences in processing a search
-- path (if any) and forming the full names of the tree files
case C_Mode is
when All_Trees =>
Scan_Search_Path (C);
when One_Tree | N_Trees =>
Scan_Tree_List (C);
-- all the tree file names have already been stored in the
-- context tree table when association parameters were processed
null;
when Partition =>
Not_Implemented_Yet ("Scan_Tree_Files_New (Partition)");
end case;
-- debug output:...
if Debug_Flag_O or else
Debug_Lib_Model or else
Debug_Mode
then
Write_Str ("Scanning tree files for Context ");
Write_Int (Int (C));
Write_Eol;
if Context_Processing_Mode (C) = All_Trees then
if Last_Tree_File < First_Tree_File then
Write_Str (" no tree file has been found");
Write_Eol;
else
Write_Str (" the content of the Name Table is:");
Write_Eol;
for I in First_Tree_File .. Last_Tree_File loop
Get_Name_String (I);
Write_Str (" ");
Write_Str (Name_Buffer (1 .. Name_Len));
Write_Eol;
end loop;
end if;
else
Write_Str ("Trees already stored in the tree table:");
Write_Eol;
for Tr in First_Tree_Id .. Last_Tree (C) loop
Get_Name_String (C, Tr);
Write_Str (" " & A_Name_Buffer (1 .. A_Name_Len));
Write_Eol;
end loop;
end if;
end if;
end Scan_Tree_Files_New;
--------------------
-- Scan_Units_New --
--------------------
procedure Scan_Units_New is
Main_Unit_Id : Unit_Id;
Next_Unit_Id : Unit_Id;
Include_Unit : Boolean := False;
begin
for N_Unit in Main_Unit .. Lib.Last_Unit loop
if Atree.Present (Lib.Cunit (N_Unit)) then
Process_Unit_New (N_Unit);
end if;
end loop;
-- And here we collect compilation dependencies for the main unit in
-- the tree:
Namet.Get_Decoded_Name_String (Lib.Unit_Name (Main_Unit));
Set_Norm_Ada_Name_String_With_Check (Main_Unit, Include_Unit);
if not Include_Unit then
return;
end if;
Main_Unit_Id := Name_Find (Current_Context);
for N_Unit in Main_Unit .. Lib.Last_Unit loop
if Atree.Present (Lib.Cunit (N_Unit)) then
Namet.Get_Decoded_Name_String (Lib.Unit_Name (N_Unit));
Set_Norm_Ada_Name_String_With_Check (N_Unit, Include_Unit);
if Include_Unit then
Next_Unit_Id := Name_Find (Current_Context);
Add_To_Elmt_List
(Unit => Next_Unit_Id,
List =>
Unit_Table.Table (Main_Unit_Id).Compilation_Dependencies);
end if;
end if;
end loop;
Unit_Table.Table (Main_Unit_Id).Main_Tree := Current_Tree;
Set_Main_Unit_Id (Main_Unit_Id);
end Scan_Units_New;
----------------
-- Store_Tree --
----------------
procedure Store_Tree (Path : String) is
New_Tree : Tree_Id;
-- we do not need it, but Allocate_Tree_Entry is a function...
pragma Warnings (Off, New_Tree);
begin
if Path = "" then
Set_Name_String (Normalize_Pathname (Name_Buffer (1 .. Name_Len)));
else
Set_Name_String
(Normalize_Pathname
(Path & Directory_Separator & Name_Buffer (1 .. Name_Len)));
end if;
New_Tree := Allocate_Tree_Entry;
end Store_Tree;
end A4G.Contt.SD;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . I M G _ L L F --
-- --
-- S p e c --
-- --
-- Copyright (C) 2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines for the Image attribute of floating point
-- types based on Long_Long_Float, also used for Float_IO output.
with System.Img_LLU;
with System.Image_R;
with System.Powten_LLF;
with System.Unsigned_Types;
package System.Img_LLF is
pragma Pure;
-- Note that the following instantiation is really for a 32-bit target,
-- where 128-bit integer types are not available. For a 64-bit targaet,
-- it is possible to use Long_Long_Unsigned and Long_Long_Long_Unsigned
-- instead of Unsigned and Long_Long_Unsigned, in order to double the
-- number of significant digits. But we do not do it by default to avoid
-- dragging 128-bit integer types for the sake of backward compatibility.
package Impl is new Image_R
(Long_Long_Float,
System.Powten_LLF.Maxpow,
System.Powten_LLF.Powten'Address,
Unsigned_Types.Long_Long_Unsigned,
System.Img_LLU.Set_Image_Long_Long_Unsigned);
procedure Image_Long_Long_Float
(V : Long_Long_Float;
S : in out String;
P : out Natural;
Digs : Natural)
renames Impl.Image_Floating_Point;
procedure Set_Image_Long_Long_Float
(V : Long_Long_Float;
S : in out String;
P : in out Natural;
Fore : Natural;
Aft : Natural;
Exp : Natural)
renames Impl.Set_Image_Real;
end System.Img_LLF;
|
procedure launch_mouse_Motion
--
-- Todo
--
is
begin
null;
end launch_mouse_Motion;
|
-- C95085A.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 CONSTRAINT_ERROR IS RAISED FOR OUT OF RANGE SCALAR
-- ARGUMENTS. SUBTESTS ARE:
-- (A) STATIC IN ARGUMENT.
-- (B) DYNAMIC IN ARGUMENT.
-- (C) IN OUT, OUT OF RANGE ON CALL.
-- (D) OUT, OUT OF RANGE ON RETURN.
-- (E) IN OUT, OUT OF RANGE ON RETURN.
-- GLH 7/15/85
-- JRK 8/23/85
-- JWC 11/15/85 ADDED VARIABLE "CALLED" TO ENSURE THAT THE ENTRY
-- CALL WAS MADE FOR THOSE CASES THAT ARE APPLICABLE.
WITH REPORT; USE REPORT;
PROCEDURE C95085A IS
SUBTYPE DIGIT IS INTEGER RANGE 0..9;
D : DIGIT;
I : INTEGER;
M1 : CONSTANT INTEGER := IDENT_INT (-1);
COUNT : INTEGER := 0;
CALLED : BOOLEAN;
SUBTYPE SI IS INTEGER RANGE M1 .. 10;
TASK T1 IS
ENTRY E1 (PIN : IN DIGIT; WHO : STRING); -- (A), (B).
END T1;
TASK BODY T1 IS
BEGIN
LOOP
BEGIN
SELECT
ACCEPT E1 (PIN : IN DIGIT;
WHO : STRING) DO -- (A), (B).
FAILED ("EXCEPTION NOT RAISED BEFORE " &
"CALL - E1 " & WHO);
END E1;
OR
TERMINATE;
END SELECT;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN E1");
END;
END LOOP;
END T1;
TASK T2 IS
ENTRY E2 (PINOUT : IN OUT DIGIT; WHO : STRING); -- (C).
END T2;
TASK BODY T2 IS
BEGIN
LOOP
BEGIN
SELECT
ACCEPT E2 (PINOUT : IN OUT DIGIT;
WHO : STRING) DO -- (C).
FAILED ("EXCEPTION NOT RAISED BEFORE " &
"CALL - E2 " & WHO);
END E2;
OR
TERMINATE;
END SELECT;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN E2");
END;
END LOOP;
END T2;
TASK T3 IS
ENTRY E3 (POUT : OUT SI; WHO : STRING); -- (D).
END T3;
TASK BODY T3 IS
BEGIN
LOOP
BEGIN
SELECT
ACCEPT E3 (POUT : OUT SI;
WHO : STRING) DO -- (D).
CALLED := TRUE;
IF WHO = "10" THEN
POUT := IDENT_INT (10); -- 10 IS NOT
-- A DIGIT.
ELSE
POUT := -1;
END IF;
END E3;
OR
TERMINATE;
END SELECT;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN E3");
END;
END LOOP;
END T3;
TASK T4 IS
ENTRY E4 (PINOUT : IN OUT INTEGER; WHO : STRING); -- (E).
END T4;
TASK BODY T4 IS
BEGIN
LOOP
BEGIN
SELECT
ACCEPT E4 (PINOUT : IN OUT INTEGER;
WHO : STRING) DO -- (E).
CALLED := TRUE;
IF WHO = "10" THEN
PINOUT := 10; -- 10 IS NOT A DIGIT.
ELSE
PINOUT := IDENT_INT (-1);
END IF;
END E4;
OR
TERMINATE;
END SELECT;
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN E4");
END;
END LOOP;
END T4;
BEGIN
TEST ("C95085A", "CHECK THAT CONSTRAINT_ERROR IS RAISED " &
"FOR OUT OF RANGE SCALAR ARGUMENTS");
BEGIN -- (A)
T1.E1 (10, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E1 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E1 (10)");
END; -- (A)
BEGIN -- (B)
T1.E1 (IDENT_INT (-1), "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E1 (" &
"IDENT_INT (-1))");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E1 (" &
"IDENT_INT (-1))");
END; -- (B)
BEGIN -- (C)
I := IDENT_INT (10);
T2.E2 (I, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E2 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E2 (10)");
END; -- (C)
BEGIN -- (C1)
I := IDENT_INT (-1);
T2.E2 (I, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED FOR E2 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E2 (-1)");
END; -- (C1)
BEGIN -- (D)
CALLED := FALSE;
D := IDENT_INT (1);
T3.E3 (D, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " &
"E3 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("EXCEPTION RAISED BEFORE CALL " &
"E3 (10)");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E3 (10)");
END; -- (D)
BEGIN -- (D1)
CALLED := FALSE;
D := IDENT_INT (1);
T3.E3 (D, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " &
"E3 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("EXCEPTION RAISED BEFORE CALL " &
"E3 (-1)");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E3 (-1)");
END; -- (D1)
BEGIN -- (E)
CALLED := FALSE;
D := 9;
T4.E4 (D, "10");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " &
"E4 (10)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("EXCEPTION RAISED BEFORE CALL " &
"E4 (10)");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E4 (10)");
END; -- (E)
BEGIN -- (E1)
CALLED := FALSE;
D := 0;
T4.E4 (D, "-1");
FAILED ("CONSTRAINT_ERROR NOT RAISED ON RETURN FROM " &
"E4 (-1)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
COUNT := COUNT + 1;
IF NOT CALLED THEN
FAILED ("EXCEPTION RAISED BEFORE CALL " &
"E4 (-1)");
END IF;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED FOR E4 (-1)");
END; -- (E1)
IF COUNT /= 8 THEN
FAILED ("INCORRECT NUMBER OF CONSTRAINT_ERRORS RAISED");
END IF;
RESULT;
END C95085A;
|
--
-- Jan & Uwe R. Zimmer, Australia, July 2011
--
package body Vectors_3D is
function "*" (V_Left, V_Right : Vector_3D) return Vector_3D is
(x => (V_Left (y) * V_Right (z) - V_Left (z) * V_Right (y)),
y => (V_Left (z) * V_Right (x) - V_Left (x) * V_Right (z)),
z => (V_Left (x) * V_Right (y) - V_Left (y) * V_Right (x)));
end Vectors_3D;
|
------------------------------------------------------------------------------
-- --
-- Giza --
-- --
-- Copyright (C) 2016 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. --
-- --
------------------------------------------------------------------------------
limited with Giza.Context;
package Giza.Font is
type Instance is interface;
subtype Class is Instance'Class;
type Ref is access all Class;
type Ref_Const is access constant Class;
procedure Glyph_Box (This : Instance;
C : Character;
Width, Height, X_Advance : out Natural;
X_Offset, Y_Offset : out Integer) is abstract;
procedure Print_Glyph (This : Instance;
Ctx : in out Giza.Context.Instance'Class;
C : Character) is abstract;
function Y_Advance (This : Instance) return Integer is abstract;
end Giza.Font;
|
-- Copyright 2014-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with System;
package Pck is
type Element is abstract tagged null record;
type GADataType is interface;
type Data_Type is new Element and GADataType with record
I : Integer := 42;
end record;
procedure Do_Nothing (A : System.Address);
end Pck;
|
------------------------------------------------------------------------------
-- --
-- A SIGMANIFICIENT PROGRAM --
-- --
-- PRIME CALCULATOR --
-- --
------------------------------------------------------------------------------
with Ada.Text_IO, Ada.Integer_Text_IO ;
use Ada.Text_IO, Ada.Integer_Text_IO ;
procedure Main is
count_prime : Integer ;
counter : Integer ;
wanted : Integer ;
iteration : Integer ;
testing : Integer ;
is_prime : Boolean ;
answer : Character ;
begin
loop
Put("Calculateur de nombre premiers") ;
New_line(2) ;
Put("Entrez 'p' pour calculer des premiers") ;
New_Line(1);
Put("Entrez 'q' pour quitter") ;
New_Line(2) ;
Put(">> ") ;
Get(answer) ;
Skip_line ;
if answer = 'p' then
Put("Entrez le nombre de premiers voulu : ");
Get(wanted) ;
Skip_line ;
iteration := 0 ;
count_prime := 0 ;
counter := 1 ;
if wanted > 0 then
Put("2");
New_Line(1);
if wanted > 1 then
Put("3");
New_Line(1);
end if ;
if wanted > 2 then
count_prime := 2;
loop
if counter = 1 then
counter := 0 ;
iteration := iteration + 1 ;
testing := ( 6 * iteration ) - 1 ;
else
counter := 1 ;
testing := ( 6 * iteration ) + 1 ;
end if ;
is_prime := True ;
for i in 2..(testing-1) loop
if (testing rem i = 0) then
is_prime := False ;
end if ;
end loop;
if is_prime = True then
Put(testing);
New_Line(1);
count_prime := count_prime + 1 ;
end if ;
exit when count_prime = wanted;
end loop ;
end if;
Put("Ended") ;
else
Put("Vous devez mettre un nombre positif ._.");
end if ;
end if ;
New_Line(3);
exit when answer = 'q' ;
end loop ;
end Main ;
-- Long life to prime ! --
|
-- Abstract:
--
-- see spec
--
-- Copyright (C) 1998, 2003, 2009, 2015, 2017 - 2019 Free Software Foundation, Inc.
--
-- SAL is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the
-- Free Software Foundation; either version 3, or (at your option)
-- any later version. SAL 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 distributed
-- with SAL; 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
-- SAL, or you link SAL object files with other files to produce an
-- executable, that 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.
pragma License (Modified_GPL);
package body SAL.Gen_Bounded_Definite_Stacks
with Spark_Mode
is
pragma Suppress (All_Checks);
procedure Clear (Stack : in out Sgbds.Stack)
is begin
Stack.Top := 0;
end Clear;
function Depth (Stack : in Sgbds.Stack) return Size_Type
is (Stack.Top);
function Is_Empty (Stack : in Sgbds.Stack) return Boolean
is begin
return Stack.Top = 0;
end Is_Empty;
function Is_Full (Stack : in Sgbds.Stack) return Boolean
is begin
return Stack.Top = Stack.Size;
end Is_Full;
function Peek
(Stack : in Sgbds.Stack;
Index : in Peek_Type := 1)
return Element_Type
is (Stack.Data (Stack.Top - Index + 1));
procedure Pop (Stack : in out Sgbds.Stack; Count : in Base_Peek_Type := 1)
is begin
Stack.Top := Stack.Top - Count;
end Pop;
procedure Pop (Stack : in out Sgbds.Stack; Item : out Element_Type)
is begin
Item := Stack.Peek (1);
Stack.Top := Stack.Top - 1;
end Pop;
function Pop (Stack : in out Sgbds.Stack) return Element_Type with
Spark_Mode => Off
is begin
return Result : Element_Type do
Pop (Stack, Result);
end return;
end Pop;
procedure Push (Stack : in out Sgbds.Stack; Item : in Element_Type)
is begin
Stack.Top := Stack.Top + 1;
Stack.Data (Stack.Top) := Item;
end Push;
end SAL.Gen_Bounded_Definite_Stacks;
|
with Matrices;
pragma Elaborate_All (Matrices);
package Matrices_3D is new Matrices (3);
|
with STM32_SVD.RCC; use STM32_SVD.RCC;
with STM32_SVD.RNG; use STM32_SVD.RNG;
package body STM32.RNG is
----------------------
-- Enable_RNG_Clock --
----------------------
procedure Enable_RNG_Clock is
begin
RCC_Periph.AHB2ENR.RNGEN := True;
end Enable_RNG_Clock;
----------------
-- Enable_RNG --
----------------
procedure Enable_RNG is
begin
RNG_Periph.CR.RNGEN := True;
end Enable_RNG;
-----------------
-- Disable_RNG --
-----------------
procedure Disable_RNG is
begin
RNG_Periph.CR.RNGEN := False;
end Disable_RNG;
---------------
-- Reset_RNG --
---------------
procedure Reset_RNG
is
begin
RCC_Periph.AHB2RSTR.RNGRST := True;
RCC_Periph.AHB2RSTR.RNGRST := False;
end Reset_RNG;
-----------------
-- RNG_Enabled --
-----------------
function RNG_Enabled return Boolean is
(RNG_Periph.CR.RNGEN);
--------------------------
-- Enable_RNG_Interrupt --
--------------------------
procedure Enable_RNG_Interrupt is
begin
RNG_Periph.CR.IE := True;
end Enable_RNG_Interrupt;
---------------------------
-- Disable_RNG_Interrupt --
---------------------------
procedure Disable_RNG_Interrupt is
begin
RNG_Periph.CR.IE := False;
end Disable_RNG_Interrupt;
---------------------------
-- RNG_Interrupt_Enabled --
---------------------------
function RNG_Interrupt_Enabled return Boolean is
(RNG_Periph.CR.IE);
--------------
-- RNG_Data --
--------------
function RNG_Data return UInt32
is (RNG_Periph.DR);
--------------------
-- RNG_Data_Ready --
--------------------
function RNG_Data_Ready return Boolean
is (RNG_Periph.SR.DRDY);
---------------------------
-- RNG_Seed_Error_Status --
---------------------------
function RNG_Seed_Error_Status return Boolean is
(RNG_Periph.SR.SECS);
----------------------------
-- RNG_Clock_Error_Status --
----------------------------
function RNG_Clock_Error_Status return Boolean is
(RNG_Periph.SR.CECS);
---------------------------------
-- Clear_RNG_Seed_Error_Status --
---------------------------------
procedure Clear_RNG_Seed_Error_Status
is
begin
RNG_Periph.SR.SECS := False;
end Clear_RNG_Seed_Error_Status;
----------------------------------
-- Clear_RNG_Clock_Error_Status --
----------------------------------
procedure Clear_RNG_Clock_Error_Status
is
begin
RNG_Periph.SR.CECS := False;
end Clear_RNG_Clock_Error_Status;
end STM32.RNG;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Menus --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2014,2018 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.33 $
-- $Date: 2018/07/07 23:36:44 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Pointers;
package body Terminal_Interface.Curses.Menus is
type C_Item_Array is array (Natural range <>) of aliased Item;
package I_Array is new
Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item);
subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
------------------------------------------------------------------------------
procedure Request_Name (Key : Menu_Request_Code;
Name : out String)
is
function Request_Name (Key : C_Int) return chars_ptr;
pragma Import (C, Request_Name, "menu_request_name");
begin
Fill_String (Request_Name (C_Int (Key)), Name);
end Request_Name;
function Request_Name (Key : Menu_Request_Code) return String
is
function Request_Name (Key : C_Int) return chars_ptr;
pragma Import (C, Request_Name, "menu_request_name");
begin
return Fill_String (Request_Name (C_Int (Key)));
end Request_Name;
function Create (Name : String;
Description : String := "") return Item
is
type Char_Ptr is access all Interfaces.C.char;
function Newitem (Name, Desc : Char_Ptr) return Item;
pragma Import (C, Newitem, "new_item");
type Name_String is new char_array (0 .. Name'Length);
type Name_String_Ptr is access Name_String;
pragma Controlled (Name_String_Ptr);
type Desc_String is new char_array (0 .. Description'Length);
type Desc_String_Ptr is access Desc_String;
pragma Controlled (Desc_String_Ptr);
Name_Str : constant Name_String_Ptr := new Name_String;
Desc_Str : constant Desc_String_Ptr := new Desc_String;
Name_Len, Desc_Len : size_t;
Result : Item;
begin
To_C (Name, Name_Str.all, Name_Len);
To_C (Description, Desc_Str.all, Desc_Len);
Result := Newitem (Name_Str.all (Name_Str.all'First)'Access,
Desc_Str.all (Desc_Str.all'First)'Access);
if Result = Null_Item then
raise Eti_System_Error;
end if;
return Result;
end Create;
procedure Delete (Itm : in out Item)
is
function Descname (Itm : Item) return chars_ptr;
pragma Import (C, Descname, "item_description");
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
function Freeitem (Itm : Item) return Eti_Error;
pragma Import (C, Freeitem, "free_item");
Ptr : chars_ptr;
begin
Ptr := Descname (Itm);
if Ptr /= Null_Ptr then
Interfaces.C.Strings.Free (Ptr);
end if;
Ptr := Itemname (Itm);
if Ptr /= Null_Ptr then
Interfaces.C.Strings.Free (Ptr);
end if;
Eti_Exception (Freeitem (Itm));
Itm := Null_Item;
end Delete;
-------------------------------------------------------------------------------
procedure Set_Value (Itm : Item;
Value : Boolean := True)
is
function Set_Item_Val (Itm : Item;
Val : C_Int) return Eti_Error;
pragma Import (C, Set_Item_Val, "set_item_value");
begin
Eti_Exception (Set_Item_Val (Itm, Boolean'Pos (Value)));
end Set_Value;
function Value (Itm : Item) return Boolean
is
function Item_Val (Itm : Item) return C_Int;
pragma Import (C, Item_Val, "item_value");
begin
if Item_Val (Itm) = Curses_False then
return False;
else
return True;
end if;
end Value;
-------------------------------------------------------------------------------
function Visible (Itm : Item) return Boolean
is
function Item_Vis (Itm : Item) return C_Int;
pragma Import (C, Item_Vis, "item_visible");
begin
if Item_Vis (Itm) = Curses_False then
return False;
else
return True;
end if;
end Visible;
-------------------------------------------------------------------------------
procedure Set_Options (Itm : Item;
Options : Item_Option_Set)
is
function Set_Item_Opts (Itm : Item;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Set_Item_Opts, "set_item_opts");
begin
Eti_Exception (Set_Item_Opts (Itm, Options));
end Set_Options;
procedure Switch_Options (Itm : Item;
Options : Item_Option_Set;
On : Boolean := True)
is
function Item_Opts_On (Itm : Item;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Item_Opts_On, "item_opts_on");
function Item_Opts_Off (Itm : Item;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Item_Opts_Off, "item_opts_off");
begin
if On then
Eti_Exception (Item_Opts_On (Itm, Options));
else
Eti_Exception (Item_Opts_Off (Itm, Options));
end if;
end Switch_Options;
procedure Get_Options (Itm : Item;
Options : out Item_Option_Set)
is
function Item_Opts (Itm : Item) return Item_Option_Set;
pragma Import (C, Item_Opts, "item_opts");
begin
Options := Item_Opts (Itm);
end Get_Options;
function Get_Options (Itm : Item := Null_Item) return Item_Option_Set
is
Ios : Item_Option_Set;
begin
Get_Options (Itm, Ios);
return Ios;
end Get_Options;
-------------------------------------------------------------------------------
procedure Name (Itm : Item;
Name : out String)
is
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
begin
Fill_String (Itemname (Itm), Name);
end Name;
function Name (Itm : Item) return String
is
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
begin
return Fill_String (Itemname (Itm));
end Name;
procedure Description (Itm : Item;
Description : out String)
is
function Descname (Itm : Item) return chars_ptr;
pragma Import (C, Descname, "item_description");
begin
Fill_String (Descname (Itm), Description);
end Description;
function Description (Itm : Item) return String
is
function Descname (Itm : Item) return chars_ptr;
pragma Import (C, Descname, "item_description");
begin
return Fill_String (Descname (Itm));
end Description;
-------------------------------------------------------------------------------
procedure Set_Current (Men : Menu;
Itm : Item)
is
function Set_Curr_Item (Men : Menu;
Itm : Item) return Eti_Error;
pragma Import (C, Set_Curr_Item, "set_current_item");
begin
Eti_Exception (Set_Curr_Item (Men, Itm));
end Set_Current;
function Current (Men : Menu) return Item
is
function Curr_Item (Men : Menu) return Item;
pragma Import (C, Curr_Item, "current_item");
Res : constant Item := Curr_Item (Men);
begin
if Res = Null_Item then
raise Menu_Exception;
end if;
return Res;
end Current;
procedure Set_Top_Row (Men : Menu;
Line : Line_Position)
is
function Set_Toprow (Men : Menu;
Line : C_Int) return Eti_Error;
pragma Import (C, Set_Toprow, "set_top_row");
begin
Eti_Exception (Set_Toprow (Men, C_Int (Line)));
end Set_Top_Row;
function Top_Row (Men : Menu) return Line_Position
is
function Toprow (Men : Menu) return C_Int;
pragma Import (C, Toprow, "top_row");
Res : constant C_Int := Toprow (Men);
begin
if Res = Curses_Err then
raise Menu_Exception;
end if;
return Line_Position (Res);
end Top_Row;
function Get_Index (Itm : Item) return Positive
is
function Get_Itemindex (Itm : Item) return C_Int;
pragma Import (C, Get_Itemindex, "item_index");
Res : constant C_Int := Get_Itemindex (Itm);
begin
if Res = Curses_Err then
raise Menu_Exception;
end if;
return Positive (Natural (Res) + Positive'First);
end Get_Index;
-------------------------------------------------------------------------------
procedure Post (Men : Menu;
Post : Boolean := True)
is
function M_Post (Men : Menu) return Eti_Error;
pragma Import (C, M_Post, "post_menu");
function M_Unpost (Men : Menu) return Eti_Error;
pragma Import (C, M_Unpost, "unpost_menu");
begin
if Post then
Eti_Exception (M_Post (Men));
else
Eti_Exception (M_Unpost (Men));
end if;
end Post;
-------------------------------------------------------------------------------
procedure Set_Options (Men : Menu;
Options : Menu_Option_Set)
is
function Set_Menu_Opts (Men : Menu;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Set_Menu_Opts, "set_menu_opts");
begin
Eti_Exception (Set_Menu_Opts (Men, Options));
end Set_Options;
procedure Switch_Options (Men : Menu;
Options : Menu_Option_Set;
On : Boolean := True)
is
function Menu_Opts_On (Men : Menu;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Menu_Opts_On, "menu_opts_on");
function Menu_Opts_Off (Men : Menu;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Menu_Opts_Off, "menu_opts_off");
begin
if On then
Eti_Exception (Menu_Opts_On (Men, Options));
else
Eti_Exception (Menu_Opts_Off (Men, Options));
end if;
end Switch_Options;
procedure Get_Options (Men : Menu;
Options : out Menu_Option_Set)
is
function Menu_Opts (Men : Menu) return Menu_Option_Set;
pragma Import (C, Menu_Opts, "menu_opts");
begin
Options := Menu_Opts (Men);
end Get_Options;
function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set
is
Mos : Menu_Option_Set;
begin
Get_Options (Men, Mos);
return Mos;
end Get_Options;
-------------------------------------------------------------------------------
procedure Set_Window (Men : Menu;
Win : Window)
is
function Set_Menu_Win (Men : Menu;
Win : Window) return Eti_Error;
pragma Import (C, Set_Menu_Win, "set_menu_win");
begin
Eti_Exception (Set_Menu_Win (Men, Win));
end Set_Window;
function Get_Window (Men : Menu) return Window
is
function Menu_Win (Men : Menu) return Window;
pragma Import (C, Menu_Win, "menu_win");
W : constant Window := Menu_Win (Men);
begin
return W;
end Get_Window;
procedure Set_Sub_Window (Men : Menu;
Win : Window)
is
function Set_Menu_Sub (Men : Menu;
Win : Window) return Eti_Error;
pragma Import (C, Set_Menu_Sub, "set_menu_sub");
begin
Eti_Exception (Set_Menu_Sub (Men, Win));
end Set_Sub_Window;
function Get_Sub_Window (Men : Menu) return Window
is
function Menu_Sub (Men : Menu) return Window;
pragma Import (C, Menu_Sub, "menu_sub");
W : constant Window := Menu_Sub (Men);
begin
return W;
end Get_Sub_Window;
procedure Scale (Men : Menu;
Lines : out Line_Count;
Columns : out Column_Count)
is
type C_Int_Access is access all C_Int;
function M_Scale (Men : Menu;
Yp, Xp : C_Int_Access) return Eti_Error;
pragma Import (C, M_Scale, "scale_menu");
X, Y : aliased C_Int;
begin
Eti_Exception (M_Scale (Men, Y'Access, X'Access));
Lines := Line_Count (Y);
Columns := Column_Count (X);
end Scale;
-------------------------------------------------------------------------------
procedure Position_Cursor (Men : Menu)
is
function Pos_Menu_Cursor (Men : Menu) return Eti_Error;
pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor");
begin
Eti_Exception (Pos_Menu_Cursor (Men));
end Position_Cursor;
-------------------------------------------------------------------------------
procedure Set_Mark (Men : Menu;
Mark : String)
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Mark (Men : Menu;
Mark : Char_Ptr) return Eti_Error;
pragma Import (C, Set_Mark, "set_menu_mark");
Txt : char_array (0 .. Mark'Length);
Len : size_t;
begin
To_C (Mark, Txt, Len);
Eti_Exception (Set_Mark (Men, Txt (Txt'First)'Access));
end Set_Mark;
procedure Mark (Men : Menu;
Mark : out String)
is
function Get_Menu_Mark (Men : Menu) return chars_ptr;
pragma Import (C, Get_Menu_Mark, "menu_mark");
begin
Fill_String (Get_Menu_Mark (Men), Mark);
end Mark;
function Mark (Men : Menu) return String
is
function Get_Menu_Mark (Men : Menu) return chars_ptr;
pragma Import (C, Get_Menu_Mark, "menu_mark");
begin
return Fill_String (Get_Menu_Mark (Men));
end Mark;
-------------------------------------------------------------------------------
procedure Set_Foreground
(Men : Menu;
Fore : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Fore (Men : Menu;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Fore, "set_menu_fore");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Fore);
begin
Eti_Exception (Set_Menu_Fore (Men, Ch));
end Set_Foreground;
procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set)
is
function Menu_Fore (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Fore, "menu_fore");
begin
Fore := Menu_Fore (Men).Attr;
end Foreground;
procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Fore (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Fore, "menu_fore");
begin
Fore := Menu_Fore (Men).Attr;
Color := Menu_Fore (Men).Color;
end Foreground;
procedure Set_Background
(Men : Menu;
Back : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Back (Men : Menu;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Back, "set_menu_back");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Back);
begin
Eti_Exception (Set_Menu_Back (Men, Ch));
end Set_Background;
procedure Background (Men : Menu;
Back : out Character_Attribute_Set)
is
function Menu_Back (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Back, "menu_back");
begin
Back := Menu_Back (Men).Attr;
end Background;
procedure Background (Men : Menu;
Back : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Back (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Back, "menu_back");
begin
Back := Menu_Back (Men).Attr;
Color := Menu_Back (Men).Color;
end Background;
procedure Set_Grey (Men : Menu;
Grey : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Grey (Men : Menu;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Grey, "set_menu_grey");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Grey);
begin
Eti_Exception (Set_Menu_Grey (Men, Ch));
end Set_Grey;
procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set)
is
function Menu_Grey (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Grey, "menu_grey");
begin
Grey := Menu_Grey (Men).Attr;
end Grey;
procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Grey (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Grey, "menu_grey");
begin
Grey := Menu_Grey (Men).Attr;
Color := Menu_Grey (Men).Color;
end Grey;
procedure Set_Pad_Character (Men : Menu;
Pad : Character := Space)
is
function Set_Menu_Pad (Men : Menu;
Ch : C_Int) return Eti_Error;
pragma Import (C, Set_Menu_Pad, "set_menu_pad");
begin
Eti_Exception (Set_Menu_Pad (Men, C_Int (Character'Pos (Pad))));
end Set_Pad_Character;
procedure Pad_Character (Men : Menu;
Pad : out Character)
is
function Menu_Pad (Men : Menu) return C_Int;
pragma Import (C, Menu_Pad, "menu_pad");
begin
Pad := Character'Val (Menu_Pad (Men));
end Pad_Character;
-------------------------------------------------------------------------------
procedure Set_Spacing (Men : Menu;
Descr : Column_Position := 0;
Row : Line_Position := 0;
Col : Column_Position := 0)
is
function Set_Spacing (Men : Menu;
D, R, C : C_Int) return Eti_Error;
pragma Import (C, Set_Spacing, "set_menu_spacing");
begin
Eti_Exception (Set_Spacing (Men,
C_Int (Descr),
C_Int (Row),
C_Int (Col)));
end Set_Spacing;
procedure Spacing (Men : Menu;
Descr : out Column_Position;
Row : out Line_Position;
Col : out Column_Position)
is
type C_Int_Access is access all C_Int;
function Get_Spacing (Men : Menu;
D, R, C : C_Int_Access) return Eti_Error;
pragma Import (C, Get_Spacing, "menu_spacing");
D, R, C : aliased C_Int;
begin
Eti_Exception (Get_Spacing (Men,
D'Access,
R'Access,
C'Access));
Descr := Column_Position (D);
Row := Line_Position (R);
Col := Column_Position (C);
end Spacing;
-------------------------------------------------------------------------------
function Set_Pattern (Men : Menu;
Text : String) return Boolean
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Pattern (Men : Menu;
Pattern : Char_Ptr) return Eti_Error;
pragma Import (C, Set_Pattern, "set_menu_pattern");
S : char_array (0 .. Text'Length);
L : size_t;
Res : Eti_Error;
begin
To_C (Text, S, L);
Res := Set_Pattern (Men, S (S'First)'Access);
case Res is
when E_No_Match =>
return False;
when others =>
Eti_Exception (Res);
return True;
end case;
end Set_Pattern;
procedure Pattern (Men : Menu;
Text : out String)
is
function Get_Pattern (Men : Menu) return chars_ptr;
pragma Import (C, Get_Pattern, "menu_pattern");
begin
Fill_String (Get_Pattern (Men), Text);
end Pattern;
-------------------------------------------------------------------------------
procedure Set_Format (Men : Menu;
Lines : Line_Count;
Columns : Column_Count)
is
function Set_Menu_Fmt (Men : Menu;
Lin : C_Int;
Col : C_Int) return Eti_Error;
pragma Import (C, Set_Menu_Fmt, "set_menu_format");
begin
Eti_Exception (Set_Menu_Fmt (Men,
C_Int (Lines),
C_Int (Columns)));
end Set_Format;
procedure Format (Men : Menu;
Lines : out Line_Count;
Columns : out Column_Count)
is
type C_Int_Access is access all C_Int;
function Menu_Fmt (Men : Menu;
Y, X : C_Int_Access) return Eti_Error;
pragma Import (C, Menu_Fmt, "menu_format");
L, C : aliased C_Int;
begin
Eti_Exception (Menu_Fmt (Men, L'Access, C'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
end Format;
-------------------------------------------------------------------------------
procedure Set_Item_Init_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Item_Init (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Item_Init, "set_item_init");
begin
Eti_Exception (Set_Item_Init (Men, Proc));
end Set_Item_Init_Hook;
procedure Set_Item_Term_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Item_Term (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Item_Term, "set_item_term");
begin
Eti_Exception (Set_Item_Term (Men, Proc));
end Set_Item_Term_Hook;
procedure Set_Menu_Init_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Menu_Init (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Menu_Init, "set_menu_init");
begin
Eti_Exception (Set_Menu_Init (Men, Proc));
end Set_Menu_Init_Hook;
procedure Set_Menu_Term_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Menu_Term (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Menu_Term, "set_menu_term");
begin
Eti_Exception (Set_Menu_Term (Men, Proc));
end Set_Menu_Term_Hook;
function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function
is
function Item_Init (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Item_Init, "item_init");
begin
return Item_Init (Men);
end Get_Item_Init_Hook;
function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function
is
function Item_Term (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Item_Term, "item_term");
begin
return Item_Term (Men);
end Get_Item_Term_Hook;
function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function
is
function Menu_Init (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Menu_Init, "menu_init");
begin
return Menu_Init (Men);
end Get_Menu_Init_Hook;
function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function
is
function Menu_Term (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Menu_Term, "menu_term");
begin
return Menu_Term (Men);
end Get_Menu_Term_Hook;
-------------------------------------------------------------------------------
procedure Redefine (Men : Menu;
Items : Item_Array_Access)
is
function Set_Items (Men : Menu;
Items : System.Address) return Eti_Error;
pragma Import (C, Set_Items, "set_menu_items");
begin
pragma Assert (Items.all (Items'Last) = Null_Item);
if Items.all (Items'Last) /= Null_Item then
raise Menu_Exception;
else
Eti_Exception (Set_Items (Men, Items.all'Address));
end if;
end Redefine;
function Item_Count (Men : Menu) return Natural
is
function Count (Men : Menu) return C_Int;
pragma Import (C, Count, "item_count");
begin
return Natural (Count (Men));
end Item_Count;
function Items (Men : Menu;
Index : Positive) return Item
is
use I_Array;
function C_Mitems (Men : Menu) return Pointer;
pragma Import (C, C_Mitems, "menu_items");
P : Pointer := C_Mitems (Men);
begin
if P = null or else Index > Item_Count (Men) then
raise Menu_Exception;
else
P := P + ptrdiff_t (C_Int (Index) - 1);
return P.all;
end if;
end Items;
-------------------------------------------------------------------------------
function Create (Items : Item_Array_Access) return Menu
is
function Newmenu (Items : System.Address) return Menu;
pragma Import (C, Newmenu, "new_menu");
M : Menu;
begin
pragma Assert (Items.all (Items'Last) = Null_Item);
if Items.all (Items'Last) /= Null_Item then
raise Menu_Exception;
else
M := Newmenu (Items.all'Address);
if M = Null_Menu then
raise Menu_Exception;
end if;
return M;
end if;
end Create;
procedure Delete (Men : in out Menu)
is
function Free (Men : Menu) return Eti_Error;
pragma Import (C, Free, "free_menu");
begin
Eti_Exception (Free (Men));
Men := Null_Menu;
end Delete;
------------------------------------------------------------------------------
function Driver (Men : Menu;
Key : Key_Code) return Driver_Result
is
function Driver (Men : Menu;
Key : C_Int) return Eti_Error;
pragma Import (C, Driver, "menu_driver");
R : constant Eti_Error := Driver (Men, C_Int (Key));
begin
case R is
when E_Unknown_Command =>
return Unknown_Request;
when E_No_Match =>
return No_Match;
when E_Request_Denied | E_Not_Selectable =>
return Request_Denied;
when others =>
Eti_Exception (R);
return Menu_Ok;
end case;
end Driver;
procedure Free (IA : in out Item_Array_Access;
Free_Items : Boolean := False)
is
procedure Release is new Ada.Unchecked_Deallocation
(Item_Array, Item_Array_Access);
begin
if IA /= null and then Free_Items then
for I in IA'First .. (IA'Last - 1) loop
if IA.all (I) /= Null_Item then
Delete (IA.all (I));
end if;
end loop;
end if;
Release (IA);
end Free;
-------------------------------------------------------------------------------
function Default_Menu_Options return Menu_Option_Set
is
begin
return Get_Options (Null_Menu);
end Default_Menu_Options;
function Default_Item_Options return Item_Option_Set
is
begin
return Get_Options (Null_Item);
end Default_Item_Options;
-------------------------------------------------------------------------------
end Terminal_Interface.Curses.Menus;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 5 9 --
-- --
-- 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 = 59
package System.Pack_59 is
pragma Preelaborate;
Bits : constant := 59;
type Bits_59 is mod 2 ** Bits;
for Bits_59'Size use Bits;
function Get_59 (Arr : System.Address; N : Natural) return Bits_59;
-- 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);
-- 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;
|
package LR.Synchro.Fifo is
function Nom_Strategie return String;
procedure Demander_Lecture;
procedure Demander_Ecriture;
procedure Terminer_Lecture;
procedure Terminer_Ecriture;
end LR.Synchro.Fifo;
|
with AAA.Strings;
with CLIC.Subcommand;
package CLIC_Ex.Commands.Subsub is
type Instance
is new CLIC.Subcommand.Command
with private;
overriding
function Name (Cmd : Instance) return CLIC.Subcommand.Identifier
is ("subsub");
overriding
function Switch_Parsing (This : Instance)
return CLIC.Subcommand.Switch_Parsing_Kind
is (CLIC.Subcommand.Parse_All);
overriding
procedure Execute (Cmd : in out Instance;
Args : AAA.Strings.Vector);
overriding
function Long_Description (Cmd : Instance) return AAA.Strings.Vector
is (AAA.Strings.Empty_Vector);
overriding
procedure Setup_Switches
(Cmd : in out Instance;
Config : in out CLIC.Subcommand.Switches_Configuration)
is null;
overriding
function Short_Description (Cmd : Instance) return String
is ("Subcommands in a subcommand");
overriding
function Usage_Custom_Parameters (Cmd : Instance) return String
is ("");
private
type Instance
is new CLIC.Subcommand.Command
with null record;
end CLIC_Ex.Commands.Subsub;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- O S I N T - B --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the low level, operating system routines used only
-- in the GNAT binder for command line processing and file input output.
package Osint.B is
function More_Lib_Files return Boolean;
-- Indicates whether more library information files remain to be processed.
-- Returns False right away if no source files, or if all source files
-- have been processed.
function Next_Main_Lib_File return File_Name_Type;
-- This function returns the name of the next library info file specified
-- on the command line. It is an error to call Next_Main_Lib_File if no
-- more library information files exist (i.e. Next_Main_Lib_File may be
-- called only if a previous call to More_Lib_Files returned True). This
-- name is the simple name, excluding any directory information.
-------------------
-- Binder Output --
-------------------
-- These routines are used by the binder to generate the Ada source files
-- containing the binder output. The format of these files is described in
-- package Bindgen.
procedure Create_Binder_Output
(Output_File_Name : String;
Typ : Character;
Bfile : out Name_Id);
-- Creates the binder output file. Typ is one of
-- 'b' create body file for case of generating Ada
-- 's' create spec file for case of generating Ada
--
-- If Output_File_Name is null, then a default name is used based on
-- the name of the most recently accessed main source file name. If
-- Output_File_Name is non-null then it is the full path name of the
-- file to be output (in the case of Ada, it must have an extension
-- of adb, and the spec file is created by changing the last character
-- from b to s. On return, Bfile also contains the Name_Id for the
-- generated file name.
procedure Write_Binder_Info (Info : String);
-- Writes the contents of the referenced string to the binder output file
-- created by a previous call to Create_Binder_Output. Info represents a
-- single line in the file, but does not contain any line termination
-- characters. The implementation of Write_Binder_Info is responsible
-- for adding necessary end of line and end of file control characters
-- as required by the operating system.
procedure Close_Binder_Output;
-- Closes the file created by Create_Binder_Output, flushing any
-- buffers etc. from writes by Write_Binder_Info.
procedure Set_Current_File_Name_Index (To : Int);
-- Set value of Current_File_Name_Index (in private part of Osint) to To
----------------------------------
-- Other binder-generated files --
----------------------------------
procedure Set_List_File (Filename : String);
-- Create Filename as a text output file and set it as the current output
-- (see Output.Set_Output).
procedure Close_List_File;
-- If a specific output file was created by Set_List_File, close it and
-- reset the current output file to standard output.
end Osint.B;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . C H 1 3 --
-- --
-- B o d y --
-- --
-- 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. 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. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
separate (Par)
package body Ch13 is
-- Local functions, used only in this chapter
function P_Component_Clause return Node_Id;
function P_Mod_Clause return Node_Id;
-----------------------------------
-- Aspect_Specifications_Present --
-----------------------------------
function Aspect_Specifications_Present
(Strict : Boolean := Ada_Version < Ada_2012) return Boolean
is
Scan_State : Saved_Scan_State;
Result : Boolean;
function Possible_Misspelled_Aspect return Boolean;
-- Returns True, if Token_Name is a misspelling of some aspect name
function With_Present return Boolean;
-- Returns True if WITH is present, indicating presence of aspect
-- specifications. Also allows incorrect use of WHEN in place of WITH.
--------------------------------
-- Possible_Misspelled_Aspect --
--------------------------------
function Possible_Misspelled_Aspect return Boolean is
begin
for J in Aspect_Id_Exclude_No_Aspect loop
if Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J)) then
return True;
end if;
end loop;
return False;
end Possible_Misspelled_Aspect;
------------------
-- With_Present --
------------------
function With_Present return Boolean is
begin
if Token = Tok_With then
return True;
-- Check for WHEN used in place of WITH
elsif Token = Tok_When then
declare
Scan_State : Saved_Scan_State;
begin
Save_Scan_State (Scan_State);
Scan; -- past WHEN
if Token = Tok_Identifier
and then Get_Aspect_Id (Token_Name) /= No_Aspect
then
Error_Msg_SC ("WHEN should be WITH");
Restore_Scan_State (Scan_State);
return True;
else
Restore_Scan_State (Scan_State);
return False;
end if;
end;
else
return False;
end if;
end With_Present;
-- Start of processing for Aspect_Specifications_Present
begin
-- Definitely must have WITH to consider aspect specs to be present
-- Note that this means that if we have a semicolon, we immediately
-- return False. There is a case in which this is not optimal, namely
-- something like
-- type R is new Integer;
-- with bla bla;
-- where the semicolon is redundant, but scanning forward for it would
-- be too expensive. Instead we pick up the aspect specifications later
-- as a bogus declaration, and diagnose the semicolon at that point.
if not With_Present then
return False;
end if;
-- Have a WITH or some token that we accept as a legitimate bad attempt
-- at writing WITH. See if it looks like an aspect specification
Save_Scan_State (Scan_State);
Scan; -- past WITH (or WHEN or other bad keyword)
-- If no identifier, then consider that we definitely do not have an
-- aspect specification.
if Token /= Tok_Identifier then
Result := False;
-- This is where we pay attention to the Strict mode. Normally when
-- we are in Ada 2012 mode, Strict is False, and we consider that we
-- have an aspect specification if the identifier is an aspect name
-- or a likely misspelling of one (even if not followed by =>) or
-- the identifier is not an aspect name but is followed by =>, by
-- a comma, or by a semicolon. The last two cases correspond to
-- (misspelled) Boolean aspects with a defaulted value of True.
-- P_Aspect_Specifications will generate messages if the aspect
-- specification is ill-formed.
elsif not Strict then
if Get_Aspect_Id (Token_Name) /= No_Aspect
or else Possible_Misspelled_Aspect
then
Result := True;
else
Scan; -- past identifier
Result := Token = Tok_Arrow or else
Token = Tok_Comma or else
Token = Tok_Semicolon;
end if;
-- If earlier than Ada 2012, check for valid aspect identifier (possibly
-- completed with 'CLASS) followed by an arrow, and consider that this
-- is still an aspect specification so we give an appropriate message.
else
if Get_Aspect_Id (Token_Name) = No_Aspect then
Result := False;
else
Scan; -- past aspect name
Result := False;
if Token = Tok_Arrow then
Result := True;
-- The identifier may be the name of a boolean aspect with a
-- defaulted True value. Further checks when analyzing aspect
-- specification, which may include further aspects.
elsif Token = Tok_Comma or else Token = Tok_Semicolon then
Result := True;
elsif Token = Tok_Apostrophe then
Scan; -- past apostrophe
if Token = Tok_Identifier
and then Token_Name = Name_Class
then
Scan; -- past CLASS
if Token = Tok_Arrow then
Result := True;
end if;
end if;
end if;
if Result then
Restore_Scan_State (Scan_State);
Error_Msg_Ada_2012_Feature ("|aspect specification", Token_Ptr);
return True;
end if;
end if;
end if;
Restore_Scan_State (Scan_State);
return Result;
end Aspect_Specifications_Present;
-------------------------------
-- Get_Aspect_Specifications --
-------------------------------
function Get_Aspect_Specifications
(Semicolon : Boolean := True) return List_Id
is
A_Id : Aspect_Id;
Aspect : Node_Id;
Aspects : List_Id;
OK : Boolean;
Opt : Boolean;
-- True if current aspect takes an optional argument
begin
Aspects := Empty_List;
-- Check if aspect specification present
if not Aspect_Specifications_Present then
if Semicolon then
TF_Semicolon;
end if;
return Aspects;
end if;
Scan; -- past WITH (or possible WHEN after error)
Aspects := Empty_List;
-- Loop to scan aspects
loop
OK := True;
-- The aspect mark is not an identifier
if Token /= Tok_Identifier then
Error_Msg_SC ("aspect identifier expected");
-- Skip the whole aspect specification list
if Semicolon then
Resync_Past_Semicolon;
end if;
return Aspects;
end if;
A_Id := Get_Aspect_Id (Token_Name);
Aspect :=
Make_Aspect_Specification (Token_Ptr,
Identifier => Token_Node);
-- The aspect mark is not recognized
if A_Id = No_Aspect then
Error_Msg_N ("& is not a valid aspect identifier", Token_Node);
OK := False;
-- Check bad spelling
for J in Aspect_Id_Exclude_No_Aspect loop
if Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J)) then
Error_Msg_Name_1 := Aspect_Names (J);
Error_Msg_N -- CODEFIX
("\possible misspelling of%", Token_Node);
exit;
end if;
end loop;
Scan; -- past incorrect identifier
if Token = Tok_Apostrophe then
Scan; -- past apostrophe
Scan; -- past presumably CLASS
end if;
-- Attempt to parse the aspect definition by assuming it is an
-- expression.
if Token = Tok_Arrow then
Scan; -- past arrow
Set_Expression (Aspect, P_Expression);
-- If we have a correct terminator (comma or semicolon, or a
-- reasonable likely missing comma), then just proceed.
elsif Token = Tok_Comma or else
Token = Tok_Semicolon or else
Token = Tok_Identifier
then
null;
-- Otherwise the aspect contains a junk definition
else
if Semicolon then
Resync_Past_Semicolon;
end if;
return Aspects;
end if;
-- Aspect mark is OK
else
Scan; -- past identifier
Opt := Aspect_Argument (A_Id) = Optional_Expression
or else
Aspect_Argument (A_Id) = Optional_Name;
-- Check for 'Class present
if Token = Tok_Apostrophe then
if Class_Aspect_OK (A_Id) then
Scan; -- past apostrophe
if Token = Tok_Identifier
and then Token_Name = Name_Class
then
Scan; -- past CLASS
Set_Class_Present (Aspect);
else
Error_Msg_SC ("Class attribute expected here");
OK := False;
if Token = Tok_Identifier then
Scan; -- past identifier not CLASS
end if;
end if;
-- The aspect does not allow 'Class
else
Error_Msg_Node_1 := Identifier (Aspect);
Error_Msg_SC ("aspect& does not permit attribute here");
OK := False;
Scan; -- past apostrophe
Scan; -- past presumably CLASS
end if;
end if;
-- Check for a missing aspect definition. Aspects with optional
-- definitions are not considered.
if Token = Tok_Comma or else Token = Tok_Semicolon then
if not Opt then
Error_Msg_Node_1 := Identifier (Aspect);
Error_Msg_AP ("aspect& requires an aspect definition");
OK := False;
end if;
-- Here we do not have a comma or a semicolon, we are done if we
-- do not have an arrow and the aspect does not need an argument
elsif Opt and then Token /= Tok_Arrow then
null;
-- Here we have either an arrow, or an aspect that definitely
-- needs an aspect definition, and we will look for one even if
-- no arrow is preseant.
-- Otherwise we have an aspect definition
else
if Token = Tok_Arrow then
Scan; -- past arrow
else
T_Arrow;
OK := False;
end if;
-- Detect a common error where the non-null definition of
-- aspect Depends, Global, Refined_Depends, Refined_Global
-- or Refined_State lacks enclosing parentheses.
if Token /= Tok_Left_Paren and then Token /= Tok_Null then
-- [Refined_]Depends
if A_Id = Aspect_Depends
or else
A_Id = Aspect_Refined_Depends
then
Error_Msg_SC -- CODEFIX
("missing ""(""");
Resync_Past_Malformed_Aspect;
-- Return when the current aspect is the last in the list
-- of specifications and the list applies to a body.
if Token = Tok_Is then
return Aspects;
end if;
-- [Refined_]Global
elsif A_Id = Aspect_Global
or else
A_Id = Aspect_Refined_Global
then
declare
Scan_State : Saved_Scan_State;
begin
Save_Scan_State (Scan_State);
Scan; -- past item or mode_selector
-- Emit an error when the aspect has a mode_selector
-- as the moded_global_list must be parenthesized:
-- with Global => Output => Item
if Token = Tok_Arrow then
Restore_Scan_State (Scan_State);
Error_Msg_SC -- CODEFIX
("missing ""(""");
Resync_Past_Malformed_Aspect;
-- Return when the current aspect is the last in
-- the list of specifications and the list applies
-- to a body.
if Token = Tok_Is then
return Aspects;
end if;
elsif Token = Tok_Comma then
Scan; -- past comma
-- An item followed by a comma does not need to
-- be parenthesized if the next token is a valid
-- aspect name:
-- with Global => Item,
-- Aspect => ...
if Token = Tok_Identifier
and then Get_Aspect_Id (Token_Name) /= No_Aspect
then
Restore_Scan_State (Scan_State);
-- Otherwise this is a list of items in which case
-- the list must be parenthesized.
else
Restore_Scan_State (Scan_State);
Error_Msg_SC -- CODEFIX
("missing ""(""");
Resync_Past_Malformed_Aspect;
-- Return when the current aspect is the last
-- in the list of specifications and the list
-- applies to a body.
if Token = Tok_Is then
return Aspects;
end if;
end if;
-- The definition of [Refined_]Global does not need to
-- be parenthesized.
else
Restore_Scan_State (Scan_State);
end if;
end;
-- Refined_State
elsif A_Id = Aspect_Refined_State then
if Token = Tok_Identifier then
declare
Scan_State : Saved_Scan_State;
begin
Save_Scan_State (Scan_State);
Scan; -- past state
-- The refinement contains a constituent, the whole
-- argument of Refined_State must be parenthesized.
-- with Refined_State => State => Constit
if Token = Tok_Arrow then
Restore_Scan_State (Scan_State);
Error_Msg_SC -- CODEFIX
("missing ""(""");
Resync_Past_Malformed_Aspect;
-- Return when the current aspect is the last
-- in the list of specifications and the list
-- applies to a body.
if Token = Tok_Is then
return Aspects;
end if;
-- The refinement lacks constituents. Do not flag
-- this case as the error would be misleading. The
-- diagnostic is left to the analysis.
-- with Refined_State => State
else
Restore_Scan_State (Scan_State);
end if;
end;
end if;
end if;
end if;
-- Note if inside Depends aspect
if A_Id = Aspect_Depends then
Inside_Depends := True;
end if;
-- Parse the aspect definition depening on the expected
-- argument kind.
if Aspect_Argument (A_Id) = Name
or else Aspect_Argument (A_Id) = Optional_Name
then
Set_Expression (Aspect, P_Name);
else
pragma Assert
(Aspect_Argument (A_Id) = Expression
or else
Aspect_Argument (A_Id) = Optional_Expression);
Set_Expression (Aspect, P_Expression);
end if;
-- Unconditionally reset flag for Inside_Depends
Inside_Depends := False;
end if;
-- Add the aspect to the resulting list only when it was properly
-- parsed.
if OK then
Append (Aspect, Aspects);
end if;
end if;
-- Merge here after good or bad aspect (we should be at a comma
-- or a semicolon, but there might be other possible errors).
-- The aspect specification list contains more than one aspect
if Token = Tok_Comma then
Scan; -- past comma
goto Continue;
-- Check for a missing comma between two aspects. Emit an error
-- and proceed to the next aspect.
elsif Token = Tok_Identifier
and then Get_Aspect_Id (Token_Name) /= No_Aspect
then
declare
Scan_State : Saved_Scan_State;
begin
Save_Scan_State (Scan_State);
Scan; -- past identifier
-- Attempt to detect ' or => following a potential aspect
-- mark.
if Token = Tok_Apostrophe or else Token = Tok_Arrow then
Restore_Scan_State (Scan_State);
Error_Msg_AP -- CODEFIX
("|missing "",""");
goto Continue;
-- The construct following the current aspect is not an
-- aspect.
else
Restore_Scan_State (Scan_State);
end if;
end;
-- Check for a mistyped semicolon in place of a comma between two
-- aspects. Emit an error and proceed to the next aspect.
elsif Token = Tok_Semicolon then
declare
Scan_State : Saved_Scan_State;
begin
Save_Scan_State (Scan_State);
Scan; -- past semicolon
if Token = Tok_Identifier
and then Get_Aspect_Id (Token_Name) /= No_Aspect
then
Scan; -- past identifier
-- Attempt to detect ' or => following potential aspect mark
if Token = Tok_Apostrophe or else Token = Tok_Arrow then
Restore_Scan_State (Scan_State);
Error_Msg_SC -- CODEFIX
("|"";"" should be "",""");
Scan; -- past semicolon
goto Continue;
end if;
end if;
-- Construct following the current aspect is not an aspect
Restore_Scan_State (Scan_State);
end;
end if;
-- Require semicolon if caller expects to scan this out
if Semicolon then
T_Semicolon;
end if;
exit;
<<Continue>>
null;
end loop;
return Aspects;
end Get_Aspect_Specifications;
--------------------------------------------
-- 13.1 Representation Clause (also I.7) --
--------------------------------------------
-- REPRESENTATION_CLAUSE ::=
-- ATTRIBUTE_DEFINITION_CLAUSE
-- | ENUMERATION_REPRESENTATION_CLAUSE
-- | RECORD_REPRESENTATION_CLAUSE
-- | AT_CLAUSE
-- ATTRIBUTE_DEFINITION_CLAUSE ::=
-- for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use EXPRESSION;
-- | for LOCAL_NAME'ATTRIBUTE_DESIGNATOR use NAME;
-- Note: in Ada 83, the expression must be a simple expression
-- AT_CLAUSE ::= for DIRECT_NAME use at EXPRESSION;
-- Note: in Ada 83, the expression must be a simple expression
-- ENUMERATION_REPRESENTATION_CLAUSE ::=
-- for first_subtype_LOCAL_NAME use ENUMERATION_AGGREGATE;
-- ENUMERATION_AGGREGATE ::= ARRAY_AGGREGATE
-- RECORD_REPRESENTATION_CLAUSE ::=
-- for first_subtype_LOCAL_NAME use
-- record [MOD_CLAUSE]
-- {COMPONENT_CLAUSE}
-- end record;
-- Note: for now we allow only a direct name as the local name in the
-- above constructs. This probably needs changing later on ???
-- The caller has checked that the initial token is FOR
-- Error recovery: cannot raise Error_Resync, if an error occurs,
-- the scan is repositioned past the next semicolon.
function P_Representation_Clause return Node_Id is
For_Loc : Source_Ptr;
Name_Node : Node_Id;
Prefix_Node : Node_Id;
Attr_Name : Name_Id;
Identifier_Node : Node_Id;
Rep_Clause_Node : Node_Id;
Expr_Node : Node_Id;
Record_Items : List_Id;
begin
For_Loc := Token_Ptr;
Scan; -- past FOR
-- Note that the name in a representation clause is always a simple
-- name, even in the attribute case, see AI-300 which made this so.
Identifier_Node := P_Identifier (C_Use);
-- Check case of qualified name to give good error message
if Token = Tok_Dot then
Error_Msg_SC
("representation clause requires simple name!");
loop
exit when Token /= Tok_Dot;
Scan; -- past dot
Discard_Junk_Node (P_Identifier);
end loop;
end if;
-- Attribute Definition Clause
if Token = Tok_Apostrophe then
-- Allow local names of the form a'b'.... This enables
-- us to parse class-wide streams attributes correctly.
Name_Node := Identifier_Node;
while Token = Tok_Apostrophe loop
Scan; -- past apostrophe
Identifier_Node := Token_Node;
Attr_Name := No_Name;
if Token = Tok_Identifier then
Attr_Name := Token_Name;
-- Note that the parser must complain in case of an internal
-- attribute name that comes from source since internal names
-- are meant to be used only by the compiler.
if not Is_Attribute_Name (Attr_Name)
and then (not Is_Internal_Attribute_Name (Attr_Name)
or else Comes_From_Source (Token_Node))
then
Signal_Bad_Attribute;
end if;
if Style_Check then
Style.Check_Attribute_Name (False);
end if;
-- Here for case of attribute designator is not an identifier
else
if Token = Tok_Delta then
Attr_Name := Name_Delta;
elsif Token = Tok_Digits then
Attr_Name := Name_Digits;
elsif Token = Tok_Access then
Attr_Name := Name_Access;
else
Error_Msg_AP ("attribute designator expected");
raise Error_Resync;
end if;
if Style_Check then
Style.Check_Attribute_Name (True);
end if;
end if;
-- Here we have an OK attribute scanned, and the corresponding
-- Attribute identifier node is stored in Ident_Node.
Prefix_Node := Name_Node;
Name_Node := New_Node (N_Attribute_Reference, Prev_Token_Ptr);
Set_Prefix (Name_Node, Prefix_Node);
Set_Attribute_Name (Name_Node, Attr_Name);
Scan;
-- Check for Address clause which needs to be marked for use in
-- optimizing performance of Exp_Util.Following_Address_Clause.
if Attr_Name = Name_Address
and then Nkind (Prefix_Node) = N_Identifier
then
Set_Name_Table_Boolean1 (Chars (Prefix_Node), True);
end if;
end loop;
Rep_Clause_Node := New_Node (N_Attribute_Definition_Clause, For_Loc);
Set_Name (Rep_Clause_Node, Prefix_Node);
Set_Chars (Rep_Clause_Node, Attr_Name);
T_Use;
Expr_Node := P_Expression_No_Right_Paren;
Check_Simple_Expression_In_Ada_83 (Expr_Node);
Set_Expression (Rep_Clause_Node, Expr_Node);
else
TF_Use;
Rep_Clause_Node := Empty;
-- AT follows USE (At Clause)
if Token = Tok_At then
Scan; -- past AT
Rep_Clause_Node := New_Node (N_At_Clause, For_Loc);
Set_Identifier (Rep_Clause_Node, Identifier_Node);
Expr_Node := P_Expression_No_Right_Paren;
Check_Simple_Expression_In_Ada_83 (Expr_Node);
Set_Expression (Rep_Clause_Node, Expr_Node);
-- Mark occurrence of address clause (used to optimize performance
-- of Exp_Util.Following_Address_Clause).
Set_Name_Table_Boolean1 (Chars (Identifier_Node), True);
-- RECORD follows USE (Record Representation Clause)
elsif Token = Tok_Record then
Record_Items := P_Pragmas_Opt;
Rep_Clause_Node :=
New_Node (N_Record_Representation_Clause, For_Loc);
Set_Identifier (Rep_Clause_Node, Identifier_Node);
Push_Scope_Stack;
Scope.Table (Scope.Last).Etyp := E_Record;
Scope.Table (Scope.Last).Ecol := Start_Column;
Scope.Table (Scope.Last).Sloc := Token_Ptr;
Scan; -- past RECORD
Record_Items := P_Pragmas_Opt;
-- Possible Mod Clause
if Token = Tok_At then
Set_Mod_Clause (Rep_Clause_Node, P_Mod_Clause);
Set_Pragmas_Before (Mod_Clause (Rep_Clause_Node), Record_Items);
Record_Items := P_Pragmas_Opt;
end if;
if No (Record_Items) then
Record_Items := New_List;
end if;
Set_Component_Clauses (Rep_Clause_Node, Record_Items);
-- Loop through component clauses
loop
if Token not in Token_Class_Name then
exit when Check_End;
end if;
Append (P_Component_Clause, Record_Items);
P_Pragmas_Opt (Record_Items);
end loop;
-- Left paren follows USE (Enumeration Representation Clause)
elsif Token = Tok_Left_Paren then
Rep_Clause_Node :=
New_Node (N_Enumeration_Representation_Clause, For_Loc);
Set_Identifier (Rep_Clause_Node, Identifier_Node);
Set_Array_Aggregate (Rep_Clause_Node, P_Aggregate);
-- Some other token follows FOR (invalid representation clause)
else
Error_Msg_SC ("invalid representation clause");
raise Error_Resync;
end if;
end if;
TF_Semicolon;
return Rep_Clause_Node;
exception
when Error_Resync =>
Resync_Past_Semicolon;
return Error;
end P_Representation_Clause;
----------------------
-- 13.1 Local Name --
----------------------
-- Local name is always parsed by its parent. In the case of its use in
-- pragmas, the check for a local name is handled in Par.Prag and allows
-- all the possible forms of local name. For the uses in chapter 13, we
-- currently only allow a direct name, but this should probably change???
---------------------------
-- 13.1 At Clause (I.7) --
---------------------------
-- Parsed by P_Representation_Clause (13.1)
---------------------------------------
-- 13.3 Attribute Definition Clause --
---------------------------------------
-- Parsed by P_Representation_Clause (13.1)
--------------------------------
-- 13.1 Aspect Specification --
--------------------------------
-- ASPECT_SPECIFICATION ::=
-- with ASPECT_MARK [=> ASPECT_DEFINITION] {,
-- ASPECT_MARK [=> ASPECT_DEFINITION] }
-- ASPECT_MARK ::= aspect_IDENTIFIER['Class]
-- ASPECT_DEFINITION ::= NAME | EXPRESSION
-- Error recovery: cannot raise Error_Resync
procedure P_Aspect_Specifications
(Decl : Node_Id;
Semicolon : Boolean := True)
is
Aspects : List_Id;
Ptr : Source_Ptr;
begin
-- Aspect Specification is present
Ptr := Token_Ptr;
-- Here we have an aspect specification to scan, note that we don't
-- set the flag till later, because it may turn out that we have no
-- valid aspects in the list.
Aspects := Get_Aspect_Specifications (Semicolon);
-- Here if aspects present
if Is_Non_Empty_List (Aspects) then
-- If Decl is Empty, we just ignore the aspects (the caller in this
-- case has always issued an appropriate error message).
if Decl = Empty then
null;
-- If Decl is Error, we ignore the aspects, and issue a message
elsif Decl = Error then
Error_Msg ("aspect specifications not allowed here", Ptr);
-- Here aspects are allowed, and we store them
else
Set_Parent (Aspects, Decl);
Set_Aspect_Specifications (Decl, Aspects);
end if;
end if;
end P_Aspect_Specifications;
---------------------------------------------
-- 13.4 Enumeration Representation Clause --
---------------------------------------------
-- Parsed by P_Representation_Clause (13.1)
---------------------------------
-- 13.4 Enumeration Aggregate --
---------------------------------
-- Parsed by P_Representation_Clause (13.1)
------------------------------------------
-- 13.5.1 Record Representation Clause --
------------------------------------------
-- Parsed by P_Representation_Clause (13.1)
------------------------------
-- 13.5.1 Mod Clause (I.8) --
------------------------------
-- MOD_CLAUSE ::= at mod static_EXPRESSION;
-- Note: in Ada 83, the expression must be a simple expression
-- The caller has checked that the initial Token is AT
-- Error recovery: cannot raise Error_Resync
-- Note: the caller is responsible for setting the Pragmas_Before field
function P_Mod_Clause return Node_Id is
Mod_Node : Node_Id;
Expr_Node : Node_Id;
begin
Mod_Node := New_Node (N_Mod_Clause, Token_Ptr);
Scan; -- past AT
T_Mod;
Expr_Node := P_Expression_No_Right_Paren;
Check_Simple_Expression_In_Ada_83 (Expr_Node);
Set_Expression (Mod_Node, Expr_Node);
TF_Semicolon;
return Mod_Node;
end P_Mod_Clause;
------------------------------
-- 13.5.1 Component Clause --
------------------------------
-- COMPONENT_CLAUSE ::=
-- COMPONENT_CLAUSE_COMPONENT_NAME at POSITION
-- range FIRST_BIT .. LAST_BIT;
-- COMPONENT_CLAUSE_COMPONENT_NAME ::=
-- component_DIRECT_NAME
-- | component_DIRECT_NAME'ATTRIBUTE_DESIGNATOR
-- | FIRST_SUBTYPE_DIRECT_NAME'ATTRIBUTE_DESIGNATOR
-- POSITION ::= static_EXPRESSION
-- Note: in Ada 83, the expression must be a simple expression
-- FIRST_BIT ::= static_SIMPLE_EXPRESSION
-- LAST_BIT ::= static_SIMPLE_EXPRESSION
-- Note: the AARM V2.0 grammar has an error at this point, it uses
-- EXPRESSION instead of SIMPLE_EXPRESSION for FIRST_BIT and LAST_BIT
-- Error recovery: cannot raise Error_Resync
function P_Component_Clause return Node_Id is
Component_Node : Node_Id;
Comp_Name : Node_Id;
Expr_Node : Node_Id;
begin
Component_Node := New_Node (N_Component_Clause, Token_Ptr);
Comp_Name := P_Name;
if Nkind (Comp_Name) = N_Identifier
or else Nkind (Comp_Name) = N_Attribute_Reference
then
Set_Component_Name (Component_Node, Comp_Name);
else
Error_Msg_N
("component name must be direct name or attribute", Comp_Name);
Set_Component_Name (Component_Node, Error);
end if;
Set_Sloc (Component_Node, Token_Ptr);
T_At;
Expr_Node := P_Expression_No_Right_Paren;
Check_Simple_Expression_In_Ada_83 (Expr_Node);
Set_Position (Component_Node, Expr_Node);
T_Range;
Expr_Node := P_Expression_No_Right_Paren;
Check_Simple_Expression_In_Ada_83 (Expr_Node);
Set_First_Bit (Component_Node, Expr_Node);
T_Dot_Dot;
Expr_Node := P_Expression_No_Right_Paren;
Check_Simple_Expression_In_Ada_83 (Expr_Node);
Set_Last_Bit (Component_Node, Expr_Node);
TF_Semicolon;
return Component_Node;
end P_Component_Clause;
----------------------
-- 13.5.1 Position --
----------------------
-- Parsed by P_Component_Clause (13.5.1)
-----------------------
-- 13.5.1 First Bit --
-----------------------
-- Parsed by P_Component_Clause (13.5.1)
----------------------
-- 13.5.1 Last Bit --
----------------------
-- Parsed by P_Component_Clause (13.5.1)
--------------------------
-- 13.8 Code Statement --
--------------------------
-- CODE_STATEMENT ::= QUALIFIED_EXPRESSION
-- On entry the caller has scanned the SUBTYPE_MARK (passed in as the
-- single argument, and the scan points to the apostrophe.
-- Error recovery: can raise Error_Resync
function P_Code_Statement (Subtype_Mark : Node_Id) return Node_Id is
Node1 : Node_Id;
begin
Scan; -- past apostrophe
-- If left paren, then we have a possible code statement
if Token = Tok_Left_Paren then
Node1 := New_Node (N_Code_Statement, Sloc (Subtype_Mark));
Set_Expression (Node1, P_Qualified_Expression (Subtype_Mark));
TF_Semicolon;
return Node1;
-- Otherwise we have an illegal range attribute. Note that P_Name
-- ensures that Token = Tok_Range is the only possibility left here.
else
Error_Msg_SC ("RANGE attribute illegal here!");
raise Error_Resync;
end if;
end P_Code_Statement;
end Ch13;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S I N F O --
-- --
-- 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. --
-- --
-- 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 --
----------------------------
-- Note: The use of Assert (False or else ...) is just a device to allow
-- uniform format of the conditions following this. Note that csinfo
-- expects this uniform format.
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
or else NT (N).Nkind = N_Iterated_Component_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_Delta_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 Entity_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_Iterated_Component_Association
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_Iterated_Component_Association
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_Delta_Aggregate
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_Iterated_Component_Association
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 Expression_Copy
(N : Node_Id) return Node_Id is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma_Argument_Association);
return Node2 (N);
end Expression_Copy;
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_Target_Names
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
return Flag8 (N);
end Has_Target_Names;
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_Abort_Block
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement);
return Flag4 (N);
end Is_Abort_Block;
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_Analyzed_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return Flag5 (N);
end Is_Analyzed_Pragma;
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_Checked_Ghost_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return Flag3 (N);
end Is_Checked_Ghost_Pragma;
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
or else NT (N).Nkind = N_Subprogram_Declaration);
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_Expanded_Contract
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Contract);
return Flag1 (N);
end Is_Expanded_Contract;
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_Generic_Contract_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return Flag2 (N);
end Is_Generic_Contract_Pragma;
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_Ignored_Ghost_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return Flag8 (N);
end Is_Ignored_Ghost_Pragma;
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_Pragma
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
return Flag4 (N);
end Is_Inherited_Pragma;
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_Qualified_Universal_Literal
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Qualified_Expression);
return Flag4 (N);
end Is_Qualified_Universal_Literal;
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_Body_Procedure
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body
or else NT (N).Nkind = N_Subprogram_Declaration);
return Flag1 (N);
end Is_Task_Body_Procedure;
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
or else NT (N).Nkind = N_Iterated_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_Side_Effect_Removal
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call);
return Flag1 (N);
end No_Side_Effect_Removal;
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_Expression_Function
(N : Node_Id) return Boolean is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body);
return Flag18 (N);
end Was_Expression_Function;
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
or else NT (N).Nkind = N_Iterated_Component_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_Delta_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 : Entity_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_Iterated_Component_Association
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_Iterated_Component_Association
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_Delta_Aggregate
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_Iterated_Component_Association
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_Expression_Copy
(N : Node_Id; Val : Node_Id) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma_Argument_Association);
Set_Node2 (N, Val); -- semantic field, no parent set
end Set_Expression_Copy;
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_Target_Names
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Assignment_Statement);
Set_Flag8 (N, Val);
end Set_Has_Target_Names;
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_Abort_Block
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Block_Statement);
Set_Flag4 (N, Val);
end Set_Is_Abort_Block;
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_Analyzed_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
Set_Flag5 (N, Val);
end Set_Is_Analyzed_Pragma;
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_Checked_Ghost_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
Set_Flag3 (N, Val);
end Set_Is_Checked_Ghost_Pragma;
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
or else NT (N).Nkind = N_Subprogram_Declaration);
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_Expanded_Contract
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Contract);
Set_Flag1 (N, Val);
end Set_Is_Expanded_Contract;
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_Generic_Contract_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
Set_Flag2 (N, Val);
end Set_Is_Generic_Contract_Pragma;
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_Ignored_Ghost_Pragma
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Pragma);
Set_Flag8 (N, Val);
end Set_Is_Ignored_Ghost_Pragma;
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_Pragma
(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_Pragma;
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_Qualified_Universal_Literal
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Qualified_Expression);
Set_Flag4 (N, Val);
end Set_Is_Qualified_Universal_Literal;
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_Body_Procedure
(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_Subprogram_Declaration);
Set_Flag1 (N, Val);
end Set_Is_Task_Body_Procedure;
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
or else NT (N).Nkind = N_Iterated_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_Side_Effect_Removal
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Function_Call);
Set_Flag1 (N, Val);
end Set_No_Side_Effect_Removal;
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_Expression_Function
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
or else NT (N).Nkind = N_Subprogram_Body);
Set_Flag18 (N, Val);
end Set_Was_Expression_Function;
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_Unmapped (N : Node_Id) return Name_Id is
begin
return Chars (Pragma_Identifier (N));
end Pragma_Name_Unmapped;
---------------------
-- Map_Pragma_Name --
---------------------
-- We don't want to introduce a dependence on some hash table package or
-- similar, so we use a simple array of Key => Value pairs, and do a linear
-- search. Linear search is plenty efficient, given that we don't expect
-- more than a couple of entries in the mapping.
type Name_Pair is record
Key : Name_Id;
Value : Name_Id;
end record;
type Pragma_Map_Index is range 1 .. 100;
Pragma_Map : array (Pragma_Map_Index) of Name_Pair;
Last_Pair : Pragma_Map_Index'Base range 0 .. Pragma_Map_Index'Last := 0;
procedure Map_Pragma_Name (From, To : Name_Id) is
begin
if Last_Pair = Pragma_Map'Last then
raise Too_Many_Pragma_Mappings;
end if;
Last_Pair := Last_Pair + 1;
Pragma_Map (Last_Pair) := (Key => From, Value => To);
end Map_Pragma_Name;
-----------------
-- Pragma_Name --
-----------------
function Pragma_Name (N : Node_Id) return Name_Id is
Result : constant Name_Id := Pragma_Name_Unmapped (N);
begin
for J in Pragma_Map'First .. Last_Pair loop
if Result = Pragma_Map (J).Key then
return Pragma_Map (J).Value;
end if;
end loop;
return Result;
end Pragma_Name;
end Sinfo;
|
------------------------------------------------------------------------------
-- --
-- Unicode Utilities --
-- UTF-8 Stream Decoder --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Characters.Conversions;
with Unicode.UTF8_Stream_Decoder.Codec;
package body Unicode.UTF8_Stream_Decoder is
--
-- Stream Decoders
--
-----------------
-- Decode_Next -- (Wide_Wide_Character)
-----------------
function Decode_Next (UTF8_Stream : not null access Root_Stream_Type'Class)
return Wide_Wide_Character
is
use Codec;
Buffer: Sequence_Array (1 .. 4) := (others => 0);
Last, Continuation: Stream_Element_Offset;
Status: Decode_Status;
begin
return Result: Wide_Wide_Character do
-- Load next octet (hoping for a valid starting octet)
Stream_Element'Read (UTF8_Stream, Buffer(1));
-- Phase 1, check for sync and then mult-byte sequence
Try_Decode (Sequence => Buffer(1 .. 1),
Last => Last,
Continuation_Bytes => Continuation,
Result => Result,
Status => Status);
-- See if we have an indicated multi-byte condition
if Status = Short_Load then
-- Load the expected number of octets and re-run
declare
-- The (verified) postcondition of Try_Decode promises that
-- Continuation will be 1 .. 3. Therefore we know that the
-- above range will never be larger than 2 .. 3 + 1 = 4
pragma Suppress (Index_Check);
pragma Suppress (Length_Check);
pragma Suppress (Overflow_Check);
pragma Suppress (Range_Check);
-- 2 .. 2, 2 .. 3, 2 .. 4 - all ok
-- Also note that the components of Sequence_Array is
-- a modular type - and therefore Overflow_Check and
-- Range_Check do not apply to those (the return values)
-- anyways.
begin
Sequence_Array'Read
(UTF8_Stream, Buffer(2 .. Continuation + 1));
end;
-- Run Try_Decode again for the final Result
Try_Decode (Sequence => Buffer(1 .. Continuation + 1),
Last => Last,
Continuation_Bytes => Continuation,
Result => Result,
Status => Status);
end if;
-- Note that the postcondition of Try_Decode promises that if Status
-- is not "Success", then Result will always be
-- Unicode_Replacement_Character
end return;
end Decode_Next;
-----------------
-- Decode_Next -- (Wide_Character)
-----------------
function Decode_Next (UTF8_Stream : not null access Root_Stream_Type'Class)
return Wide_Character
is
use Ada.Characters.Conversions;
Full_Char: Wide_Wide_Character
:= Decode_Next (UTF8_Stream);
begin
if not Is_Wide_Character (Full_Char) then
raise Insufficient_Width
with "Encoded character is not within the range of Wide_Character";
else
return To_Wide_Character (Full_Char);
end if;
end Decode_Next;
-----------------
-- Decode_Next -- (Character)
-----------------
function Decode_Next (UTF8_Stream : not null access Root_Stream_Type'Class)
return Character
is
use Ada.Characters.Conversions;
Full_Char: Wide_Wide_Character
:= Decode_Next (UTF8_Stream);
begin
if not Is_Character (Full_Char) then
raise Insufficient_Width
with "Encoded character is not within the range of Character";
else
return To_Character (Full_Char);
end if;
end Decode_Next;
-- Buffer Decoders ---------------------------------------------------------
-----------------
-- Decode_Next -- (Wide_Wide_Character)
-----------------
procedure Decode_Next (Buffer : in Stream_Element_Array;
Last : out Stream_Element_Offset;
Result : out Wide_Wide_Character)
is
use Codec;
Start : Stream_Element_Offset := Buffer'First;
Continuation: Stream_Element_Offset;
Status : Decode_Status;
Sequence_Last: Sequence_Index;
begin
if Buffer'Length = 0 then
raise Short_Buffer with "Buffer is empty.";
end if;
Last := Buffer'First;
-- Phase 1, check for sync and then mult-byte sequence
Try_Decode
(Sequence => Sequence_Array'(1 => Buffer(Buffer'First)),
Last => Sequence_Last,
Continuation_Bytes => Continuation,
Result => Result,
Status => Status);
-- See if we have an indicated multi-byte condition
if Status = Short_Load then
-- Check that we can actually provide the required number of
-- continuation bytes.
if Buffer'First + Continuation > Buffer'Last then
raise Short_Buffer;
end if;
-- Re-run with the Load the expected number of octets
declare
-- The (verified) postcondition of Try_Decode promises that
-- Continuation will be 1 .. 3. Therefore we know that the
-- above range will never be larger than 2 .. 3 + 1 = 4
pragma Suppress (Index_Check);
pragma Suppress (Length_Check);
pragma Suppress (Overflow_Check);
pragma Suppress (Range_Check);
-- 2 .. 2, 2 .. 3, 2 .. 4 - all ok
-- Also note that the components of Sequence_Array is
-- a modular type - and therefore Overflow_Check and
-- Range_Check do not apply to those (the return values)
-- anyways.
Sequence: constant Sequence_Array(1 .. 1 + Continuation)
:= Sequence_Array
(Buffer(Buffer'First .. Buffer'First + Continuation));
-- 1 + Continuation must be: 2, 3, 4
-- Buffer'First + Continuation must be <= Buffer'Last, due
-- to the if statement above
begin
-- Run Try_Decode again for the final Result
Try_Decode (Sequence => Sequence,
Last => Sequence_Last,
Continuation_Bytes => Continuation,
Result => Result,
Status => Status);
end;
end if;
Last := Buffer'First + Continuation;
if Status /= Success then
Result := Unicode_Replacement_Character;
end if;
end Decode_Next;
-----------------
-- Decode_Next -- (Wide_Character)
-----------------
procedure Decode_Next (Buffer : in Stream_Element_Array;
Last : out Stream_Element_Offset;
Result : out Wide_Character)
is
use Ada.Characters.Conversions;
Full_Char: Wide_Wide_Character;
Temp_Last: Stream_Element_Offset;
begin
Decode_Next (Buffer => Buffer,
Last => Temp_Last,
Result => Full_Char);
if not Is_Wide_Character (Full_Char) then
raise Insufficient_Width
with "Encoded character is not within the range of Wide_Character";
else
Result := To_Wide_Character (Full_Char);
Last := Temp_Last;
end if;
end Decode_Next;
-----------------
-- Decode_Next -- (Character)
-----------------
procedure Decode_Next (Buffer : in Stream_Element_Array;
Last : out Stream_Element_Offset;
Result : out Character)
is
use Ada.Characters.Conversions;
Full_Char: Wide_Wide_Character;
Temp_Last: Stream_Element_Offset;
begin
Decode_Next (Buffer => Buffer,
Last => Temp_Last,
Result => Full_Char);
if not Is_Character (Full_Char) then
raise Insufficient_Width
with "Encoded character is not within the range of Character";
else
Result := To_Character (Full_Char);
Last := Temp_Last;
end if;
end Decode_Next;
end Unicode.UTF8_Stream_Decoder;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- ADA.CONTAINERS.INDEFINITE_HASHED_MAPS --
-- --
-- S p e c --
-- --
-- Copyright (C) 2004-2021, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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.Iterator_Interfaces;
private with Ada.Containers.Hash_Tables;
private with Ada.Finalization;
private with Ada.Streams;
private with Ada.Strings.Text_Buffers;
generic
type Key_Type (<>) is private;
type Element_Type (<>) is private;
with function Hash (Key : Key_Type) return Hash_Type;
with function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
with function "=" (Left, Right : Element_Type) return Boolean is <>;
package Ada.Containers.Indefinite_Hashed_Maps with
SPARK_Mode => Off
is
pragma Annotate (CodePeer, Skip_Analysis);
pragma Preelaborate;
pragma Remote_Types;
type Map is tagged private with
Constant_Indexing => Constant_Reference,
Variable_Indexing => Reference,
Default_Iterator => Iterate,
Iterator_Element => Element_Type,
Aggregate => (Empty => Empty,
Add_Named => Insert);
pragma Preelaborable_Initialization (Map);
type Cursor is private;
pragma Preelaborable_Initialization (Cursor);
Empty_Map : constant Map;
-- Map objects declared without an initialization expression are
-- initialized to the value Empty_Map.
function Empty (Capacity : Count_Type := 1000) return Map;
No_Element : constant Cursor;
-- Cursor objects declared without an initialization expression are
-- initialized to the value No_Element.
function Has_Element (Position : Cursor) return Boolean;
-- Equivalent to Position /= No_Element
package Map_Iterator_Interfaces is new
Ada.Iterator_Interfaces (Cursor, Has_Element);
overriding function "=" (Left, Right : Map) return Boolean;
-- For each key/element pair in Left, equality attempts to find the key in
-- Right; if a search fails the equality returns False. The search works by
-- calling Hash to find the bucket in the Right map that corresponds to the
-- Left key. If bucket is non-empty, then equality calls Equivalent_Keys
-- to compare the key (in Left) to the key of each node in the bucket (in
-- Right); if the keys are equivalent, then the equality test for this
-- key/element pair (in Left) completes by calling the element equality
-- operator to compare the element (in Left) to the element of the node
-- (in Right) whose key matched.
function Capacity (Container : Map) return Count_Type;
-- Returns the current capacity of the map. Capacity is the maximum length
-- before which rehashing in guaranteed not to occur.
procedure Reserve_Capacity (Container : in out Map; Capacity : Count_Type);
-- Adjusts the current capacity, by allocating a new buckets array. If the
-- requested capacity is less than the current capacity, then the capacity
-- is contracted (to a value not less than the current length). If the
-- requested capacity is greater than the current capacity, then the
-- capacity is expanded (to a value not less than what is requested). In
-- either case, the nodes are rehashed from the old buckets array onto the
-- new buckets array (Hash is called once for each existing key in order to
-- compute the new index), and then the old buckets array is deallocated.
function Length (Container : Map) return Count_Type;
-- Returns the number of items in the map
function Is_Empty (Container : Map) return Boolean;
-- Equivalent to Length (Container) = 0
procedure Clear (Container : in out Map);
-- Removes all of the items from the map
function Key (Position : Cursor) return Key_Type;
-- Returns the key of the node designated by the cursor
function Element (Position : Cursor) return Element_Type;
-- Returns the element of the node designated by the cursor
procedure Replace_Element
(Container : in out Map;
Position : Cursor;
New_Item : Element_Type);
-- Assigns the value New_Item to the element designated by the cursor
procedure Query_Element
(Position : Cursor;
Process : not null access procedure (Key : Key_Type;
Element : Element_Type));
-- Calls Process with the key and element (both having only a constant
-- view) of the node designed by the cursor.
procedure Update_Element
(Container : in out Map;
Position : Cursor;
Process : not null access procedure (Key : Key_Type;
Element : in out Element_Type));
-- Calls Process with the key (with only a constant view) and element (with
-- a variable view) of the node designed by the cursor.
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 Map;
Position : Cursor) return Constant_Reference_Type;
pragma Inline (Constant_Reference);
function Reference
(Container : aliased in out Map;
Position : Cursor) return Reference_Type;
pragma Inline (Reference);
function Constant_Reference
(Container : aliased Map;
Key : Key_Type) return Constant_Reference_Type;
pragma Inline (Constant_Reference);
function Reference
(Container : aliased in out Map;
Key : Key_Type) return Reference_Type;
pragma Inline (Reference);
procedure Assign (Target : in out Map; Source : Map);
function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
procedure Move (Target : in out Map; Source : in out Map);
-- Clears Target (if it's not empty), and then moves (not copies) the
-- buckets array and nodes from Source to Target.
procedure Insert
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type;
Position : out Cursor;
Inserted : out Boolean);
-- Conditionally inserts New_Item into the map. If Key is already in the
-- map, then Inserted returns False and Position designates the node
-- containing the existing key/element pair (neither of which is modified).
-- If Key is not already in the map, the Inserted returns True and Position
-- designates the newly-inserted node container Key and New_Item. The
-- search for the key works as follows. Hash is called to determine Key's
-- bucket; if the bucket is non-empty, then Equivalent_Keys is called to
-- compare Key to each node in that bucket. If the bucket is empty, or
-- there were no matching keys in the bucket, the search "fails" and the
-- key/item pair is inserted in the map (and Inserted returns True);
-- otherwise, the search "succeeds" (and Inserted returns False).
procedure Insert
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type);
-- Attempts to insert Key into the map, performing the usual search (which
-- involves calling both Hash and Equivalent_Keys); if the search succeeds
-- (because Key is already in the map), then it raises Constraint_Error.
-- (This version of Insert is similar to Replace, but having the opposite
-- exception behavior. It is intended for use when you want to assert that
-- Key is not already in the map.)
procedure Include
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type);
-- Attempts to insert Key into the map. If Key is already in the map, then
-- both the existing key and element are assigned the values of Key and
-- New_Item, respectively. (This version of Insert only raises an exception
-- if cursor tampering occurs. It is intended for use when you want to
-- insert the key/element pair in the map, and you don't care whether Key
-- is already present.)
procedure Replace
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type);
-- Searches for Key in the map; if the search fails (because Key was not in
-- the map), then it raises Constraint_Error. Otherwise, both the existing
-- key and element are assigned the values of Key and New_Item rsp. (This
-- is similar to Insert, but with the opposite exception behavior. It is
-- intended for use when you want to assert that Key is already in the
-- map.)
procedure Exclude (Container : in out Map; Key : Key_Type);
-- Searches for Key in the map, and if found, removes its node from the map
-- and then deallocates it. The search works as follows. The operation
-- calls Hash to determine the key's bucket; if the bucket is not empty, it
-- calls Equivalent_Keys to compare Key to each key in the bucket. (This is
-- the deletion analog of Include. It is intended for use when you want to
-- remove the item from the map, but don't care whether the key is already
-- in the map.)
procedure Delete (Container : in out Map; Key : Key_Type);
-- Searches for Key in the map (which involves calling both Hash and
-- Equivalent_Keys). If the search fails, then the operation raises
-- Constraint_Error. Otherwise it removes the node from the map and then
-- deallocates it. (This is the deletion analog of non-conditional
-- Insert. It is intended for use when you want to assert that the item is
-- already in the map.)
procedure Delete (Container : in out Map; Position : in out Cursor);
-- Removes the node designated by Position from the map, and then
-- deallocates the node. The operation calls Hash to determine the bucket,
-- and then compares Position to each node in the bucket until there's a
-- match (it does not call Equivalent_Keys).
function First (Container : Map) return Cursor;
-- Returns a cursor that designates the first non-empty bucket, by
-- searching from the beginning of the buckets array.
function Next (Position : Cursor) return Cursor;
-- Returns a cursor that designates the node that follows the current one
-- designated by Position. If Position designates the last node in its
-- bucket, the operation calls Hash to compute the index of this bucket,
-- and searches the buckets array for the first non-empty bucket, starting
-- from that index; otherwise, it simply follows the link to the next node
-- in the same bucket.
procedure Next (Position : in out Cursor);
-- Equivalent to Position := Next (Position)
function Find (Container : Map; Key : Key_Type) return Cursor;
-- Searches for Key in the map. Find calls Hash to determine the key's
-- bucket; if the bucket is not empty, it calls Equivalent_Keys to compare
-- Key to each key in the bucket. If the search succeeds, Find returns a
-- cursor designating the matching node; otherwise, it returns No_Element.
function Contains (Container : Map; Key : Key_Type) return Boolean;
-- Equivalent to Find (Container, Key) /= No_Element
function Element (Container : Map; Key : Key_Type) return Element_Type;
-- Equivalent to Element (Find (Container, Key))
function Equivalent_Keys (Left, Right : Cursor) return Boolean;
-- Returns the result of calling Equivalent_Keys with the keys of the nodes
-- designated by cursors Left and Right.
function Equivalent_Keys (Left : Cursor; Right : Key_Type) return Boolean;
-- Returns the result of calling Equivalent_Keys with key of the node
-- designated by Left and key Right.
function Equivalent_Keys (Left : Key_Type; Right : Cursor) return Boolean;
-- Returns the result of calling Equivalent_Keys with key Left and the node
-- designated by Right.
procedure Iterate
(Container : Map;
Process : not null access procedure (Position : Cursor));
-- Calls Process for each node in the map
function Iterate (Container : Map)
return Map_Iterator_Interfaces.Forward_Iterator'class;
private
pragma Inline ("=");
pragma Inline (Length);
pragma Inline (Is_Empty);
pragma Inline (Clear);
pragma Inline (Key);
pragma Inline (Element);
pragma Inline (Move);
pragma Inline (Contains);
pragma Inline (Capacity);
pragma Inline (Reserve_Capacity);
pragma Inline (Has_Element);
pragma Inline (Equivalent_Keys);
pragma Inline (Next);
type Node_Type;
type Node_Access is access Node_Type;
type Key_Access is access Key_Type;
type Element_Access is access all Element_Type;
type Node_Type is limited record
Key : Key_Access;
Element : Element_Access;
Next : Node_Access;
end record;
package HT_Types is
new Hash_Tables.Generic_Hash_Table_Types (Node_Type, Node_Access);
type Map is new Ada.Finalization.Controlled with record
HT : HT_Types.Hash_Table_Type;
end record with Put_Image => Put_Image;
procedure Put_Image
(S : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; V : Map);
overriding procedure Adjust (Container : in out Map);
overriding procedure Finalize (Container : in out Map);
use HT_Types, HT_Types.Implementation;
use Ada.Finalization;
use Ada.Streams;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Container : Map);
for Map'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Container : out Map);
for Map'Read use Read;
type Map_Access is access all Map;
for Map_Access'Storage_Size use 0;
type Cursor is record
Container : Map_Access;
-- Access to this cursor's container
Node : Node_Access;
-- Access to the node pointed to by this cursor
Position : Hash_Type := Hash_Type'Last;
-- Position of the node in the buckets of the container. If this is
-- equal to Hash_Type'Last, then it will not be used. Position is
-- not requried by the implementation, but improves the efficiency
-- of various operations.
--
-- However, this value must be maintained so that the predefined
-- equality operation acts as required by RM A.18.4-18/2, which
-- states: "The predefined "=" operator for type Cursor returns True
-- if both cursors are No_Element, or designate the same element
-- in the same container."
end record;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Cursor);
for Cursor'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Cursor);
for Cursor'Read use Read;
subtype Reference_Control_Type is Implementation.Reference_Control_Type;
-- It is necessary to rename this here, so that the compiler can find it
type Constant_Reference_Type
(Element : not null access constant Element_Type) is
record
Control : Reference_Control_Type :=
raise Program_Error with "uninitialized reference";
-- The RM says, "The default initialization of an object of
-- type Constant_Reference_Type or Reference_Type propagates
-- Program_Error."
end record;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Constant_Reference_Type);
for Constant_Reference_Type'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Constant_Reference_Type);
for Constant_Reference_Type'Read use Read;
type Reference_Type
(Element : not null access Element_Type) is
record
Control : Reference_Control_Type :=
raise Program_Error with "uninitialized reference";
-- The RM says, "The default initialization of an object of
-- type Constant_Reference_Type or Reference_Type propagates
-- Program_Error."
end record;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Reference_Type);
for Reference_Type'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Reference_Type);
for Reference_Type'Read use Read;
-- Three operations are used to optimize in the expansion of "for ... of"
-- loops: the Next(Cursor) procedure in the visible part, and the following
-- Pseudo_Reference and Get_Element_Access functions. See Sem_Ch5 for
-- details.
function Pseudo_Reference
(Container : aliased Map'Class) return Reference_Control_Type;
pragma Inline (Pseudo_Reference);
-- Creates an object of type Reference_Control_Type pointing to the
-- container, and increments the Lock. Finalization of this object will
-- decrement the Lock.
function Get_Element_Access
(Position : Cursor) return not null Element_Access;
-- Returns a pointer to the element designated by Position.
Empty_Map : constant Map := (Controlled with others => <>);
No_Element : constant Cursor :=
(Container => null, Node => null, Position => Hash_Type'Last);
type Iterator is new Limited_Controlled and
Map_Iterator_Interfaces.Forward_Iterator with
record
Container : Map_Access;
end record
with Disable_Controlled => not T_Check;
overriding procedure Finalize (Object : in out Iterator);
overriding function First (Object : Iterator) return Cursor;
overriding function Next
(Object : Iterator;
Position : Cursor) return Cursor;
end Ada.Containers.Indefinite_Hashed_Maps;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S O C K E T S . C O N S T A N T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides target dependent definitions of constant for use
-- by the GNAT.Sockets package (g-socket.ads). This package should not be
-- directly with'ed by an applications program.
-- This is the version for ia64-hp-linux-gnu
-- This file is generated automatically, do not modify it by hand! Instead,
-- make changes to gen-soccon.c and re-run it on each target.
package GNAT.Sockets.Constants is
--------------
-- Families --
--------------
AF_INET : constant := 2; -- IPv4 address family
AF_INET6 : constant := 10; -- IPv6 address family
-----------
-- Modes --
-----------
SOCK_STREAM : constant := 1; -- Stream socket
SOCK_DGRAM : constant := 2; -- Datagram socket
-------------------
-- Socket errors --
-------------------
EACCES : constant := 13; -- Permission denied
EADDRINUSE : constant := 98; -- Address already in use
EADDRNOTAVAIL : constant := 99; -- Cannot assign address
EAFNOSUPPORT : constant := 97; -- Addr family not supported
EALREADY : constant := 114; -- Operation in progress
EBADF : constant := 9; -- Bad file descriptor
ECONNABORTED : constant := 103; -- Connection aborted
ECONNREFUSED : constant := 111; -- Connection refused
ECONNRESET : constant := 104; -- Connection reset by peer
EDESTADDRREQ : constant := 89; -- Destination addr required
EFAULT : constant := 14; -- Bad address
EHOSTDOWN : constant := 112; -- Host is down
EHOSTUNREACH : constant := 113; -- No route to host
EINPROGRESS : constant := 115; -- Operation now in progress
EINTR : constant := 4; -- Interrupted system call
EINVAL : constant := 22; -- Invalid argument
EIO : constant := 5; -- Input output error
EISCONN : constant := 106; -- Socket already connected
ELOOP : constant := 40; -- Too many symbolic lynks
EMFILE : constant := 24; -- Too many open files
EMSGSIZE : constant := 90; -- Message too long
ENAMETOOLONG : constant := 36; -- Name too long
ENETDOWN : constant := 100; -- Network is down
ENETRESET : constant := 102; -- Disconn. on network reset
ENETUNREACH : constant := 101; -- Network is unreachable
ENOBUFS : constant := 105; -- No buffer space available
ENOPROTOOPT : constant := 92; -- Protocol not available
ENOTCONN : constant := 107; -- Socket not connected
ENOTSOCK : constant := 88; -- Operation on non socket
EOPNOTSUPP : constant := 95; -- Operation not supported
EPFNOSUPPORT : constant := 96; -- Unknown protocol family
EPROTONOSUPPORT : constant := 93; -- Unknown protocol
EPROTOTYPE : constant := 91; -- Unknown protocol type
ESHUTDOWN : constant := 108; -- Cannot send once shutdown
ESOCKTNOSUPPORT : constant := 94; -- Socket type not supported
ETIMEDOUT : constant := 110; -- Connection timed out
ETOOMANYREFS : constant := 109; -- Too many references
EWOULDBLOCK : constant := 11; -- Operation would block
-----------------
-- Host errors --
-----------------
HOST_NOT_FOUND : constant := 1; -- Unknown host
TRY_AGAIN : constant := 2; -- Host name lookup failure
NO_DATA : constant := 4; -- No data record for name
NO_RECOVERY : constant := 3; -- Non recoverable errors
-------------------
-- Control flags --
-------------------
FIONBIO : constant := 21537; -- Set/clear non-blocking io
FIONREAD : constant := 21531; -- How many bytes to read
--------------------
-- Shutdown modes --
--------------------
SHUT_RD : constant := 0; -- No more recv
SHUT_WR : constant := 1; -- No more send
SHUT_RDWR : constant := 2; -- No more recv/send
---------------------
-- Protocol levels --
---------------------
SOL_SOCKET : constant := 1; -- Options for socket level
IPPROTO_IP : constant := 0; -- Dummy protocol for IP
IPPROTO_UDP : constant := 17; -- UDP
IPPROTO_TCP : constant := 6; -- TCP
-------------------
-- Request flags --
-------------------
MSG_OOB : constant := 1; -- Process out-of-band data
MSG_PEEK : constant := 2; -- Peek at incoming data
MSG_EOR : constant := 128; -- Send end of record
MSG_WAITALL : constant := 256; -- Wait for full reception
MSG_NOSIGNAL : constant := 16384; -- No SIGPIPE on send
MSG_Forced_Flags : constant := MSG_NOSIGNAL;
-- Flags set on all send(2) calls
--------------------
-- Socket options --
--------------------
TCP_NODELAY : constant := 1; -- Do not coalesce packets
SO_REUSEADDR : constant := 2; -- Bind reuse local address
SO_KEEPALIVE : constant := 9; -- Enable keep-alive msgs
SO_LINGER : constant := 13; -- Defer close to flush data
SO_BROADCAST : constant := 6; -- Can send broadcast msgs
SO_SNDBUF : constant := 7; -- Set/get send buffer size
SO_RCVBUF : constant := 8; -- Set/get recv buffer size
SO_SNDTIMEO : constant := 21; -- Emission timeout
SO_RCVTIMEO : constant := 20; -- Reception timeout
SO_ERROR : constant := 4; -- Get/clear error status
IP_MULTICAST_IF : constant := 32; -- Set/get mcast interface
IP_MULTICAST_TTL : constant := 33; -- Set/get multicast TTL
IP_MULTICAST_LOOP : constant := 34; -- Set/get mcast loopback
IP_ADD_MEMBERSHIP : constant := 35; -- Join a multicast group
IP_DROP_MEMBERSHIP : constant := 36; -- Leave a multicast group
-------------------
-- System limits --
-------------------
IOV_MAX : constant := 2147483647; -- Maximum writev iovcnt
----------------------
-- Type definitions --
----------------------
-- Sizes (in bytes) of the components of struct timeval
SIZEOF_tv_sec : constant := 8; -- tv_sec
SIZEOF_tv_usec : constant := 8; -- tv_usec
end GNAT.Sockets.Constants;
|
-- Copyright 2010-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
Last_Node_Id : Node_Id := Node_Id'First;
function Pn (N : Node_Id) return Node_Id is
begin
Last_Node_Id := N;
return N;
end Pn;
end Pck;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
generic
type Enum is (<>);
package League.Holders.Generic_Enumerations is
pragma Preelaborate;
Value_Tag : constant Tag;
function Element (Self : Holder) return Enum;
-- Returns internal value.
procedure Replace_Element (Self : in out Holder; To : Enum);
-- Set value. Tag of the value must be set before this call.
function To_Holder (Item : Enum) return Holder;
-- Creates new Value from specified value.
private
type Enumeration_Container is new Abstract_Container with record
Value : Enum;
end record;
overriding function Constructor
(Is_Empty : not null access Boolean) return Enumeration_Container;
Value_Tag : constant Tag := Tag (Enumeration_Container'Tag);
end League.Holders.Generic_Enumerations;
|
-- Copyright 2018-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Pck is
procedure Do_Nothing (A : System.Address) is
begin
null;
end Do_Nothing;
function Ident (S : String) return String is
begin
return S;
end Ident;
end Pck;
|
-- The MIT License (MIT)
-- Copyright (c) 2015 Pavel Zhukov <landgraf@fedoraproject.org>
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
with Nanomsg.Domains;
with Nanomsg.Pubsub;
with Aunit.Assertions;
with Nanomsg.Messages;
package body Nanomsg.Test_Pub_Sub is
procedure Run_Test (T : in out TC) is
use Aunit.Assertions;
Address : constant String := "tcp://127.0.0.1:5555";
Subscribe : constant String := "HELPME" ;
Publish : constant String := "HELPME: Hello world";
Not_Publish : constant String := "XHELPME: You shouldn't see that";
Publish_Message : Nanomsg.Messages.Message_T;
Not_Publish_Message : Nanomsg.Messages.Message_T;
Finished : Boolean := False with Volatile;
task Sender is
entry Start;
end Sender;
task body Sender is
begin
accept Start;
while not Finished loop
Nanomsg.Socket.Send (T.Server, Publish_Message);
Nanomsg.Socket.Send (T.Server, Not_Publish_Message);
delay 0.1;
end loop;
end Sender;
begin
Nanomsg.Messages.From_String (Publish_Message, Publish);
Nanomsg.Messages.From_String (Not_Publish_Message, Not_Publish);
Nanomsg.Socket.Init (T.Server, Nanomsg.Domains.Af_Sp, Nanomsg.Pubsub.Nn_PUB);
Nanomsg.Socket.Init (T.Client, Nanomsg.Domains.Af_Sp, Nanomsg.Pubsub.Nn_SUB);
Assert (Condition => not T.Server.Is_Null, Message => "Failed to initialize socket1");
Assert (Condition => not T.Client.Is_Null, Message => "Failed to initialize socket2");
Assert (Condition => T.Server.Get_Fd /= T.Client.Get_Fd,
Message => "Descriptors collision!");
Nanomsg.Socket.Bind (T.Server, "tcp://*:5555");
Sender.Start;
Nanomsg.Pubsub.Subscribe (T.Client, Subscribe);
Nanomsg.Socket.Connect (T.Client, Address);
declare
Msg : Nanomsg.Messages.Message_T;
begin
for X in 1 .. 100 loop
select
delay 2.0;
Assert (False, "Aborted by timeout");
Finished := True;
then abort
T.Client.Receive (Msg);
declare
Text : constant String := Msg.Text;
begin
Assert (Text (Text'First .. Subscribe'Length) = Subscribe, "Received not subscribed!");
end;
end select;
end loop;
Finished := True;
end;
end Run_Test;
function Name (T : TC) return Message_String is
begin
return Aunit.Format ("Test case name : Publisher/Subsriber test");
end Name;
procedure Tear_Down (T : in out Tc) is
begin
if T.Server.Get_Fd >= 0 then
T.Server.Close;
end if;
if T.Client.Get_Fd >= 0 then
T.Client.Close;
end if;
end Tear_Down;
end Nanomsg.Test_Pub_Sub;
|
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Fixed;
with Ada.Text_IO;
with Ada.Streams.Stream_IO;
with Ada.Assertions;
with Ada.Directories;
with Ada.Environment_Variables;
with Platform_Info;
with Registrar.Queries;
with Registrar.Registration;
with Registrar.Subsystems;
with Registrar.Library_Units;
with Workers, Workers.Reporting;
with Child_Processes.Path_Searching;
package body Build.Linking is
New_Line: Character renames Workers.Reporting.New_Line;
procedure Assert (Check: Boolean; Message: in String)
renames Ada.Assertions.Assert;
package Program_Paths renames Child_Processes.Path_Searching;
Binder_Program: aliased constant String
:= (Platform_Info.Toolchain_Prefix & "gnatbind");
Binder: constant Program_Paths.Elaboration_Path_Search
:= Program_Paths.Initialize (Binder_Program);
Linker_Program: aliased constant String
:= Platform_Info.Toolchain_Prefix & "gcc";
Linker: constant Program_Paths.Elaboration_Path_Search
:= Program_Paths.Initialize (Linker_Program);
Archiver_Program: aliased constant String
:= Platform_Info.Toolchain_Prefix & "ar";
Archiver: constant Program_Paths.Elaboration_Path_Search
:= Program_Paths.Initialize (Archiver_Program);
--
-- Scan_ALI_Order
--
type Scan_ALI_Order is new Workers.Work_Order with
record
Target: Registrar.Library_Units.Library_Unit;
end record;
overriding function Image (Order: Scan_ALI_Order) return String;
overriding procedure Execute (Order: in out Scan_ALI_Order);
-----------
-- Image --
-----------
function Image (Order: Scan_ALI_Order) return String is
("[Scan_ALI_Order] (Build.Scan_Linker_Options)" & New_Line
& "Target: " & Order.Target.Name.To_UTF8_String);
-------------
-- Execute --
-------------
procedure Execute (Order: in out Scan_ALI_Order) is
use Ada.Text_IO;
use Registrar.Library_Units;
-- Avoid using the secondary stack, for efficincy
Buffer: String (1 .. 1920);
Last : Natural;
ALI_File: File_Type;
begin
pragma Assert (Order.Target.State = Compiled);
-- Skip units that are not Ada Library Units
if Order.Target.Kind not in Package_Unit | Subprogram_Unit then
return;
end if;
Open (File => ALI_File,
Mode => In_File,
Name => ALI_File_Name (Order.Target));
-- Fairly simple operation. We'll keep going until we hit the end of the
-- file, scanning each line. Linker option lines start with 'L', and then
-- a space, and then a quote-enclosed string. We simply take those strings,
-- strip the quotes, and slap them onto the queue
while not End_Of_File (ALI_File) loop
Get_Line (File => ALI_File,
Item => Buffer,
Last => Last);
if Last > Buffer'First
-- if Last = Item'First, we definately don't want it anyways
and then Buffer(1) = 'L'
then
pragma Assert (Buffer(3) = '"');
pragma Assert (Buffer(Last) = '"');
Linker_Options.Enqueue
(UBS.To_Unbounded_String (Buffer(4 .. Last - 1)));
-- L "option"
-- ^....^
-- 1234.....Last
end if;
end loop;
Close (ALI_File);
exception
when others =>
if Is_Open (ALI_File) then Close (ALI_File); end if;
raise;
end Execute;
-------------------------
-- Scan_Linker_Options --
-------------------------
procedure Scan_Linker_Options
(Unit_Set: in Registrar.Library_Units.Library_Unit_Sets.Set)
is
use Registrar.Library_Units;
New_Order: Scan_ALI_Order := (Tracker => Scan_Progress'Access,
others => <>);
begin
Scan_Progress.Increase_Total_Items_By (Natural (Unit_Set.Length));
for Unit of Unit_Set loop
New_Order.Target := Unit;
Workers.Enqueue_Order (New_Order);
end loop;
end Scan_Linker_Options;
----------
-- Bind --
----------
procedure Bind
(Unit_Set : in Registrar.Library_Units.Library_Unit_Sets.Set;
Configuration: in Build_Configuration;
Errors : out UBS.Unbounded_String)
is
use UBS;
use Registrar.Library_Units;
use type Ada.Containers.Count_Type;
Need_GNARL: Boolean := False;
-- GNAT-specific. GNARL is the tasting part of the Ada runtime. Not
-- all programs need this, and those that do also need pthreads
Args: Unbounded_String;
Bind_Output: Unbounded_String;
begin
pragma Assert (Configuration.Mode in Library | Image);
pragma Assert
(if Unit_Set.Length = 1 then
Configuration.Mode = Image
and then Unit_Set(Unit_Set.First).Kind = Subprogram_Unit);
pragma Assert (for all Unit of Unit_Set =>
Unit.Kind in Package_Unit | Subprogram_Unit);
-- Verify that we have a binder
if not Program_Paths.Found (Binder) then
raise Program_Error with
"Bind failed: Could not find the binder program ("
& Binder_Program & ").";
end if;
-- Generate the binder file
-- Switches first
Set_Unbounded_String (Args, "-x -o ada_main.adb");
if Configuration.Mode = Library then
Append (Args, " -n");
elsif Unit_Set.Length > 1 then
Append (Args, " -z");
end if;
if Configuration.Linking in Static | Static_RT then
Append (Args, " -static");
else
Append (Args, " -shared");
end if;
-- Now add the unit ALI file names
for Unit of Unit_Set loop
Append (Args, ' ' & ALI_File_Name (Unit));
end loop;
-- Keep a record of our command
declare
use Ada.Text_IO;
Path: constant String := Build_Output_Root & "/ada_main.binder.cmd";
CMD_OUT: File_Type;
begin
if Ada.Directories.Exists (Path) then
Open (File => CMD_OUT,
Mode => Out_File,
Name => Path);
else
Create (File => CMD_OUT,
Name => Path);
end if;
Put_Line (CMD_OUT, "Binder used:");
Put_Line (CMD_OUT, Program_Paths.Image_Path (Binder));
Put_Line (CMD_OUT, "Arguments used:");
Put_Line (CMD_OUT, To_String (Args));
Close (CMD_OUT);
end;
-- Execute
declare
use Child_Processes;
Bind_Process: Child_Process'Class
:= Spawn_Process
(Image_Path => Program_Paths.Image_Path (Binder),
Arguments => To_String (Args),
Working_Directory => Build_Root);
Timed_Out: Boolean;
Status : Exit_Status;
Output : Unbounded_String;
begin
Output := Null_Unbounded_String;
Wait_And_Buffer (Process => Bind_Process,
Poll_Rate => 0.1,
Timeout => 300.0,
Output => Output,
Error => Errors,
Timed_Out => Timed_Out,
Status => Status);
if Timed_Out then
Bind_Process.Kill;
Append (Errors, " [TIMED OUT]");
elsif Status = Failure or else Length (Errors) > 0 then
if Length (Errors) = 0 then
Append (Errors, "[No error output]");
end if;
return;
end if;
end;
-- Successful. Errors is empty.
-- Complete by entering the outputed binder unit
declare
use Ada.Directories;
Search : Search_Type;
Unit_Source: Directory_Entry_Type;
begin
Start_Search (Search => Search,
Directory => Build_Root,
Pattern => "ada_main.ad*");
-- We are expecting exactly two entries
for I in 1 .. 2 loop
if not More_Entries (Search) then
Set_Unbounded_String
(Errors, "Could not find the expected binder output.");
return;
end if;
Get_Next_Entry (Search => Search,
Directory_Entry => Unit_Source);
Registrar.Registration.Enter_Unit (Unit_Source);
end loop;
if More_Entries (Search) then
Set_Unbounded_String (Errors, "Unexpected binder artifacts.");
return;
end if;
End_Search (Search);
end;
end Bind;
--
-- Link Operations
--
------------------
-- Find_Ada_RTS --
------------------
-- Path to the Ada RTS
function Find_Ada_RTS return String is
-- This function is very GCC-specific. We want to find the directory
-- that contains the actual Ada Run-Time libraries (libgnat and libgnarl)
-- These always reside in the location of libgcc, within the directory
-- adalib.
use UBS;
use Ada.Directories;
use Child_Processes;
GCC_Info: Child_Process'Class
:= Spawn_Process
(Image_Path => Program_Paths.Image_Path (Linker),
Arguments => "-print-libgcc-file-name",
Working_Directory => Current_Directory);
Output, Error: Unbounded_String;
Timed_Out : Boolean;
Status : Exit_Status;
begin
Wait_And_Buffer (Process => GCC_Info,
Poll_Rate => 0.01, -- Expected to be quick
Timeout => 1.0, -- Generous
Output => Output,
Error => Error,
Timed_Out => Timed_Out,
Status => Status);
Assert (Check => not Timed_Out,
Message => "gcc timed out unexpectedly.");
Assert (Check => Status = Success and then Length (Error) = 0,
Message => "gcc failed unexpectedly.");
-- Output now consists of a "full name" to 'libgcc.a'. The containing
-- directory of that file contains a directory "adalib", which is what
-- we need to return
return Containing_Directory (To_String (Output)) & "/adalib";
end Find_Ada_RTS;
-----------------
-- Needs_GNARL --
-----------------
-- GNAT-specific. Scans the binder body file looking for the presence of
-- "-lgnarl"
function Needs_GNARL return Boolean is
use Ada.Text_IO;
File: File_Type;
Test: Character;
In_Section : Boolean := False;
Section_Test : constant String := "-- BEGIN Object file/option list";
Section_Test_Depth: Positive := Section_Test'First;
GNARL_Test : constant String := "-lgnarl";
GNARL_Test_Depth: Positive := GNARL_Test'First;
begin
Open (File => File,
Mode => In_File,
Name => Build_Root & "/ada_main.adb");
while not End_Of_File (File) loop
Get (File, Test);
if not In_Section then
if Test = Section_Test(Section_Test_Depth) then
if Section_Test_Depth = Section_Test'Last then
In_Section := True;
else
Section_Test_Depth := Section_Test_Depth + 1;
end if;
else
Section_Test_Depth := Section_Test'First;
end if;
else
if Test = GNARL_Test(GNARL_Test_Depth) then
if GNARL_Test_Depth = GNARL_Test'Last then
Close (File);
return True;
else
GNARL_Test_Depth := GNARL_Test_Depth + 1;
end if;
else
GNARL_Test_Depth := GNARL_Test'First;
end if;
end if;
end loop;
-- End of file and we didn't find any -lgnarl
Close (File);
Assert (In_Section, "Could not find option list in binder source.");
return False;
exception
when Name_Error =>
raise Name_Error with "Binder source was not found";
end Needs_GNARL;
------------------------
-- Add_Linker_Options --
------------------------
-- A generalized procedure for adding all the various linker options that
-- would be shared between image and library linking
procedure Add_Linker_Options (Configuration: in Build_Configuration;
Args : in out UBS.Unbounded_String)
is
use UBS;
begin
-- Debug options
if Configuration.Debug_Enabled then
Append (Args, " -g");
end if;
-- User-defined linker options
declare
Option: UBS.Unbounded_String;
begin
loop
select
Linker_Options.Dequeue (Option);
else
exit;
end select;
Append (Args, ' ' & UBS.To_String (Option));
end loop;
end;
-- The following options really only apply when we are linking some kind
-- of final elf "image" - either an executable or a shared library.
--
-- For archives (static libraries), we don't want to include these
-- options in "linker options" output provided along-side the archive
if Configuration.Mode in Image | Systemize
or else (Configuration.Mode = Library
and then Configuration.Linking = Static)
then
-- Initial set-up depending on the linking mode
case Configuration.Linking is
when Shared =>
Append (Args, " -shared-libgcc -shared");
-- Only if we are actually creating an executable (image),
-- should we add the pie/no-pie flags
if Configuration.Mode = Image then
if Configuration.Position_Independent then
Append (Args, " -pie");
else
Append (Args, " -no-pie");
end if;
end if;
when Static_RT =>
Append (Args, " -static-libgcc");
when Static =>
Append (Args, " -static-libgcc");
if Configuration.Position_Independent then
Append (Args, " -static-pie");
else
Append (Args, " -static");
end if;
end case;
-- If we are building a shared library, we will add in the
-- initialization and finalization symbols to cause elaboration of the
-- Ada code via the binder program.
if Configuration.Mode = Library
and then Configuration.Linking = Shared
then
Append (Args, " -Wl,-init=adainit,-fini=adafinal");
end if;
end if;
-- Now all the user libraries
for Subsys of Registrar.Queries.Available_Subsystems loop
for Lib_Pair of Subsys.Configuration.External_Libraries loop
Append (Args, " -l" & To_String (Lib_Pair.Value));
end loop;
end loop;
end Add_Linker_Options;
-----------------
-- Add_Runtime --
-----------------
-- Adds the appropriate libraries or archives for the Ada runtime. This
-- must come after the object list in the case of a static rt
--
-- For_Archive is set true when building the linker option outbut for
-- static archive library builds. This causes only the libgnat and
-- libgnarl objects to be rolled into the archive
procedure Add_Static_Runtime_Archives
(Configuration: in Build_Configuration;
Args : in out UBS.Unbounded_String;
GNARL : in Boolean := Needs_GNARL;
RTS_Dir : in String := Find_Ada_RTS)
is
-- Add_Static_Runtime_Archives specifically adds the actual archives
-- for the static version of the Ada runtime. This subprogram is used
-- both by Add_Runtime and Archive.
--
-- Add_Runtime uses it to pass to the linker, while Archive uses it
-- to include the static runtime archives in the final archive object
begin
if GNARL then
UBS.Append (Args, ' ' & RTS_Dir
& (if Configuration.Position_Independent then
"/libgnarl_pic.a"
else
"/libgnarl.a"));
end if;
UBS.Append (Args, ' ' & RTS_DIR
& (if Configuration.Position_Independent then
"/libgnat_pic.a"
else
"/libgnat.a"));
end;
----------------------------------------------------------------------
procedure Add_Runtime (Configuration: in Build_Configuration;
Args : in out UBS.Unbounded_String)
is
use UBS;
RTS_Dir: constant String := Find_Ada_RTS;
GNARL : constant Boolean := Needs_GNARL;
-- Note in theory, there should be only one link per run of AURA, so it
-- is perfectly fine to elaborate these locally, since it will only
-- happen once anyways.
begin
if GNARL and then Platform_Info.Platform_Family = "unix" then
Append (Args, " -pthread");
end if;
case Configuration.Linking is
when Shared =>
Append (Args, " -L" & RTS_Dir);
Append (Args, " -lgnat");
if GNARL then
Append (Args, " -lgnarl");
end if;
when Static_RT | Static =>
Add_Static_Runtime_Archives (Configuration, Args, GNARL, RTS_Dir);
end case;
end Add_Runtime;
----------------
-- Link_Image --
----------------
procedure Link_Image
(Image_Path : in String;
Unit_Set : in Registrar.Library_Units.Library_Unit_Sets.Set;
Configuration: in Build_Configuration;
Errors : out UBS.Unbounded_String)
is
use UBS;
use Child_Processes;
Args: Unbounded_String;
begin
-- Verify that we can find the Linker
if not Program_Paths.Found (Binder) then
raise Program_Error with
"Link failed: Could not find the linker program ("
& Linker_Program & ").";
end if;
if Image_Path'Length = 0 then
raise Constraint_Error with "Attempt to link without an image path";
end if;
Set_Unbounded_String (Args, "-o " & Image_Path);
Add_Linker_Options (Configuration, Args);
-- Add linker options
-- Then the objects
declare
use Ada.Directories;
use Registrar.Library_Units;
begin
for Unit of Unit_Set loop
if Unit.Kind not in Unknown | Subunit then
Append (Args, ' ' & Simple_Name (Object_File_Name (Unit)));
-- We use Simple_Name and then execute the linker from the
-- aura-build subdirectory to avoid any problems with
-- overwhelming the arguments of the linker with long path-names
-- for each object. It's also a bit nicer to look at when
-- debugging
end if;
end loop;
end;
-- Finally the Ada Runtime
Add_Runtime (Configuration, Args);
-- Record the command
declare
use Ada.Text_IO;
Path: constant String := Build_Output_Root & "/ada_main.linker.cmd";
CMD_OUT: File_Type;
begin
if Ada.Directories.Exists (Path) then
Open (File => CMD_OUT,
Mode => Out_File,
Name => Path);
else
Create (File => CMD_OUT,
Name => Path);
end if;
Put_Line (CMD_OUT, "Linker used:");
Put_Line (CMD_OUT, Program_Paths.Image_Path (Linker));
Put_Line (CMD_OUT, "Arguments used:");
Put_Line (CMD_OUT, To_String (Args));
Close (CMD_OUT);
end;
-- Execute
declare
use Child_Processes;
Link_Process: Child_Process'Class
:= Spawn_Process
(Image_Path => Program_Paths.Image_Path (Linker),
Arguments => To_String (Args),
Working_Directory => Build_Root);
Discard : Unbounded_String;
Timed_Out: Boolean;
Status : Exit_Status;
begin
Wait_And_Buffer (Process => Link_Process,
Poll_Rate => 0.1,
Timeout => 300.0,
Output => Discard,
Error => Errors,
Timed_Out => Timed_Out,
Status => Status);
if Timed_Out then
Link_Process.Kill;
Append (Errors, " [TIMED OUT]");
elsif Status = Failure and then Length (Errors) = 0 then
Set_Unbounded_String (Errors, "[No error output]");
end if;
end;
end Link_Image;
-------------
-- Archive --
-------------
procedure Archive
(Archive_Path : in String;
Unit_Set : in Registrar.Library_Units.Library_Unit_Sets.Set;
Configuration: in Build_Configuration;
Errors : out UBS.Unbounded_String)
is
Args: UBS.Unbounded_String := UBS.To_Unbounded_String
("-rc " & Archive_Path & ' ');
GNARL : constant Boolean := Needs_GNARL;
RTS_Dir: constant String := Find_Ada_RTS;
procedure Output_Linker_Options is
use Ada.Strings.Fixed;
use Ada.Text_IO;
use all type Ada.Strings.Direction;
Linker_Options: UBS.Unbounded_String;
LO_File: File_Type;
Extension_Start: constant Natural := Index (Source => Archive_Path,
Pattern => ".",
Going => Backward);
Path: constant String
:= Archive_Path (Archive_Path'First .. Extension_Start)
& "linkopt";
begin
if Extension_Start < Archive_Path'First then
-- This will likely be checked by the command processor,
-- but this is such a cheap check to make, why not
raise Constraint_Error with
"Library archive path shall have an extension.";
end if;
if GNARL and then Platform_Info.Platform_Family = "unix" then
UBS.Append (Linker_Options, " -pthread");
end if;
Add_Linker_Options (Configuration, Linker_Options);
if Ada.Directories.Exists (Path) then
Open (File => LO_File,
Mode => Out_File,
Name => Path);
else
Create (File => LO_File,
Mode => Out_File,
Name => Path);
end if;
Put_Line (File => LO_File, Item => UBS.To_String (Linker_Options));
Close (LO_File);
end;
begin
pragma Assert (Configuration.Mode = Library);
-- Verify that we can find the Archiver
if not Program_Paths.Found (Archiver) then
raise Program_Error with
"Archive failed: Could not find the archiver program ("
& Archiver_Program & ").";
end if;
declare
use Ada.Directories;
use Registrar.Library_Units;
begin
for Unit of Unit_Set loop
if Unit.Kind not in Unknown | Subunit then
UBS.Append (Args, ' ' & Simple_Name (Object_File_Name (Unit)));
-- We use Simple_Name and then execute the linker from the
-- aura-build subdirectory to avoid any problems with
-- overwhelming the arguments of the linker with long path-names
-- for each object. It's also a bit nicer to look at when
-- debugging
end if;
end loop;
end;
-- Add the Ada runtime archives
Add_Static_Runtime_Archives (Configuration, Args, GNARL, RTS_Dir);
-- Record the command
declare
use Ada.Text_IO;
Path: constant String := Build_Output_Root & "/ada_main.archiver.cmd";
CMD_OUT: File_Type;
begin
if Ada.Directories.Exists (Path) then
Open (File => CMD_OUT,
Mode => Out_File,
Name => Path);
else
Create (File => CMD_OUT,
Name => Path);
end if;
Put_Line (CMD_OUT, "Archiver used:");
Put_Line (CMD_OUT, Program_Paths.Image_Path (Archiver));
Put_Line (CMD_OUT, "Arguments used:");
Put_Line (CMD_OUT, UBS.To_String (Args));
Close (CMD_OUT);
end;
-- Execute
declare
use Child_Processes;
Archive_Process: Child_Process'Class
:= Spawn_Process
(Image_Path => Program_Paths.Image_Path (Archiver),
Arguments => UBS.To_String (Args),
Working_Directory => Build_Root);
Discard : UBS.Unbounded_String;
Timed_Out: Boolean;
Status : Exit_Status;
begin
Wait_And_Buffer (Process => Archive_Process,
Poll_Rate => 0.1,
Timeout => 60.0,
Output => Discard,
Error => Errors,
Timed_Out => Timed_Out,
Status => Status);
if Timed_Out then
Archive_Process.Kill;
UBS.Append (Errors, " [TIMED OUT]");
elsif Status = Success then
Output_Linker_Options;
elsif Status = Failure and then UBS.Length (Errors) = 0 then
UBS.Set_Unbounded_String (Errors, "[No error output]");
end if;
end;
end Archive;
---------------------
-- Link_Subsystems --
---------------------
procedure Link_Subsystems is
begin
-- TODO
raise Program_Error with "Not implemented";
end Link_Subsystems;
end Build.Linking;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . C O N C A T _ 9 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2008-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a procedure for runtime concatenation of eight string
-- operands. It is used when we want to save space in the generated code.
pragma Compiler_Unit_Warning;
package System.Concat_9 is
procedure Str_Concat_9
(R : out String;
S1, S2, S3, S4, S5, S6, S7, S8, S9 : String);
-- Performs the operation R := S1 & S2 & S3 & S4 & S5 & S6 & S7 & S8 & S9.
-- The bounds of R are known to be correct (usually set by a call to the
-- Str_Concat_Bounds_9 procedure below), so no bounds checks are required,
-- and it is known that none of the input operands overlaps R. No
-- assumptions can be made about the lower bounds of any of the operands.
procedure Str_Concat_Bounds_9
(Lo, Hi : out Natural;
S1, S2, S3, S4, S5, S6, S7, S8, S9 : String);
-- Assigns to Lo..Hi the bounds of the result of concatenating the nine
-- given strings, following the rules in the RM regarding null operands.
end System.Concat_9;
|
-- Concurrency can be offered by the OS, the language, or a combination
-- Link to some papers that say that threading can't be a library.
-- Ousterhout has an interesting paper here that shows that you can't guarantee pthreads correctness.
-- Processes offer protection but are too heavy-weight.
-- Compiler must take care of low-level thread management, as opposed to RTOS
with Ada.Text_IO;
procedure Tasking is
-- Specification of nested task
task HelloTask;
task body HelloTask is
begin
-- Task body begins executing as soon as Tasking starts
for idx in 1 .. 5 loop
Ada.Text_IO.Put_Line("The task says hello.");
delay 1.0;
end loop;
end HelloTask;
begin
Ada.Text_IO.Put_Line("Starting Program!");
-- Tasking ends when both the body and task have ended
-- Task must terminate
end Tasking;
|
-----------------------------------------------------------------------
-- keystore-passwords -- Password provider
-- Copyright (C) 2019 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package Keystore.Passwords is
type Provider is limited interface;
type Provider_Access is access all Provider'Class;
-- Get the password through the Getter operation.
procedure Get_Password (From : in Provider;
Getter : not null
access procedure (Password : in Secret_Key)) is abstract;
subtype Tag_Type is Interfaces.Unsigned_32;
type Slot_Provider is limited interface and Provider;
function Get_Tag (From : in Slot_Provider) return Tag_Type is abstract;
function Has_Password (From : in Slot_Provider) return Boolean is abstract;
procedure Next (From : in out Slot_Provider) is abstract;
-- Get the key and IV through the Getter operation.
procedure Get_Key (From : in Slot_Provider;
Getter : not null access procedure (Key : in Secret_Key;
IV : in Secret_Key)) is abstract;
procedure To_Provider (Secret : in Secret_Key;
Process : not null access procedure (P : in out Provider'Class));
private
type Internal_Key_Provider is limited interface;
procedure Save_Key (Provider : in Internal_Key_Provider;
Data : out Ada.Streams.Stream_Element_Array) is abstract;
type Default_Provider (Len : Key_Length) is limited new Provider with record
Password : Keystore.Secret_Key (Len);
end record;
type Default_Provider_Access is access all Default_Provider'Class;
-- Get the password through the Getter operation.
overriding
procedure Get_Password (From : in Default_Provider;
Getter : not null access procedure (Password : in Secret_Key));
-- Create a password provider.
function Create (Password : in out Ada.Streams.Stream_Element_Array) return Provider_Access;
end Keystore.Passwords;
|
with Ada.Text_IO; use Ada.Text_IO;
procedure Adventofcode.Day_20.Main is
begin
Put_Line ("Day-20");
end Adventofcode.Day_20.Main;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . A S S E R T I O N S --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1997 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.Exceptions;
package body System.Assertions is
--------------------------
-- Raise_Assert_Failure --
--------------------------
procedure Raise_Assert_Failure (Msg : String) is
begin
Ada.Exceptions.Raise_Exception (Assert_Failure'Identity, Msg);
end Raise_Assert_Failure;
end System.Assertions;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M --
-- --
-- S p e c --
-- (VxWorks e500 AE653 vThreads) --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This version is for the AE653/e500v2 vThreads full run-time
package System is
pragma Pure;
-- Note that we take advantage of the implementation permission to make
-- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-- 2005, this is Pure in any case (AI-362).
pragma No_Elaboration_Code_All;
-- Allow the use of that restriction in units that WITH this unit
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
-- System-Dependent Named Numbers
Min_Int : constant := -2 ** (Standard'Max_Integer_Size - 1);
Max_Int : constant := 2 ** (Standard'Max_Integer_Size - 1) - 1;
Max_Binary_Modulus : constant := 2 ** Standard'Max_Integer_Size;
Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
Max_Base_Digits : constant := Long_Long_Float'Digits;
Max_Digits : constant := Long_Long_Float'Digits;
Max_Mantissa : constant := 63;
Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
Tick : constant := 1.0 / 60.0;
-- Storage-related Declarations
type Address is private;
pragma Preelaborable_Initialization (Address);
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := 32;
Memory_Size : constant := 2 ** 32;
-- Address comparison
function "<" (Left, Right : Address) return Boolean;
function "<=" (Left, Right : Address) return Boolean;
function ">" (Left, Right : Address) return Boolean;
function ">=" (Left, Right : Address) return Boolean;
function "=" (Left, Right : Address) return Boolean;
pragma Import (Intrinsic, "<");
pragma Import (Intrinsic, "<=");
pragma Import (Intrinsic, ">");
pragma Import (Intrinsic, ">=");
pragma Import (Intrinsic, "=");
-- Other System-Dependent Declarations
type Bit_Order is (High_Order_First, Low_Order_First);
Default_Bit_Order : constant Bit_Order := High_Order_First;
pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-- Priority-related Declarations (RM D.1)
-- Ada priorities are mapped to VxWorks priorities using the following
-- transformation: 255 - Ada Priority
-- Ada priorities are used as follows:
-- 256 is reserved for the VxWorks kernel
-- 248 - 255 correspond to hardware interrupt levels 0 .. 7
-- 247 is a catchall default "interrupt" priority for signals,
-- allowing higher priority than normal tasks, but lower than
-- hardware priority levels. Protected Object ceilings can
-- override these values.
-- 246 is used by the Interrupt_Manager task
Max_Priority : constant Positive := 245;
Max_Interrupt_Priority : constant Positive := 255;
subtype Any_Priority is Integer range 0 .. 255;
subtype Priority is Any_Priority range 0 .. 245;
subtype Interrupt_Priority is Any_Priority range 246 .. 255;
Default_Priority : constant Priority := 122;
private
type Address is mod Memory_Size;
Null_Address : constant Address := 0;
--------------------------------------
-- System Implementation Parameters --
--------------------------------------
-- These parameters provide information about the target that is used
-- by the compiler. They are in the private part of System, where they
-- can be accessed using the special circuitry in the Targparm unit
-- whose source should be consulted for more detailed descriptions
-- of the individual switch values.
Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := False;
Configurable_Run_Time : constant Boolean := False;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Exit_Status_Supported : constant Boolean := True;
Fractional_Fixed_Ops : constant Boolean := False;
Frontend_Layout : constant Boolean := False;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
Preallocated_Stacks : constant Boolean := False;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := True;
Stack_Check_Limits : constant Boolean := False;
Support_Aggregates : constant Boolean := True;
Support_Composite_Assign : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts : constant Boolean := True;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := True;
Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := False;
Executable_Extension : constant String := ".out";
end System;
|
type Kernel_3x3 is array (-1..1, -1..1) of Float_Luminance;
procedure Filter (Picture : in out Image; K : Kernel_3x3) is
function Get (I, J : Integer) return Float_Pixel is
pragma Inline (Get);
begin
if I in Picture'Range (1) and then J in Picture'Range (2) then
declare
Color : Pixel := Picture (I, J);
begin
return (Float_Luminance (Color.R), Float_Luminance (Color.G), Float_Luminance (Color.B));
end;
else
return (others => 0.0);
end if;
end Get;
W11, W12, W13 : Float_Pixel; -- The image window
W21, W22, W23 : Float_Pixel;
W31, W32, W33 : Float_Pixel;
Above : array (Picture'First (2) - 1..Picture'Last (2) + 1) of Float_Pixel;
This : Float_Pixel;
begin
for I in Picture'Range (1) loop
W11 := Above (Picture'First (2) - 1); -- The upper row is taken from the cache
W12 := Above (Picture'First (2) );
W13 := Above (Picture'First (2) + 1);
W21 := (others => 0.0); -- The middle row
W22 := Get (I, Picture'First (2) );
W23 := Get (I, Picture'First (2) + 1);
W31 := (others => 0.0); -- The bottom row
W32 := Get (I+1, Picture'First (2) );
W33 := Get (I+1, Picture'First (2) + 1);
for J in Picture'Range (2) loop
This :=
W11 * K (-1, -1) + W12 * K (-1, 0) + W13 * K (-1, 1) +
W21 * K ( 0, -1) + W22 * K ( 0, 0) + W23 * K ( 0, 1) +
W31 * K ( 1, -1) + W32 * K ( 1, 0) + W33 * K ( 1, 1);
Above (J-1) := W21;
W11 := W12; W12 := W13; W13 := Above (J+1); -- Shift the window
W21 := W22; W22 := W23; W23 := Get (I, J+1);
W31 := W32; W32 := W23; W33 := Get (I+1, J+1);
Picture (I, J) := To_Pixel (This);
end loop;
Above (Picture'Last (2)) := W21;
end loop;
end Filter;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY COMPONENTS --
-- --
-- S Y S T E M . C O M P A R E _ A R R A Y _ S I G N E D _ 8 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2002-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains functions for runtime comparisons on arrays whose
-- elements are 8-bit discrete type values to be treated as signed.
package System.Compare_Array_Signed_8 is
-- Note: although the functions in this package are in a sense Pure, the
-- package cannot be declared as Pure, since the arguments are addresses,
-- not the data, and the result is not pure wrt the address values.
function Compare_Array_S8
(Left : System.Address;
Right : System.Address;
Left_Len : Natural;
Right_Len : Natural) return Integer;
-- Compare the array starting at address Left of length Left_Len
-- with the array starting at address Right of length Right_Len.
-- The comparison is in the normal Ada semantic sense of array
-- comparison. The result is -1,0,+1 for Left<Right, Left=Right,
-- Left>Right respectively. This function works with 4 byte words
-- if the operands are aligned on 4-byte boundaries and long enough.
function Compare_Array_S8_Unaligned
(Left : System.Address;
Right : System.Address;
Left_Len : Natural;
Right_Len : Natural) return Integer;
-- Same functionality as Compare_Array_S8 but always proceeds by
-- bytes. Used when the caller knows that the operands are unaligned,
-- or short enough that it makes no sense to go by words.
end System.Compare_Array_Signed_8;
|
package FLTK.Widgets.Valuators is
type Valuator is new Widget with private;
type Valuator_Reference (Data : not null access Valuator'Class) is
limited null record with Implicit_Dereference => Data;
package Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Valuator;
end Forge;
function Clamp
(This : in Valuator;
Input : in Long_Float)
return Long_Float;
function Round
(This : in Valuator;
Input : in Long_Float)
return Long_Float;
function Increment
(This : in Valuator;
Input : in Long_Float;
Step : in Integer)
return Long_Float;
function Get_Minimum
(This : in Valuator)
return Long_Float;
procedure Set_Minimum
(This : in out Valuator;
To : in Long_Float);
function Get_Maximum
(This : in Valuator)
return Long_Float;
procedure Set_Maximum
(This : in out Valuator;
To : in Long_Float);
function Get_Step
(This : in Valuator)
return Long_Float;
procedure Set_Step
(This : in out Valuator;
To : in Long_Float);
function Get_Value
(This : in Valuator)
return Long_Float;
procedure Set_Value
(This : in out Valuator;
To : in Long_Float);
procedure Set_Bounds
(This : in out Valuator;
Min, Max : in Long_Float);
procedure Set_Precision
(This : in out Valuator;
To : in Integer);
procedure Set_Range
(This : in out Valuator;
Min, Max : in Long_Float);
function Handle
(This : in out Valuator;
Event : in Event_Kind)
return Event_Outcome;
private
type Valuator is new Widget with null record;
overriding procedure Finalize
(This : in out Valuator);
pragma Inline (Clamp);
pragma Inline (Round);
pragma Inline (Increment);
pragma Inline (Get_Minimum);
pragma Inline (Set_Minimum);
pragma Inline (Get_Maximum);
pragma Inline (Set_Maximum);
pragma Inline (Get_Step);
pragma Inline (Set_Step);
pragma Inline (Get_Value);
pragma Inline (Set_Value);
pragma Inline (Set_Bounds);
pragma Inline (Set_Precision);
pragma Inline (Set_Range);
pragma Inline (Handle);
end FLTK.Widgets.Valuators;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, Fabien Chouteau --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with AGATE;
package Test_Dynamic_Tasks is
procedure Create;
function Dyamic_Semaphore return AGATE.Semaphore_ID;
end Test_Dynamic_Tasks;
|
-- Copyright 2008-2016 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 Proc (I : Integer) is
Not_In_Scope : Integer := 77;
begin
Inner.Inside_Variable := Not_In_Scope + I;
end Proc;
procedure Ambiguous_Func is
begin
null;
end Ambiguous_Func;
end Pck;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . S H A 2 2 4 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements the SHA-224 secure hash function as described in
-- FIPS PUB 180-3. The complete text of FIPS PUB 180-3 can be found at:
-- http://csrc.nist.gov/publications/fips/fips180-3/fips180-3_final.pdf
-- See the declaration of GNAT.Secure_Hashes.H in g-sechas.ads for complete
-- documentation.
with GNAT.Secure_Hashes.SHA2_Common;
with GNAT.Secure_Hashes.SHA2_32;
with System;
package GNAT.SHA224 is new GNAT.Secure_Hashes.H
(Block_Words => GNAT.Secure_Hashes.SHA2_Common.Block_Words,
State_Words => 8,
Hash_Words => 7,
Hash_Bit_Order => System.High_Order_First,
Hash_State => GNAT.Secure_Hashes.SHA2_32.Hash_State,
Initial_State => GNAT.Secure_Hashes.SHA2_32.SHA224_Init_State,
Transform => GNAT.Secure_Hashes.SHA2_32.Transform);
|
------------------------------------------------------------------------------
-- --
-- Modular Hash Infrastructure --
-- --
-- xxHash32 --
-- --
-- Pedantic Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2021, 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. --
-- --
------------------------------------------------------------------------------
-- This implementation follows the official xxHash algorithm specification as
-- described at https://github.com/Cyan4973/xxHash (v 0.8.0).
--
-- The specification contains the following copyright notice:
--
-- Copyright (c) Yann Collet
--
-- Permission is granted to copy and distribute this document for any purpose
-- and without charge, including translations into other languages and
-- incorporation into compilations, provided that the copyright notice and this
-- notice are preserved, and that any substantive changes or deletions from the
-- original are clearly marked. Distribution of this document is unlimited.
package body Modular_Hashing.xxHash32 is
--
-- XXH32_Hash
--
function "<" (Left, Right : XXH32_Hash) return Boolean is
(Left.Digest < Right.Digest);
function ">" (Left, Right : XXH32_Hash) return Boolean is
(Left.Digest > Right.Digest);
function "=" (Left, Right : XXH32_Hash) return Boolean is
(Left.Digest = Right.Digest);
------------
-- Binary --
------------
function Binary (Value: XXH32_Hash) return Hash_Binary_Value is
V: Accumulator_Type := Value.Digest;
begin
return Bin: Hash_Binary_Value (1 .. XXH32_Hash_Bytes) do
for Byte of Bin loop
Byte := Unsigned_8 (V and 16#FF#);
V := Shift_Right (V, 8);
end loop;
end return;
end Binary;
--
-- XXH32_Engine
--
------------------
-- Stripe_Round -- "Step 2"
------------------
-- Stripe_Round executes one full strip round (16-bytes) on the engine.
-- This consumes the entire 16-byte Buffer (which must be full)
procedure Stripe_Round (Engine: in out XXH32_Engine) with
Inline,
Pre => Engine.Last_Element = Engine.Buffer'Last
is
Lanes : Accumulator_Array;
Accumulators: Accumulator_Array renames Engine.Accumulators;
begin
-- For each lane, load the value and then run the round on the
-- accumulator. This is designed for simd, and we'll try to structure
-- this to give the compiler as much of a chance as possible to see the
-- obvious simd conditions
-- Load lanes
declare
I: Stream_Element_Offset := Engine.Buffer'First;
begin
for Lane of Lanes loop
for Byte of reverse Engine.Buffer(I .. I + 3) loop
Lane := Shift_Left (Lane, 8);
Lane := Lane + Accumulator_Type (Byte);
end loop;
I := I + 4;
end loop;
end;
for I in Lanes'Range loop
-- The actual rounds
Accumulators(I) := Accumulators(I) + (Lanes(I) * PRIME32_2);
Accumulators(I) := Rotate_Left (Accumulators(I), 13);
Accumulators(I) := Accumulators(I) * PRIME32_1;
end loop;
Engine.Last_Element := Engine.Buffer'First - 1;
end Stripe_Round;
-----------
-- Write --
-----------
procedure Write (Engine : in out XXH32_Engine;
Item : in Stream_Element_Array)
is
Last_Load: Stream_Element_Offset := Item'First - 1;
procedure Load_Round with Inline, Pre => Last_Load < Item'Last is
Buffer_Space: Stream_Element_Offset
:= Engine.Buffer'Last - Engine.Last_Element;
Load_First: constant Stream_Element_Offset := Last_Load + 1;
Load_Last : Stream_Element_Offset;
Load_Size : Stream_Element_Offset := Buffer_Space;
New_Last_Element: Stream_Element_Offset;
begin
pragma Assert (Buffer_Space > 0);
-- Load in as many bytes as we can into the buffer. If we hit 16
-- bytes, we call a Stripe_Round.
Load_Last := Load_First + Buffer_Space - 1;
if Load_Last > Item'Last then
Load_Last := Item'Last;
Load_Size := Load_Last - Load_First + 1;
end if;
New_Last_Element := Engine.Last_Element + Load_Size;
Engine.Buffer (Engine.Last_Element + 1 .. New_Last_Element)
:= Item (Load_First .. Load_Last);
Last_Load := Load_Last;
Engine.Last_Element := New_Last_Element;
if New_Last_Element = Engine.Buffer'Last then
Stripe_Round (Engine);
end if;
end;
begin
if Item'Length = 0 then return; end if;
while Last_Load < Item'Last loop
Load_Round;
end loop;
Engine.Input_Total := Engine.Input_Total + Item'Length;
end Write;
-----------
-- Reset --
-----------
procedure Reset (Engine : in out XXH32_Engine) is
begin
Engine.Last_Element := Engine.Buffer'First - 1;
Engine.Input_Total := 0;
Engine.Accumulators := Accumulators_Initial;
end Reset;
------------
-- Digest --
------------
function Digest (Engine : in out XXH32_Engine) return Hash'Class is
Lane_Accumulators: Accumulator_Array renames Engine.Accumulators;
Hash_Accumulator : Accumulator_Type;
-- Steps as per the xxHash spec
procedure Step_1_Short with Inline; -- Step 1 with < 16 byte total input
-- Step 2. Process Stripes is done in Write
procedure Step_3 with Inline; -- Accumulator Convergence
procedure Step_4 with Inline; -- Add input length
procedure Step_5 with Inline; -- Consume remaining input
procedure Step_6 with Inline; -- Final mix (avalanche)
-- Step 1 Short
procedure Step_1_Short is
-- This is invoked when Digest is called before 16 or more bytes have
-- been written to the engine
begin
Hash_Accumulator := PRIME32_5;
end;
-- Step 3: Accumulator Convergence
procedure Step_3 is begin
Hash_Accumulator
:= Rotate_Left (Lane_Accumulators(1), 1)
+ Rotate_Left (Lane_Accumulators(2), 7)
+ Rotate_Left (Lane_Accumulators(3), 12)
+ Rotate_Left (Lane_Accumulators(4), 18);
end;
-- Step 4: Add input length
procedure Step_4 is begin
Hash_Accumulator := Hash_Accumulator + Engine.Input_Total;
end;
-- Step 5: Consume remaining input
procedure Step_5 is
Lane: Accumulator_Type := 0;
Mark: Stream_Element_Offset := Engine.Buffer'First;
begin
pragma Assert (Engine.Last_Element < Engine.Buffer'Last);
while (Engine.Last_Element - Mark) >= 3 loop
-- Note that since we are shifting the lane 4 x 8bits,
-- the initial value of Lane does not matter at all,
-- so we don't need to clear it every time
for Byte of reverse Engine.Buffer (Mark .. Mark + 3) loop
Lane := Shift_Left (Lane, 8);
Lane := Lane + Accumulator_Type (Byte);
end loop;
Mark := Mark + 4;
Hash_Accumulator := Hash_Accumulator + Lane * PRIME32_3;
Hash_Accumulator := Rotate_Left (Hash_Accumulator, 17);
Hash_Accumulator := Hash_Accumulator * PRIME32_4;
end loop;
while Mark <= Engine.Last_Element loop
Lane := Accumulator_Type (Engine.Buffer(Mark));
Hash_Accumulator := Hash_Accumulator + Lane * PRIME32_5;
Hash_Accumulator := Rotate_Left (Hash_Accumulator, 11);
Hash_Accumulator := Hash_Accumulator * PRIME32_1;
Mark := Mark + 1;
end loop;
end;
-- Step 6: Final mix (avalanche)
procedure Step_6 is
Acc: Accumulator_Type renames Hash_Accumulator;
begin
Acc := Acc xor Shift_Right (Acc, 15);
Acc := Acc * PRIME32_2;
Acc := Acc xor Shift_Right (Acc, 13);
Acc := Acc * PRIME32_3;
Acc := Acc xor Shift_Right (Acc, 16);
end Step_6;
begin
if Engine.Input_Total < 16 then
-- If the total input is less than 16, we need to "manually"
-- initialize the accumulator. If we have done any rounds ("Step 2")
-- to process 16-byte "stripes", then we would use "Step 3" to
-- initialize Hash_Accumulator from the Engine's accumulators.
Hash_Accumulator := PRIME32_5;
else
-- Normal completion (Converge the engine accumulators into the hash
-- accumulator)
Step_3;
end if;
Step_4;
Step_5;
Step_6;
return XXH32_Hash'(Digest => Hash_Accumulator);
end Digest;
end Modular_Hashing.xxHash32;
|
-- Copyright 2013-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
Thread: Integer;
begin
Thread := 0;
for I in 1 .. 100 loop
Thread := Thread + I; -- STOP_HERE
end loop;
Put(Integer'Image(Thread));
end Foo;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- Based on ft5336.h from MCD Application Team
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Unchecked_Conversion;
with HAL.Touch_Panel; use HAL.Touch_Panel;
with STM32.Board; use STM32.Board;
with STM32.Device; use STM32.Device;
with FT5336; use FT5336;
package body Touch_Panel_FT5336 is
----------------
-- Initialize --
----------------
function Initialize
(This : in out Touch_Panel;
Orientation : HAL.Framebuffer.Display_Orientation :=
HAL.Framebuffer.Default)
return Boolean
is
begin
Initialize_I2C_GPIO (TP_I2C);
-- Wait at least 200ms after power up before accessing the TP registers
delay until Clock + Milliseconds (200);
Configure_I2C (TP_I2C);
This.TP_Set_Use_Interrupts (False);
This.Set_Orientation (Orientation);
return This.Check_Id;
end Initialize;
----------------
-- Initialize --
----------------
procedure Initialize (This : in out Touch_Panel;
Orientation : HAL.Framebuffer.Display_Orientation :=
HAL.Framebuffer.Default) is
begin
if not This.Initialize (Orientation) then
raise Constraint_Error with "Cannot initialize the touch panel";
end if;
end Initialize;
---------------------
-- Set_Orientation --
---------------------
procedure Set_Orientation
(This : in out Touch_Panel;
Orientation : HAL.Framebuffer.Display_Orientation)
is
begin
case Orientation is
when HAL.Framebuffer.Default | HAL.Framebuffer.Landscape =>
This.Set_Bounds (LCD_Natural_Width,
LCD_Natural_Height,
0);
when HAL.Framebuffer.Portrait =>
This.Set_Bounds (LCD_Natural_Width,
LCD_Natural_Height,
Invert_Y or Swap_XY);
end case;
end Set_Orientation;
end Touch_Panel_FT5336;
|
-- { dg-do compile }
package body itypes is
Size : constant := 10;
type Arr is array (1 .. size) of Integer;
type Rec is record
Field1 : Arr := (others => 0);
Field2 : Arr := (others => 0);
Field3 : Arr := (others => 0);
Field4 : Arr := (others => 0);
Field5 : Arr := (others => 0);
Field6 : Arr := (others => 0);
Field7 : Arr := (others => 0);
end record;
procedure Proc is
Temp1 : Rec;
begin
null;
end;
end;
|
-- Copyright 2015-2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pack is
type Table_Type is
array (Natural range <>) of Integer;
type Table_Ptr_Type is access all Table_Type;
Table : Table_Type := (1 => 10, 2 => 20);
Table_Ptr : aliased Table_Ptr_Type := new Table_Type'(3 => 30, 4 => 40);
end Pack;
|
-------------------------------------------------------------------------------
-- LSE -- L-System Editor
-- Author: Heziode
--
-- License:
-- MIT License
--
-- Copyright (c) 2018 Quentin Dauprat (Heziode) <Heziode@protonmail.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitation
-- the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- and/or sell copies of the Software, and to permit persons to whom the
-- Software is furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------------------------
package body LSE.Model.Grammar.Symbol.OtherSymbol is
procedure Initialize (This : out Instance)
is
begin
This := Instance '(Representation => ' ');
end Initialize;
procedure Initialize (This : out Instance; Representation : Character)
is
begin
This := Instance '(Representation => Representation);
end Initialize;
procedure Interpret (This : in out Instance;
T : in out Holder)
is
begin
-- Nothing to do
null;
end Interpret;
end LSE.Model.Grammar.Symbol.OtherSymbol;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling 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$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Internals.Utp_Elements;
with AMF.UML.Call_Operation_Actions;
with AMF.Utp.Stop_Timer_Actions;
with AMF.Visitors;
package AMF.Internals.Utp_Stop_Timer_Actions is
type Utp_Stop_Timer_Action_Proxy is
limited new AMF.Internals.Utp_Elements.Utp_Element_Proxy
and AMF.Utp.Stop_Timer_Actions.Utp_Stop_Timer_Action with null record;
overriding function Get_Base_Call_Operation_Action
(Self : not null access constant Utp_Stop_Timer_Action_Proxy)
return AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access;
-- Getter of StopTimerAction::base_CallOperationAction.
--
overriding procedure Set_Base_Call_Operation_Action
(Self : not null access Utp_Stop_Timer_Action_Proxy;
To : AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access);
-- Setter of StopTimerAction::base_CallOperationAction.
--
overriding procedure Enter_Element
(Self : not null access constant Utp_Stop_Timer_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Leave_Element
(Self : not null access constant Utp_Stop_Timer_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Visit_Element
(Self : not null access constant Utp_Stop_Timer_Action_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
end AMF.Internals.Utp_Stop_Timer_Actions;
|
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_IO; use Ada.Text_IO;
with Generic_Stack;
procedure RPN_to_Infix is
-- The code above
begin
Put_Line ("3 4 2 * 1 5 - 2 3 ^ ^ / + = ");
Put_Line (Convert ("3 4 2 * 1 5 - 2 3 ^ ^ / +"));
Put_Line ("1 2 + 3 4 + ^ 5 6 + ^ = ");
Put_Line (Convert ("1 2 + 3 4 + ^ 5 6 + ^"));
end RPN_to_Infix;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.