content stringlengths 23 1.05M |
|---|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- SYSTEM.TASKING.PROTECTED_OBJECTS.SINGLE_ENTRY --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2019, 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. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram ordering check, since restricted GNARLI subprograms are
-- gathered together at end.
-- This package provides an optimized version of Protected_Objects.Operations
-- and Protected_Objects.Entries making the following assumptions:
-- PO has only one entry
-- There is only one caller at a time (No_Entry_Queue)
-- There is no dynamic priority support (No_Dynamic_Priorities)
-- No Abort Statements
-- (No_Abort_Statements, Max_Asynchronous_Select_Nesting => 0)
-- PO are at library level
-- No Requeue
-- None of the tasks will terminate (no need for finalization)
-- This interface is intended to be used in the ravenscar and restricted
-- profiles, the compiler is responsible for ensuring that the conditions
-- mentioned above are respected, except for the No_Entry_Queue restriction
-- that is checked dynamically in this package, since the check cannot be
-- performed at compile time, and is relatively cheap (see PO_Do_Or_Queue,
-- Service_Entry).
pragma Polling (Off);
-- Turn off polling, we do not want polling to take place during tasking
-- operations. It can cause infinite loops and other problems.
pragma Suppress (All_Checks);
-- Why is this required ???
with Ada.Exceptions;
with System.Task_Primitives.Operations;
with System.Parameters;
package body System.Tasking.Protected_Objects.Single_Entry is
package STPO renames System.Task_Primitives.Operations;
use Parameters;
-----------------------
-- Local Subprograms --
-----------------------
procedure Send_Program_Error (Entry_Call : Entry_Call_Link);
pragma Inline (Send_Program_Error);
-- Raise Program_Error in the caller of the specified entry call
--------------------------
-- Entry Calls Handling --
--------------------------
procedure Wakeup_Entry_Caller (Entry_Call : Entry_Call_Link);
pragma Inline (Wakeup_Entry_Caller);
-- This is called at the end of service of an entry call, to abort the
-- caller if he is in an abortable part, and to wake up the caller if he
-- is on Entry_Caller_Sleep. Call it holding the lock of Entry_Call.Self.
procedure Wait_For_Completion (Entry_Call : Entry_Call_Link);
pragma Inline (Wait_For_Completion);
-- This procedure suspends the calling task until the specified entry call
-- has either been completed or cancelled. On exit, the call will not be
-- queued. This waits for calls on protected entries.
-- Call this only when holding Self_ID locked.
procedure Check_Exception
(Self_ID : Task_Id;
Entry_Call : Entry_Call_Link);
pragma Inline (Check_Exception);
-- Raise any pending exception from the Entry_Call. This should be called
-- at the end of every compiler interface procedure that implements an
-- entry call. The caller should not be holding any locks, or there will
-- be deadlock.
procedure PO_Do_Or_Queue
(Object : Protection_Entry_Access;
Entry_Call : Entry_Call_Link);
-- This procedure executes or queues an entry call, depending on the status
-- of the corresponding barrier. The specified object is assumed locked.
---------------------
-- Check_Exception --
---------------------
procedure Check_Exception
(Self_ID : Task_Id;
Entry_Call : Entry_Call_Link)
is
pragma Warnings (Off, Self_ID);
procedure Internal_Raise (X : Ada.Exceptions.Exception_Id);
pragma Import (C, Internal_Raise, "__gnat_raise_with_msg");
use type Ada.Exceptions.Exception_Id;
E : constant Ada.Exceptions.Exception_Id :=
Entry_Call.Exception_To_Raise;
begin
if E /= Ada.Exceptions.Null_Id then
Internal_Raise (E);
end if;
end Check_Exception;
------------------------
-- Send_Program_Error --
------------------------
procedure Send_Program_Error (Entry_Call : Entry_Call_Link) is
Caller : constant Task_Id := Entry_Call.Self;
begin
Entry_Call.Exception_To_Raise := Program_Error'Identity;
if Single_Lock then
STPO.Lock_RTS;
end if;
STPO.Write_Lock (Caller);
Wakeup_Entry_Caller (Entry_Call);
STPO.Unlock (Caller);
if Single_Lock then
STPO.Unlock_RTS;
end if;
end Send_Program_Error;
-------------------------
-- Wait_For_Completion --
-------------------------
procedure Wait_For_Completion (Entry_Call : Entry_Call_Link) is
Self_Id : constant Task_Id := Entry_Call.Self;
begin
Self_Id.Common.State := Entry_Caller_Sleep;
STPO.Sleep (Self_Id, Entry_Caller_Sleep);
Self_Id.Common.State := Runnable;
end Wait_For_Completion;
-------------------------
-- Wakeup_Entry_Caller --
-------------------------
-- This is called at the end of service of an entry call, to abort the
-- caller if he is in an abortable part, and to wake up the caller if it
-- is on Entry_Caller_Sleep. It assumes that the call is already off-queue.
-- (This enforces the rule that a task must be off-queue if its state is
-- Done or Cancelled.) Call it holding the lock of Entry_Call.Self.
-- The caller is waiting on Entry_Caller_Sleep, in Wait_For_Completion.
procedure Wakeup_Entry_Caller
(Entry_Call : Entry_Call_Link)
is
Caller : constant Task_Id := Entry_Call.Self;
begin
pragma Assert
(Caller.Common.State /= Terminated and then
Caller.Common.State /= Unactivated);
Entry_Call.State := Done;
STPO.Wakeup (Caller, Entry_Caller_Sleep);
end Wakeup_Entry_Caller;
-----------------------
-- Restricted GNARLI --
-----------------------
--------------------------------------------
-- Exceptional_Complete_Single_Entry_Body --
--------------------------------------------
procedure Exceptional_Complete_Single_Entry_Body
(Object : Protection_Entry_Access;
Ex : Ada.Exceptions.Exception_Id)
is
begin
Object.Call_In_Progress.Exception_To_Raise := Ex;
end Exceptional_Complete_Single_Entry_Body;
---------------------------------
-- Initialize_Protection_Entry --
---------------------------------
procedure Initialize_Protection_Entry
(Object : Protection_Entry_Access;
Ceiling_Priority : Integer;
Compiler_Info : System.Address;
Entry_Body : Entry_Body_Access)
is
begin
Initialize_Protection (Object.Common'Access, Ceiling_Priority);
Object.Compiler_Info := Compiler_Info;
Object.Call_In_Progress := null;
Object.Entry_Body := Entry_Body;
Object.Entry_Queue := null;
end Initialize_Protection_Entry;
----------------
-- Lock_Entry --
----------------
-- Compiler interface only
-- Do not call this procedure from within the run-time system.
procedure Lock_Entry (Object : Protection_Entry_Access) is
begin
Lock (Object.Common'Access);
end Lock_Entry;
--------------------------
-- Lock_Read_Only_Entry --
--------------------------
-- Compiler interface only
-- Do not call this procedure from within the runtime system
procedure Lock_Read_Only_Entry (Object : Protection_Entry_Access) is
begin
Lock_Read_Only (Object.Common'Access);
end Lock_Read_Only_Entry;
--------------------
-- PO_Do_Or_Queue --
--------------------
procedure PO_Do_Or_Queue
(Object : Protection_Entry_Access;
Entry_Call : Entry_Call_Link)
is
Barrier_Value : Boolean;
begin
-- When the Action procedure for an entry body returns, it must be
-- completed (having called [Exceptional_]Complete_Entry_Body).
Barrier_Value := Object.Entry_Body.Barrier (Object.Compiler_Info, 1);
if Barrier_Value then
if Object.Call_In_Progress /= null then
-- This violates the No_Entry_Queue restriction, send
-- Program_Error to the caller.
Send_Program_Error (Entry_Call);
return;
end if;
Object.Call_In_Progress := Entry_Call;
Object.Entry_Body.Action
(Object.Compiler_Info, Entry_Call.Uninterpreted_Data, 1);
Object.Call_In_Progress := null;
if Single_Lock then
STPO.Lock_RTS;
end if;
STPO.Write_Lock (Entry_Call.Self);
Wakeup_Entry_Caller (Entry_Call);
STPO.Unlock (Entry_Call.Self);
if Single_Lock then
STPO.Unlock_RTS;
end if;
else
pragma Assert (Entry_Call.Mode = Simple_Call);
if Object.Entry_Queue /= null then
-- This violates the No_Entry_Queue restriction, send
-- Program_Error to the caller.
Send_Program_Error (Entry_Call);
return;
else
Object.Entry_Queue := Entry_Call;
end if;
end if;
exception
when others =>
Send_Program_Error (Entry_Call);
end PO_Do_Or_Queue;
---------------------------
-- Protected_Count_Entry --
---------------------------
function Protected_Count_Entry (Object : Protection_Entry) return Natural is
begin
if Object.Entry_Queue /= null then
return 1;
else
return 0;
end if;
end Protected_Count_Entry;
---------------------------------
-- Protected_Single_Entry_Call --
---------------------------------
procedure Protected_Single_Entry_Call
(Object : Protection_Entry_Access;
Uninterpreted_Data : System.Address)
is
Self_Id : constant Task_Id := STPO.Self;
Entry_Call : Entry_Call_Record renames
Self_Id.Entry_Calls (Self_Id.Entry_Calls'First);
begin
-- If pragma Detect_Blocking is active then Program_Error must be
-- raised if this potentially blocking operation is called from a
-- protected action.
if Detect_Blocking
and then Self_Id.Common.Protected_Action_Nesting > 0
then
raise Program_Error with "potentially blocking operation";
end if;
Lock_Entry (Object);
Entry_Call.Mode := Simple_Call;
Entry_Call.State := Now_Abortable;
Entry_Call.Uninterpreted_Data := Uninterpreted_Data;
Entry_Call.Exception_To_Raise := Ada.Exceptions.Null_Id;
PO_Do_Or_Queue (Object, Entry_Call'Access);
Unlock_Entry (Object);
-- The call is either `Done' or not. It cannot be cancelled since there
-- is no ATC construct.
pragma Assert (Entry_Call.State /= Cancelled);
if Entry_Call.State /= Done then
if Single_Lock then
STPO.Lock_RTS;
end if;
STPO.Write_Lock (Self_Id);
Wait_For_Completion (Entry_Call'Access);
STPO.Unlock (Self_Id);
if Single_Lock then
STPO.Unlock_RTS;
end if;
end if;
Check_Exception (Self_Id, Entry_Call'Access);
end Protected_Single_Entry_Call;
-----------------------------------
-- Protected_Single_Entry_Caller --
-----------------------------------
function Protected_Single_Entry_Caller
(Object : Protection_Entry) return Task_Id
is
begin
return Object.Call_In_Progress.Self;
end Protected_Single_Entry_Caller;
-------------------
-- Service_Entry --
-------------------
procedure Service_Entry (Object : Protection_Entry_Access) is
Entry_Call : constant Entry_Call_Link := Object.Entry_Queue;
Caller : Task_Id;
begin
if Entry_Call /= null
and then Object.Entry_Body.Barrier (Object.Compiler_Info, 1)
then
Object.Entry_Queue := null;
if Object.Call_In_Progress /= null then
-- Violation of No_Entry_Queue restriction, raise exception
Send_Program_Error (Entry_Call);
Unlock_Entry (Object);
return;
end if;
Object.Call_In_Progress := Entry_Call;
Object.Entry_Body.Action
(Object.Compiler_Info, Entry_Call.Uninterpreted_Data, 1);
Object.Call_In_Progress := null;
Caller := Entry_Call.Self;
Unlock_Entry (Object);
if Single_Lock then
STPO.Lock_RTS;
end if;
STPO.Write_Lock (Caller);
Wakeup_Entry_Caller (Entry_Call);
STPO.Unlock (Caller);
if Single_Lock then
STPO.Unlock_RTS;
end if;
else
-- Just unlock the entry
Unlock_Entry (Object);
end if;
exception
when others =>
Send_Program_Error (Entry_Call);
Unlock_Entry (Object);
end Service_Entry;
------------------
-- Unlock_Entry --
------------------
procedure Unlock_Entry (Object : Protection_Entry_Access) is
begin
Unlock (Object.Common'Access);
end Unlock_Entry;
end System.Tasking.Protected_Objects.Single_Entry;
|
-- Divide By Zero Detection
with Ada.Text_Io; use Ada.Text_Io;
with Ada.Float_Text_Io; use Ada.Float_Text_Io;
with Ada.Integer_Text_Io; use Ada.Integer_Text_Io;
procedure Divide_By_Zero is
Fnum : Float := 1.0;
Fdenom : Float := 0.0;
Fresult : Float;
Inum : Integer := 1;
Idenom : Integer := 0;
Iresult : Integer;
begin
begin
Put("Integer divide by zero: ");
Iresult := Inum / Idenom;
Put(Item => Iresult);
exception
when Constraint_Error =>
Put("Division by zero detected.");
end;
New_Line;
Put("Floating point divide by zero: ");
Fresult := Fnum / Fdenom;
if Fresult > Float'Last or Fresult < Float'First then
Put("Division by zero detected (infinite value).");
else
Put(Item => Fresult, Aft => 9, Exp => 0);
end if;
New_Line;
end Divide_By_Zero;
|
-- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
with Ada.Unchecked_Deallocation;
package body Yaml.Transformation is
procedure Adjust (Object : in out Reference) is
begin
Increase_Refcount (Object.Data);
end Adjust;
procedure Finalize (Object : in out Reference) is
begin
Decrease_Refcount (Object.Data);
end Finalize;
procedure Finalize (Object : in out Instance) is
procedure Free is new Ada.Unchecked_Deallocation
(Transformator.Instance'Class, Transformator.Pointer);
begin
for Element of Object.Transformators loop
declare
Ptr : Transformator.Pointer := Element;
begin
Free (Ptr);
end;
end loop;
end Finalize;
function Transform (Original : Stream_Impl.Reference) return Instance is
begin
return (Refcount_Base with Original => Original,
Transformators => <>);
end Transform;
function Transform (Original : Stream_Impl.Reference) return Reference is
Ptr : constant not null Instance_Access :=
new Instance'(Refcount_Base with Original => Original,
Transformators => <>);
begin
return (Ada.Finalization.Controlled with Data => Ptr);
end Transform;
function Value (Object : Reference) return Accessor is
((Data => Object.Data.all'Access));
function Next (Object : in out Instance) return Event is
use type Transformator_Vectors.Cursor;
Cursor : Transformator_Vectors.Cursor := Object.Transformators.Last;
Current : Event;
begin
Outer : loop
while Cursor /= Transformator_Vectors.No_Element loop
exit when Transformator_Vectors.Element (Cursor).Has_Next;
Transformator_Vectors.Previous (Cursor);
end loop;
if Cursor = Transformator_Vectors.No_Element then
Current :=
Stream_Impl.Next (Stream_Impl.Value (Object.Original).Data.all);
Cursor := Object.Transformators.First;
else
Current := Transformator_Vectors.Element (Cursor).Next;
Transformator_Vectors.Next (Cursor);
end if;
loop
exit Outer when Cursor = Transformator_Vectors.No_Element;
Transformator_Vectors.Element (Cursor).Put (Current);
exit when not Transformator_Vectors.Element (Cursor).Has_Next;
Current := Transformator_Vectors.Element (Cursor).Next;
Transformator_Vectors.Next (Cursor);
end loop;
Transformator_Vectors.Previous (Cursor);
end loop Outer;
return Current;
end Next;
procedure Append (Object : in out Instance;
T : not null Transformator.Pointer) is
begin
Object.Transformators.Append (T);
end Append;
end Yaml.Transformation;
|
package GESTE_Fonts.FreeMono18pt7b is
Font : constant Bitmap_Font_Ref;
private
FreeMono18pt7bBitmaps : aliased constant Font_Bitmap := (
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#20#, 16#00#, 16#03#, 16#80#, 16#00#,
16#1C#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#07#, 16#00#, 16#00#, 16#38#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#60#, 16#00#,
16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#,
16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#01#,
16#F0#, 16#00#, 16#0F#, 16#80#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3E#,
16#F8#, 16#01#, 16#E3#, 16#C0#, 16#0F#, 16#1E#, 16#00#, 16#38#, 16#E0#,
16#01#, 16#C7#, 16#00#, 16#0E#, 16#38#, 16#00#, 16#71#, 16#C0#, 16#03#,
16#8E#, 16#00#, 16#18#, 16#30#, 16#00#, 16#41#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#C4#,
16#00#, 16#06#, 16#20#, 16#00#, 16#31#, 16#00#, 16#01#, 16#08#, 16#00#,
16#08#, 16#40#, 16#00#, 16#42#, 16#00#, 16#02#, 16#30#, 16#00#, 16#11#,
16#80#, 16#00#, 16#8C#, 16#00#, 16#7F#, 16#FE#, 16#00#, 16#23#, 16#00#,
16#03#, 16#18#, 16#00#, 16#18#, 16#80#, 16#00#, 16#C4#, 16#00#, 16#7F#,
16#FE#, 16#00#, 16#31#, 16#00#, 16#01#, 16#88#, 16#00#, 16#08#, 16#40#,
16#00#, 16#42#, 16#00#, 16#02#, 16#30#, 16#00#, 16#11#, 16#80#, 16#00#,
16#8C#, 16#00#, 16#04#, 16#60#, 16#00#, 16#23#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#04#, 16#00#,
16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#3F#, 16#40#, 16#06#,
16#0E#, 16#00#, 16#60#, 16#30#, 16#02#, 16#00#, 16#80#, 16#10#, 16#00#,
16#00#, 16#80#, 16#00#, 16#06#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#7C#, 16#00#, 16#00#, 16#3C#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#02#, 16#01#, 16#00#, 16#10#, 16#08#, 16#01#, 16#80#,
16#60#, 16#08#, 16#03#, 16#C1#, 16#80#, 16#13#, 16#F8#, 16#00#, 16#02#,
16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#,
16#00#, 16#20#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#01#, 16#8C#,
16#00#, 16#18#, 16#20#, 16#00#, 16#81#, 16#80#, 16#04#, 16#0C#, 16#00#,
16#30#, 16#40#, 16#00#, 16#C6#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#00#,
16#1E#, 16#00#, 16#07#, 16#C0#, 16#01#, 16#F0#, 16#00#, 16#78#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#00#, 16#78#, 16#00#, 16#0C#, 16#60#, 16#00#,
16#41#, 16#80#, 16#06#, 16#04#, 16#00#, 16#30#, 16#20#, 16#00#, 16#83#,
16#00#, 16#06#, 16#30#, 16#00#, 16#0F#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#C0#, 16#00#,
16#C4#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#40#, 16#00#, 16#03#, 16#00#, 16#00#,
16#18#, 16#00#, 16#03#, 16#E0#, 16#00#, 16#19#, 16#0E#, 16#01#, 16#8C#,
16#40#, 16#08#, 16#36#, 16#00#, 16#40#, 16#B0#, 16#02#, 16#07#, 16#00#,
16#18#, 16#18#, 16#00#, 16#61#, 16#C0#, 16#01#, 16#F3#, 16#C0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#C0#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#07#,
16#00#, 16#00#, 16#38#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#0E#, 16#00#,
16#00#, 16#70#, 16#00#, 16#03#, 16#80#, 16#00#, 16#08#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#60#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#,
16#03#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#,
16#00#, 16#00#, 16#70#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#C0#, 16#00#, 16#07#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#06#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#02#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#80#, 16#00#,
16#06#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#,
16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#,
16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#,
16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#,
16#08#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#60#,
16#00#, 16#03#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#00#, 16#00#,
16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#06#, 16#10#,
16#C0#, 16#0E#, 16#B8#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#50#, 16#00#,
16#06#, 16#C0#, 16#00#, 16#63#, 16#00#, 16#06#, 16#08#, 16#00#, 16#20#,
16#20#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#,
16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#,
16#01#, 16#FF#, 16#FC#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#,
16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#,
16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#80#,
16#00#, 16#78#, 16#00#, 16#03#, 16#C0#, 16#00#, 16#3C#, 16#00#, 16#01#,
16#C0#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#07#, 16#00#,
16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FF#, 16#FC#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#03#, 16#80#, 16#00#, 16#3E#, 16#00#, 16#01#, 16#F0#,
16#00#, 16#0F#, 16#80#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#08#,
16#00#, 16#00#, 16#C0#, 16#00#, 16#04#, 16#00#, 16#00#, 16#60#, 16#00#,
16#02#, 16#00#, 16#00#, 16#30#, 16#00#, 16#01#, 16#00#, 16#00#, 16#18#,
16#00#, 16#00#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#40#, 16#00#,
16#06#, 16#00#, 16#00#, 16#20#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#,
16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#40#, 16#00#,
16#06#, 16#00#, 16#00#, 16#20#, 16#00#, 16#03#, 16#00#, 16#00#, 16#10#,
16#00#, 16#01#, 16#80#, 16#00#, 16#08#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#C0#, 16#00#, 16#63#, 16#00#, 16#04#, 16#04#, 16#00#, 16#60#,
16#30#, 16#02#, 16#00#, 16#80#, 16#30#, 16#06#, 16#01#, 16#80#, 16#30#,
16#08#, 16#00#, 16#80#, 16#40#, 16#04#, 16#02#, 16#00#, 16#20#, 16#10#,
16#01#, 16#00#, 16#80#, 16#08#, 16#04#, 16#00#, 16#40#, 16#20#, 16#02#,
16#01#, 16#80#, 16#30#, 16#0C#, 16#01#, 16#80#, 16#20#, 16#08#, 16#01#,
16#80#, 16#C0#, 16#04#, 16#04#, 16#00#, 16#18#, 16#C0#, 16#00#, 16#7C#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#03#, 16#00#, 16#00#, 16#38#, 16#00#, 16#03#, 16#40#,
16#00#, 16#32#, 16#00#, 16#03#, 16#10#, 16#00#, 16#30#, 16#80#, 16#00#,
16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#,
16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#,
16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#07#, 16#FF#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#C0#, 16#00#, 16#C3#, 16#00#,
16#08#, 16#04#, 16#00#, 16#80#, 16#10#, 16#04#, 16#00#, 16#80#, 16#00#,
16#06#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#18#,
16#00#, 16#01#, 16#80#, 16#00#, 16#18#, 16#00#, 16#01#, 16#80#, 16#00#,
16#18#, 16#00#, 16#01#, 16#80#, 16#00#, 16#18#, 16#00#, 16#01#, 16#80#,
16#00#, 16#18#, 16#00#, 16#01#, 16#80#, 16#60#, 16#18#, 16#03#, 16#01#,
16#80#, 16#18#, 16#0F#, 16#FF#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#C0#, 16#01#,
16#C1#, 16#80#, 16#18#, 16#06#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#20#, 16#00#, 16#03#, 16#00#,
16#00#, 16#30#, 16#00#, 16#1E#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#,
16#30#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#,
16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#60#, 16#30#,
16#06#, 16#00#, 16#E0#, 16#60#, 16#00#, 16#FC#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#F0#, 16#00#, 16#05#, 16#80#, 16#00#, 16#4C#, 16#00#, 16#02#, 16#60#,
16#00#, 16#23#, 16#00#, 16#03#, 16#18#, 16#00#, 16#10#, 16#C0#, 16#01#,
16#86#, 16#00#, 16#08#, 16#30#, 16#00#, 16#C1#, 16#80#, 16#04#, 16#0C#,
16#00#, 16#40#, 16#60#, 16#06#, 16#03#, 16#00#, 16#20#, 16#18#, 16#01#,
16#FF#, 16#F0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#, 16#01#,
16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#, 16#00#, 16#1F#, 16#C0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#3F#, 16#F8#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#60#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#06#, 16#FC#, 16#00#, 16#38#, 16#30#, 16#00#, 16#00#, 16#40#,
16#00#, 16#03#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#,
16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#0C#,
16#02#, 16#00#, 16#60#, 16#18#, 16#06#, 16#00#, 16#70#, 16#60#, 16#00#,
16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#7E#, 16#00#, 16#0C#, 16#00#, 16#01#,
16#80#, 16#00#, 16#18#, 16#00#, 16#00#, 16#80#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#40#, 16#00#, 16#06#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#0F#, 16#00#, 16#09#, 16#86#, 16#00#, 16#58#, 16#18#, 16#03#, 16#80#,
16#40#, 16#18#, 16#03#, 16#00#, 16#80#, 16#18#, 16#06#, 16#00#, 16#C0#,
16#10#, 16#06#, 16#00#, 16#C0#, 16#20#, 16#02#, 16#03#, 16#00#, 16#0C#,
16#30#, 16#00#, 16#3E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#FC#, 16#02#, 16#00#,
16#60#, 16#10#, 16#03#, 16#00#, 16#80#, 16#10#, 16#00#, 16#01#, 16#80#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#,
16#30#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#03#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#,
16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C0#,
16#00#, 16#C1#, 16#80#, 16#0C#, 16#06#, 16#00#, 16#40#, 16#10#, 16#06#,
16#00#, 16#C0#, 16#30#, 16#06#, 16#01#, 16#80#, 16#30#, 16#04#, 16#01#,
16#00#, 16#30#, 16#18#, 16#00#, 16#C1#, 16#80#, 16#01#, 16#F0#, 16#00#,
16#30#, 16#60#, 16#03#, 16#01#, 16#80#, 16#30#, 16#06#, 16#01#, 16#80#,
16#30#, 16#08#, 16#00#, 16#80#, 16#60#, 16#0C#, 16#03#, 16#00#, 16#60#,
16#0C#, 16#06#, 16#00#, 16#30#, 16#60#, 16#00#, 16#7C#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#C0#, 16#00#, 16#61#, 16#80#, 16#06#, 16#06#, 16#00#, 16#60#,
16#10#, 16#02#, 16#00#, 16#C0#, 16#10#, 16#02#, 16#00#, 16#80#, 16#18#,
16#04#, 16#00#, 16#C0#, 16#30#, 16#0E#, 16#00#, 16#80#, 16#F0#, 16#03#,
16#0D#, 16#80#, 16#0F#, 16#8C#, 16#00#, 16#00#, 16#60#, 16#00#, 16#02#,
16#00#, 16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#18#, 16#00#,
16#01#, 16#80#, 16#00#, 16#18#, 16#00#, 16#03#, 16#80#, 16#03#, 16#F0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#F8#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#3E#,
16#00#, 16#00#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#,
16#80#, 16#00#, 16#3E#, 16#00#, 16#01#, 16#F0#, 16#00#, 16#0F#, 16#80#,
16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#1C#, 16#00#, 16#01#, 16#F0#, 16#00#, 16#0F#, 16#80#,
16#00#, 16#7C#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#0F#, 16#80#, 16#00#, 16#78#, 16#00#, 16#03#, 16#C0#, 16#00#,
16#3C#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#0E#, 16#00#, 16#00#, 16#60#,
16#00#, 16#07#, 16#00#, 16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#1C#, 16#00#, 16#03#, 16#80#, 16#00#, 16#70#, 16#00#,
16#0E#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#1C#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#03#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#01#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#FF#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#FF#, 16#80#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#,
16#80#, 16#00#, 16#06#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#00#, 16#38#,
16#00#, 16#00#, 16#70#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#01#, 16#80#,
16#00#, 16#07#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#03#, 16#80#, 16#00#,
16#70#, 16#00#, 16#06#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#1C#, 16#00#,
16#03#, 16#80#, 16#00#, 16#30#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#00#, 16#0E#,
16#0C#, 16#00#, 16#40#, 16#30#, 16#02#, 16#00#, 16#C0#, 16#10#, 16#02#,
16#00#, 16#00#, 16#10#, 16#00#, 16#01#, 16#80#, 16#00#, 16#08#, 16#00#,
16#01#, 16#C0#, 16#00#, 16#38#, 16#00#, 16#03#, 16#00#, 16#00#, 16#10#,
16#00#, 16#00#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#01#, 16#F0#, 16#00#, 16#0F#,
16#80#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#C0#, 16#00#, 16#43#,
16#00#, 16#04#, 16#04#, 16#00#, 16#40#, 16#30#, 16#06#, 16#00#, 16#80#,
16#30#, 16#04#, 16#01#, 16#00#, 16#20#, 16#08#, 16#0F#, 16#00#, 16#41#,
16#88#, 16#02#, 16#18#, 16#40#, 16#10#, 16#82#, 16#00#, 16#8C#, 16#10#,
16#04#, 16#20#, 16#80#, 16#21#, 16#04#, 16#01#, 16#0C#, 16#20#, 16#08#,
16#1F#, 16#80#, 16#40#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#, 16#00#,
16#00#, 16#40#, 16#00#, 16#01#, 16#00#, 16#00#, 16#0C#, 16#0C#, 16#00#,
16#1F#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#FC#, 16#00#, 16#01#, 16#A0#, 16#00#, 16#0D#, 16#00#, 16#00#,
16#4C#, 16#00#, 16#06#, 16#20#, 16#00#, 16#21#, 16#80#, 16#01#, 16#0C#,
16#00#, 16#18#, 16#20#, 16#00#, 16#81#, 16#80#, 16#04#, 16#04#, 16#00#,
16#60#, 16#20#, 16#02#, 16#01#, 16#80#, 16#1F#, 16#FC#, 16#01#, 16#80#,
16#20#, 16#08#, 16#01#, 16#80#, 16#40#, 16#04#, 16#06#, 16#00#, 16#30#,
16#20#, 16#01#, 16#81#, 16#00#, 16#04#, 16#7F#, 16#03#, 16#FC#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#0F#, 16#FF#, 16#00#, 16#18#, 16#06#, 16#00#, 16#C0#,
16#18#, 16#06#, 16#00#, 16#40#, 16#30#, 16#02#, 16#01#, 16#80#, 16#10#,
16#0C#, 16#00#, 16#80#, 16#60#, 16#0C#, 16#03#, 16#01#, 16#C0#, 16#1F#,
16#FC#, 16#00#, 16#C0#, 16#38#, 16#06#, 16#00#, 16#60#, 16#30#, 16#01#,
16#01#, 16#80#, 16#0C#, 16#0C#, 16#00#, 16#60#, 16#60#, 16#03#, 16#03#,
16#00#, 16#18#, 16#18#, 16#01#, 16#80#, 16#C0#, 16#18#, 16#1F#, 16#FF#,
16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#10#, 16#06#, 16#0E#,
16#80#, 16#60#, 16#1C#, 16#04#, 16#00#, 16#60#, 16#60#, 16#01#, 16#02#,
16#00#, 16#08#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#60#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#03#, 16#00#, 16#18#, 16#0C#, 16#01#, 16#80#, 16#38#, 16#38#,
16#00#, 16#7E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#FE#, 16#00#,
16#10#, 16#1C#, 16#00#, 16#80#, 16#30#, 16#04#, 16#00#, 16#C0#, 16#20#,
16#02#, 16#01#, 16#00#, 16#18#, 16#08#, 16#00#, 16#C0#, 16#40#, 16#02#,
16#02#, 16#00#, 16#10#, 16#10#, 16#00#, 16#80#, 16#80#, 16#04#, 16#04#,
16#00#, 16#20#, 16#20#, 16#01#, 16#01#, 16#00#, 16#18#, 16#08#, 16#00#,
16#C0#, 16#40#, 16#04#, 16#02#, 16#00#, 16#60#, 16#10#, 16#06#, 16#00#,
16#80#, 16#E0#, 16#1F#, 16#FC#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#,
16#FF#, 16#E0#, 16#18#, 16#01#, 16#00#, 16#C0#, 16#08#, 16#06#, 16#00#,
16#40#, 16#30#, 16#02#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#60#, 16#80#, 16#03#, 16#04#, 16#00#, 16#1F#, 16#E0#, 16#00#, 16#C1#,
16#00#, 16#06#, 16#08#, 16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#,
16#0C#, 16#00#, 16#40#, 16#60#, 16#02#, 16#03#, 16#00#, 16#10#, 16#18#,
16#00#, 16#80#, 16#C0#, 16#04#, 16#1F#, 16#FF#, 16#E0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#0F#, 16#FF#, 16#F0#, 16#18#, 16#00#, 16#80#, 16#C0#, 16#04#,
16#06#, 16#00#, 16#20#, 16#30#, 16#01#, 16#01#, 16#80#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#60#, 16#80#, 16#03#, 16#04#, 16#00#, 16#1F#, 16#E0#,
16#00#, 16#C1#, 16#00#, 16#06#, 16#08#, 16#00#, 16#30#, 16#00#, 16#01#,
16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#, 16#00#, 16#03#, 16#00#,
16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#1F#, 16#F8#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#90#, 16#06#, 16#07#, 16#80#,
16#60#, 16#0C#, 16#06#, 16#00#, 16#20#, 16#60#, 16#01#, 16#02#, 16#00#,
16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#60#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#, 16#0F#, 16#F8#, 16#C0#,
16#01#, 16#06#, 16#00#, 16#08#, 16#10#, 16#00#, 16#40#, 16#C0#, 16#02#,
16#02#, 16#00#, 16#10#, 16#08#, 16#00#, 16#80#, 16#30#, 16#1C#, 16#00#,
16#7F#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#E3#, 16#F8#, 16#18#,
16#03#, 16#00#, 16#C0#, 16#18#, 16#06#, 16#00#, 16#C0#, 16#30#, 16#06#,
16#01#, 16#80#, 16#30#, 16#0C#, 16#01#, 16#80#, 16#60#, 16#0C#, 16#03#,
16#00#, 16#60#, 16#1F#, 16#FF#, 16#00#, 16#C0#, 16#18#, 16#06#, 16#00#,
16#C0#, 16#30#, 16#06#, 16#01#, 16#80#, 16#30#, 16#0C#, 16#01#, 16#80#,
16#60#, 16#0C#, 16#03#, 16#00#, 16#60#, 16#18#, 16#03#, 16#00#, 16#C0#,
16#18#, 16#1F#, 16#C7#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FF#,
16#E0#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#,
16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#,
16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#,
16#00#, 16#02#, 16#00#, 16#07#, 16#FF#, 16#C0#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#3F#, 16#FC#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#,
16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#08#, 16#00#, 16#80#, 16#40#, 16#04#, 16#02#, 16#00#,
16#20#, 16#10#, 16#01#, 16#00#, 16#80#, 16#18#, 16#04#, 16#00#, 16#80#,
16#10#, 16#0C#, 16#00#, 16#60#, 16#C0#, 16#00#, 16#F8#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#0F#, 16#E1#, 16#F8#, 16#18#, 16#03#, 16#00#, 16#C0#,
16#30#, 16#06#, 16#03#, 16#00#, 16#30#, 16#30#, 16#01#, 16#83#, 16#00#,
16#0C#, 16#30#, 16#00#, 16#63#, 16#00#, 16#03#, 16#30#, 16#00#, 16#1B#,
16#E0#, 16#00#, 16#F1#, 16#80#, 16#07#, 16#06#, 16#00#, 16#30#, 16#10#,
16#01#, 16#80#, 16#C0#, 16#0C#, 16#02#, 16#00#, 16#60#, 16#18#, 16#03#,
16#00#, 16#40#, 16#18#, 16#03#, 16#00#, 16#C0#, 16#18#, 16#1F#, 16#C0#,
16#78#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#FC#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#,
16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#,
16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#,
16#04#, 16#00#, 16#00#, 16#20#, 16#04#, 16#01#, 16#00#, 16#60#, 16#08#,
16#03#, 16#00#, 16#40#, 16#18#, 16#02#, 16#00#, 16#C0#, 16#10#, 16#06#,
16#1F#, 16#FF#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1E#, 16#00#, 16#3C#,
16#38#, 16#03#, 16#C1#, 16#40#, 16#16#, 16#0B#, 16#01#, 16#B0#, 16#48#,
16#09#, 16#82#, 16#60#, 16#4C#, 16#11#, 16#06#, 16#60#, 16#88#, 16#23#,
16#04#, 16#63#, 16#18#, 16#21#, 16#10#, 16#C1#, 16#0D#, 16#86#, 16#08#,
16#2C#, 16#30#, 16#41#, 16#C1#, 16#82#, 16#0E#, 16#0C#, 16#10#, 16#00#,
16#60#, 16#80#, 16#03#, 16#04#, 16#00#, 16#18#, 16#20#, 16#00#, 16#C1#,
16#00#, 16#06#, 16#7F#, 16#81#, 16#FC#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#,
16#01#, 16#FC#, 16#18#, 16#01#, 16#80#, 16#A0#, 16#0C#, 16#05#, 16#00#,
16#60#, 16#24#, 16#03#, 16#01#, 16#30#, 16#18#, 16#08#, 16#80#, 16#C0#,
16#46#, 16#06#, 16#02#, 16#10#, 16#30#, 16#10#, 16#41#, 16#80#, 16#83#,
16#0C#, 16#04#, 16#08#, 16#60#, 16#20#, 16#63#, 16#01#, 16#01#, 16#18#,
16#08#, 16#04#, 16#C0#, 16#40#, 16#26#, 16#02#, 16#00#, 16#B0#, 16#10#,
16#07#, 16#80#, 16#80#, 16#1C#, 16#3F#, 16#C0#, 16#E0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#3E#, 16#00#, 16#06#, 16#0C#, 16#00#, 16#40#, 16#10#,
16#04#, 16#00#, 16#40#, 16#60#, 16#03#, 16#02#, 16#00#, 16#08#, 16#30#,
16#00#, 16#61#, 16#00#, 16#03#, 16#08#, 16#00#, 16#08#, 16#40#, 16#00#,
16#42#, 16#00#, 16#02#, 16#10#, 16#00#, 16#10#, 16#80#, 16#01#, 16#86#,
16#00#, 16#0C#, 16#10#, 16#00#, 16#40#, 16#C0#, 16#06#, 16#02#, 16#00#,
16#20#, 16#08#, 16#02#, 16#00#, 16#30#, 16#60#, 16#00#, 16#7C#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#0F#, 16#FF#, 16#00#, 16#18#, 16#0E#, 16#00#,
16#C0#, 16#18#, 16#06#, 16#00#, 16#40#, 16#30#, 16#02#, 16#01#, 16#80#,
16#10#, 16#0C#, 16#00#, 16#80#, 16#60#, 16#0C#, 16#03#, 16#00#, 16#40#,
16#18#, 16#0C#, 16#00#, 16#FF#, 16#80#, 16#06#, 16#00#, 16#00#, 16#30#,
16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#, 16#00#,
16#03#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#1F#,
16#F8#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3E#, 16#00#, 16#06#,
16#0C#, 16#00#, 16#40#, 16#10#, 16#04#, 16#00#, 16#40#, 16#60#, 16#03#,
16#02#, 16#00#, 16#08#, 16#30#, 16#00#, 16#61#, 16#00#, 16#03#, 16#08#,
16#00#, 16#08#, 16#40#, 16#00#, 16#42#, 16#00#, 16#02#, 16#10#, 16#00#,
16#10#, 16#80#, 16#01#, 16#86#, 16#00#, 16#0C#, 16#10#, 16#00#, 16#40#,
16#C0#, 16#06#, 16#02#, 16#00#, 16#20#, 16#18#, 16#02#, 16#00#, 16#30#,
16#60#, 16#00#, 16#FC#, 16#00#, 16#03#, 16#00#, 16#00#, 16#30#, 16#00#,
16#03#, 16#FC#, 16#60#, 16#38#, 16#1E#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#FF#,
16#00#, 16#18#, 16#0C#, 16#00#, 16#C0#, 16#10#, 16#06#, 16#00#, 16#C0#,
16#30#, 16#02#, 16#01#, 16#80#, 16#10#, 16#0C#, 16#00#, 16#80#, 16#60#,
16#0C#, 16#03#, 16#00#, 16#C0#, 16#18#, 16#0C#, 16#00#, 16#FF#, 16#80#,
16#06#, 16#0C#, 16#00#, 16#30#, 16#10#, 16#01#, 16#80#, 16#40#, 16#0C#,
16#03#, 16#00#, 16#60#, 16#0C#, 16#03#, 16#00#, 16#20#, 16#18#, 16#01#,
16#80#, 16#C0#, 16#04#, 16#1F#, 16#C0#, 16#3C#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#3E#, 16#20#, 16#06#, 16#0D#, 16#00#, 16#60#, 16#18#, 16#06#,
16#00#, 16#C0#, 16#30#, 16#02#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#E0#, 16#00#, 16#03#, 16#F0#, 16#00#,
16#01#, 16#F0#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#02#, 16#00#, 16#00#,
16#18#, 16#18#, 16#00#, 16#C0#, 16#C0#, 16#06#, 16#06#, 16#00#, 16#20#,
16#38#, 16#03#, 16#01#, 16#F0#, 16#70#, 16#0C#, 16#FE#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#07#, 16#FF#, 16#F0#, 16#20#, 16#40#, 16#81#, 16#02#,
16#04#, 16#08#, 16#10#, 16#20#, 16#40#, 16#81#, 16#00#, 16#04#, 16#00#,
16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#,
16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#,
16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#03#, 16#FF#,
16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#E1#, 16#FC#, 16#10#, 16#01#,
16#00#, 16#80#, 16#08#, 16#04#, 16#00#, 16#40#, 16#20#, 16#02#, 16#01#,
16#00#, 16#10#, 16#08#, 16#00#, 16#80#, 16#40#, 16#04#, 16#02#, 16#00#,
16#20#, 16#10#, 16#01#, 16#00#, 16#80#, 16#08#, 16#04#, 16#00#, 16#40#,
16#20#, 16#02#, 16#01#, 16#00#, 16#10#, 16#08#, 16#00#, 16#80#, 16#40#,
16#04#, 16#03#, 16#00#, 16#60#, 16#0C#, 16#06#, 16#00#, 16#30#, 16#60#,
16#00#, 16#7C#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#80#, 16#FE#,
16#20#, 16#00#, 16#81#, 16#00#, 16#04#, 16#0C#, 16#00#, 16#60#, 16#20#,
16#02#, 16#01#, 16#80#, 16#30#, 16#0C#, 16#01#, 16#80#, 16#20#, 16#08#,
16#01#, 16#80#, 16#C0#, 16#0C#, 16#04#, 16#00#, 16#20#, 16#20#, 16#01#,
16#83#, 16#00#, 16#04#, 16#10#, 16#00#, 16#21#, 16#80#, 16#01#, 16#88#,
16#00#, 16#04#, 16#40#, 16#00#, 16#36#, 16#00#, 16#01#, 16#A0#, 16#00#,
16#07#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#,
16#C1#, 16#FC#, 16#60#, 16#00#, 16#C3#, 16#00#, 16#06#, 16#18#, 16#00#,
16#30#, 16#40#, 16#01#, 16#02#, 16#0E#, 16#08#, 16#10#, 16#50#, 16#40#,
16#82#, 16#82#, 16#04#, 16#36#, 16#10#, 16#31#, 16#B1#, 16#81#, 16#88#,
16#8C#, 16#0C#, 16#46#, 16#60#, 16#66#, 16#33#, 16#01#, 16#20#, 16#90#,
16#09#, 16#04#, 16#80#, 16#58#, 16#34#, 16#02#, 16#81#, 16#A0#, 16#14#,
16#05#, 16#00#, 16#E0#, 16#38#, 16#07#, 16#01#, 16#C0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#0F#, 16#C1#, 16#F8#, 16#10#, 16#03#, 16#00#, 16#C0#, 16#18#,
16#03#, 16#01#, 16#80#, 16#0C#, 16#18#, 16#00#, 16#60#, 16#80#, 16#01#,
16#8C#, 16#00#, 16#06#, 16#C0#, 16#00#, 16#14#, 16#00#, 16#00#, 16#E0#,
16#00#, 16#07#, 16#00#, 16#00#, 16#6C#, 16#00#, 16#02#, 16#20#, 16#00#,
16#31#, 16#80#, 16#03#, 16#06#, 16#00#, 16#30#, 16#18#, 16#01#, 16#00#,
16#C0#, 16#18#, 16#03#, 16#01#, 16#80#, 16#0C#, 16#3F#, 16#83#, 16#F8#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#0F#, 16#C1#, 16#F8#, 16#18#, 16#03#, 16#00#,
16#40#, 16#18#, 16#03#, 16#01#, 16#80#, 16#08#, 16#08#, 16#00#, 16#60#,
16#C0#, 16#01#, 16#8C#, 16#00#, 16#04#, 16#40#, 16#00#, 16#36#, 16#00#,
16#00#, 16#E0#, 16#00#, 16#07#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#,
16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#,
16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#03#,
16#FF#, 16#80#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#FF#, 16#C0#, 16#18#,
16#02#, 16#00#, 16#C0#, 16#30#, 16#06#, 16#03#, 16#00#, 16#30#, 16#18#,
16#01#, 16#81#, 16#80#, 16#00#, 16#18#, 16#00#, 16#00#, 16#C0#, 16#00#,
16#0C#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#60#,
16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#10#, 16#03#, 16#00#, 16#80#,
16#30#, 16#04#, 16#01#, 16#80#, 16#20#, 16#18#, 16#01#, 16#00#, 16#80#,
16#08#, 16#07#, 16#FF#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#08#,
16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#,
16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#,
16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#,
16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#,
16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#F8#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#20#, 16#00#,
16#01#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#,
16#80#, 16#00#, 16#06#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#02#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#40#, 16#00#,
16#03#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#60#, 16#00#, 16#03#,
16#00#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#, 16#00#, 16#01#, 16#00#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#80#, 16#00#,
16#04#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#80#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#3F#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#,
16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#,
16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#,
16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#,
16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#,
16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#,
16#3F#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#01#, 16#00#, 16#00#, 16#1C#, 16#00#, 16#01#, 16#B0#,
16#00#, 16#08#, 16#80#, 16#00#, 16#C6#, 16#00#, 16#0C#, 16#18#, 16#00#,
16#C0#, 16#60#, 16#0C#, 16#01#, 16#80#, 16#40#, 16#04#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#07#, 16#FF#, 16#FF#, 16#C0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#06#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#60#, 16#00#, 16#01#, 16#C0#, 16#00#, 16#02#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#7F#, 16#00#, 16#0E#,
16#06#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#,
16#00#, 16#00#, 16#10#, 16#01#, 16#FF#, 16#80#, 16#38#, 16#0C#, 16#03#,
16#00#, 16#20#, 16#10#, 16#01#, 16#00#, 16#80#, 16#08#, 16#04#, 16#00#,
16#C0#, 16#20#, 16#0E#, 16#01#, 16#81#, 16#D0#, 16#03#, 16#F0#, 16#F0#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#03#, 16#C0#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#,
16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#0F#,
16#80#, 16#09#, 16#83#, 16#00#, 16#50#, 16#0C#, 16#03#, 16#00#, 16#30#,
16#18#, 16#00#, 16#80#, 16#80#, 16#06#, 16#04#, 16#00#, 16#30#, 16#20#,
16#01#, 16#81#, 16#00#, 16#0C#, 16#08#, 16#00#, 16#60#, 16#60#, 16#02#,
16#03#, 16#00#, 16#30#, 16#1C#, 16#03#, 16#00#, 16#B8#, 16#30#, 16#3C#,
16#7E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#1F#, 16#88#, 16#03#, 16#03#, 16#C0#, 16#30#, 16#0E#, 16#03#,
16#00#, 16#30#, 16#10#, 16#01#, 16#81#, 16#80#, 16#00#, 16#08#, 16#00#,
16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#03#, 16#00#, 16#18#, 16#08#, 16#01#, 16#80#, 16#30#,
16#38#, 16#00#, 16#7E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3E#, 16#00#, 16#00#,
16#30#, 16#00#, 16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#,
16#00#, 16#03#, 16#00#, 16#3E#, 16#18#, 16#06#, 16#0C#, 16#C0#, 16#60#,
16#16#, 16#06#, 16#00#, 16#70#, 16#20#, 16#03#, 16#83#, 16#00#, 16#0C#,
16#18#, 16#00#, 16#60#, 16#C0#, 16#03#, 16#06#, 16#00#, 16#18#, 16#30#,
16#00#, 16#C0#, 16#80#, 16#06#, 16#06#, 16#00#, 16#70#, 16#18#, 16#07#,
16#80#, 16#60#, 16#EC#, 16#00#, 16#FC#, 16#78#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#00#, 16#07#, 16#06#,
16#00#, 16#60#, 16#18#, 16#06#, 16#00#, 16#60#, 16#20#, 16#01#, 16#83#,
16#00#, 16#0C#, 16#18#, 16#00#, 16#20#, 16#FF#, 16#FF#, 16#06#, 16#00#,
16#00#, 16#30#, 16#00#, 16#00#, 16#80#, 16#00#, 16#06#, 16#00#, 16#00#,
16#18#, 16#01#, 16#80#, 16#30#, 16#38#, 16#00#, 16#7E#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#FF#, 16#00#, 16#18#, 16#00#, 16#01#, 16#80#, 16#00#, 16#0C#,
16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#01#, 16#FF#, 16#F0#,
16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#,
16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#07#, 16#FF#,
16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#3E#, 16#3E#, 16#06#, 16#0D#, 16#80#, 16#60#, 16#3C#, 16#06#, 16#00#,
16#E0#, 16#20#, 16#03#, 16#03#, 16#00#, 16#18#, 16#18#, 16#00#, 16#C0#,
16#C0#, 16#06#, 16#06#, 16#00#, 16#30#, 16#30#, 16#01#, 16#80#, 16#80#,
16#0C#, 16#06#, 16#00#, 16#E0#, 16#18#, 16#0F#, 16#00#, 16#60#, 16#D8#,
16#00#, 16#F8#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#,
16#01#, 16#80#, 16#00#, 16#08#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#03#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#,
16#00#, 16#01#, 16#8F#, 16#80#, 16#0D#, 16#86#, 16#00#, 16#78#, 16#08#,
16#03#, 16#80#, 16#60#, 16#18#, 16#03#, 16#00#, 16#C0#, 16#18#, 16#06#,
16#00#, 16#C0#, 16#30#, 16#06#, 16#01#, 16#80#, 16#30#, 16#0C#, 16#01#,
16#80#, 16#60#, 16#0C#, 16#03#, 16#00#, 16#60#, 16#18#, 16#03#, 16#00#,
16#C0#, 16#18#, 16#1F#, 16#83#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#60#, 16#00#, 16#03#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#FC#, 16#00#, 16#00#, 16#20#, 16#00#,
16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#,
16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#,
16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#40#, 16#00#, 16#02#, 16#00#, 16#0F#, 16#FF#, 16#E0#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#,
16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#, 16#FF#, 16#C0#, 16#00#,
16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#,
16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#,
16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#,
16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#,
16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#06#, 16#00#, 16#00#,
16#30#, 16#00#, 16#01#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#01#, 16#E0#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#83#,
16#F0#, 16#04#, 16#0C#, 16#00#, 16#20#, 16#C0#, 16#01#, 16#0C#, 16#00#,
16#08#, 16#C0#, 16#00#, 16#4C#, 16#00#, 16#02#, 16#E0#, 16#00#, 16#1F#,
16#00#, 16#00#, 16#CC#, 16#00#, 16#04#, 16#30#, 16#00#, 16#20#, 16#C0#,
16#01#, 16#03#, 16#00#, 16#08#, 16#0C#, 16#00#, 16#40#, 16#30#, 16#1E#,
16#07#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#3F#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#,
16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#,
16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#,
16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#,
16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#,
16#00#, 16#0F#, 16#FF#, 16#E0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#1E#, 16#F8#, 16#F0#, 16#1C#, 16#78#, 16#C0#, 16#C1#,
16#82#, 16#04#, 16#08#, 16#18#, 16#20#, 16#40#, 16#C1#, 16#02#, 16#06#,
16#08#, 16#10#, 16#30#, 16#40#, 16#81#, 16#82#, 16#04#, 16#0C#, 16#10#,
16#20#, 16#60#, 16#81#, 16#03#, 16#04#, 16#08#, 16#18#, 16#20#, 16#40#,
16#C1#, 16#02#, 16#06#, 16#7E#, 16#1C#, 16#3C#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#07#, 16#9F#, 16#80#, 16#0D#, 16#86#,
16#00#, 16#70#, 16#08#, 16#03#, 16#00#, 16#60#, 16#18#, 16#03#, 16#00#,
16#C0#, 16#18#, 16#06#, 16#00#, 16#C0#, 16#30#, 16#06#, 16#01#, 16#80#,
16#30#, 16#0C#, 16#01#, 16#80#, 16#60#, 16#0C#, 16#03#, 16#00#, 16#60#,
16#18#, 16#03#, 16#00#, 16#C0#, 16#18#, 16#1F#, 16#83#, 16#F0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#1F#, 16#00#,
16#03#, 16#06#, 16#00#, 16#20#, 16#08#, 16#02#, 16#00#, 16#20#, 16#30#,
16#01#, 16#81#, 16#00#, 16#04#, 16#08#, 16#00#, 16#20#, 16#40#, 16#01#,
16#02#, 16#00#, 16#08#, 16#10#, 16#00#, 16#40#, 16#C0#, 16#06#, 16#02#,
16#00#, 16#20#, 16#18#, 16#02#, 16#00#, 16#30#, 16#60#, 16#00#, 16#7C#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#0F#,
16#1F#, 16#80#, 16#0B#, 16#83#, 16#00#, 16#70#, 16#0C#, 16#03#, 16#00#,
16#30#, 16#18#, 16#00#, 16#C0#, 16#80#, 16#06#, 16#04#, 16#00#, 16#30#,
16#20#, 16#01#, 16#81#, 16#00#, 16#0C#, 16#08#, 16#00#, 16#60#, 16#60#,
16#02#, 16#03#, 16#00#, 16#30#, 16#14#, 16#03#, 16#00#, 16#98#, 16#30#,
16#04#, 16#7E#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#,
16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#3F#, 16#1E#, 16#06#, 16#0E#, 16#C0#, 16#60#, 16#1E#,
16#06#, 16#00#, 16#70#, 16#20#, 16#01#, 16#83#, 16#00#, 16#0C#, 16#18#,
16#00#, 16#60#, 16#C0#, 16#03#, 16#06#, 16#00#, 16#18#, 16#30#, 16#00#,
16#C0#, 16#80#, 16#0E#, 16#06#, 16#00#, 16#70#, 16#18#, 16#07#, 16#80#,
16#60#, 16#EC#, 16#00#, 16#FC#, 16#60#, 16#00#, 16#03#, 16#00#, 16#00#,
16#18#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#F0#, 16#F8#, 16#01#, 16#98#, 16#60#,
16#0D#, 16#80#, 16#00#, 16#78#, 16#00#, 16#03#, 16#80#, 16#00#, 16#18#,
16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#,
16#01#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#, 16#60#, 16#00#, 16#03#,
16#00#, 16#00#, 16#18#, 16#00#, 16#0F#, 16#FF#, 16#80#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#3F#, 16#A0#, 16#07#,
16#07#, 16#80#, 16#20#, 16#0C#, 16#03#, 16#00#, 16#60#, 16#18#, 16#00#,
16#00#, 16#60#, 16#00#, 16#01#, 16#E0#, 16#00#, 16#01#, 16#F8#, 16#00#,
16#00#, 16#60#, 16#00#, 16#01#, 16#80#, 16#40#, 16#04#, 16#02#, 16#00#,
16#20#, 16#18#, 16#03#, 16#00#, 16#E0#, 16#70#, 16#04#, 16#FE#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#01#, 16#00#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#60#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#, 16#00#, 16#07#, 16#FF#,
16#C0#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#, 16#01#, 16#80#, 16#00#,
16#0C#, 16#00#, 16#00#, 16#60#, 16#00#, 16#03#, 16#00#, 16#00#, 16#18#,
16#00#, 16#00#, 16#C0#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#,
16#01#, 16#80#, 16#00#, 16#0C#, 16#01#, 16#00#, 16#30#, 16#38#, 16#00#,
16#7E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#07#, 16#81#, 16#F0#, 16#0C#, 16#01#, 16#80#, 16#60#, 16#0C#, 16#03#,
16#00#, 16#60#, 16#18#, 16#03#, 16#00#, 16#C0#, 16#18#, 16#06#, 16#00#,
16#C0#, 16#30#, 16#06#, 16#01#, 16#80#, 16#30#, 16#0C#, 16#01#, 16#80#,
16#60#, 16#0C#, 16#03#, 16#00#, 16#60#, 16#08#, 16#07#, 16#00#, 16#60#,
16#F8#, 16#00#, 16#F8#, 16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#0F#, 16#E0#, 16#FE#, 16#08#, 16#00#, 16#80#, 16#60#,
16#0C#, 16#03#, 16#00#, 16#60#, 16#08#, 16#02#, 16#00#, 16#60#, 16#30#,
16#01#, 16#01#, 16#00#, 16#0C#, 16#18#, 16#00#, 16#20#, 16#80#, 16#01#,
16#04#, 16#00#, 16#0C#, 16#60#, 16#00#, 16#22#, 16#00#, 16#01#, 16#90#,
16#00#, 16#05#, 16#00#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#0F#, 16#C0#, 16#7E#, 16#10#, 16#00#,
16#40#, 16#80#, 16#02#, 16#06#, 16#08#, 16#30#, 16#30#, 16#E1#, 16#80#,
16#85#, 16#08#, 16#04#, 16#28#, 16#40#, 16#23#, 16#62#, 16#01#, 16#91#,
16#30#, 16#0C#, 16#89#, 16#80#, 16#2C#, 16#68#, 16#01#, 16#61#, 16#40#,
16#0A#, 16#0A#, 16#00#, 16#70#, 16#70#, 16#03#, 16#81#, 16#80#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#03#, 16#E0#, 16#F8#,
16#0C#, 16#01#, 16#80#, 16#30#, 16#18#, 16#00#, 16#C1#, 16#80#, 16#03#,
16#18#, 16#00#, 16#0D#, 16#80#, 16#00#, 16#38#, 16#00#, 16#01#, 16#C0#,
16#00#, 16#1B#, 16#00#, 16#01#, 16#8C#, 16#00#, 16#18#, 16#30#, 16#01#,
16#80#, 16#C0#, 16#18#, 16#03#, 16#00#, 16#80#, 16#18#, 16#1F#, 16#83#,
16#F0#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#07#,
16#E0#, 16#FC#, 16#08#, 16#00#, 16#C0#, 16#60#, 16#04#, 16#03#, 16#00#,
16#60#, 16#0C#, 16#02#, 16#00#, 16#60#, 16#30#, 16#01#, 16#01#, 16#00#,
16#0C#, 16#18#, 16#00#, 16#20#, 16#80#, 16#01#, 16#84#, 16#00#, 16#04#,
16#60#, 16#00#, 16#32#, 16#00#, 16#00#, 16#B0#, 16#00#, 16#07#, 16#00#,
16#00#, 16#38#, 16#00#, 16#00#, 16#80#, 16#00#, 16#0C#, 16#00#, 16#00#,
16#40#, 16#00#, 16#06#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#01#, 16#FF#, 16#F0#, 16#0C#, 16#03#, 16#00#, 16#60#, 16#30#,
16#03#, 16#01#, 16#00#, 16#00#, 16#18#, 16#00#, 16#01#, 16#80#, 16#00#,
16#18#, 16#00#, 16#01#, 16#80#, 16#00#, 16#08#, 16#00#, 16#00#, 16#C0#,
16#00#, 16#0C#, 16#00#, 16#00#, 16#C0#, 16#20#, 16#0C#, 16#01#, 16#00#,
16#40#, 16#08#, 16#07#, 16#FF#, 16#C0#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#0C#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#,
16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#,
16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#C0#, 16#00#, 16#0C#,
16#00#, 16#01#, 16#C0#, 16#00#, 16#03#, 16#00#, 16#00#, 16#0C#, 16#00#,
16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#,
16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#,
16#00#, 16#04#, 16#00#, 16#00#, 16#30#, 16#00#, 16#00#, 16#E0#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#01#,
16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#,
16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#,
16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#, 16#00#, 16#40#,
16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#,
16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#,
16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#, 16#10#, 16#00#,
16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#18#, 16#00#, 16#00#, 16#40#, 16#00#,
16#02#, 16#00#, 16#00#, 16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#,
16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#, 16#00#, 16#08#, 16#00#,
16#00#, 16#60#, 16#00#, 16#01#, 16#80#, 16#00#, 16#07#, 16#00#, 16#00#,
16#60#, 16#00#, 16#06#, 16#00#, 16#00#, 16#20#, 16#00#, 16#01#, 16#00#,
16#00#, 16#08#, 16#00#, 16#00#, 16#40#, 16#00#, 16#02#, 16#00#, 16#00#,
16#10#, 16#00#, 16#00#, 16#80#, 16#00#, 16#04#, 16#00#, 16#00#, 16#60#,
16#00#, 16#0E#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#E0#, 16#00#, 16#08#, 16#81#, 16#80#, 16#C2#, 16#18#, 16#0C#, 16#08#,
16#80#, 16#00#, 16#38#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#,
16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#);
Font_D : aliased constant Bitmap_Font :=
(
Bytes_Per_Glyph => 92,
Glyph_Width => 21,
Glyph_Height => 35,
Data => FreeMono18pt7bBitmaps'Access);
Font : constant Bitmap_Font_Ref := Font_D'Access;
end GESTE_Fonts.FreeMono18pt7b;
|
with Gela.Classificators;
with Gela.Character_Class_Buffers; use Gela;
with Asis.Gela.Parser.Tokens;
package Asis.Gela.Scanner_Tables is
subtype Token is Asis.Gela.Parser.Tokens.Token;
Error : constant Token := Asis.Gela.Parser.Tokens.Error;
subtype Character_Class is Character_Class_Buffers.Character_Class
range 0 .. 57;
type State is mod 359;
Default : constant State := 0;
Allow_Char : constant State := 334;
Allow_Keyword : constant State := 357;
function Switch (S : State; C : Character_Class) return State;
pragma Inline (Switch);
function Accepted (S : State) return Token;
pragma Inline (Accepted);
subtype Code_Point is Classificators.Code_Point;
function Get_Class (Pos : Code_Point) return Character_Class;
end Asis.Gela.Scanner_Tables;
|
--
-- Copyright (C) 2022 Jeremy Grosser <jeremy@synack.me>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
-- Plantower Particulate Matter Sensor
-- https://www.espruino.com/datasheets/PMS7003.pdf
--
-- This driver is compatible with all of the Plantower PM2.5 sensors:
-- PMS1003
-- PMS3003
-- PMS5003
-- PMS6003
-- PMS7003 (tested)
-- PMSA003
--
-- The module has a female socket that accepts 2x5 1.27mm pitch pins.
-- Samtec SFSD-05-28C-G-09.00-S is a compatible wire-to-board assembly.
--
-- ________---_
-- | 9 7 5 3 1 |
-- | 10 8 6 4 2 |
-- ‾‾‾‾‾‾‾‾‾‾‾‾
--
-- Pin Function
-- 1 +5V
-- 2 +5V
-- 3 GND
-- 4 GND
-- 5 RESET (active low)
-- 6 NC
-- 7 RX
-- 8 NC
-- 9 TX
-- 10 SET (active low)
--
-- RESET and SET should have R10k pullups to your logic level (either 3.3 or 5.0V)
-- RX and TX are a 9600 8n1 UART
--
-- This driver only receives data from the sensor (active mode), it does not
-- send commands or support other modes.
--
-- Read this before trusting any data you get from this sensor.
-- https://learn.adafruit.com/pm25-air-quality-sensor/usage-notes
--
with HAL.UART; use HAL.UART;
with HAL; use HAL;
package PMS is
type Field is
(Start, Length,
CF1_PM_1, CF1_PM_2_5, CF1_PM_10,
ATM_PM_1, ATM_PM_2_5, ATM_PM_10,
PART_0_3, PART_0_5, PART_1, PART_2_5, PART_5, PART_10,
Reserved, Checksum);
subtype Measurement is Field range CF1_PM_1 .. PART_10;
type Frame is array (Field) of UInt16
with Component_Size => 16;
function Name
(F : Field)
return String;
procedure Receive
(Port : not null Any_UART_Port;
Data : out Frame;
Status : out UART_Status;
Timeout : Natural := 1_000);
function Calculate_Checksum
(Data : Frame)
return UInt16;
end PMS;
|
type Interval is record
Lower : Float;
Upper : Float;
end record;
|
-- parse_args-usage.adb
-- A simple command line option parser
-- Copyright (c) 2014 - 2015, James Humphry
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
pragma Profile(No_Implementation_Extensions);
with Ada.Text_IO, Ada.Strings;
use Ada.Text_IO, Ada.Strings;
with Ada.Containers;
use type Ada.Containers.Count_Type;
separate (Parse_Args)
procedure Usage(A : in Argument_Parser) is
First_Positional : Boolean := True;
begin
Put("Usage: ");
Put(A.Command_Name);
if A.Option_Help_Details.Length > 0 then
Put(" [OPTIONS]...");
end if;
for I of A.Option_Help_Details loop
if I.Positional then
if First_Positional then
Put(" [--] ");
First_Positional := False;
end if;
Put(" [" & To_String(I.Name) & "]");
end if;
end loop;
if A.Allow_Tail then
Put(" [" & To_String(A.Tail_Usage) & "]...");
end if;
New_Line;
if Length(A.Prologue) > 0 then
Put_Line(To_String(A.Prologue));
end if;
New_Line;
for I of A.Option_Help_Details loop
if not I.Positional then
if I.Short_Option /= '-' then
Set_Col(3);
Put("-" & I.Short_Option & ", ");
end if;
if I.Long_Option /= Null_Unbounded_String then
Set_Col(7);
Put("--" & To_String(I.Long_Option) & " ");
end if;
Set_Col(20);
Put(To_String(I.Usage));
New_Line;
end if;
end loop;
end Usage;
|
--
-- Copyright (C) 2015 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.Registers;
package body HW.GFX.GMA.PCH.Sideband is
SBI_CTL_DEST_ICLK : constant := 0 * 2 ** 16;
SBI_CTL_DEST_MPHY : constant := 1 * 2 ** 16;
SBI_CTL_OP_IORD : constant := 2 * 2 ** 8;
SBI_CTL_OP_IOWR : constant := 3 * 2 ** 8;
SBI_CTL_OP_CRRD : constant := 6 * 2 ** 8;
SBI_CTL_OP_CRWR : constant := 7 * 2 ** 8;
SBI_RESPONSE_FAIL : constant := 1 * 2 ** 1;
SBI_BUSY : constant := 1 * 2 ** 0;
type Register_Array is array (Register_Type) of Word32;
Register_Addr : constant Register_Array := Register_Array'
(SBI_SSCDIVINTPHASE6 => 16#0600_0000#,
SBI_SSCCTL6 => 16#060c_0000#,
SBI_SSCAUXDIV => 16#0610_0000#);
----------------------------------------------------------------------------
procedure Read
(Dest : in Destination_Type;
Register : in Register_Type;
Value : out Word32)
is
begin
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
Registers.Write
(Register => Registers.SBI_ADDR,
Value => Register_Addr (Register));
if Dest = SBI_ICLK then
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_ICLK or SBI_CTL_OP_CRRD or SBI_BUSY);
else
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_MPHY or SBI_CTL_OP_IORD or SBI_BUSY);
end if;
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
Registers.Read
(Register => Registers.SBI_DATA,
Value => Value);
end Read;
procedure Write
(Dest : in Destination_Type;
Register : in Register_Type;
Value : in Word32)
is
begin
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
Registers.Write
(Register => Registers.SBI_ADDR,
Value => Register_Addr (Register));
Registers.Write
(Register => Registers.SBI_DATA,
Value => Value);
if Dest = SBI_ICLK then
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_ICLK or SBI_CTL_OP_CRWR or SBI_BUSY);
else
Registers.Write
(Register => Registers.SBI_CTL_STAT,
Value => SBI_CTL_DEST_MPHY or SBI_CTL_OP_IOWR or SBI_BUSY);
end if;
Registers.Wait_Unset_Mask
(Register => Registers.SBI_CTL_STAT,
Mask => SBI_BUSY);
end Write;
----------------------------------------------------------------------------
procedure Unset_Mask
(Dest : in Destination_Type;
Register : in Register_Type;
Mask : in Word32)
is
Value : Word32;
begin
Read (Dest, Register, Value);
Write (Dest, Register, Value and not Mask);
end Unset_Mask;
procedure Set_Mask
(Dest : in Destination_Type;
Register : in Register_Type;
Mask : in Word32)
is
Value : Word32;
begin
Read (Dest, Register, Value);
Write (Dest, Register, Value or Mask);
end Set_Mask;
procedure Unset_And_Set_Mask
(Dest : in Destination_Type;
Register : in Register_Type;
Mask_Unset : in Word32;
Mask_Set : in Word32)
is
Value : Word32;
begin
Read (Dest, Register, Value);
Write (Dest, Register, (Value and not Mask_Unset) or Mask_Set);
end Unset_And_Set_Mask;
end HW.GFX.GMA.PCH.Sideband;
|
-------------------------------------------------------------------------------
-- package body LCG_Rand, Linear Congruential Generator
-- Copyright (C) 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 body LCG_Rand
with Spark_Mode => On
is
-- Marsaglia-Zaman multiply-with-carry algorithm is used to construct
-- two LCG's (linear congruential generators) with prime number moduli
-- m0 and m1, and prime number periods (m0-1)/2 and (m1-1)/2.
-------------------------
-- Get_Random_LCG_64_0 --
-------------------------
-- a0 = 2731662333
-- b0 = 2^32
-- m0 = a0 * b0 - 1
-- m0 = 11732400383950061567
-- result should be
-- x = (x*a0) mod m0
-- but (x0*a0) overflows 64 bit computation, so tests need 128 bit ints.
procedure Get_Random_LCG_64_0 (X0 : in out Parent_Random_Int) is
S_lo, S_hi : Parent_Random_Int;
begin
S_lo := X0 mod b0;
S_hi := X0 / b0;
X0 := a0 * S_lo + S_hi;
-- X0_final is in 1 .. m0-1 if x0_initial is in 1 .. m0-1.
-- m0 is prime.
-- Period = p0 = (m0-1) / 2. Period is prime.
end Get_Random_LCG_64_0;
-- a1 = 1688234283
-- b1 = 2^32
-- m1 = a1 * b1 - 1
-- m1 = 7250911033471008767
-- result should be
-- x1 := (x1*a1) mod m1,
-- but (x1*a1) overflows 64 bit computation, so tests need 128 bit ints.
procedure Get_Random_LCG_64_1 (X1 : in out Parent_Random_Int) is
S_lo, S_hi : Parent_Random_Int;
begin
S_lo := X1 mod b1;
S_hi := X1 / b1;
X1 := a1 * S_lo + S_hi;
-- X1 is in 1 .. m1-1.
-- m1 is prime.
-- Period = p1 = (m1-1) / 2. Period is prime.
end Get_Random_LCG_64_1;
procedure Get_Random_LCG_64_Combined
(S0 : in out Parent_Random_Int;
S1 : in out Parent_Random_Int;
Random_x : out Parent_Random_Int) -- result
is
x0 : Parent_Random_Int;
-- verify that summing x0+s1 doesn't go out-of-range of 2^64: p0+m1<2^64
pragma Assert (p0 + m1 <= Parent_Random_Int'Last);
begin
Get_Random_LCG_64_0 (S0); -- this updates state S0
-- x0 = S0 is in 1 .. m0-1, with prime number period p0 = (m0-1)/2
x0 := S0;
if x0 > p0 then
x0 := (m0 - 1) - x0;
else
x0 := x0 - 1;
end if;
-- Now x0 is in 0 .. p0-1, with prime number period p0 = (m0-1)/2
Get_Random_LCG_64_1 (S1); -- this updates state S1
-- S1 is in 1 .. m1-1, with prime number period p1 = (m1-1)/2
Random_x := (x0 + S1) mod p0;
-- Stnd combination generator. Only 1 of the 2 component generators (the 0th)
-- needs to be full period. If that's the case, then the combination
-- generator returns numbers uniformly distributed in 1 .. p0-1, with no
-- subcycles shorter than p0*p1; in other words it's a full period generator.
--
-- Random_LCG_64_0, as modified above, is a rearrangement generator. It takes
-- each of the numbers in the range 0 .. p0-1, and returns them out of order.
-- During a cycle of length p0, it returns each of the numbers exactly
-- once. (Random_LCG_64_1 has a similar property: it takes 1/2 the numbers
-- in 0 .. m1-1, and returns each of them exactly once during a period of
-- length (m1-1)/2.)
--
-- Let's say the 1st generator has period p0, and returns each number in 0..p0-1
-- exactly once during that period. If you then add the results of the 1st generator
-- to those of another generator modulo p0, and if the 2nd generator's period, p1,
-- has no prime factors in common with p0, then the resulting combination
-- generator is full period, with period p0*p1. The combination generator returns
-- each number in 0..p0-1 exactly p1 times during its period of length p0*p1.
end Get_Random_LCG_64_Combined;
end LCG_Rand;
|
--PRÁCTICA 2: César Borao Moratinos (chat_client)
with Ada.Text_IO;
with Chat_Messages;
with Lower_Layer_UDP;
with Ada.Command_Line;
with Client_Collections;
with Ada.Strings.Unbounded;
procedure Chat_Client is
package ATI renames Ada.Text_IO;
package CM renames Chat_Messages;
package LLU renames Lower_Layer_UDP;
package ACL renames Ada.Command_Line;
package CC renames Client_Collections;
package ASU renames Ada.Strings.Unbounded;
use type CM.Message_Type;
Server_EP: LLU.End_Point_Type;
Client_EP: LLU.End_Point_Type;
Buffer: aliased LLU.Buffer_Type(1024);
Expired: Boolean;
Port: Integer;
Mess: CM.Message_Type;
Nick: ASU.Unbounded_String;
Comment: ASU.Unbounded_String;
begin
--IP and Port Selection (Binding)
Port := Integer'Value(ACL.Argument(2));
Server_EP := LLU.Build(LLU.To_IP(ACL.Argument(1)), Port);
LLU.Bind_Any(Client_EP);
Nick := ASU.To_Unbounded_String(ACL.Argument(3));
LLU.Reset(Buffer);
--Client Init
Mess := CM.Init;
CM.Message_Type'Output(Buffer'Access, Mess);
LLU.End_Point_Type'Output(Buffer'Access, Client_EP);
ASU.Unbounded_String'Output(Buffer'Access, Nick);
LLU.Send (Server_EP, Buffer'Access);
LLU.Reset(Buffer);
if ASU.To_String(Nick) = "reader" then
loop
LLU.Receive (Client_EP, Buffer'Access, 1000.0, Expired);
if Expired then
ATI.Put_Line ("Please, try again");
else
--Server messages to readers
Mess := CM.Message_Type'Input(Buffer'Access);
Nick := ASU.Unbounded_String'Input(Buffer'Access);
Comment := ASU.Unbounded_String'Input(Buffer'Access);
ATI.Put_Line(ASU.To_String(Nick) & ": " & ASU.To_String(Comment));
LLU.Reset(Buffer);
end if;
end loop;
else
loop
ATI.Put("Message: ");
Comment := ASU.To_Unbounded_String(ATI.Get_Line);
--Client Writer
Mess := CM.Writer;
CM.Message_Type'Output(Buffer'Access, Mess);
LLU.End_Point_Type'Output(Buffer'Access, Client_EP);
ASU.Unbounded_String'Output(Buffer'Access, Comment);
if ASU.To_String(Comment) /= ".quit" then
LLU.Send(Server_EP, Buffer'Access);
end if;
LLU.Reset(Buffer);
exit when ASU.To_String(Comment) = ".quit";
end loop;
end if;
LLU.Finalize;
end Chat_Client;
|
with Ada.Unchecked_Deallocation;
with PB_Support.IO;
with PB_Support.Internal;
package body Google.Protobuf.Wrappers is
function Length (Self : Double_Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out Double_Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(Double_Value_Array, Double_Value_Array_Access);
procedure Append (Self : in out Double_Value_Vector; V : Double_Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / Double_Value'Size);
begin
if Self.Length = 0 then
Self.Data := new Double_Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new Double_Value_Array'
(Self.Data.all & Double_Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out Double_Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new Double_Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out Double_Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_Double_Value_Variable_Reference
(Self : aliased in out Double_Value_Vector;
Index : Positive)
return Double_Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Double_Value_Variable_Reference;
not overriding function Get_Double_Value_Constant_Reference
(Self : aliased Double_Value_Vector;
Index : Positive)
return Double_Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Double_Value_Constant_Reference;
procedure Read_Double_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Double_Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_Double_Value;
procedure Write_Double_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Double_Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_Double_Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Option (1, V.Value, 0.0);
if WS.End_Message then
Write_Double_Value (WS'Access, V);
end if;
end;
end Write_Double_Value;
function Length (Self : Float_Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out Float_Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(Float_Value_Array, Float_Value_Array_Access);
procedure Append (Self : in out Float_Value_Vector; V : Float_Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / Float_Value'Size);
begin
if Self.Length = 0 then
Self.Data := new Float_Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new Float_Value_Array'
(Self.Data.all & Float_Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out Float_Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new Float_Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out Float_Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_Float_Value_Variable_Reference
(Self : aliased in out Float_Value_Vector;
Index : Positive)
return Float_Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Float_Value_Variable_Reference;
not overriding function Get_Float_Value_Constant_Reference
(Self : aliased Float_Value_Vector;
Index : Positive)
return Float_Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Float_Value_Constant_Reference;
procedure Read_Float_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Float_Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_Float_Value;
procedure Write_Float_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Float_Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_Float_Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Option (1, V.Value, 0.0);
if WS.End_Message then
Write_Float_Value (WS'Access, V);
end if;
end;
end Write_Float_Value;
function Length (Self : Int_64Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out Int_64Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(Int_64Value_Array, Int_64Value_Array_Access);
procedure Append (Self : in out Int_64Value_Vector; V : Int_64Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / Int_64Value'Size);
begin
if Self.Length = 0 then
Self.Data := new Int_64Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new Int_64Value_Array'
(Self.Data.all & Int_64Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out Int_64Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new Int_64Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out Int_64Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_Int_64Value_Variable_Reference
(Self : aliased in out Int_64Value_Vector;
Index : Positive)
return Int_64Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Int_64Value_Variable_Reference;
not overriding function Get_Int_64Value_Constant_Reference
(Self : aliased Int_64Value_Vector;
Index : Positive)
return Int_64Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Int_64Value_Constant_Reference;
procedure Read_Int_64Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Int_64Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read_Varint (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_Int_64Value;
procedure Write_Int_64Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Int_64Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_Int_64Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Varint_Option (1, V.Value, 0);
if WS.End_Message then
Write_Int_64Value (WS'Access, V);
end if;
end;
end Write_Int_64Value;
function Length (Self : UInt_64Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out UInt_64Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(UInt_64Value_Array, UInt_64Value_Array_Access);
procedure Append (Self : in out UInt_64Value_Vector; V : UInt_64Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / UInt_64Value'Size);
begin
if Self.Length = 0 then
Self.Data := new UInt_64Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new UInt_64Value_Array'
(Self.Data.all & UInt_64Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out UInt_64Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new UInt_64Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out UInt_64Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_UInt_64Value_Variable_Reference
(Self : aliased in out UInt_64Value_Vector;
Index : Positive)
return UInt_64Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_UInt_64Value_Variable_Reference;
not overriding function Get_UInt_64Value_Constant_Reference
(Self : aliased UInt_64Value_Vector;
Index : Positive)
return UInt_64Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_UInt_64Value_Constant_Reference;
procedure Read_UInt_64Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out UInt_64Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read_Varint (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_UInt_64Value;
procedure Write_UInt_64Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : UInt_64Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_UInt_64Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Varint_Option (1, V.Value, 0);
if WS.End_Message then
Write_UInt_64Value (WS'Access, V);
end if;
end;
end Write_UInt_64Value;
function Length (Self : Int_32Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out Int_32Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(Int_32Value_Array, Int_32Value_Array_Access);
procedure Append (Self : in out Int_32Value_Vector; V : Int_32Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / Int_32Value'Size);
begin
if Self.Length = 0 then
Self.Data := new Int_32Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new Int_32Value_Array'
(Self.Data.all & Int_32Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out Int_32Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new Int_32Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out Int_32Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_Int_32Value_Variable_Reference
(Self : aliased in out Int_32Value_Vector;
Index : Positive)
return Int_32Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Int_32Value_Variable_Reference;
not overriding function Get_Int_32Value_Constant_Reference
(Self : aliased Int_32Value_Vector;
Index : Positive)
return Int_32Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Int_32Value_Constant_Reference;
procedure Read_Int_32Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Int_32Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read_Varint (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_Int_32Value;
procedure Write_Int_32Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Int_32Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_Int_32Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Varint_Option (1, V.Value, 0);
if WS.End_Message then
Write_Int_32Value (WS'Access, V);
end if;
end;
end Write_Int_32Value;
function Length (Self : UInt_32Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out UInt_32Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(UInt_32Value_Array, UInt_32Value_Array_Access);
procedure Append (Self : in out UInt_32Value_Vector; V : UInt_32Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / UInt_32Value'Size);
begin
if Self.Length = 0 then
Self.Data := new UInt_32Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new UInt_32Value_Array'
(Self.Data.all & UInt_32Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out UInt_32Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new UInt_32Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out UInt_32Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_UInt_32Value_Variable_Reference
(Self : aliased in out UInt_32Value_Vector;
Index : Positive)
return UInt_32Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_UInt_32Value_Variable_Reference;
not overriding function Get_UInt_32Value_Constant_Reference
(Self : aliased UInt_32Value_Vector;
Index : Positive)
return UInt_32Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_UInt_32Value_Constant_Reference;
procedure Read_UInt_32Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out UInt_32Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read_Varint (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_UInt_32Value;
procedure Write_UInt_32Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : UInt_32Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_UInt_32Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Varint_Option (1, V.Value, 0);
if WS.End_Message then
Write_UInt_32Value (WS'Access, V);
end if;
end;
end Write_UInt_32Value;
function Length (Self : Bool_Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out Bool_Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(Bool_Value_Array, Bool_Value_Array_Access);
procedure Append (Self : in out Bool_Value_Vector; V : Bool_Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / Bool_Value'Size);
begin
if Self.Length = 0 then
Self.Data := new Bool_Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new Bool_Value_Array'
(Self.Data.all & Bool_Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out Bool_Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new Bool_Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out Bool_Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_Bool_Value_Variable_Reference
(Self : aliased in out Bool_Value_Vector;
Index : Positive)
return Bool_Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Bool_Value_Variable_Reference;
not overriding function Get_Bool_Value_Constant_Reference
(Self : aliased Bool_Value_Vector;
Index : Positive)
return Bool_Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Bool_Value_Constant_Reference;
procedure Read_Bool_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Bool_Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_Bool_Value;
procedure Write_Bool_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Bool_Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_Bool_Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Option (1, V.Value, False);
if WS.End_Message then
Write_Bool_Value (WS'Access, V);
end if;
end;
end Write_Bool_Value;
function Length (Self : String_Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out String_Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(String_Value_Array, String_Value_Array_Access);
procedure Append (Self : in out String_Value_Vector; V : String_Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / String_Value'Size);
begin
if Self.Length = 0 then
Self.Data := new String_Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new String_Value_Array'
(Self.Data.all & String_Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out String_Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new String_Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out String_Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_String_Value_Variable_Reference
(Self : aliased in out String_Value_Vector;
Index : Positive)
return String_Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_String_Value_Variable_Reference;
not overriding function Get_String_Value_Constant_Reference
(Self : aliased String_Value_Vector;
Index : Positive)
return String_Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_String_Value_Constant_Reference;
procedure Read_String_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out String_Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_String_Value;
procedure Write_String_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : String_Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_String_Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Option (1, V.Value);
if WS.End_Message then
Write_String_Value (WS'Access, V);
end if;
end;
end Write_String_Value;
function Length (Self : Bytes_Value_Vector) return Natural is
begin
return Self.Length;
end Length;
procedure Clear (Self : in out Bytes_Value_Vector) is
begin
Self.Length := 0;
end Clear;
procedure Free is new Ada.Unchecked_Deallocation
(Bytes_Value_Array, Bytes_Value_Array_Access);
procedure Append (Self : in out Bytes_Value_Vector; V : Bytes_Value) is
Init_Length : constant Positive :=
Positive'Max (1, 256 / Bytes_Value'Size);
begin
if Self.Length = 0 then
Self.Data := new Bytes_Value_Array (1 .. Init_Length);
elsif Self.Length = Self.Data'Last then
Self.Data :=
new Bytes_Value_Array'
(Self.Data.all & Bytes_Value_Array'(1 .. Self.Length => <>));
end if;
Self.Length := Self.Length + 1;
Self.Data (Self.Length) := V;
end Append;
overriding procedure Adjust (Self : in out Bytes_Value_Vector) is
begin
if Self.Length > 0 then
Self.Data := new Bytes_Value_Array'(Self.Data (1 .. Self.Length));
end if;
end Adjust;
overriding procedure Finalize (Self : in out Bytes_Value_Vector) is
begin
if Self.Data /= null then
Free (Self.Data);
end if;
end Finalize;
not overriding function Get_Bytes_Value_Variable_Reference
(Self : aliased in out Bytes_Value_Vector;
Index : Positive)
return Bytes_Value_Variable_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Bytes_Value_Variable_Reference;
not overriding function Get_Bytes_Value_Constant_Reference
(Self : aliased Bytes_Value_Vector;
Index : Positive)
return Bytes_Value_Constant_Reference is
begin
return (Element => Self.Data (Index)'Access);
end Get_Bytes_Value_Constant_Reference;
procedure Read_Bytes_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : out Bytes_Value) is
Key : aliased PB_Support.IO.Key;
begin
while PB_Support.IO.Read_Key (Stream, Key'Access) loop
case Key.Field is
when 1 =>
PB_Support.IO.Read (Stream, Key.Encoding, V.Value);
when others =>
PB_Support.IO.Unknown_Field (Stream, Key.Encoding);
end case;
end loop;
end Read_Bytes_Value;
procedure Write_Bytes_Value
(Stream : access Ada.Streams.Root_Stream_Type'Class;
V : Bytes_Value) is
begin
if Stream.all not in PB_Support.Internal.Stream then
declare
WS : aliased PB_Support.Internal.Stream (Stream);
begin
Write_Bytes_Value (WS'Access, V);
return;
end;
end if;
declare
WS : PB_Support.Internal.Stream renames
PB_Support.Internal.Stream (Stream.all);
begin
WS.Start_Message;
WS.Write_Option (1, V.Value);
if WS.End_Message then
Write_Bytes_Value (WS'Access, V);
end if;
end;
end Write_Bytes_Value;
end Google.Protobuf.Wrappers; |
with Ada.Text_IO;
with Ada.Containers.Vectors;
package body Problem_40 is
package IO renames Ada.Text_IO;
package Natural_Vector is new Ada.Containers.Vectors(Index_Type => Natural, Element_Type => Natural);
procedure Solve is
bases : Natural_Vector.Vector;
procedure Digit_At(location: in Positive; digit : out Character) is
domain : Natural := 0;
begin
if location > bases.Last_Element then
loop
declare
next_domain : constant Natural := Natural(bases.Last_Index) + 1;
count : constant Positive := 10**next_domain - 10**(next_domain - 1);
begin
bases.Append(count * next_domain + bases.Last_Element);
exit when location <= bases.Last_Element;
end;
end loop;
domain := bases.Last_Index - 1;
else
declare
use Natural_Vector;
cursor : Natural_Vector.Cursor := bases.First;
begin
while cursor /= Natural_Vector.No_Element loop
exit when Natural_Vector.Element(cursor) > location;
domain := Natural_Vector.To_Index(cursor);
Natural_Vector.Next(cursor);
end loop;
end;
end if;
if domain = 0 then
digit := Character'Val(location + Character'Pos('0'));
else
declare
bounded_number : constant Natural := location - bases.Element(domain);
stride : constant Natural := domain + 1;
position : constant Natural := domain - bounded_number mod stride;
number : constant Natural := 10**domain + (bounded_number / stride);
digit_num : constant Natural := (number / 10**position) mod 10;
begin
digit := Character'Val(digit_num + Character'Pos('0'));
end;
end if;
end Digit_At;
type Positive_Array is Array(Positive range <>) of Positive;
locations : constant Positive_Array := (1, 10, 100, 1_000, 10_000, 100_000, 1_000_000);
result : String(locations'Range);
begin
bases.Append(0);
bases.Append(10);
for index in locations'Range loop
Digit_At(locations(index), result(index));
end loop;
IO.Put_Line(result);
end Solve;
end Problem_40;
|
with Offmt; use Offmt;
procedure Example is
X : constant Integer := 42;
pragma Unreferenced (X);
Str : constant String := "lol";
begin
Offmt.Log ("Test X: {u32:X}");
Offmt.Log ("Test X + 1: {u32:X + 1}");
Log ("Test X * 10: {u32:X * 10}");
Log ("Test hex: 0x{xu32:X - 1}");
Log ("Test binary: 0b{bu32:X - 1}");
Log ("Test hex u16: 0x{xu16:X}");
Log ("Test hex u8: 0x{xu8:X - 1}");
Log ("Is that a literal? " & Str);
Log ("Multiple formats X:{u32:X} X - 1:{u32:X - 1} X + 1:{u32:X + 1}");
Log ("A string without format");
Log ("{u32:X}"); -- Only a format
Log ("{u32:X} format at the beginning");
Log ("Format at the end {u32:X}");
end Example;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ U N B O U N D E D . 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 child package of Ada.Strings.Wide_Unbounded provides some specialized
-- access functions which are intended to allow more efficient use of the
-- facilities of Ada.Strings.Wide_Unbounded, particularly by other layered
-- utilities.
package Ada.Strings.Wide_Unbounded.Aux is
pragma Preelaborate;
subtype Big_Wide_String is Wide_String (Positive'Range);
type Big_Wide_String_Access is access all Big_Wide_String;
procedure Get_Wide_String
(U : Unbounded_Wide_String;
S : out Big_Wide_String_Access;
L : out Natural);
pragma Inline (Get_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 much more efficient than the use of To_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_String (UP : out Unbounded_Wide_String; S : Wide_String)
renames Set_Unbounded_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_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_String
(UP : in out Unbounded_Wide_String;
S : Wide_String_Access);
pragma Inline (Set_Wide_String);
-- This version of Set_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_Unbounded.Aux;
|
with Interfaces.C.Extensions;
with DDS.DataReader;
with Dds;
package Replier is
type RTI_Connext_ReplierParams is new Integer;
type RTI_Connext_EntityParams is new Integer;
type RTI_Connext_Replier is abstract tagged record
null;
end record;
procedure RTI_Connext_Replier_On_Data_Available (Listener_Data : Interfaces.C.Extensions.Void_Ptr;
Reader : DDS.DataReader.Ref_Access);
procedure RTI_Connext_ReplierParams_ToEntityParams (Self : in RTI_Connext_ReplierParams;
ToParams : out RTI_Connext_EntityParams);
procedure RTI_Connext_Replier_Wait_For_Requests (Self : not null access RTI_Connext_Replier;
Min_Count : DDS.Natural;
Max_Wait : out DDS.Duration_T);
procedure RTI_Connext_EntityUntypedImpl_Wait_For_Any_Sample (Self : not null access RTI_Connext_Replier;
Min_Count : DDS.Natural;
Max_Wait : out DDS.Duration_T) is abstract;
end Replier;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- K R U N C H --
-- --
-- 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 procedure implements file name crunching
-- First, the name is divided into segments separated by minus signs and
-- underscores, then all minus signs and underscores are eliminated. If
-- this leaves the name short enough, we are done.
-- If not, then the longest segment is located (left-most if there are
-- two of equal length), and shortened by dropping its last character.
-- This is repeated until the name is short enough.
-- As an example, consider the krunch of our-strings-wide_fixed.adb
-- to fit the name into 8 characters as required by DOS:
-- our-strings-wide_fixed 22
-- our strings wide fixed 19
-- our string wide fixed 18
-- our strin wide fixed 17
-- our stri wide fixed 16
-- our stri wide fixe 15
-- our str wide fixe 14
-- our str wid fixe 13
-- our str wid fix 12
-- ou str wid fix 11
-- ou st wid fix 10
-- ou st wi fix 9
-- ou st wi fi 8
-- Final file name: OUSTWIFX.ADB
-- A special rule applies for children of System, Ada, Gnat, and Interfaces.
-- In these cases, the following special prefix replacements occur:
-- ada- replaced by a-
-- gnat- replaced by g-
-- interfaces- replaced by i-
-- system- replaced by s-
-- The rest of the name is krunched in the usual manner described above.
-- In addition, these names, as well as the names of the renamed packages
-- from the obsolescent features annex, are always krunched to 8 characters
-- regardless of the setting of Maxlen.
-- As an example of this special rule, consider ada-strings-wide_fixed.adb
-- which gets krunched as follows:
-- ada-strings-wide_fixed 22
-- a- strings wide fixed 18
-- a- string wide fixed 17
-- a- strin wide fixed 16
-- a- stri wide fixed 15
-- a- stri wide fixe 14
-- a- str wide fixe 13
-- a- str wid fixe 12
-- a- str wid fix 11
-- a- st wid fix 10
-- a- st wi fix 9
-- a- st wi fi 8
-- Final file name: A-STWIFX.ADB
-- Since children of units named A, G, I or S might conflict with the names
-- of predefined units, the naming rule in that case is that the first hyphen
-- is replaced by a tilde sign.
-- Note: as described below, this special treatment of predefined library
-- unit file names can be inhibited by setting the No_Predef flag.
-- Of course there is no guarantee that this algorithm results in uniquely
-- crunched names (nor, obviously, is there any algorithm which would do so)
-- In fact we run into such a case in the standard library routines with
-- children of Wide_Text_IO, so a special rule is applied to deal with this
-- clash, namely the prefix ada-wide_text_io- is replaced by a-wt- and then
-- the normal crunching rules are applied, so that for example, the unit:
-- Ada.Wide_Text_IO.Float_IO
-- has the file name
-- a-wtflio
-- More problems arise with Wide_Wide, so we replace this sequence by
-- a z (which is not used much) and also (as in the Wide_Text_IO case),
-- we replace the prefix ada.wide_wide_text_io- by a-zt- and then
-- the normal crunching rules are applied.
-- These are the only irregularity required (so far!) to keep the file names
-- unique in the standard predefined libraries.
procedure Krunch
(Buffer : in out String;
Len : in out Natural;
Maxlen : Natural;
No_Predef : Boolean);
pragma Elaborate_Body (Krunch);
-- The full file name is stored in Buffer (1 .. Len) on entry. The file
-- name is crunched in place and on return Len is updated, so that the
-- resulting krunched name is in Buffer (1 .. Len) where Len <= Maxlen.
-- Note that Len may be less than or equal to Maxlen on entry, in which
-- case it may be possible that Krunch does not modify Buffer. The fourth
-- parameter, No_Predef, is a switch which, if set to True, disables the
-- normal special treatment of predefined library unit file names.
--
-- Note: the string Buffer must have a lower bound of 1, and may not
-- contain any blanks (in particular, it must not have leading blanks).
|
with Interfaces; use Interfaces;
generic
Register_Size : Natural := 4;
package Opcode_Helper is
type Registers is
array (Natural range 0 .. Register_Size - 1) of Unsigned_64;
function Execute_Instruction
(Op : String;
Reg : Registers;
A, B, C : Unsigned_64)
return Registers;
end Opcode_Helper;
|
-- Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
--
-- SPDX-License-Identifier: BSD-3-Clause
-- This spec has been automatically generated from rp2040.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
-- Register block to control RTC
package RP_SVD.RTC is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CLKDIV_M1_CLKDIV_M1_Field is HAL.UInt16;
-- Divider minus 1 for the 1 second counter. Safe to change the value when
-- RTC is not enabled.
type CLKDIV_M1_Register is record
CLKDIV_M1 : CLKDIV_M1_CLKDIV_M1_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CLKDIV_M1_Register use record
CLKDIV_M1 at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype SETUP_0_DAY_Field is HAL.UInt5;
subtype SETUP_0_MONTH_Field is HAL.UInt4;
subtype SETUP_0_YEAR_Field is HAL.UInt12;
-- RTC setup register 0
type SETUP_0_Register is record
-- Day of the month (1..31)
DAY : SETUP_0_DAY_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Month (1..12)
MONTH : SETUP_0_MONTH_Field := 16#0#;
-- Year
YEAR : SETUP_0_YEAR_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETUP_0_Register use record
DAY at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
MONTH at 0 range 8 .. 11;
YEAR at 0 range 12 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype SETUP_1_SEC_Field is HAL.UInt6;
subtype SETUP_1_MIN_Field is HAL.UInt6;
subtype SETUP_1_HOUR_Field is HAL.UInt5;
subtype SETUP_1_DOTW_Field is HAL.UInt3;
-- RTC setup register 1
type SETUP_1_Register is record
-- Seconds
SEC : SETUP_1_SEC_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Minutes
MIN : SETUP_1_MIN_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Hours
HOUR : SETUP_1_HOUR_Field := 16#0#;
-- unspecified
Reserved_21_23 : HAL.UInt3 := 16#0#;
-- Day of the week: 1-Monday...0-Sunday ISO 8601 mod 7
DOTW : SETUP_1_DOTW_Field := 16#0#;
-- unspecified
Reserved_27_31 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SETUP_1_Register use record
SEC at 0 range 0 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
MIN at 0 range 8 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
HOUR at 0 range 16 .. 20;
Reserved_21_23 at 0 range 21 .. 23;
DOTW at 0 range 24 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
-- RTC Control and status
type CTRL_Register is record
-- Enable RTC
RTC_ENABLE : Boolean := False;
-- Read-only. RTC enabled (running)
RTC_ACTIVE : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- After a write operation all bits in the field are cleared (set to
-- zero). Load RTC
LOAD : Boolean := False;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- If set, leapyear is forced off.\n Useful for years divisible by 100
-- but not by 400
FORCE_NOTLEAPYEAR : Boolean := False;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CTRL_Register use record
RTC_ENABLE at 0 range 0 .. 0;
RTC_ACTIVE at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
LOAD at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
FORCE_NOTLEAPYEAR at 0 range 8 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype IRQ_SETUP_0_DAY_Field is HAL.UInt5;
subtype IRQ_SETUP_0_MONTH_Field is HAL.UInt4;
subtype IRQ_SETUP_0_YEAR_Field is HAL.UInt12;
-- Interrupt setup register 0
type IRQ_SETUP_0_Register is record
-- Day of the month (1..31)
DAY : IRQ_SETUP_0_DAY_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Month (1..12)
MONTH : IRQ_SETUP_0_MONTH_Field := 16#0#;
-- Year
YEAR : IRQ_SETUP_0_YEAR_Field := 16#0#;
-- Enable day matching
DAY_ENA : Boolean := False;
-- Enable month matching
MONTH_ENA : Boolean := False;
-- Enable year matching
YEAR_ENA : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Global match enable. Don't change any other value while this one is
-- enabled
MATCH_ENA : Boolean := False;
-- Read-only.
MATCH_ACTIVE : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IRQ_SETUP_0_Register use record
DAY at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
MONTH at 0 range 8 .. 11;
YEAR at 0 range 12 .. 23;
DAY_ENA at 0 range 24 .. 24;
MONTH_ENA at 0 range 25 .. 25;
YEAR_ENA at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
MATCH_ENA at 0 range 28 .. 28;
MATCH_ACTIVE at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype IRQ_SETUP_1_SEC_Field is HAL.UInt6;
subtype IRQ_SETUP_1_MIN_Field is HAL.UInt6;
subtype IRQ_SETUP_1_HOUR_Field is HAL.UInt5;
subtype IRQ_SETUP_1_DOTW_Field is HAL.UInt3;
-- Interrupt setup register 1
type IRQ_SETUP_1_Register is record
-- Seconds
SEC : IRQ_SETUP_1_SEC_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Minutes
MIN : IRQ_SETUP_1_MIN_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Hours
HOUR : IRQ_SETUP_1_HOUR_Field := 16#0#;
-- unspecified
Reserved_21_23 : HAL.UInt3 := 16#0#;
-- Day of the week
DOTW : IRQ_SETUP_1_DOTW_Field := 16#0#;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Enable second matching
SEC_ENA : Boolean := False;
-- Enable minute matching
MIN_ENA : Boolean := False;
-- Enable hour matching
HOUR_ENA : Boolean := False;
-- Enable day of the week matching
DOTW_ENA : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IRQ_SETUP_1_Register use record
SEC at 0 range 0 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
MIN at 0 range 8 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
HOUR at 0 range 16 .. 20;
Reserved_21_23 at 0 range 21 .. 23;
DOTW at 0 range 24 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
SEC_ENA at 0 range 28 .. 28;
MIN_ENA at 0 range 29 .. 29;
HOUR_ENA at 0 range 30 .. 30;
DOTW_ENA at 0 range 31 .. 31;
end record;
subtype RTC_1_DAY_Field is HAL.UInt5;
subtype RTC_1_MONTH_Field is HAL.UInt4;
subtype RTC_1_YEAR_Field is HAL.UInt12;
-- RTC register 1.
type RTC_1_Register is record
-- Read-only. Day of the month (1..31)
DAY : RTC_1_DAY_Field;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Month (1..12)
MONTH : RTC_1_MONTH_Field;
-- Read-only. Year
YEAR : RTC_1_YEAR_Field;
-- unspecified
Reserved_24_31 : HAL.UInt8;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RTC_1_Register use record
DAY at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
MONTH at 0 range 8 .. 11;
YEAR at 0 range 12 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype RTC_0_SEC_Field is HAL.UInt6;
subtype RTC_0_MIN_Field is HAL.UInt6;
subtype RTC_0_HOUR_Field is HAL.UInt5;
subtype RTC_0_DOTW_Field is HAL.UInt3;
-- RTC register 0\n Read this before RTC 1!
type RTC_0_Register is record
-- Read-only. Seconds
SEC : RTC_0_SEC_Field;
-- unspecified
Reserved_6_7 : HAL.UInt2;
-- Read-only. Minutes
MIN : RTC_0_MIN_Field;
-- unspecified
Reserved_14_15 : HAL.UInt2;
-- Read-only. Hours
HOUR : RTC_0_HOUR_Field;
-- unspecified
Reserved_21_23 : HAL.UInt3;
-- Read-only. Day of the week
DOTW : RTC_0_DOTW_Field;
-- unspecified
Reserved_27_31 : HAL.UInt5;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RTC_0_Register use record
SEC at 0 range 0 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
MIN at 0 range 8 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
HOUR at 0 range 16 .. 20;
Reserved_21_23 at 0 range 21 .. 23;
DOTW at 0 range 24 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
-- Raw Interrupts
type INTR_Register is record
-- Read-only.
RTC : Boolean;
-- unspecified
Reserved_1_31 : HAL.UInt31;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for INTR_Register use record
RTC at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Interrupt Enable
type INTE_Register is record
RTC : Boolean := False;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for INTE_Register use record
RTC at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Interrupt Force
type INTF_Register is record
RTC : Boolean := False;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for INTF_Register use record
RTC at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Interrupt status after masking & forcing
type INTS_Register is record
-- Read-only.
RTC : Boolean;
-- unspecified
Reserved_1_31 : HAL.UInt31;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for INTS_Register use record
RTC at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Register block to control RTC
type RTC_Peripheral is record
-- Divider minus 1 for the 1 second counter. Safe to change the value
-- when RTC is not enabled.
CLKDIV_M1 : aliased CLKDIV_M1_Register;
-- RTC setup register 0
SETUP_0 : aliased SETUP_0_Register;
-- RTC setup register 1
SETUP_1 : aliased SETUP_1_Register;
-- RTC Control and status
CTRL : aliased CTRL_Register;
-- Interrupt setup register 0
IRQ_SETUP_0 : aliased IRQ_SETUP_0_Register;
-- Interrupt setup register 1
IRQ_SETUP_1 : aliased IRQ_SETUP_1_Register;
-- RTC register 1.
RTC_1 : aliased RTC_1_Register;
-- RTC register 0\n Read this before RTC 1!
RTC_0 : aliased RTC_0_Register;
-- Raw Interrupts
INTR : aliased INTR_Register;
-- Interrupt Enable
INTE : aliased INTE_Register;
-- Interrupt Force
INTF : aliased INTF_Register;
-- Interrupt status after masking & forcing
INTS : aliased INTS_Register;
end record
with Volatile;
for RTC_Peripheral use record
CLKDIV_M1 at 16#0# range 0 .. 31;
SETUP_0 at 16#4# range 0 .. 31;
SETUP_1 at 16#8# range 0 .. 31;
CTRL at 16#C# range 0 .. 31;
IRQ_SETUP_0 at 16#10# range 0 .. 31;
IRQ_SETUP_1 at 16#14# range 0 .. 31;
RTC_1 at 16#18# range 0 .. 31;
RTC_0 at 16#1C# range 0 .. 31;
INTR at 16#20# range 0 .. 31;
INTE at 16#24# range 0 .. 31;
INTF at 16#28# range 0 .. 31;
INTS at 16#2C# range 0 .. 31;
end record;
-- Register block to control RTC
RTC_Periph : aliased RTC_Peripheral
with Import, Address => RTC_Base;
end RP_SVD.RTC;
|
-- { dg-do compile }
with Layered_Abstraction_P;
with layered_abstraction;
procedure layered_instance is
package s1 is new Layered_Abstraction_P (Integer, 15);
package S2 is new Layered_Abstraction_P (Integer, 20);
package Inst is new layered_abstraction (S1, S2);
begin
null;
end;
|
with Ada.Strings.Unbounded;
with Ada.Containers.Indefinite_Doubly_Linked_Lists;
with Ada.Containers.Indefinite_Hashed_Maps;
with Interfaces;
private with System.Storage_Elements;
private with Ada.Containers.Vectors;
package Offmt_Lib is
Log_Root_Pkg : constant Wide_Wide_String := "Offmt";
type Format_Kind is (Decimal, Hexadecimal, Binary);
type Format_Type is (Type_U8, Type_U16, Type_U32);
type Format is record
Expression : Ada.Strings.Unbounded.Unbounded_String;
Kind : Format_Kind;
Typ : Format_Type;
end record;
type Trace_Element_Kind is (Plain_String, Format_String);
type Trace_Element (Kind : Trace_Element_Kind) is record
case Kind is
when Plain_String =>
Str : Ada.Strings.Unbounded.Unbounded_String;
when Format_String =>
Fmt : Format;
end case;
end record;
package Trace_Element_Lists
is new Ada.Containers.Indefinite_Doubly_Linked_Lists (Trace_Element);
type Trace_ID is new Interfaces.Unsigned_16;
type Trace is record
Original : Ada.Strings.Unbounded.Unbounded_String;
Id : Trace_ID;
List : Trace_Element_Lists.List;
end record;
procedure Pretty_Print (T : Trace);
function ID_Hashed (Id : Trace_ID) return Ada.Containers.Hash_Type
is (Ada.Containers.Hash_Type (Id));
package Trace_Maps
is new Ada.Containers.Indefinite_Hashed_Maps (Trace_ID,
Trace,
ID_Hashed,
Equivalent_Keys => "=");
type Trace_Map is new Trace_Maps.Map with null record;
Empty_Map : constant Trace_Map;
type Data_Frame is private;
private
Empty_Map : constant Trace_Map := (Trace_Maps.Empty_Map with null record);
package SE_Vectors
is new Ada.Containers.Vectors (Natural,
System.Storage_Elements.Storage_Element,
System.Storage_Elements."=");
type Data_Frame is record
Data : SE_Vectors.Vector;
Next : Natural := 0;
end record;
function Remaining (Frame : Data_Frame) return Natural;
procedure Clear (Frame : in out Data_Frame)
with Post => Remaining (Frame) = 0;
procedure Push (Frame : in out Data_Frame;
Elt : System.Storage_Elements.Storage_Element);
function Pop (Frame : in out Data_Frame)
return System.Storage_Elements.Storage_Element
with Pre => Remaining (Frame) > 0;
Frame_Error : exception;
end Offmt_Lib;
|
-- { dg-do compile }
-- { dg-options "-gnatws" }
with Slice6_Pkg; use Slice6_Pkg;
procedure Slice6 is
procedure Send (V_LENGTH : SHORT_INTEGER) is
V : Integer;
V_BLOCK : T_BLOCK (1 .. 4096);
for V_BLOCK use at V'Address;
V_MSG : T_MSG ;
begin
V_MSG := (V_LENGTH, 1, V_BLOCK (1 .. V_LENGTH));
end;
begin
null;
end;
|
-- { dg-do compile }
package body Check1 is
function FD (X : access R) return P2 is
begin
return P2 (X.Disc);
end FD;
end Check1;
|
with Protypo.Api.Interpreters;
with Protypo.Api.Consumers.File_Writer;
with Protypo.Api.Engine_Values.Basic_Array_Wrappers;
-- with User_Records;
with Integer_Arrays;
with Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Exceptions;
with Protypo.Api.Engine_Values.Table_Wrappers;
procedure Test_Tabelle is
use Ada.Command_Line;
use Protypo.Api.Interpreters;
use Protypo.Api.Engine_Values;
use Protypo.Api.Consumers;
use Protypo.Api;
Default_Source_File : constant String := "test-data/prova_tabelle.txt";
function Source_File return String
is (if Argument_Count = 0 then Default_Source_File else Argument (1));
use Protypo.Api.Engine_Values;
type User_Record is
record
Age : Integer;
Serial : Integer;
Address : Integer;
end record;
type User_Field is (Age, Serial, Address);
package User_Package is
new Table_Wrappers.Enumerated_Rows (User_Field);
type Aggregate_Array is array (Positive range <>) of User_Record;
function Convert (X : User_Record) return User_Package.Aggregate_Type
is
begin
return User_Package.Aggregate_Type'(Age => Create (X.Age),
Serial => Create (X.Serial),
Address => Create (X.Address));
end Convert;
procedure Fill is
new User_Package.Append_Array (Ada_Aggregate => User_Record,
Aggregate_Index => Positive,
Generic_Aggregate_Array => Aggregate_Array,
Convert => Convert);
DB : constant Aggregate_Array := (1 => (Age => 42,
Serial => 12345,
Address => 99),
2 => (Age => 53,
Serial => 23451,
Address => 0),
3 => (Age => 66,
Serial => 34512,
Address => 44),
4 => (Age => 88,
Serial => 54321,
Address => 112));
-- Program : constant Template_Type := Slurp (Source_File);
Code : Compiled_Code;
Consumer : constant Consumer_Access :=
File_Writer.Open (File_Writer.Standard_Error);
Scores : constant Engine_Value :=
Integer_Arrays.Wrappers.Create (Value => (1 => 18,
2 => 33,
3 => 42,
4 => -5));
User_Dir : constant Table_Wrappers.Table_Wrapper_Access :=
User_Package.Make_Table;
Engine : Interpreter_Type;
begin
Fill (User_Dir.all, Db);
Engine.Define (Name => "users",
Value => Create (Ambivalent_Interface_Access (User_Dir)));
Engine.Define (Name => "scores",
Value => Scores);
-- Engine.Define (Name => "splitbit",
-- Value => Create (Val => User_Records.Split_Bit'Access,
-- Min_Parameters => 1,
-- Max_Parameters => 2));
Compile (Target => Code,
Program => Slurp(Source_File));
Engine.Run (Program => Code,
Consumer => Consumer);
Set_Exit_Status (Success);
exception
when E : Protypo.Run_Time_Error =>
Put_Line (Standard_Error, "Run time error: " & Ada.Exceptions.Exception_Message (E));
Set_Exit_Status (Failure);
when E : Protypo.Parsing_Error =>
Put_Line (Standard_Error, "parsing error: " & Ada.Exceptions.Exception_Message (E));
Set_Exit_Status (Failure);
when E : others =>
Put_Line (Standard_Error, "other: " & Ada.Exceptions.Exception_Message (E));
Put_Line (Ada.Exceptions.Exception_Information (E));
end Test_Tabelle;
|
-- { dg-do run }
procedure capture_value is
x : integer := 0;
begin
declare
z : integer renames x;
begin
z := 3;
x := 5;
z := z + 1;
if z /= 6 then
raise Program_Error;
end if;
end;
end;
|
with Ada.Text_IO;
with Ada.IO_Exceptions;
with GNAT.Sockets;
procedure echo_server_multi is
-- Multiple socket connections example based on Rosetta Code echo server.
Tasks_To_Create : constant := 3; -- simultaneous socket connections.
-------------------------------------------------------------------------------
-- Use stack to pop the next free task index. When a task finishes its
-- asynchronous (no rendezvous) phase, it pushes the index back on the stack.
type Integer_List is array (1..Tasks_To_Create) of integer;
subtype Counter is integer range 0 .. Tasks_To_Create;
subtype Index is integer range 1 .. Tasks_To_Create;
protected type Info is
procedure Push_Stack (Return_Task_Index : in Index);
procedure Initialize_Stack;
entry Pop_Stack (Get_Task_Index : out Index);
private
Task_Stack : Integer_List; -- Stack of free-to-use tasks.
Stack_Pointer: Counter := 0;
end Info;
protected body Info is
procedure Push_Stack (Return_Task_Index : in Index) is
begin -- Performed by tasks that were popped, so won't overflow.
Stack_Pointer := Stack_Pointer + 1;
Task_Stack(Stack_Pointer) := Return_Task_Index;
end;
entry Pop_Stack (Get_Task_Index : out Index) when Stack_Pointer /= 0 is
begin -- guarded against underflow.
Get_Task_Index := Task_Stack(Stack_Pointer);
Stack_Pointer := Stack_Pointer - 1;
end;
procedure Initialize_Stack is
begin
for I in Task_Stack'range loop
Push_Stack (I);
end loop;
end;
end Info;
Task_Info : Info;
-------------------------------------------------------------------------------
task type SocketTask is
-- Rendezvous the setup, which sets the parameters for entry Echo.
entry Setup (Connection : GNAT.Sockets.Socket_Type;
Client : GNAT.Sockets.Sock_Addr_Type;
Channel : GNAT.Sockets.Stream_Access;
Task_Index : Index);
-- Echo accepts the asynchronous phase, i.e. no rendezvous. When the
-- communication is over, push the task number back on the stack.
entry Echo;
end SocketTask;
task body SocketTask is
my_Connection : GNAT.Sockets.Socket_Type;
my_Client : GNAT.Sockets.Sock_Addr_Type;
my_Channel : GNAT.Sockets.Stream_Access;
my_Index : Index;
begin
loop -- Infinitely reusable
accept Setup (Connection : GNAT.Sockets.Socket_Type;
Client : GNAT.Sockets.Sock_Addr_Type;
Channel : GNAT.Sockets.Stream_Access;
Task_Index : Index) do
-- Store parameters and mark task busy.
my_Connection := Connection;
my_Client := Client;
my_Channel := Channel;
my_Index := Task_Index;
end;
accept Echo; -- Do the echo communications.
begin
Ada.Text_IO.Put_Line ("Task " & integer'image(my_Index));
loop
Character'Output (my_Channel, Character'Input(my_Channel));
end loop;
exception
when Ada.IO_Exceptions.End_Error =>
Ada.Text_IO.Put_Line ("Echo " & integer'image(my_Index) & " end");
when others =>
Ada.Text_IO.Put_Line ("Echo " & integer'image(my_Index) & " err");
end;
GNAT.Sockets.Close_Socket (my_Connection);
Task_Info.Push_Stack (my_Index); -- Return to stack of unused tasks.
end loop;
end SocketTask;
-------------------------------------------------------------------------------
-- Setup the socket receiver, initialize the task stack, and then loop,
-- blocking on Accept_Socket, using Pop_Stack for the next free task from the
-- stack, waiting if necessary.
task type SocketServer (my_Port : GNAT.Sockets.Port_Type) is
entry Listen;
end SocketServer;
task body SocketServer is
Receiver : GNAT.Sockets.Socket_Type;
Connection : GNAT.Sockets.Socket_Type;
Client : GNAT.Sockets.Sock_Addr_Type;
Channel : GNAT.Sockets.Stream_Access;
Worker : array (1..Tasks_To_Create) of SocketTask;
Use_Task : Index;
begin
accept Listen;
GNAT.Sockets.Create_Socket (Socket => Receiver);
GNAT.Sockets.Set_Socket_Option
(Socket => Receiver,
Option => (Name => GNAT.Sockets.Reuse_Address, Enabled => True));
GNAT.Sockets.Bind_Socket
(Socket => Receiver,
Address => (Family => GNAT.Sockets.Family_Inet,
Addr => GNAT.Sockets.Inet_Addr ("127.0.0.1"),
Port => my_Port));
GNAT.Sockets.Listen_Socket (Socket => Receiver);
Task_Info.Initialize_Stack;
Find: loop -- Block for connection and take next free task.
GNAT.Sockets.Accept_Socket
(Server => Receiver,
Socket => Connection,
Address => Client);
Ada.Text_IO.Put_Line ("Connect " & GNAT.Sockets.Image(Client));
Channel := GNAT.Sockets.Stream (Connection);
Task_Info.Pop_Stack(Use_Task); -- Protected guard waits if full house.
-- Setup the socket in this task in rendezvous.
Worker(Use_Task).Setup(Connection,Client, Channel,Use_Task);
-- Run the asynchronous task for the socket communications.
Worker(Use_Task).Echo; -- Start echo loop.
end loop Find;
end SocketServer;
Echo_Server : SocketServer(my_Port => 12321);
-------------------------------------------------------------------------------
begin
Echo_Server.Listen;
end echo_server_multi;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E I N F O --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
with Snames; use Snames;
with Types; use Types;
with Uintp; use Uintp;
with Urealp; use Urealp;
package Einfo is
-- This package defines the annotations to the abstract syntax tree that
-- are needed to support semantic processing of an Ada compilation.
-- Note that after editing this spec and the corresponding body it is
-- required to run ceinfo to check the consistentcy of spec and body.
-- See ceinfo.adb for more information about the checks made.
-- These annotations are for the most part attributes of declared entities,
-- and they correspond to conventional symbol table information. Other
-- attributes include sets of meanings for overloaded names, possible
-- types for overloaded expressions, flags to indicate deferred constants,
-- incomplete types, etc. These attributes are stored in available fields in
-- tree nodes (i.e. fields not used by the parser, as defined by the Sinfo
-- package specification), and accessed by means of a set of subprograms
-- which define an abstract interface.
-- There are two kinds of semantic information
-- First, the tree nodes with the following Nkind values:
-- N_Defining_Identifier
-- N_Defining_Character_Literal
-- N_Defining_Operator_Symbol
-- are called Entities, and constitute the information that would often
-- be stored separately in a symbol table. These nodes are all extended
-- to provide extra space, and contain fields which depend on the entity
-- kind, as defined by the contents of the Ekind field. The use of the
-- Ekind field, and the associated fields in the entity, are defined
-- in this package, as are the access functions to these fields.
-- Second, in some cases semantic information is stored directly in other
-- kinds of nodes, e.g. the Etype field, used to indicate the type of an
-- expression. The access functions to these fields are defined in the
-- Sinfo package, but their full documentation is to be found in
-- the Einfo package specification.
-- Declaration processing places information in the nodes of their defining
-- identifiers. Name resolution places in all other occurrences of an
-- identifier a pointer to the corresponding defining occurrence.
--------------------------------
-- The XEINFO Utility Program --
--------------------------------
-- XEINFO is a utility program which automatically produces a C header file,
-- einfo.h from the spec and body of package Einfo. It reads the input files
-- einfo.ads and einfo.adb and produces the output file einfo.h. XEINFO is run
-- automatically by the build scripts when you do a full bootstrap.
-- In order for this utility program to operate correctly, the form of the
-- einfo.ads and einfo.adb files must meet certain requirements and be laid
-- out in a specific manner.
-- The general form of einfo.ads is as follows:
-- type declaration for type Entity_Kind
-- subtype declarations declaring subranges of Entity_Kind
-- subtype declarations declaring synonyms for some standard types
-- function specs for attributes
-- procedure specs
-- pragma Inline declarations
-- This order must be observed. There are no restrictions on the procedures,
-- since the C header file only includes functions (The back end is not
-- allowed to modify the generated tree). However, functions are required to
-- have headers that fit on a single line.
-- XEINFO reads and processes the function specs and the pragma Inlines. For
-- functions that are declared as inlined, XEINFO reads the corresponding body
-- from einfo.adb, and processes it into C code. This results in some strict
-- restrictions on which functions can be inlined:
-- The function spec must be on a single line
-- There can only be a single return statement, not counting any pragma
-- Assert statements, possibly followed by a comment.
-- This single statement must either contain a function call with simple,
-- single token arguments, or it must contain a membership test of the form
-- a in b, where a and b are single tokens, or it must contain an equality
-- or inequality test of single tokens, or it must contain a disjunction of
-- the preceding constructs.
-- For functions that are not inlined, there is no restriction on the body,
-- and XEINFO generates a direct reference in the C header file which allows
-- the C code in the backend to directly call the corresponding Ada body.
----------------------------------
-- Handling of Type'Size Values --
----------------------------------
-- The Ada 95 RM contains some rather peculiar (to us) rules on the value
-- of type'Size (see RM 13.3(55)). We have found that attempting to use
-- these RM Size values generally, and in particular for determining the
-- default size of objects, creates chaos, and major incompatibilities in
-- existing code.
-- The Ada 2020 RM acknowledges it and adopts GNAT's Object_Size attribute
-- for determining the default size of objects, but stops short of applying
-- it universally like GNAT. Indeed the notable exceptions are nonaliased
-- stand-alone objects, which are not covered by Object_Size in Ada 2020.
-- We proceed as follows, for discrete and fixed-point subtypes, we have
-- two separate sizes for each subtype:
-- The Object_Size, which is used for determining the default size of
-- objects and components. This size value can be referred to using the
-- Object_Size attribute. The phrase "is used" here means that it is
-- the basis of the determination of the size. The back end is free to
-- pad this up if necessary for efficiency, e.g. an 8-bit stand-alone
-- character might be stored in 32 bits on a machine with no efficient
-- byte access instructions such as the Alpha.
-- The default rules for the value of Object_Size are as follows:
-- The Object_Size for base subtypes reflect the natural hardware
-- size in bits (see Ttypes and Cstand for integer types). For
-- enumeration and fixed-point base subtypes have 8, 16, 32, or 64
-- bits for this size, depending on the range of values to be stored.
-- The Object_Size of a subtype is the same as the Object_Size of
-- the subtype from which it is obtained.
-- The Object_Size of a derived base type is copied from the parent
-- base type, and the Object_Size of a derived first subtype is copied
-- from the parent first subtype.
-- The Ada 2020 RM defined attribute Object_Size uses this implementation.
-- The Value_Size, which is the number of bits required to store a value
-- of the type. This size can be referred to using the Value_Size
-- attribute. This value is used for determining how tightly to pack
-- records or arrays with components of this type, and also affects
-- the semantics of unchecked conversion (unchecked conversions where
-- the Value_Size values differ generate a warning, and are potentially
-- target dependent).
-- The default rules for the value of Value_Size are as follows:
-- The Value_Size for a base subtype is the minimum number of bits
-- required to store all values of the type (including the sign bit
-- only if negative values are possible).
-- If a subtype statically matches the first subtype, then it has
-- by default the same Value_Size as the first subtype. This is a
-- consequence of RM 13.1(14) ("if two subtypes statically match,
-- then their subtype-specific aspects are the same".)
-- All other subtypes have a Value_Size corresponding to the minimum
-- number of bits required to store all values of the subtype. For
-- dynamic bounds, it is assumed that the value can range down or up
-- to the corresponding bound of the ancestor.
-- The Ada 95 RM defined attribute Size is identified with Value_Size.
-- The Size attribute may be defined for a first-named subtype. This sets
-- the Value_Size of the first-named subtype to the given value, and the
-- Object_Size of this first-named subtype to the given value padded up
-- to an appropriate boundary. It is a consequence of the default rules
-- above that this Object_Size will apply to all further subtypes. On the
-- other hand, Value_Size is affected only for the first subtype, any
-- dynamic subtypes obtained from it directly, and any statically matching
-- subtypes. The Value_Size of any other static subtypes is not affected.
-- Value_Size and Object_Size may be explicitly set for any subtype using
-- an attribute definition clause. Note that the use of such a clause can
-- cause the RM 13.1(14) rule to be violated, in Ada 95 and 2020 for the
-- Value_Size attribute, but only in Ada 95 for the Object_Size attribute.
-- If access types reference aliased objects whose subtypes have differing
-- Object_Size values as a result of explicit attribute definition clauses,
-- then it is erroneous to convert from one access subtype to the other.
-- At the implementation level, the Esize field stores the Object_Size
-- and the RM_Size field stores the Value_Size (hence the value of the
-- Size attribute, which, as noted above, is equivalent to Value_Size).
-- To get a feel for the difference, consider the following examples (note
-- that in each case the base is short_short_integer with a size of 8):
-- Object_Size Value_Size
-- type x1 is range 0..5; 8 3
-- type x2 is range 0..5;
-- for x2'size use 12; 16 12
-- subtype x3 is x2 range 0 .. 3; 16 2
-- subtype x4 is x2'base range 0 .. 10; 8 4
-- dynamic : x2'Base range -64 .. +63;
-- subtype x5 is x2 range 0 .. dynamic; 16 3*
-- subtype x6 is x2'base range 0 .. dynamic; 8 7*
-- Note: the entries marked * are not actually specified by the Ada 95 RM,
-- but it seems in the spirit of the RM rules to allocate the minimum number
-- of bits known to be large enough to hold the given range of values.
-- So far, so good, but GNAT has to obey the RM rules, so the question is
-- under what conditions must the RM Size be used. The following is a list
-- of the occasions on which the RM Size must be used:
-- Component size for packed arrays or records
-- Value of the attribute Size for a type
-- Warning about sizes not matching for unchecked conversion
-- The RM_Size field keeps track of the RM Size as needed in these
-- three situations.
-- For elementary types other than discrete and fixed-point types, the
-- Object_Size and Value_Size are the same (and equivalent to the RM
-- attribute Size). Only Size may be specified for such types.
-- For composite types, Object_Size and Value_Size are computed from their
-- respective value for the type of each element as well as the layout.
-- All size attributes are stored as Uint values. Negative values are used to
-- reference GCC expressions for the case of non-static sizes, as explained
-- in Repinfo.
--------------------------------------
-- Delayed Freezing and Elaboration --
--------------------------------------
-- The flag Has_Delayed_Freeze indicates that an entity carries an explicit
-- freeze node, which appears later in the expanded tree.
-- a) The flag is used by the front end to trigger expansion activities which
-- include the generation of that freeze node. Typically this happens at the
-- end of the current compilation unit, or before the first subprogram body is
-- encountered in the current unit. See units Freeze and Exp_Ch13 for details
-- on the actions triggered by a freeze node, which include the construction
-- of initialization procedures and dispatch tables.
-- b) The presence of a freeze node on an entity is used by the back end to
-- defer elaboration of the entity until its freeze node is seen. In the
-- absence of an explicit freeze node, an entity is frozen (and elaborated)
-- at the point of declaration.
-- For object declarations, the flag is set when an address clause for the
-- object is encountered. Legality checks on the address expression only take
-- place at the freeze point of the object. In Ada 2012, the flag is also set
-- when an address aspect for the object is encountered.
-- Most types have an explicit freeze node, because they cannot be elaborated
-- until all representation and operational items that apply to them have been
-- analyzed. Private types and incomplete types have the flag set as well, as
-- do task and protected types.
-- Implicit base types created for type derivations, as well as class-wide
-- types created for all tagged types, have the flag set.
-- If a subprogram has an access parameter whose designated type is incomplete
-- the subprogram has the flag set.
-----------------------
-- Entity Attributes --
-----------------------
-- This section contains a complete list of the attributes that are defined
-- on entities. Some attributes apply to all entities, others only to certain
-- kinds of entities. In the latter case the attribute should only be set or
-- accessed if the Ekind field indicates an appropriate entity.
-- There are two kinds of attributes that apply to entities, stored and
-- synthesized. Stored attributes correspond to a field or flag in the entity
-- itself. Such attributes are identified in the table below by giving the
-- field or flag in the attribute that is used to hold the attribute value.
-- Synthesized attributes are not stored directly, but are rather computed as
-- needed from other attributes, or from information in the tree. These are
-- marked "synthesized" in the table below. The stored attributes have both
-- access functions and set procedures to set the corresponding values, while
-- synthesized attributes have only access functions.
-- Note: in the case of Node, Uint, or Elist fields, there are cases where the
-- same physical field is used for different purposes in different entities,
-- so these access functions should only be referenced for the class of
-- entities in which they are defined as being present. Flags are not
-- overlapped in this way, but nevertheless as a matter of style and
-- abstraction (which may or may not be checked by assertions in the
-- body), this restriction should be observed for flag fields as well.
-- Note: certain of the attributes on types apply only to base types, and
-- are so noted by the notation [base type only]. These are cases where the
-- attribute of any subtype is the same as the attribute of the base type.
-- The attribute can be referenced on a subtype (and automatically retrieves
-- the value from the base type). However, it is an error to try to set the
-- attribute on other than the base type, and if assertions are enabled,
-- an attempt to set the attribute on a subtype will raise an assert error.
-- Other attributes are noted as applying to the [implementation base type
-- only]. These are representation attributes which must always apply to a
-- full non-private type, and where the attributes are always on the full
-- type. The attribute can be referenced on a subtype (and automatically
-- retrieves the value from the implementation base type). However, it is an
-- error to try to set the attribute on other than the implementation base
-- type, and if assertions are enabled, an attempt to set the attribute on a
-- subtype will raise an assert error.
-- Abstract_States (Elist25)
-- Defined for E_Package entities. Contains a list of all the abstract
-- states declared by the related package.
-- Accept_Address (Elist21)
-- Defined in entries. If an accept has a statement sequence, then an
-- address variable is created, which is used to hold the address of the
-- parameters, as passed by the runtime. Accept_Address holds an element
-- list which represents a stack of entities for these address variables.
-- The current entry is the top of the stack, which is the last element
-- on the list. A stack is required to handle the case of nested select
-- statements referencing the same entry.
-- Access_Disp_Table (Elist16) [implementation base type only]
-- Defined in E_Record_Type and E_Record_Subtype entities. Set in tagged
-- types to point to their dispatch tables. The first two entities are
-- associated with the primary dispatch table: 1) primary dispatch table
-- with user-defined primitives 2) primary dispatch table with predefined
-- primitives. For each interface type covered by the tagged type we also
-- have: 3) secondary dispatch table with thunks of primitives covering
-- user-defined interface primitives, 4) secondary dispatch table with
-- thunks of predefined primitives, 5) secondary dispatch table with user
-- defined primitives, and 6) secondary dispatch table with predefined
-- primitives. The last entity of this list is an access type declaration
-- used to expand dispatching calls through the primary dispatch table.
-- For an untagged record, contains No_Elist.
-- Access_Disp_Table_Elab_Flag (Node30) [implementation base type only]
-- Defined in E_Record_Type and E_Record_Subtype entities. Set in tagged
-- types whose dispatch table elaboration must be completed at run time
-- by the IP routine to point to its pending elaboration flag entity.
-- This flag is needed when the elaboration of the dispatch table relies
-- on attribute 'Position applied to an object of the type; it is used by
-- the IP routine to avoid performing this elaboration twice.
-- Access_Subprogram_Wrapper (Node41)
-- Entity created for access_to_subprogram types that have pre/post
-- conditions. Wrapper subprogram is created when analyzing corresponding
-- aspect, and inherits said aspects. Body of subprogram includes code
-- to check contracts, and a direct call to the designated subprogram.
-- The body is part of the freeze actions for the type.
-- The Subprogram_Type created for the Access_To_Subprogram carries the
-- Access_Subprogram_Wrapper for use in the expansion of indirect calls.
-- Activation_Record_Component (Node31)
-- Defined for E_Variable, E_Constant, E_Loop_Parameter, and formal
-- parameter entities. Used in Opt.Unnest_Subprogram_Mode, in which case
-- a reference to an uplevel entity produces a corresponding component
-- in the generated ARECnT activation record (Exp_Unst for details).
-- Actual_Subtype (Node17)
-- Defined in variables, constants, and formal parameters. This is the
-- subtype imposed by the value of the object, as opposed to its nominal
-- subtype, which is imposed by the declaration. The actual subtype
-- differs from the nominal one when the latter is indefinite (as in the
-- case of an unconstrained formal parameter, or a variable declared
-- with an unconstrained type and an initial value). The nominal subtype
-- is the Etype entry for the entity. The Actual_Subtype field is set
-- only if the actual subtype differs from the nominal subtype. If the
-- actual and nominal subtypes are the same, then the Actual_Subtype
-- field is Empty, and Etype indicates both types.
--
-- For objects, the Actual_Subtype is set only if this is a discriminated
-- type. For arrays, the bounds of the expression are obtained and the
-- Etype of the object is directly the constrained subtype. This is
-- rather irregular, and the semantic checks that depend on the nominal
-- subtype being unconstrained use flag Is_Constr_Subt_For_U_Nominal(qv).
-- Address_Clause (synthesized)
-- Applies to entries, objects and subprograms. Set if an address clause
-- is present which references the object or subprogram and points to
-- the N_Attribute_Definition_Clause node. Empty if no Address clause.
-- The expression in the address clause is always a constant that is
-- defined before the entity to which the address clause applies.
-- Note: The backend references this field in E_Task_Type entities???
-- Address_Taken (Flag104)
-- Defined in all entities. Set if the Address or Unrestricted_Access
-- attribute is applied directly to the entity, i.e. the entity is the
-- entity of the prefix of the attribute reference. Also set if the
-- entity is the second argument of an Asm_Input or Asm_Output attribute,
-- as the construct may entail taking its address. And also set if the
-- entity is a subprogram and the Access or Unchecked_Access attribute is
-- applied. Used by the backend to make sure that the address can be
-- meaningfully taken, and also in the case of subprograms to control
-- output of certain warnings.
-- Aft_Value (synthesized)
-- Applies to fixed and decimal types. Computes a universal integer that
-- holds value of the Aft attribute for the type.
-- Alias (Node18)
-- Defined in overloadable entities (literals, subprograms, entries) and
-- subprograms that cover a primitive operation of an abstract interface
-- (that is, subprograms with the Interface_Alias attribute). In case of
-- overloaded entities it points to the parent subprogram of a derived
-- subprogram. In case of abstract interface subprograms it points to the
-- subprogram that covers the abstract interface primitive. Also used for
-- a subprogram renaming, where it points to the renamed subprogram. For
-- an inherited operation (of a type extension) that is overridden in a
-- private part, the Alias is the overriding operation. In this fashion a
-- call from outside the package ends up executing the new body even if
-- non-dispatching, and a call from inside calls the overriding operation
-- because it hides the implicit one. Alias is always empty for entries.
-- Alignment (Uint14)
-- Defined in entities for types and also in constants, variables
-- (including exceptions where it refers to the static data allocated for
-- an exception), loop parameters, and formal parameters. This indicates
-- the desired alignment for a type, or the actual alignment for an
-- object. A value of zero (Uint_0) indicates that the alignment has not
-- been set yet. The alignment can be set by an explicit alignment
-- clause, or set by the front-end in package Layout, or set by the
-- back-end as part of the back-end back-annotation process. The
-- alignment field is also defined in E_Exception entities, but there it
-- is used only by the back-end for back annotation.
-- Alignment_Clause (synthesized)
-- Applies to all entities for types and objects. If an alignment
-- attribute definition clause is present for the entity, then this
-- function returns the N_Attribute_Definition clause that specifies the
-- alignment. If no alignment clause applies to the type, then the call
-- to this function returns Empty. Note that the call can return a
-- non-Empty value even if Has_Alignment_Clause is not set (happens with
-- subtype and derived type declarations). Note also that a record
-- definition clause with an (obsolescent) mod clause is converted
-- into an attribute definition clause for this purpose.
-- Anonymous_Designated_Type (Node35)
-- Defined in variables which represent anonymous finalization masters.
-- Contains the designated type which is being serviced by the master.
-- Anonymous_Masters (Elist29)
-- Defined in packages, subprograms, and subprogram bodies. Contains a
-- list of anonymous finalization masters declared within the related
-- unit. The list acts as a mapping between a master and a designated
-- type.
-- Anonymous_Object (Node30)
-- Present in protected and task type entities. Contains the entity of
-- the anonymous object created for a single protected or task type.
-- Associated_Entity (Node37)
-- Defined in all entities. This field is similar to Associated_Node, but
-- applied to entities. The attribute links an entity from the generic
-- template with its corresponding entity in the analyzed generic copy.
-- The global references mechanism relies on the Associated_Entity to
-- infer the context.
-- Associated_Formal_Package (Node12)
-- Defined in packages that are the actuals of formal_packages. Points
-- to the entity in the declaration for the formal package.
-- Associated_Node_For_Itype (Node8)
-- Defined in all type and subtype entities. Set non-Empty only for
-- Itypes. Set to point to the associated node for the Itype, i.e.
-- the node whose elaboration generated the Itype. This is used for
-- copying trees, to determine whether or not to copy an Itype, and
-- also for accessibility checks on anonymous access types. This
-- node is typically an object declaration, component declaration,
-- type or subtype declaration.
-- For an access discriminant in a type declaration, the associated_
-- node_for_itype is the corresponding discriminant specification.
-- For an access parameter it is the enclosing subprogram declaration.
-- For an access_to_protected_subprogram parameter it is the declaration
-- of the corresponding formal parameter.
--
-- Itypes have no explicit declaration, and therefore are not attached to
-- the tree: their Parent field is always empty. The Associated_Node_For_
-- Itype is the only way to determine the construct that leads to the
-- creation of a given itype entity.
-- Associated_Storage_Pool (Node22) [root type only]
-- Defined in simple and general access type entities. References the
-- storage pool to be used for the corresponding collection. A value of
-- Empty means that the default pool is to be used. This is defined
-- only in the root type, since derived types must have the same pool
-- as the parent type.
-- Barrier_Function (Node12)
-- Defined in protected entries and entry families. This is the
-- subprogram declaration for the body of the function that returns
-- the value of the entry barrier.
-- Base_Type (synthesized)
-- Applies to all type and subtype entities. Returns the base type of a
-- type or subtype. The base type of a type is the type itself. The base
-- type of a subtype is the type that it constrains (which is always
-- a type entity, not some other subtype). Note that in the case of a
-- subtype of a private type, it is possible for the base type attribute
-- to return a private type, even if the subtype to which it applies is
-- non-private. See also Implementation_Base_Type. Note: it is allowed to
-- apply Base_Type to other than a type, in which case it simply returns
-- the entity unchanged.
-- Block_Node (Node11)
-- Defined in block entities. Points to the identifier in the
-- Block_Statement itself. Used when retrieving the block construct
-- for finalization purposes, the block entity has an implicit label
-- declaration in the enclosing declarative part, and has otherwise
-- no direct connection in the tree with the block statement. The
-- link is to the identifier (which is an occurrence of the entity)
-- and not to the block_statement itself, because the statement may
-- be rewritten, e.g. in the process of removing dead code.
-- Body_Entity (Node19)
-- Defined in package and generic package entities, points to the
-- corresponding package body entity if one is present.
-- Body_Needed_For_SAL (Flag40)
-- Defined in package and subprogram entities that are compilation
-- units. Indicates that the source for the body must be included
-- when the unit is part of a standalone library.
-- Body_Needed_For_Inlining (Flag299)
-- Defined in package entities that are compilation units. Used to
-- determine whether the body unit needs to be compiled when the
-- package declaration appears in the list of units to inline. A body
-- is needed for inline processing if the unit declaration contains
-- functions that carry pragma Inline or Inline_Always, or if it
-- contains a generic unit that requires a body.
--
-- Body_References (Elist16)
-- Defined in abstract state entities. Contains an element list of
-- references (identifiers) that appear in a package body whose spec
-- defines the related state. If the body refines the said state, all
-- references on this list are illegal due to the visible refinement.
-- BIP_Initialization_Call (Node29)
-- Defined in constants and variables whose corresponding declaration
-- is wrapped in a transient block and the inital value is provided by
-- a build-in-place function call. Contains the relocated build-in-place
-- call after the expansion has decoupled the call from the object. This
-- attribute is used by the finalization machinery to insert cleanup code
-- for all additional transient objects found in the transient block.
-- C_Pass_By_Copy (Flag125) [implementation base type only]
-- Defined in record types. Set if a pragma Convention for the record
-- type specifies convention C_Pass_By_Copy. This convention name is
-- treated as identical in all respects to convention C, except that
-- if it is specified for a record type, then the C_Pass_By_Copy flag
-- is set, and if a foreign convention subprogram has a formal of the
-- corresponding type, then the parameter passing mechanism will be
-- set to By_Copy (unless specifically overridden by an Import or
-- Export pragma).
-- Can_Never_Be_Null (Flag38)
-- This flag is defined in all entities. It is set in an object which can
-- never have a null value. Set for constant access values initialized to
-- a non-null value. This is also set for all access parameters in Ada 83
-- and Ada 95 modes, and for access parameters that explicitly exclude
-- null in Ada 2005 mode.
--
-- This is used to avoid unnecessary resetting of the Is_Known_Non_Null
-- flag for such entities. In Ada 2005 mode, this is also used when
-- determining subtype conformance of subprogram profiles to ensure
-- that two formals have the same null-exclusion status.
--
-- This is also set on some access types, e.g. the Etype of the anonymous
-- access type of a controlling formal.
-- Can_Use_Internal_Rep (Flag229) [base type only]
-- Defined in Access_Subprogram_Kind nodes. This flag is set by the
-- front end and used by the backend. False means that the backend
-- must represent the type in the same way as Convention-C types (and
-- other foreign-convention types). On many targets, this means that
-- the backend will use dynamically generated trampolines for nested
-- subprograms. True means that the backend can represent the type in
-- some internal way. On the aforementioned targets, this means that the
-- backend will not use dynamically generated trampolines. This flag
-- must be False if Has_Foreign_Convention is True; otherwise, the front
-- end is free to set the policy.
--
-- Setting this False in all cases corresponds to the traditional back
-- end strategy, where all access-to-subprogram types are represented the
-- same way, independent of the Convention. For further details, see also
-- Always_Compatible_Rep in Targparm.
--
-- Efficiency note: On targets that use dynamically generated
-- trampolines, False generally favors efficiency of top-level
-- subprograms, whereas True generally favors efficiency of nested
-- ones. On other targets, this flag has little or no effect on
-- efficiency. The front end should take this into account. In
-- particular, pragma Favor_Top_Level gives a hint that the flag
-- should be False.
--
-- Note: We considered using Convention-C for this purpose, but we need
-- this separate flag, because Convention-C implies that in the case of
-- P'[Unrestricted_]Access, P also have convention C. Sometimes we want
-- to have Can_Use_Internal_Rep False for an access type, but allow P to
-- have convention Ada.
-- Chars (Name1)
-- Defined in all entities. This field contains an entry into the names
-- table that has the character string of the identifier, character
-- literal or operator symbol. See Namet for further details. Note that
-- throughout the processing of the front end, this name is the simple
-- unqualified name. However, just before the backend is called, a call
-- is made to Qualify_All_Entity_Names. This causes entity names to be
-- qualified using the encoding described in exp_dbug.ads, and from that
-- point (including post backend steps, e.g. cross-reference generation),
-- the entities will contain the encoded qualified names.
-- Checks_May_Be_Suppressed (Flag31)
-- Defined in all entities. Set if a pragma Suppress or Unsuppress
-- mentions the entity specifically in the second argument. If this
-- flag is set the Global_Entity_Suppress and Local_Entity_Suppress
-- tables must be consulted to determine if there actually is an active
-- Suppress or Unsuppress pragma that applies to the entity.
-- Class_Wide_Clone (Node38)
-- Defined on subprogram entities. Set if the subprogram has a class-wide
-- ore- or postcondition, and the expression contains calls to other
-- primitive funtions of the type. Used to implement properly the
-- semantics of inherited operations whose class-wide condition may
-- be different from that of the ancestor (See AI012-0195).
-- Class_Wide_Type (Node9)
-- Defined in all type entities. For a tagged type or subtype, returns
-- the corresponding implicitly declared class-wide type. For a
-- class-wide type, returns itself. Set to Empty for untagged types.
-- Cloned_Subtype (Node16)
-- Defined in E_Record_Subtype and E_Class_Wide_Subtype entities.
-- Each such entity can either have a Discriminant_Constraint, in
-- which case it represents a distinct type from the base type (and
-- will have a list of components and discriminants in the list headed by
-- First_Entity) or else no such constraint, in which case it will be a
-- copy of the base type.
--
-- o Each element of the list in First_Entity is copied from the base
-- type; in that case, this field is Empty.
--
-- o The list in First_Entity is shared with the base type; in that
-- case, this field points to that entity.
--
-- A record or classwide subtype may also be a copy of some other
-- subtype and share the entities in the First_Entity with that subtype.
-- In that case, this field points to that subtype.
--
-- For E_Class_Wide_Subtype, the presence of Equivalent_Type overrides
-- this field. Note that this field ONLY appears in subtype entities, not
-- in type entities, it is not defined, and it is an error to reference
-- Cloned_Subtype in an E_Record_Type or E_Class_Wide_Type entity.
-- Comes_From_Source
-- This flag appears on all nodes, including entities, and indicates
-- that the node was created by the scanner or parser from the original
-- source. Thus for entities, it indicates that the entity is defined
-- in the original source program.
-- Component_Alignment (special field) [base type only]
-- Defined in array and record entities. Contains a value of type
-- Component_Alignment_Kind indicating the alignment of components.
-- Set to Calign_Default normally, but can be overridden by use of
-- the Component_Alignment pragma. Note: this field is currently
-- stored in a non-standard way, see body for details.
-- Component_Bit_Offset (Uint11)
-- Defined in record components (E_Component, E_Discriminant). First
-- bit position of given component, computed from the first bit and
-- position values given in the component clause. A value of No_Uint
-- means that the value is not yet known. The value can be set by the
-- appearance of an explicit component clause in a record representation
-- clause, or it can be set by the front-end in package Layout, or it can
-- be set by the backend. By the time backend processing is completed,
-- this field is always set. A negative value is used to represent
-- a value which is not known at compile time, and must be computed
-- at run-time (this happens if fields of a record have variable
-- lengths). See package Layout for details of these values.
--
-- Note: Component_Bit_Offset is redundant with respect to the fields
-- Normalized_First_Bit and Normalized_Position, and could in principle
-- be eliminated, but it is convenient in several situations, including
-- use in the backend, to have this redundant field.
-- Component_Clause (Node13)
-- Defined in record components and discriminants. If a record
-- representation clause is present for the corresponding record type a
-- that specifies a position for the component, then the Component_Clause
-- field of the E_Component entity points to the N_Component_Clause node.
-- Set to Empty if no record representation clause was present, or if
-- there was no specification for this component.
-- Component_Size (Uint22) [implementation base type only]
-- Defined in array types. It contains the component size value for
-- the array. A value of No_Uint means that the value is not yet set.
-- The value can be set by the use of a component size clause, or
-- by the front end in package Layout, or by the backend. A negative
-- value is used to represent a value which is not known at compile
-- time, and must be computed at run-time (this happens if the type
-- of the component has a variable length size). See package Layout
-- for details of these values.
-- Component_Type (Node20) [implementation base type only]
-- Defined in array types and string types. References component type.
-- Contains_Ignored_Ghost_Code (Flag279)
-- Defined in blocks, packages and their bodies, subprograms and their
-- bodies. Set if the entity contains any ignored Ghost code in the form
-- of declaration, procedure call, assignment statement or pragma.
-- Contract (Node34)
-- Defined in constant, entry, entry family, operator, [generic] package,
-- package body, protected unit, [generic] subprogram, subprogram body,
-- variable, task unit, and type entities. Points to the contract of the
-- entity, holding various assertion items and data classifiers.
-- Contract_Wrapper (Node25)
-- Defined in entry and entry family entities. Set only when the entry
-- [family] has contract cases, preconditions, and/or postconditions.
-- Contains the entity of a wrapper procedure which encapsulates the
-- original entry and implements precondition/postcondition semantics.
-- Corresponding_Concurrent_Type (Node18)
-- Defined in record types that are constructed by the expander to
-- represent task and protected types (Is_Concurrent_Record_Type flag
-- set). Points to the entity for the corresponding task type or the
-- protected type.
-- Corresponding_Discriminant (Node19)
-- Defined in discriminants of a derived type, when the discriminant is
-- used to constrain a discriminant of the parent type. Points to the
-- corresponding discriminant in the parent type. Otherwise it is Empty.
-- Corresponding_Equality (Node30)
-- Defined in function entities for implicit inequality operators.
-- Denotes the explicit or derived equality operation that creates
-- the implicit inequality. Note that this field is not present in
-- other function entities, only in implicit inequality routines,
-- where Comes_From_Source is always False.
-- Corresponding_Function (Node32)
-- Defined on procedures internally built with an extra out parameter
-- to return a constrained array type, when Modify_Tree_For_C is set.
-- Denotes the function that returns the constrained array type for
-- which this procedure was built.
-- Corresponding_Procedure (Node32)
-- Defined on functions that return a constrained array type, when
-- Modify_Tree_For_C is set. Denotes the internally built procedure
-- with an extra out parameter created for it.
-- Corresponding_Protected_Entry (Node18)
-- Defined in subprogram bodies. Set for subprogram bodies that implement
-- a protected type entry to point to the entity for the entry.
-- Corresponding_Record_Component (Node21)
-- Defined in components of a derived untagged record type, including
-- discriminants. For a regular component or a girder discriminant,
-- points to the corresponding component in the parent type. Set to
-- Empty for a non-girder discriminant. It is used by the back end to
-- ensure the layout of the derived type matches that of the parent
-- type when there is no representation clause on the derived type.
-- Corresponding_Record_Type (Node18)
-- Defined in protected and task types and subtypes. References the
-- entity for the corresponding record type constructed by the expander
-- (see Exp_Ch9). This type is used to represent values of the task type.
-- Corresponding_Remote_Type (Node22)
-- Defined in record types that describe the fat pointer structure for
-- Remote_Access_To_Subprogram types. References the original access
-- to subprogram type.
-- CR_Discriminant (Node23)
-- Defined in discriminants of concurrent types. Denotes the homologous
-- discriminant of the corresponding record type. The CR_Discriminant is
-- created at the same time as the discriminal, and used to replace
-- occurrences of the discriminant within the type declaration.
-- Current_Use_Clause (Node27)
-- Defined in packages and in types. For packages, denotes the use
-- package clause currently in scope that makes the package use_visible.
-- For types, it denotes the use_type clause that makes the operators of
-- the type visible. Used for more precise warning messages on redundant
-- use clauses.
-- Current_Value (Node9)
-- Defined in all object entities. Set in E_Variable, E_Constant, formal
-- parameters and E_Loop_Parameter entities if we have trackable current
-- values. Set non-Empty if the (constant) current value of the variable
-- is known. This value is valid only for references from the same
-- sequential scope as the entity. The sequential scope of an entity
-- includes the immediate scope and any contained scopes that are package
-- specs, package bodies, blocks (at any nesting level) or statement
-- sequences in IF or loop statements.
--
-- Another related use of this field is to record information about the
-- value obtained from an IF or WHILE statement condition. If the IF or
-- ELSIF or WHILE condition has the form "NOT {,NOT] OBJ RELOP VAL ",
-- or OBJ [AND [THEN]] expr, where OBJ refers to an entity with a
-- Current_Value field, RELOP is one of the six relational operators, and
-- VAL is a compile-time known value then the Current_Value field of OBJ
-- points to the N_If_Statement, N_Elsif_Part, or N_Iteration_Scheme node
-- of the relevant construct, and the Condition field of this can be
-- consulted to give information about the value of OBJ. For more details
-- on this usage, see the procedure Exp_Util.Get_Current_Value_Condition.
-- Debug_Info_Off (Flag166)
-- Defined in all entities. Set if a pragma Suppress_Debug_Info applies
-- to the entity, or if internal processing in the compiler determines
-- that suppression of debug information is desirable. Note that this
-- flag is only for use by the front end as part of the processing for
-- determining if Needs_Debug_Info should be set. The backend should
-- always test Needs_Debug_Info, it should never test Debug_Info_Off.
-- Debug_Renaming_Link (Node25)
-- Used to link the variable associated with a debug renaming declaration
-- to the renamed entity. See Exp_Dbug.Debug_Renaming_Declaration for
-- details of the use of this field.
-- Declaration_Node (synthesized)
-- Applies to all entities. Returns the tree node for the construct that
-- declared the entity. Normally this is just the Parent of the entity.
-- One exception arises with child units, where the parent of the entity
-- is a selected component/defining program unit name. Another exception
-- is that if the entity is an incomplete type that has been completed or
-- a private type, then we obtain the declaration node denoted by the
-- full type, i.e. the full type declaration node. Also note that for
-- subprograms, this returns the {function,procedure}_specification, not
-- the subprogram_declaration.
-- Default_Aspect_Component_Value (Node19) [base type only]
-- Defined in array types. Holds the static value specified in a
-- Default_Component_Value aspect specification for the array type,
-- or inherited on derivation.
-- Default_Aspect_Value (Node19) [base type only]
-- Defined in scalar types. Holds the static value specified in a
-- Default_Value aspect specification for the type, or inherited
-- on derivation.
-- Default_Expr_Function (Node21)
-- Defined in parameters. It holds the entity of the parameterless
-- function that is built to evaluate the default expression if it is
-- more complex than a simple identifier or literal. For the latter
-- simple cases or if there is no default value, this field is Empty.
-- Default_Expressions_Processed (Flag108)
-- A flag in subprograms (functions, operators, procedures) and in
-- entries and entry families used to indicate that default expressions
-- have been processed and to avoid multiple calls to process the
-- default expressions (see Freeze.Process_Default_Expressions), which
-- would not only waste time, but also generate false error messages.
-- Default_Value (Node20)
-- Defined in formal parameters. Points to the node representing the
-- expression for the default value for the parameter. Empty if the
-- parameter has no default value (which is always the case for OUT
-- and IN OUT parameters in the absence of errors).
-- Delay_Cleanups (Flag114)
-- Defined in entities that have finalization lists (subprograms
-- blocks, and tasks). Set if there are pending generic body
-- instantiations for the corresponding entity. If this flag is
-- set, then generation of cleanup actions for the corresponding
-- entity must be delayed, since the insertion of the generic body
-- may affect cleanup generation (see Inline for further details).
-- Delay_Subprogram_Descriptors (Flag50)
-- Defined in entities for which exception subprogram descriptors
-- are generated (subprograms, package declarations and package
-- bodies). Defined if there are pending generic body instantiations
-- for the corresponding entity. If this flag is set, then generation
-- of the subprogram descriptor for the corresponding enities must
-- be delayed, since the insertion of the generic body may add entries
-- to the list of handlers.
--
-- Note: for subprograms, Delay_Subprogram_Descriptors is set if and
-- only if Delay_Cleanups is set. But Delay_Cleanups can be set for a
-- a block (in which case Delay_Subprogram_Descriptors is set for the
-- containing subprogram). In addition Delay_Subprogram_Descriptors is
-- set for a library level package declaration or body which contains
-- delayed instantiations (in this case the descriptor refers to the
-- enclosing elaboration procedure).
-- Delta_Value (Ureal18)
-- Defined in fixed and decimal types. Points to a universal real
-- that holds value of delta for the type, as given in the declaration
-- or as inherited by a subtype or derived type.
-- Dependent_Instances (Elist8)
-- Defined in packages that are instances. Holds list of instances
-- of inner generics. Used to place freeze nodes for those instances
-- after that of the current one, i.e. after the corresponding generic
-- bodies.
-- Depends_On_Private (Flag14)
-- Defined in all type entities. Set if the type is private or if it
-- depends on a private type.
-- Derived_Type_Link (Node31)
-- Defined in all type and subtype entities. Set in a base type if
-- a derived type declaration is encountered which derives from
-- this base type or one of its subtypes, and there are already
-- primitive operations declared. In this case, it references the
-- entity for the type declared by the derived type declaration.
-- For example:
--
-- type R is ...
-- subtype RS is R ...
-- ...
-- type G is new RS ...
--
-- In this case, if primitive operations have been declared for R, at
-- the point of declaration of G, then the Derived_Type_Link of R is set
-- to point to the entity for G. This is used to generate warnings and
-- errors for rep clauses that appear later on for R, which might result
-- in an unexpected (or illegal) implicit conversion operation.
--
-- Note: if there is more than one such derived type, the link will point
-- to the last one.
-- Designated_Type (synthesized)
-- Applies to access types. Returns the designated type. Differs from
-- Directly_Designated_Type in that if the access type refers to an
-- incomplete type, and the full type is available, then this full type
-- is returned instead of the incomplete type.
-- DIC_Procedure (synthesized)
-- Defined in all type entities. Set for a private type and its full view
-- when the type is subject to pragma Default_Initial_Condition (DIC), or
-- when the type inherits a DIC pragma from a parent type. Points to the
-- entity of a procedure which takes a single argument of the given type
-- and verifies the assertion expression of the DIC pragma at run time.
-- Note: the reason this is marked as a synthesized attribute is that the
-- way this is stored is as an element of the Subprograms_For_Type field.
-- Digits_Value (Uint17)
-- Defined in floating point types and subtypes and decimal types and
-- subtypes. Contains the Digits value specified in the declaration.
-- Direct_Primitive_Operations (Elist10)
-- Defined in tagged types and subtypes (including synchronized types),
-- in tagged private types and in tagged incomplete types. Element list
-- of entities for primitive operations of the tagged type. Not defined
-- in untagged types. In order to follow the C++ ABI, entities of
-- primitives that come from source must be stored in this list in the
-- order of their occurrence in the sources. For incomplete types the
-- list is always empty.
-- When expansion is disabled the corresponding record type of a
-- synchronized type is not constructed. In that case, such types
-- carry this attribute directly.
-- Directly_Designated_Type (Node20)
-- Defined in access types. This field points to the type that is
-- directly designated by the access type. In the case of an access
-- type to an incomplete type, this field references the incomplete
-- type. Directly_Designated_Type is typically used in implementing the
-- static semantics of the language; in implementing dynamic semantics,
-- we typically want the full view of the designated type. The function
-- Designated_Type obtains this full type in the case of access to an
-- incomplete type.
-- Disable_Controlled (Flag253)
-- Present in all entities. Set for a controlled type subject to aspect
-- Disable_Controlled which evaluates to True. This flag is taken into
-- account in synthesized attribute Is_Controlled.
-- Discard_Names (Flag88)
-- Defined in types and exception entities. Set if pragma Discard_Names
-- applies to the entity. It is also set for declarative regions and
-- package specs for which a Discard_Names pragma with zero arguments
-- has been encountered. The purpose of setting this flag is to be able
-- to set the Discard_Names attribute on enumeration types declared
-- after the pragma within the same declarative region. This flag is
-- set to False if a Keep_Names pragma appears for an enumeration type.
-- Discriminal (Node17)
-- Defined in discriminants (Discriminant formal: GNAT's first
-- coinage). The entity used as a formal parameter that corresponds
-- to a discriminant. See section "Handling of Discriminants" for
-- full details of the use of discriminals.
-- Discriminal_Link (Node10)
-- Defined in E_In_Parameter or E_Constant entities. For discriminals,
-- points back to corresponding discriminant. For other entities, must
-- remain Empty.
-- Discriminant_Checking_Func (Node20)
-- Defined in components. Points to the defining identifier of the
-- function built by the expander returns a Boolean indicating whether
-- the given record component exists for the current discriminant
-- values.
-- Discriminant_Constraint (Elist21)
-- Defined in entities whose Has_Discriminants flag is set (concurrent
-- types, subtypes, record types and subtypes, private types and
-- subtypes, limited private types and subtypes and incomplete types).
-- It is an error to reference the Discriminant_Constraint field if
-- Has_Discriminants is False.
--
-- If the Is_Constrained flag is set, Discriminant_Constraint points
-- to an element list containing the discriminant constraints in the
-- same order in which the discriminants are declared.
--
-- If the Is_Constrained flag is not set but the discriminants of the
-- unconstrained type have default initial values then this field
-- points to an element list giving these default initial values in
-- the same order in which the discriminants are declared. Note that
-- in this case the entity cannot be a tagged record type, because
-- discriminants in this case cannot have defaults.
--
-- If the entity is a tagged record implicit type, then this field is
-- inherited from the first subtype (so that the itype is subtype
-- conformant with its first subtype, which is needed when the first
-- subtype overrides primitive operations inherited by the implicit
-- base type).
--
-- In all other cases Discriminant_Constraint contains the empty
-- Elist (i.e. it is initialized with a call to New_Elmt_List).
-- Discriminant_Default_Value (Node20)
-- Defined in discriminants. Points to the node representing the
-- expression for the default value of the discriminant. Set to
-- Empty if the discriminant has no default value.
-- Discriminant_Number (Uint15)
-- Defined in discriminants. Gives the ranking of a discriminant in
-- the list of discriminants of the type, i.e. a sequential integer
-- index starting at 1 and ranging up to number of discriminants.
-- Dispatch_Table_Wrappers (Elist26) [implementation base type only]
-- Defined in E_Record_Type and E_Record_Subtype entities. Set in library
-- level tagged type entities if we are generating statically allocated
-- dispatch tables. Points to the list of dispatch table wrappers
-- associated with the tagged type. For an untagged record, contains
-- No_Elist.
-- DTC_Entity (Node16)
-- Defined in function and procedure entities. Set to Empty unless
-- the subprogram is dispatching in which case it references the
-- Dispatch Table pointer Component. For regular Ada tagged this, this
-- is the _Tag component. For CPP_Class types and their descendants,
-- this points to the component entity in the record that holds the
-- Vtable pointer for the Vtable containing the entry referencing the
-- subprogram.
-- DT_Entry_Count (Uint15)
-- Defined in E_Component entities. Only used for component marked
-- Is_Tag. Store the number of entries in the Vtable (or Dispatch Table)
-- DT_Offset_To_Top_Func (Node25)
-- Defined in E_Component entities. Only used for component marked
-- Is_Tag. If present it stores the Offset_To_Top function used to
-- provide this value in tagged types whose ancestor has discriminants.
-- DT_Position (Uint15)
-- Defined in function and procedure entities which are dispatching
-- (should not be referenced without first checking that flag
-- Is_Dispatching_Operation is True). Contains the offset into
-- the Vtable for the entry that references the subprogram.
-- Ekind (Ekind)
-- Defined in all entities. Contains a value of the enumeration type
-- Entity_Kind declared in a subsequent section in this spec.
-- Elaborate_Body_Desirable (Flag210)
-- Defined in package entities. Set if the elaboration circuitry detects
-- a case where there is a package body that modifies one or more visible
-- entities in the package spec and there is no explicit Elaborate_Body
-- pragma for the package. This information is passed on to the binder,
-- which attempts, but does not promise, to elaborate the body as close
-- to the spec as possible.
-- Elaboration_Entity (Node13)
-- Defined in entry, entry family, [generic] package, and subprogram
-- entities. This is a counter associated with the unit that is initially
-- set to zero, is incremented when an elaboration request for the unit
-- is made, and is decremented when a finalization request for the unit
-- is made. This is used for three purposes. First, it is used to
-- implement access before elaboration checks (the counter must be
-- non-zero to call a subprogram at elaboration time). Second, it is
-- used to guard against repeated execution of the elaboration code.
-- Third, it is used to ensure that the finalization code is executed
-- only after all clients have requested it.
--
-- Note that we always allocate this counter, and set this field, but
-- we do not always actually use it. It is only used if it is needed
-- for access before elaboration use (see Elaboration_Entity_Required
-- flag) or if either the spec or the body has elaboration code. If
-- neither of these two conditions holds, then the entity is still
-- allocated (since we don't know early enough whether or not there
-- is elaboration code), but is simply not used for any purpose.
-- Elaboration_Entity_Required (Flag174)
-- Defined in entry, entry family, [generic] package, and subprogram
-- entities. Set only if Elaboration_Entity is non-Empty to indicate that
-- the counter is required to be non-zero even if there is no other
-- elaboration code. This occurs when the Elaboration_Entity counter
-- is used for access before elaboration checks. If the counter is
-- only used to prevent multiple execution of the elaboration code,
-- then if there is no other elaboration code, obviously there is no
-- need to set the flag.
-- Encapsulating_State (Node32)
-- Defined in abstract state, constant and variable entities. Contains
-- the entity of an ancestor state or a single concurrent type whose
-- refinement utilizes this item as a constituent.
-- Enclosing_Scope (Node18)
-- Defined in labels. Denotes the innermost enclosing construct that
-- contains the label. Identical to the scope of the label, except for
-- labels declared in the body of an accept statement, in which case the
-- entry_name is the Enclosing_Scope. Used to validate goto's within
-- accept statements.
-- Entry_Accepted (Flag152)
-- Defined in E_Entry and E_Entry_Family entities. Set if there is
-- at least one accept for this entry in the task body. Used to
-- generate warnings for missing accepts.
-- Entry_Bodies_Array (Node19)
-- Defined in protected types for which Has_Entries is true.
-- This is the defining identifier for the array of entry body
-- action procedures and barrier functions used by the runtime to
-- execute the user code associated with each entry.
-- Entry_Cancel_Parameter (Node23)
-- Defined in blocks. This only applies to a block statement for
-- which the Is_Asynchronous_Call_Block flag is set. It
-- contains the defining identifier of an object that must be
-- passed to the Cancel_Task_Entry_Call or Cancel_Protected_Entry_Call
-- call in the cleanup handler added to the block by
-- Exp_Ch7.Expand_Cleanup_Actions. This parameter is a Boolean
-- object for task entry calls and a Communications_Block object
-- in the case of protected entry calls. In both cases the objects
-- are declared in outer scopes to this block.
-- Entry_Component (Node11)
-- Defined in formal parameters (in, in out and out parameters). Used
-- only for formals of entries. References the corresponding component
-- of the entry parameter record for the entry.
-- Entry_Formal (Node16)
-- Defined in components of the record built to correspond to entry
-- parameters. This field points from the component to the formal. It
-- is the back pointer corresponding to Entry_Component.
-- Entry_Index_Constant (Node18)
-- Defined in an entry index parameter. This is an identifier that
-- eventually becomes the name of a constant representing the index
-- of the entry family member whose entry body is being executed. Used
-- to expand references to the entry index specification identifier.
-- Entry_Index_Type (synthesized)
-- Applies to an entry family. Denotes Etype of the subtype indication
-- in the entry declaration. Used to resolve the index expression in an
-- accept statement for a member of the family, and in the prefix of
-- 'COUNT when it applies to a family member.
-- Entry_Max_Queue_Lengths_Array (Node35)
-- Defined in protected types for which Has_Entries is true. Contains the
-- defining identifier for the array of naturals used by the runtime to
-- limit the queue size of each entry individually.
-- Entry_Parameters_Type (Node15)
-- Defined in entries. Points to the access-to-record type that is
-- constructed by the expander to hold a reference to the parameter
-- values. This reference is manipulated (as an address) by the
-- tasking runtime. The designated record represents a packaging
-- up of the entry parameters (see Exp_Ch9.Expand_N_Entry_Declaration
-- for further details). Entry_Parameters_Type is Empty if the entry
-- has no parameters.
-- Enumeration_Pos (Uint11)
-- Defined in enumeration literals. Contains the position number
-- corresponding to the value of the enumeration literal.
-- Enumeration_Rep (Uint12)
-- Defined in enumeration literals. Contains the representation that
-- corresponds to the value of the enumeration literal. Note that
-- this is normally the same as Enumeration_Pos except in the presence
-- of representation clauses, where Pos will still represent the
-- position of the literal within the type and Rep will have be the
-- value given in the representation clause.
-- Enumeration_Rep_Expr (Node22)
-- Defined in enumeration literals. Points to the expression in an
-- associated enumeration rep clause that provides the representation
-- value for this literal. Empty if no enumeration rep clause for this
-- literal (or if rep clause does not have an entry for this literal,
-- an error situation). This is also used to catch duplicate entries
-- for the same literal.
-- Enum_Pos_To_Rep (Node23)
-- Defined in enumeration types, but not enumeration subtypes. Set to
-- Empty unless the enumeration type has a non-standard representation,
-- i.e. at least one literal has a representation value different from
-- its position value. In this case, the alternative is the following:
-- if the representation is not contiguous, then Enum_Pos_To_Rep is the
-- entity for an array constant built when the type is frozen that maps
-- Pos values to corresponding Rep values, whose index type is Natural
-- and whose component type is the enumeration type itself; or else, if
-- the representation is contiguous, then Enum_Pos_To_Rep is the entity
-- of the index type defined above.
-- Equivalent_Type (Node18)
-- Defined in class wide types and subtypes, access to protected
-- subprogram types, and in exception types. For a classwide type, it
-- is always Empty. For a class wide subtype, it points to an entity
-- created by the expander which gives the backend an understandable
-- equivalent of the class subtype with a known size (given by an
-- initial value). See Exp_Util.Expand_Class_Wide_Subtype for further
-- details. For E_Exception_Type, this points to the record containing
-- the data necessary to represent exceptions (for further details, see
-- System.Standard_Library). For access to protected subprograms, it
-- denotes a record that holds pointers to the operation and to the
-- protected object. For remote Access_To_Subprogram types, it denotes
-- the record that is the fat pointer representation of an RAST.
-- Esize (Uint12)
-- Defined in all types and subtypes, and also for components, constants,
-- and variables, including exceptions where it refers to the static data
-- allocated for an exception. Contains the Object_Size of the type or of
-- the object. A value of zero indicates that the value is not yet known.
--
-- For the case of components where a component clause is present, the
-- value is the value from the component clause, which must be non-
-- negative (but may be zero, which is acceptable for the case of
-- a type with only one possible value). It is also possible for Esize
-- of a component to be set without a component clause defined, which
-- means that the component size is specified, but not the position.
-- See also RM_Size and the section on "Handling of Type'Size Values".
-- During backend processing, the value is back annotated for all zero
-- values, so that after the call to the backend, the value is set.
-- Etype (Node5)
-- Defined in all entities. Represents the type of the entity, which
-- is itself another entity. For a type entity, points to the parent
-- type for a derived type, or if the type is not derived, points to
-- itself. For a subtype entity, Etype points to the base type. For
-- a class wide type, points to the corresponding specific type. For a
-- subprogram or subprogram type, Etype has the return type of a function
-- or is set to Standard_Void_Type to represent a procedure. The Etype
-- field of a package is also set to Standard_Void_Type.
--
-- Note one obscure case: for pragma Default_Storage_Pool (null), the
-- Etype of the N_Null node is Empty.
-- Extra_Accessibility (Node13)
-- Defined in formal parameters in the non-generic case. Normally Empty,
-- but if expansion is active, and a parameter is one for which a
-- dynamic accessibility check is required, then an extra formal of type
-- Natural is created (see description of field Extra_Formal), and the
-- Extra_Accessibility field of the formal parameter points to the entity
-- for this extra formal. Also defined in variables when compiling
-- receiving stubs. In this case, a non Empty value means that this
-- variable's accessibility depth has been transmitted by the caller and
-- must be retrieved through the entity designed by this field instead of
-- being computed.
-- Extra_Accessibility_Of_Result (Node19)
-- Defined in (non-generic) Function, Operator, and Subprogram_Type
-- entities. Normally Empty, but if expansion is active, and a function
-- is one for which "the accessibility level of the result ... determined
-- by the point of call" (AI05-0234) is needed, then an extra formal of
-- subtype Natural is created (see description of field Extra_Formal),
-- and the Extra_Accessibility_Of_Result field of the function points to
-- the entity for this extra formal.
-- Extra_Constrained (Node23)
-- Defined in formal parameters in the non-generic case. Normally Empty,
-- but if expansion is active and a parameter is one for which a dynamic
-- indication of its constrained status is required, then an extra formal
-- of type Boolean is created (see description of field Extra_Formal),
-- and the Extra_Constrained field of the formal parameter points to the
-- entity for this extra formal. Also defined in variables when compiling
-- receiving stubs. In this case, a non empty value means that this
-- variable's constrained status has been transmitted by the caller and
-- must be retrieved through the entity designed by this field instead of
-- being computed.
-- Extra_Formal (Node15)
-- Defined in formal parameters in the non-generic case. Certain
-- parameters require extra implicit information to be passed (e.g. the
-- flag indicating if an unconstrained variant record argument is
-- constrained, and the accessibility level for access parameters). See
-- description of Extra_Constrained, Extra_Accessibility fields for
-- further details. Extra formal parameters are constructed to represent
-- these values, and chained to the end of the list of formals using the
-- Extra_Formal field (i.e. the Extra_Formal field of the last "real"
-- formal points to the first extra formal, and the Extra_Formal field of
-- each extra formal points to the next one, with Empty indicating the
-- end of the list of extra formals). Another case of Extra_Formal arises
-- in connection with unnesting of subprograms, where the ARECnF formal
-- that represents an activation record pointer is an extra formal.
-- Extra_Formals (Node28)
-- Applies to subprograms, subprogram types, entries, and entry
-- families. Returns first extra formal of the subprogram or entry.
-- Returns Empty if there are no extra formals.
-- Finalization_Master (Node23) [root type only]
-- Defined in access-to-controlled or access-to-class-wide types. The
-- field contains the entity of the finalization master which handles
-- dynamically allocated controlled objects referenced by the access
-- type. Empty for access-to-subprogram types. Empty for access types
-- whose designated type does not need finalization actions.
-- Finalize_Storage_Only (Flag158) [base type only]
-- Defined in all types. Set on direct controlled types to which a
-- valid Finalize_Storage_Only pragma applies. This flag is also set on
-- composite types when they have at least one controlled component and
-- all their controlled components are Finalize_Storage_Only. It is also
-- inherited by type derivation except for direct controlled types where
-- the Finalize_Storage_Only pragma is required at each level of
-- derivation.
-- Finalizer (Node28)
-- Applies to package declarations and bodies. Contains the entity of the
-- library-level program which finalizes all package-level controlled
-- objects.
-- First_Component (synthesized)
-- Applies to incomplete, private, protected, record and task types.
-- Returns the first component by following the chain of declared
-- entities for the type a component is found (one with an Ekind of
-- E_Component). The discriminants are skipped. If the record is null,
-- then Empty is returned.
-- First_Component_Or_Discriminant (synthesized)
-- Similar to First_Component, but discriminants are not skipped, so will
-- find the first discriminant if discriminants are present.
-- First_Entity (Node17)
-- Defined in all entities which act as scopes to which a list of
-- associated entities is attached (blocks, class subtypes and types,
-- entries, functions, loops, packages, procedures, protected objects,
-- record types and subtypes, private types, task types and subtypes).
-- Points to a list of associated entities using the Next_Entity field
-- as a chain pointer with Empty marking the end of the list.
-- First_Exit_Statement (Node8)
-- Defined in E_Loop entity. The exit statements for a loop are chained
-- (in reverse order of appearance) using this field to point to the
-- first entry in the chain (last exit statement in the loop). The
-- entries are chained through the Next_Exit_Statement field of the
-- N_Exit_Statement node with Empty marking the end of the list.
-- First_Formal (synthesized)
-- Applies to subprograms and subprogram types, and also to entries
-- and entry families. Returns first formal of the subprogram or entry.
-- The formals are the first entities declared in a subprogram or in
-- a subprogram type (the designated type of an Access_To_Subprogram
-- definition) or in an entry.
-- First_Formal_With_Extras (synthesized)
-- Applies to subprograms and subprogram types, and also in entries
-- and entry families. Returns first formal of the subprogram or entry.
-- Returns Empty if there are no formals. The list returned includes
-- all the extra formals (see description of Extra_Formals field).
-- First_Index (Node17)
-- Defined in array types and subtypes. By introducing implicit subtypes
-- for the index constraints, we have the same structure for constrained
-- and unconstrained arrays, subtype marks and discrete ranges are
-- both represented by a subtype. This function returns the tree node
-- corresponding to an occurrence of the first index (NOT the entity for
-- the type). Subsequent indices are obtained using Next_Index. Note that
-- this field is defined for the case of string literal subtypes, but is
-- always Empty.
-- First_Literal (Node17)
-- Defined in all enumeration types, including character and boolean
-- types. This field points to the first enumeration literal entity
-- for the type (i.e. it is set to First (Literals (N)) where N is
-- the enumeration type definition node. A special case occurs with
-- standard character and wide character types, where this field is
-- Empty, since there are no enumeration literal lists in these cases.
-- Note that this field is set in enumeration subtypes, but it still
-- points to the first literal of the base type in this case.
-- First_Private_Entity (Node16)
-- Defined in all entities containing private parts (packages, protected
-- types and subtypes, task types and subtypes). The entities on the
-- entity chain are in order of declaration, so the entries for private
-- entities are at the end of the chain. This field points to the first
-- entity for the private part. It is Empty if there are no entities
-- declared in the private part or if there is no private part.
-- First_Rep_Item (Node6)
-- Defined in all entities. If non-empty, points to a linked list of
-- representation pragmas nodes and representation clause nodes that
-- apply to the entity, linked using Next_Rep_Item, with Empty marking
-- the end of the list. In the case of derived types and subtypes, the
-- new entity inherits the chain at the point of declaration. This means
-- that it is possible to have multiple instances of the same kind of rep
-- item on the chain, in which case it is the first one that applies to
-- the entity.
--
-- Note: pragmas that can apply to more than one overloadable entity,
-- (Convention, Interface, Inline, Inline_Always, Import, Export,
-- External) are never present on this chain when they apply to
-- overloadable entities, since it is impossible for a given pragma
-- to be on more than one chain at a time.
--
-- For most representation items, the representation information is
-- reflected in other fields and flags in the entity. For example if a
-- record representation clause is present, the component entities
-- reflect the specified information. However, there are some items that
-- are only reflected in the chain. These include:
--
-- Machine_Attribute pragma
-- Link_Alias pragma
-- Linker_Constructor pragma
-- Linker_Destructor pragma
-- Weak_External pragma
-- Thread_Local_Storage pragma
--
-- If any of these items are present, then the flag Has_Gigi_Rep_Item is
-- set, indicating that the backend should search the chain.
--
-- Other representation items are included in the chain so that error
-- messages can easily locate the relevant nodes for posting errors.
-- Note in particular that size clauses are defined only for this
-- purpose, and should only be accessed if Has_Size_Clause is set.
-- Float_Rep (Uint10)
-- Defined in floating-point entities. Contains a value of type
-- Float_Rep_Kind. Together with the Digits_Value uniquely defines
-- the floating-point representation to be used.
-- Freeze_Node (Node7)
-- Defined in all entities. If there is an associated freeze node for the
-- entity, this field references this freeze node. If no freeze node is
-- associated with the entity, then this field is Empty. See package
-- Freeze for further details.
-- From_Limited_With (Flag159)
-- Defined in abtract states, package and type entities. Set to True when
-- the related entity is generated by the expansion of a limited with
-- clause. Such an entity is said to be a "shadow" - it acts as the
-- abstract view of a state or variable or as the incomplete view of a
-- type by inheriting relevant attributes from the said entity.
-- Full_View (Node11)
-- Defined in all type and subtype entities and in deferred constants.
-- References the entity for the corresponding full type or constant
-- declaration. For all types other than private and incomplete types,
-- this field always contains Empty. If an incomplete type E1 is
-- completed by a private type E2 whose full type declaration entity is
-- E3 then the full view of E1 is E2, and the full view of E2 is E3. See
-- also Underlying_Type.
-- Generic_Homonym (Node11)
-- Defined in generic packages. The generic homonym is the entity of
-- a renaming declaration inserted in every generic unit. It is used
-- to resolve the name of a local entity that is given by a qualified
-- name, when the generic entity itself is hidden by a local name.
-- Generic_Renamings (Elist23)
-- Defined in package and subprogram instances. Holds mapping that
-- associates generic parameters with the corresponding instances, in
-- those cases where the instance is an entity.
-- Handler_Records (List10)
-- Defined in subprogram and package entities. Points to a list of
-- identifiers referencing the handler record entities for the
-- corresponding unit.
-- Has_Aliased_Components (Flag135) [implementation base type only]
-- Defined in array type entities. Indicates that the component type
-- of the array is aliased. Should this also be set for records to
-- indicate that at least one component is aliased (see processing in
-- Sem_Prag.Process_Atomic_Independent_Shared_Volatile???)
-- Has_Alignment_Clause (Flag46)
-- Defined in all type entities and objects. Indicates if an alignment
-- clause has been given for the entity. If set, then Alignment_Clause
-- returns the N_Attribute_Definition node for the alignment attribute
-- definition clause. Note that it is possible for this flag to be False
-- even when Alignment_Clause returns non_Empty (this happens in the case
-- of derived type declarations).
-- Has_All_Calls_Remote (Flag79)
-- Defined in all library unit entities. Set if the library unit has an
-- All_Calls_Remote pragma. Note that such entities must also be RCI
-- entities, so the flag Is_Remote_Call_Interface will always be set if
-- this flag is set.
-- Has_Atomic_Components (Flag86) [implementation base type only]
-- Defined in all types and objects. Set only for an array type or
-- an array object if a valid pragma Atomic_Components applies to the
-- type or object. Note that in the case of an object, this flag is
-- only set on the object if there was an explicit pragma for the
-- object. In other words, the proper test for whether an object has
-- atomic components is to see if either the object or its base type
-- has this flag set. Note that in the case of a type, the pragma will
-- be chained to the rep item chain of the first subtype in the usual
-- manner.
-- Has_Attach_Handler (synthesized)
-- Applies to record types that are constructed by the expander to
-- represent protected types. Returns True if there is at least one
-- Attach_Handler pragma in the corresponding specification.
-- Has_Biased_Representation (Flag139)
-- Defined in discrete types (where it applies to the type'size value),
-- and to objects (both stand-alone and components), where it applies to
-- the size of the object from a size or record component clause. In
-- all cases it indicates that the size in question is smaller than
-- would normally be required, but that the size requirement can be
-- satisfied by using a biased representation, in which stored values
-- have the low bound (Expr_Value (Type_Low_Bound (T)) subtracted to
-- reduce the required size. For example, a type with a range of 1..2
-- takes one bit, using 0 to represent 1 and 1 to represent 2.
--
-- Note that in the object and component cases, the flag is only set if
-- the type is unbiased, but the object specifies a smaller size than the
-- size of the type, forcing biased representation for the object, but
-- the subtype is still an unbiased type.
-- Has_Completion (Flag26)
-- Defined in all entities that require a completion (functions,
-- procedures, private types, limited private types, incomplete types,
-- constants and packages that require a body). The flag is set if the
-- completion has been encountered and analyzed.
-- Has_Completion_In_Body (Flag71)
-- Defined in all entities for types and subtypes. Set only in "Taft
-- amendment types" (incomplete types whose full declaration appears in
-- the package body).
-- Has_Complex_Representation (Flag140) [implementation base type only]
-- Defined in record types. Set only for a base type to which a valid
-- pragma Complex_Representation applies.
-- Has_Component_Size_Clause (Flag68) [implementation base type only]
-- Defined in all type entities. Set if a component size clause is
-- Defined for the given type. Note that this flag can be False even
-- if Component_Size is non-zero (happens in the case of derived types).
-- Has_Constrained_Partial_View (Flag187)
-- Defined in private type and their completions, when the private
-- type has no discriminants and the full view has discriminants with
-- defaults. In Ada 2005 heap-allocated objects of such types are not
-- constrained, and can change their discriminants with full assignment.
--
-- Ada 2012 has an additional rule (3.3. (23/10.3)) concerning objects
-- declared in a generic package body. Objects whose type is an untagged
-- generic formal private type are considered to have a constrained
-- partial view. The predicate Object_Type_Has_Constrained_Partial_View
-- in sem_aux is used to test for this case.
-- Has_Contiguous_Rep (Flag181)
-- Defined in enumeration types. Set if the type has a representation
-- clause whose entries are successive integers.
-- Has_Controlled_Component (Flag43) [base type only]
-- Defined in all type and subtype entities. Set only for composite type
-- entities which contain a component that either is a controlled type,
-- or itself contains controlled component (i.e. either Is_Controlled or
-- Has_Controlled_Component is set for at least one component).
-- Has_Controlling_Result (Flag98)
-- Defined in E_Function entities. Set if the function is a primitive
-- function of a tagged type which can dispatch on result.
-- Has_Convention_Pragma (Flag119)
-- Defined in all entities. Set for an entity for which a valid pragma
-- Convention, Import, or Export has been given. Used to prevent more
-- than one such pragma appearing for a given entity (RM B.1(45)).
-- Has_Default_Aspect (Flag39) [base type only]
-- Defined in entities for types and subtypes, set for scalar types with
-- a Default_Value aspect and array types with a Default_Component_Value
-- aspect. If this flag is set, then a corresponding aspect specification
-- node will be present on the rep item chain for the entity. For a
-- derived type that inherits a default from its ancestor, the default
-- value is set, but it may be overridden by an aspect declaration on
-- type derivation.
-- Has_Delayed_Aspects (Flag200)
-- Defined in all entities. Set if the Rep_Item chain for the entity has
-- one or more N_Aspect_Definition nodes chained which are not to be
-- evaluated till the freeze point. The aspect definition expression
-- clause has been preanalyzed to get visibility at the point of use,
-- but no other action has been taken.
-- Has_Delayed_Freeze (Flag18)
-- Defined in all entities. Set to indicate that an explicit freeze
-- node must be generated for the entity at its freezing point. See
-- separate section ("Delayed Freezing and Elaboration") for details.
-- Has_Delayed_Rep_Aspects (Flag261)
-- Defined in all types and subtypes. This flag is set if there is at
-- least one aspect for a representation characteristic that has to be
-- delayed and is one of the characteristics that may be inherited by
-- types derived from this type if not overridden. If this flag is set,
-- then types derived from this type have May_Inherit_Delayed_Rep_Aspects
-- set, signalling that Freeze.Inherit_Delayed_Rep_Aspects must be called
-- at the freeze point of the derived type.
-- Has_DIC (synthesized)
-- Defined in all type entities. Set for a private type and its full view
-- when the type is subject to pragma Default_Initial_Condition (DIC), or
-- when the type inherits a DIC pragma from a parent type.
-- Has_Discriminants (Flag5)
-- Defined in all types and subtypes. For types that are allowed to have
-- discriminants (record types and subtypes, task types and subtypes,
-- protected types and subtypes, private types, limited private types,
-- and incomplete types), indicates if the corresponding type or subtype
-- has a known discriminant part. Always false for all other types.
-- Has_Dispatch_Table (Flag220)
-- Defined in E_Record_Types that are tagged. Set to indicate that the
-- corresponding dispatch table is already built. This flag is used to
-- avoid duplicate construction of library level dispatch tables (because
-- the declaration of library level objects cause premature construction
-- of the table); otherwise the code that builds the table is added at
-- the end of the list of declarations of the package.
-- Has_Dynamic_Predicate_Aspect (Flag258)
-- Defined in all types and subtypes. Set if a Dynamic_Predicate aspect
-- was explicitly applied to the type. Generally we treat predicates as
-- static if possible, regardless of whether they are specified using
-- Predicate, Static_Predicate, or Dynamic_Predicate. And if a predicate
-- can be treated as static (i.e. its expression is predicate-static),
-- then the flag Has_Static_Predicate will be set True. But there are
-- cases where legality is affected by the presence of an explicit
-- Dynamic_Predicate aspect. For example, even if a predicate looks
-- static, you can't use it in a case statement if there is an explicit
-- Dynamic_Predicate aspect specified. So test Has_Static_Predicate if
-- you just want to know if the predicate can be evaluated statically,
-- but test Has_Dynamic_Predicate_Aspect to enforce legality rules about
-- the use of dynamic predicates.
-- Has_Entries (synthesized)
-- Applies to concurrent types. True if any entries are declared
-- within the task or protected definition for the type.
-- Has_Enumeration_Rep_Clause (Flag66)
-- Defined in enumeration types. Set if an enumeration representation
-- clause has been given for this enumeration type. Used to prevent more
-- than one enumeration representation clause for a given type. Note
-- that this does not imply a representation with holes, since the rep
-- clause may merely confirm the default 0..N representation.
-- Has_Exit (Flag47)
-- Defined in loop entities. Set if the loop contains an exit statement.
-- Has_Expanded_Contract (Flag240)
-- Defined in functions, procedures, entries, and entry families. Set
-- when a subprogram has a N_Contract node that has been expanded. The
-- flag prevents double expansion of a contract when a construct is
-- rewritten into something else and subsequently reanalyzed/expanded.
-- Has_Foreign_Convention (synthesized)
-- Applies to all entities. Determines if the Convention for the entity
-- is a foreign convention, i.e. non-native: other than Convention_Ada,
-- Convention_Intrinsic, Convention_Entry, Convention_Protected,
-- Convention_Stubbed and Convention_Ada_Pass_By_(Copy,Reference).
-- Has_Forward_Instantiation (Flag175)
-- Defined in package entities. Set for packages that instantiate local
-- generic entities before the corresponding generic body has been seen.
-- If a package has a forward instantiation, we cannot inline subprograms
-- appearing in the same package because the placement requirements of
-- the instance will conflict with the linear elaboration of front-end
-- inlining.
-- Has_Fully_Qualified_Name (Flag173)
-- Defined in all entities. Set if the name in the Chars field has been
-- replaced by the fully qualified name, as used for debug output. See
-- Exp_Dbug for a full description of the use of this flag and also the
-- related flag Has_Qualified_Name.
-- Has_Gigi_Rep_Item (Flag82)
-- Defined in all entities. Set if the rep item chain (referenced by
-- First_Rep_Item and linked through the Next_Rep_Item chain) contains a
-- representation item that needs to be specially processed by the back
-- end, i.e. one of the following items:
--
-- Machine_Attribute pragma
-- Linker_Alias pragma
-- Linker_Constructor pragma
-- Linker_Destructor pragma
-- Weak_External pragma
-- Thread_Local_Storage pragma
--
-- If this flag is set, then the backend should scan the rep item chain
-- to process any of these items that appear. At least one such item will
-- be present.
--
-- Has_Homonym (Flag56)
-- Defined in all entities. Set if an entity has a homonym in the same
-- scope. Used by the backend to generate unique names for all entities.
-- Has_Implicit_Dereference (Flag251)
-- Defined in types and discriminants. Set if the type has an aspect
-- Implicit_Dereference. Set also on the discriminant named in the aspect
-- clause, to simplify type resolution.
-- Has_Independent_Components (Flag34) [implementation base type only]
-- Defined in all types and objects. Set only for a record type or an
-- array type or array object if a valid pragma Independent_Components
-- applies to the type or object. Note that in the case of an object,
-- this flag is only set on the object if there was an explicit pragma
-- for the object. In other words, the proper test for whether an object
-- has independent components is to see if either the object or its base
-- type has this flag set. Note that in the case of a type, the pragma
-- will be chained to the rep item chain of the first subtype in the
-- usual manner. Also set if a pragma Has_Atomic_Components or pragma
-- Has_Aliased_Components applies to the type or object.
-- Has_Inheritable_Invariants (Flag248) [base type only]
-- Defined in all type entities. Set on private types and interface types
-- which define at least one class-wide invariant. Such invariants must
-- be inherited by derived types. The flag is also set on the full view
-- of a private type for completeness.
-- Has_Inherited_DIC (Flag133) [base type only]
-- Defined in all type entities. Set for a derived type which inherits
-- pragma Default_Initial_Condition from a parent type.
-- Has_Inherited_Invariants (Flag291) [base type only]
-- Defined in all type entities. Set on private extensions and derived
-- types which inherit at least one class-wide invariant from a parent or
-- an interface type. The flag is also set on the full view of a private
-- extension for completeness.
-- Has_Initial_Value (Flag219)
-- Defined in entities for variables and out parameters. Set if there
-- is an explicit initial value expression in the declaration of the
-- variable. Note that this is set only if this initial value is
-- explicit, it is not set for the case of implicit initialization
-- of access types or controlled types. Always set to False for out
-- parameters. Also defined in entities for in and in-out parameters,
-- but always false in these cases.
-- Has_Interrupt_Handler (synthesized)
-- Applies to all protected type entities. Set if the protected type
-- definition contains at least one procedure to which a pragma
-- Interrupt_Handler applies.
-- Has_Invariants (synthesized)
-- Defined in all type entities. True if the type defines at least one
-- invariant of its own or inherits at least one class-wide invariant
-- from a parent type or an interface.
-- Has_Loop_Entry_Attributes (Flag260)
-- Defined in E_Loop entities. Set when the loop is subject to at least
-- one attribute 'Loop_Entry. The flag also implies that the loop has
-- already been transformed. See Expand_Loop_Entry_Attribute for details.
-- Has_Machine_Radix_Clause (Flag83)
-- Defined in decimal types and subtypes, set if a Machine_Radix
-- representation clause is present. This flag is used to detect
-- the error of multiple machine radix clauses for a single type.
-- Has_Master_Entity (Flag21)
-- Defined in entities that can appear in the scope stack (see spec
-- of Sem). It is set if a task master entity (_master) has been
-- declared and initialized in the corresponding scope.
-- Has_Missing_Return (Flag142)
-- Defined in functions and generic functions. Set if there is one or
-- more missing return statements in the function. This is used to
-- control wrapping of the body in Exp_Ch6 to ensure that the program
-- error exception is correctly raised in this case at run time.
-- Has_Nested_Block_With_Handler (Flag101)
-- Defined in scope entities. Set if there is a nested block within the
-- scope that has an exception handler and the two scopes are in the
-- same procedure. This is used by the backend for controlling certain
-- optimizations to ensure that they are consistent with exceptions.
-- See documentation in backend for further details.
-- Has_Nested_Subprogram (Flag282)
-- Defined in subprogram entities. Set for a subprogram which contains at
-- least one nested subprogram.
-- Has_Non_Limited_View (synth)
-- Defined in E_Incomplete_Type, E_Incomplete_Subtype, E_Class_Wide_Type,
-- E_Abstract_State entities. True if their Non_Limited_View attribute
-- is present.
-- Has_Non_Null_Abstract_State (synth)
-- Defined in package entities. True if the package is subject to a non-
-- null Abstract_State aspect/pragma.
-- Has_Non_Null_Visible_Refinement (synth)
-- Defined in E_Abstract_State entities. True if the state has a visible
-- refinement of at least one variable or state constituent as expressed
-- in aspect/pragma Refined_State.
-- Has_Non_Standard_Rep (Flag75) [implementation base type only]
-- Defined in all type entities. Set when some representation clause
-- or pragma causes the representation of the item to be significantly
-- modified. In this category are changes of small or radix for a
-- fixed-point type, change of component size for an array, and record
-- or enumeration representation clauses, as well as packed pragmas.
-- All other representation clauses (e.g. Size and Alignment clauses)
-- are not considered to be significant since they do not affect
-- stored bit patterns.
-- Has_Null_Abstract_State (synth)
-- Defined in package entities. True if the package is subject to a null
-- Abstract_State aspect/pragma.
-- Has_Null_Visible_Refinement (synth)
-- Defined in E_Abstract_State entities. True if the state has a visible
-- null refinement as expressed in aspect/pragma Refined_State.
-- Has_Object_Size_Clause (Flag172)
-- Defined in entities for types and subtypes. Set if an Object_Size
-- clause has been processed for the type. Used to prevent multiple
-- Object_Size clauses for a given entity.
-- Has_Out_Or_In_Out_Parameter (Flag110)
-- Present in subprograms, generic subprograms, entries, and entry
-- families. Set if they have at least one OUT or IN OUT parameter
-- (allowed for functions only in Ada 2012).
-- Has_Own_DIC (Flag3) [base type only]
-- Defined in all type entities. Set for a private type and its full view
-- (and its underlying full view, if the full view is itsef private) when
-- the type is subject to pragma Default_Initial_Condition.
-- Has_Own_Invariants (Flag232) [base type only]
-- Defined in all type entities. Set on any type that defines at least
-- one invariant of its own.
-- Note: this flag is set on both partial and full view of types to which
-- an Invariant pragma or aspect applies, and on the underlying full view
-- if the full view is private.
-- Has_Partial_Visible_Refinement (Flag296)
-- Defined in E_Abstract_State entities. Set when a state has at least
-- one refinement constituent subject to indicator Part_Of, and analysis
-- is in the region between the declaration of the first constituent for
-- this abstract state (in the private part of the package) and the end
-- of the package spec or body with visibility over this private part
-- (which includes the package itself and its child packages).
-- Has_Per_Object_Constraint (Flag154)
-- Defined in E_Component entities. Set if the subtype of the component
-- has a per object constraint. Per object constraints result from the
-- following situations :
--
-- 1. N_Attribute_Reference - when the prefix is the enclosing type and
-- the attribute is Access.
-- 2. N_Discriminant_Association - when the expression uses the
-- discriminant of the enclosing type.
-- 3. N_Index_Or_Discriminant_Constraint - when at least one of the
-- individual constraints is a per object constraint.
-- 4. N_Range - when the lower or upper bound uses the discriminant of
-- the enclosing type.
-- 5. N_Range_Constraint - when the range expression uses the
-- discriminant of the enclosing type.
-- Has_Pragma_Controlled (Flag27) [implementation base type only]
-- Defined in access type entities. It is set if a pragma Controlled
-- applies to the access type.
-- Has_Pragma_Elaborate_Body (Flag150)
-- Defined in all entities. Set in compilation unit entities if a
-- pragma Elaborate_Body applies to the compilation unit.
-- Has_Pragma_Inline (Flag157)
-- Defined in all entities. Set for functions and procedures for which a
-- pragma Inline or Inline_Always applies to the subprogram. Note that
-- this flag can be set even if Is_Inlined is not set. This happens for
-- pragma Inline (if Inline_Active is False). In other words, the flag
-- Has_Pragma_Inline represents the formal semantic status, and is used
-- for checking semantic correctness. The flag Is_Inlined indicates
-- whether inlining is actually active for the entity.
-- Has_Pragma_Inline_Always (Flag230)
-- Defined in all entities. Set for functions and procedures for which a
-- pragma Inline_Always applies. Note that if this flag is set, the flag
-- Has_Pragma_Inline is also set.
-- Has_Pragma_No_Inline (Flag201)
-- Defined in all entities. Set for functions and procedures for which a
-- pragma No_Inline applies. Note that if this flag is set, the flag
-- Has_Pragma_Inline_Always cannot be set.
-- Has_Pragma_Ordered (Flag198) [implementation base type only]
-- Defined in entities for enumeration types. If set indicates that a
-- valid pragma Ordered was given for the type. This flag is inherited
-- by derived enumeration types. We don't need to distinguish the derived
-- case since we allow multiple occurrences of this pragma anyway.
-- Has_Pragma_Pack (Flag121) [implementation base type only]
-- Defined in array and record type entities. If set, indicates that a
-- valid pragma Pack was given for the type. Note that this flag is not
-- inherited by derived type. See also the Is_Packed flag.
-- Has_Pragma_Preelab_Init (Flag221)
-- Defined in type and subtype entities. If set indicates that a valid
-- pragma Preelaborable_Initialization applies to the type.
-- Has_Pragma_Pure (Flag203)
-- Defined in all entities. If set, indicates that a valid pragma Pure
-- was given for the entity. In some cases, we need to test whether
-- Is_Pure was explicitly set using this pragma.
-- Has_Pragma_Pure_Function (Flag179)
-- Defined in all entities. If set, indicates that a valid pragma
-- Pure_Function was given for the entity. In some cases, we need to test
-- whether Is_Pure was explicitly set using this pragma. We also set
-- this flag for some internal entities that we know should be treated
-- as pure for optimization purposes.
-- Has_Pragma_Thread_Local_Storage (Flag169)
-- Defined in all entities. If set, indicates that a valid pragma
-- Thread_Local_Storage was given for the entity.
-- Has_Pragma_Unmodified (Flag233)
-- Defined in all entities. Can only be set for variables (E_Variable,
-- E_Out_Parameter, E_In_Out_Parameter). Set if a valid pragma Unmodified
-- applies to the variable, indicating that no warning should be given
-- if the entity is never modified. Note that clients should generally
-- not test this flag directly, but instead use function Has_Unmodified.
-- Has_Pragma_Unreferenced (Flag180)
-- Defined in all entities. Set if a valid pragma Unreferenced applies
-- to the entity, indicating that no warning should be given if the
-- entity has no references, but a warning should be given if it is
-- in fact referenced. For private types, this flag is set in both the
-- private entity and full entity if the pragma applies to either. Note
-- that clients should generally not test this flag directly, but instead
-- use function Has_Unreferenced.
-- ??? this real description was clobbered
-- Has_Pragma_Unreferenced_Objects (Flag212)
-- Defined in all entities. Set if a valid pragma Unused applies to an
-- entity, indicating that warnings should be given if the entity is
-- modified or referenced. This pragma is equivalent to a pair of
-- Unmodified and Unreferenced pragmas.
-- Has_Pragma_Unused (Flag294)
-- Defined in all entities. Set if a valid pragma Unused applies to a
-- variable or entity, indicating that warnings should not be given if
-- it is never modified or referenced. Note: This pragma is exactly
-- equivalent Unmodified and Unreference combined.
-- Has_Predicates (Flag250)
-- Defined in type and subtype entities. Set if a pragma Predicate or
-- Predicate aspect applies to the type or subtype, or if it inherits a
-- Predicate aspect from its parent or progenitor types.
--
-- Note: this flag is set on both partial and full view of types to which
-- a Predicate pragma or aspect applies, and on the underlying full view
-- if the full view is private.
-- Has_Primitive_Operations (Flag120) [base type only]
-- Defined in all type entities. Set if at least one primitive operation
-- is defined for the type.
-- Has_Private_Ancestor (Flag151)
-- Applies to type extensions. True if some ancestor is derived from a
-- private type, making some components invisible and aggregates illegal.
-- This flag is set at the point of derivation. The legality of the
-- aggregate must be rechecked because it also depends on the visibility
-- at the point the aggregate is resolved. See sem_aggr.adb. This is part
-- of AI05-0115.
-- Has_Private_Declaration (Flag155)
-- Defined in all entities. Set if it is the defining entity of a private
-- type declaration or its corresponding full declaration. This flag is
-- thus preserved when the full and the partial views are exchanged, to
-- indicate if a full type declaration is a completion. Used for semantic
-- checks in E.4(18) and elsewhere.
-- Has_Private_Extension (Flag300)
-- Defined in tagged types. Set to indicate that the tagged type has some
-- private extension. Used to report a warning on public primitives added
-- after defining its private extensions.
-- Has_Protected (Flag271) [base type only]
-- Defined in all type entities. Set on protected types themselves, and
-- also (recursively) on any composite type which has a component for
-- which Has_Protected is set, unless the protected type is declared in
-- the private part of an internal unit. The meaning is that restrictions
-- for protected types apply to this type. Note: the flag is not set on
-- access types, even if they designate an object that Has_Protected.
-- Has_Qualified_Name (Flag161)
-- Defined in all entities. Set if the name in the Chars field has
-- been replaced by its qualified name, as used for debug output. See
-- Exp_Dbug for a full description of qualification requirements. For
-- some entities, the name is the fully qualified name, but there are
-- exceptions. In particular, for local variables in procedures, we
-- do not include the procedure itself or higher scopes. See also the
-- flag Has_Fully_Qualified_Name, which is set if the name does indeed
-- include the fully qualified name.
-- Has_RACW (Flag214)
-- Defined in package spec entities. Set if the spec contains the
-- declaration of a remote access-to-classwide type.
-- Has_Record_Rep_Clause (Flag65) [implementation base type only]
-- Defined in record types. Set if a record representation clause has
-- been given for this record type. Used to prevent more than one such
-- clause for a given record type. Note that this is initially cleared
-- for a derived type, even though the representation is inherited. See
-- also the flag Has_Specified_Layout.
-- Has_Recursive_Call (Flag143)
-- Defined in procedures. Set if a direct parameterless recursive call
-- is detected while analyzing the body. Used to activate some error
-- checks for infinite recursion.
-- Has_Shift_Operator (Flag267) [base type only]
-- Defined in integer types. Set in the base type of an integer type for
-- which at least one of the shift operators is defined.
-- Has_Size_Clause (Flag29)
-- Defined in entities for types and objects. Set if a size clause is
-- defined for the entity. Used to prevent multiple Size clauses for a
-- given entity. Note that it is always initially cleared for a derived
-- type, even though the Size for such a type is inherited from a Size
-- clause given for the parent type.
-- Has_Small_Clause (Flag67)
-- Defined in ordinary fixed point types (but not subtypes). Indicates
-- that a small clause has been given for the entity. Used to prevent
-- multiple Small clauses for a given entity. Note that it is always
-- initially cleared for a derived type, even though the Small for such
-- a type is inherited from a Small clause given for the parent type.
-- Has_Specified_Layout (Flag100) [implementation base type only]
-- Defined in all type entities. Set for a record type or subtype if
-- the record layout has been specified by a record representation
-- clause. Note that this differs from the flag Has_Record_Rep_Clause
-- in that it is inherited by a derived type. Has_Record_Rep_Clause is
-- used to indicate that the type is mentioned explicitly in a record
-- representation clause, and thus is not inherited by a derived type.
-- This flag is always False for non-record types.
-- Has_Specified_Stream_Input (Flag190)
-- Has_Specified_Stream_Output (Flag191)
-- Has_Specified_Stream_Read (Flag192)
-- Has_Specified_Stream_Write (Flag193)
-- Defined in all type and subtype entities. Set for a given view if the
-- corresponding stream-oriented attribute has been defined by an
-- attribute definition clause. When such a clause occurs, a TSS is set
-- on the underlying full view; the flags are used to track visibility of
-- the attribute definition clause for partial or incomplete views.
-- Has_Static_Discriminants (Flag211)
-- Defined in record subtypes constrained by discriminant values. Set if
-- all the discriminant values have static values, meaning that in the
-- case of a variant record, the component list can be trimmed down to
-- include only the components corresponding to these discriminants.
-- Has_Static_Predicate (Flag269)
-- Defined in all types and subtypes. Set if the type (which must be a
-- scalar type) has a predicate whose expression is predicate-static.
-- This can result from the use of any Predicate, Static_Predicate, or
-- Dynamic_Predicate aspect. We can distinguish these cases by testing
-- Has_Static_Predicate_Aspect and Has_Dynamic_Predicate_Aspect. See
-- description of the latter flag for further information on dynamic
-- predicates which are also static.
-- Has_Static_Predicate_Aspect (Flag259)
-- Defined in all types and subtypes. Set if a Static_Predicate aspect
-- applies to the type. Note that we can tell if a static predicate is
-- present by looking at Has_Static_Predicate, but this could have come
-- from a Predicate aspect or pragma or even from a Dynamic_Predicate
-- aspect. When we need to know the difference (e.g. to know what set of
-- check policies apply, use this flag and Has_Dynamic_Predicate_Aspect
-- to determine which case we have).
-- Has_Storage_Size_Clause (Flag23) [implementation base type only]
-- Defined in task types and access types. It is set if a Storage_Size
-- clause is present for the type. Used to prevent multiple clauses for
-- one type. Note that this flag is initially cleared for a derived type
-- even though the Storage_Size for such a type is inherited from a
-- Storage_Size clause given for the parent type. Note that in the case
-- of access types, this flag is defined only in the root type, since a
-- storage size clause cannot be given to a derived type.
-- Has_Stream_Size_Clause (Flag184)
-- Defined in all entities. It is set for types which have a Stream_Size
-- clause attribute. Used to prevent multiple Stream_Size clauses for a
-- given entity, and also whether it is necessary to check for a stream
-- size clause.
-- Has_Task (Flag30) [base type only]
-- Defined in all type entities. Set on task types themselves, and also
-- (recursively) on any composite type which has a component for which
-- Has_Task is set. The meaning is that an allocator or declaration of
-- such an object must create the required tasks. Note: the flag is not
-- set on access types, even if they designate an object that Has_Task.
-- Has_Timing_Event (Flag289) [base type only]
-- Defined in all type entities. Set on language defined type
-- Ada.Real_Time.Timing_Events.Timing_Event, and also (recursively) on
-- any composite type which has a component for which Has_Timing_Event
-- is set. Used for the No_Local_Timing_Event restriction.
-- Has_Thunks (Flag228)
-- Applies to E_Constant entities marked Is_Tag. True for secondary tag
-- referencing a dispatch table whose contents are pointers to thunks.
-- Has_Unchecked_Union (Flag123) [base type only]
-- Defined in all type entities. Set on unchecked unions themselves
-- and (recursively) on any composite type which has a component for
-- which Has_Unchecked_Union is set. The meaning is that a comparison
-- operation or 'Valid_Scalars reference for the type is not permitted.
-- Note that the flag is not set on access types, even if they designate
-- an object that has the flag Has_Unchecked_Union set.
-- Has_Unknown_Discriminants (Flag72)
-- Defined in all entities. Set for types with unknown discriminants.
-- Types can have unknown discriminants either from their declaration or
-- through type derivation. The use of this flag exactly meets the spec
-- in RM 3.7(26). Note that all class-wide types are considered to have
-- unknown discriminants. Note that both flags Has_Discriminants and
-- Has_Unknown_Discriminants may be true for a type. Class-wide types and
-- their subtypes have unknown discriminants and can have declared ones
-- as well. Private types declared with unknown discriminants may have a
-- full view that has explicit discriminants, and both flag will be set
-- on the partial view, to ensure that discriminants are properly
-- inherited in certain contexts.
-- Has_Visible_Refinement (Flag263)
-- Defined in E_Abstract_State entities. Set when a state has at least
-- one refinement constituent and analysis is in the region between
-- pragma Refined_State and the end of the package body declarations.
-- Has_Volatile_Components (Flag87) [implementation base type only]
-- Defined in all types and objects. Set only for an array type or array
-- object if a valid pragma Volatile_Components or a valid pragma
-- Atomic_Components applies to the type or object. Note that in the case
-- of an object, this flag is only set on the object if there was an
-- explicit pragma for the object. In other words, the proper test for
-- whether an object has volatile components is to see if either the
-- object or its base type has this flag set. Note that in the case of a
-- type the pragma will be chained to the rep item chain of the first
-- subtype in the usual manner.
-- Has_Xref_Entry (Flag182)
-- Defined in all entities. Set if an entity has an entry in the Xref
-- information generated in ali files. This is true for all source
-- entities in the extended main source file. It is also true of entities
-- in other packages that are referenced directly or indirectly from the
-- main source file (indirect reference occurs when the main source file
-- references an entity with a type reference. See package Lib.Xref for
-- further details).
-- Has_Yield_Aspect (Flag308)
-- Defined in subprograms, generic subprograms, entries, entry families.
-- Set if the entity has aspect Yield.
-- Hiding_Loop_Variable (Node8)
-- Defined in variables. Set only if a variable of a discrete type is
-- hidden by a loop variable in the same local scope, in which case
-- the Hiding_Loop_Variable field of the hidden variable points to
-- the E_Loop_Parameter entity doing the hiding. Used in processing
-- warning messages if the hidden variable turns out to be unused
-- or is referenced without being set.
-- Hidden_In_Formal_Instance (Elist30)
-- Defined on actuals for formal packages. Entities on the list are
-- formals that are hidden outside of the formal package when this
-- package is not declared with a box, or the formal itself is not
-- defaulted (see RM 12.7 (10)). Their visibility is restored on exit
-- from the current generic, because the actual for the formal package
-- may be used subsequently in the current unit.
-- Homonym (Node4)
-- Defined in all entities. Link for list of entities that have the
-- same source name and that are declared in the same or enclosing
-- scopes. Homonyms in the same scope are overloaded. Used for name
-- resolution and for the generation of debugging information.
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Present in concurrent type, entry, operator, [generic] package,
-- package body, [generic] subprogram, and subprogram body entities.
-- Set when the entity appears in an instance subject to SPARK_Mode
-- "off" and indicates that all SPARK_Mode pragmas found within must
-- be ignored.
-- Implementation_Base_Type (synthesized)
-- Applies to all entities. For types, similar to Base_Type, but never
-- returns a private type when applied to a non-private type. Instead in
-- this case, it always returns the Underlying_Type of the base type, so
-- that we still have a concrete type. For entities other than types,
-- returns the entity unchanged.
-- Import_Pragma (Node35)
-- Defined in subprogram entities. Set if a valid pragma Import or pragma
-- Import_Function or pragma Import_Procedure applies to the subprogram,
-- in which case this field points to the pragma (we can't use the normal
-- Rep_Item chain mechanism, because a single pragma Import can apply
-- to multiple subprogram entities).
-- In_Package_Body (Flag48)
-- Defined in package entities. Set on the entity that denotes the
-- package (the defining occurrence of the package declaration) while
-- analyzing and expanding the package body. Reset on completion of
-- analysis/expansion.
-- In_Private_Part (Flag45)
-- Defined in all entities. Can be set only in package entities and
-- objects. For package entities, this flag is set to indicate that the
-- private part of the package is being analyzed. The flag is reset at
-- the end of the package declaration. For objects it indicates that the
-- declaration of the object occurs in the private part of a package.
-- Incomplete_Actuals (Elist24)
-- Defined on package entities that are instances. Indicates the actuals
-- types in the instantiation that are limited views. If this list is
-- not empty, the instantiation, which appears in a package declaration,
-- is relocated to the corresponding package body, which must have a
-- corresponding nonlimited with_clause.
-- Initialization_Statements (Node28)
-- Defined in constants and variables. For a composite object initialized
-- initialized with an aggregate that has been converted to a sequence
-- of assignments, points to a block statement containing the
-- assignments.
-- Inner_Instances (Elist23)
-- Defined in generic units. Contains element list of units that are
-- instantiated within the given generic. Used to diagnose circular
-- instantiations.
-- Interface_Alias (Node25)
-- Defined in subprograms that cover a primitive operation of an abstract
-- interface type. Can be set only if the Is_Hidden flag is also set,
-- since such entities are always hidden. Points to its associated
-- interface subprogram. It is used to register the subprogram in
-- secondary dispatch table of the interface (Ada 2005: AI-251).
-- Interface_Name (Node21)
-- Defined in constants, variables, exceptions, functions, procedures,
-- and packages. Set to Empty unless an export, import, or interface name
-- pragma has explicitly specified an external name, in which case it
-- references an N_String_Literal node for the specified external name.
-- Note that if this field is Empty, and Is_Imported or Is_Exported is
-- set, then the default interface name is the name of the entity, cased
-- in a manner that is appropriate to the system in use. Note that
-- Interface_Name is ignored if an address clause is present (since it
-- is meaningless in this case).
-- Interfaces (Elist25)
-- Defined in record types and subtypes. List of abstract interfaces
-- implemented by a tagged type that are not already implemented by the
-- ancestors (Ada 2005: AI-251).
-- Invariant_Procedure (synthesized)
-- Defined in types and subtypes. Set for private types and their full
-- views if one or more [class-wide] invariants apply to the type, or
-- when the type inherits class-wide invariants from a parent type or
-- an interface, or when the type is an array and its component type is
-- subject to an invariant, or when the type is record and contains a
-- component subject to an invariant (property is recursive). Points to
-- to the entity for a procedure which checks all these invariants. The
-- invariant procedure takes a single argument of the given type, and
-- returns if the invariant holds, or raises exception Assertion_Error
-- with an appropriate message if it does not hold. This attribute is
-- defined but always Empty for private subtypes.
-- Note: the reason this is marked as a synthesized attribute is that the
-- way this is stored is as an element of the Subprograms_For_Type field.
-- In_Use (Flag8)
-- Defined in packages and types. Set when analyzing a use clause for
-- the corresponding entity. Reset at end of corresponding declarative
-- part. The flag on a type is also used to determine the visibility of
-- the primitive operators of the type.
-- Is_Abstract_Subprogram (Flag19)
-- Defined in all subprograms and entries. Set for abstract subprograms.
-- Always False for enumeration literals and entries. See also
-- Requires_Overriding.
-- Is_Abstract_Type (Flag146)
-- Defined in all types. Set for abstract types.
-- Is_Access_Constant (Flag69)
-- Defined in access types and subtypes. Indicates that the keyword
-- constant was present in the access type definition.
-- Is_Access_Protected_Subprogram_Type (synthesized)
-- Applies to all types, true for named and anonymous access to
-- protected subprograms.
-- Is_Access_Type (synthesized)
-- Applies to all entities, true for access types and subtypes
-- Is_Access_Object_Type (synthesized)
-- Applies to all entities, true for access-to-object types and subtypes
-- Is_Activation_Record (Flag305)
-- Applies to E_In_Parameters generated in Exp_Unst for nested
-- subprograms, to mark the added formal that carries the activation
-- record created in the enclosing subprogram.
-- Is_Actual_Subtype (Flag293)
-- Defined on all types, true for the generated constrained subtypes
-- that are built for unconstrained composite actuals.
-- Is_Ada_2005_Only (Flag185)
-- Defined in all entities, true if a valid pragma Ada_05 or Ada_2005
-- applies to the entity which specifically names the entity, indicating
-- that the entity is Ada 2005 only. Note that this flag is not set if
-- the entity is part of a unit compiled with the normal no-argument form
-- of pragma Ada_05 or Ada_2005.
-- Is_Ada_2012_Only (Flag199)
-- Defined in all entities, true if a valid pragma Ada_12 or Ada_2012
-- applies to the entity which specifically names the entity, indicating
-- that the entity is Ada 2012 only. Note that this flag is not set if
-- the entity is part of a unit compiled with the normal no-argument form
-- of pragma Ada_12 or Ada_2012.
-- Is_Aliased (Flag15)
-- Defined in all entities. Set for objects and types whose declarations
-- carry the keyword aliased, and on record components that have the
-- keyword. For Ada 2012, also applies to formal parameters.
-- Is_Array_Type (synthesized)
-- Applies to all entities, true for array types and subtypes
-- Is_Asynchronous (Flag81)
-- Defined in all type entities and in procedure entities. Set
-- if a pragma Asynchronous applies to the entity.
-- Is_Atomic (Flag85)
-- Defined in all type entities, and also in constants, components, and
-- variables. Set if a pragma Atomic or Shared applies to the entity.
-- In the case of private and incomplete types, this flag is set in
-- both the partial view and the full view.
-- Is_Atomic_Or_VFA (synth)
-- Defined in all type entities, and also in constants, components and
-- variables. Set if a pragma Atomic or Shared or Volatile_Full_Access
-- applies to the entity. For many purposes VFA objects should be treated
-- the same as Atomic objects, and this predicate is intended for that
-- usage. In the case of private and incomplete types, the predicate
-- applies to both the partial view and the full view.
-- Is_Base_Type (synthesized)
-- Applies to type and subtype entities. True if entity is a base type.
-- Is_Bit_Packed_Array (Flag122) [implementation base type only]
-- Defined in all entities. This flag is set for a packed array type that
-- is bit-packed (i.e. the component size is known by the front end and
-- is in the range 1-63 but not a multiple of 8). Is_Packed is always set
-- if Is_Bit_Packed_Array is set, but it is possible for Is_Packed to be
-- set without Is_Bit_Packed_Array if the component size is not known by
-- the front-end or for the case of an array having one or more index
-- types that are enumeration types with non-standard representation.
-- Is_Boolean_Type (synthesized)
-- Applies to all entities, true for boolean types and subtypes,
-- i.e. Standard.Boolean and all types ultimately derived from it.
-- Is_Called (Flag102)
-- Defined in subprograms and packages. Set if a subprogram is called
-- from the unit being compiled or a unit in the closure. Also set for
-- a package that contains called subprograms. Used only for inlining.
-- Is_Character_Type (Flag63)
-- Defined in all entities. Set for character types and subtypes,
-- i.e. enumeration types that have at least one character literal.
-- Is_Checked_Ghost_Entity (Flag277)
-- Applies to all entities. Set for abstract states, [generic] packages,
-- [generic] subprograms, components, discriminants, formal parameters,
-- objects, package bodies, subprogram bodies, and [sub]types subject to
-- pragma Ghost or inherit "ghostness" from an enclosing construct, and
-- subject to Assertion_Policy Ghost => Check.
-- Is_Child_Unit (Flag73)
-- Defined in all entities. Set only for defining entities of program
-- units that are child units (but False for subunits).
-- Is_Class_Wide_Clone (Flag290)
-- Defined on subprogram entities. Set for subprograms built in order
-- to implement properly the inheritance of class-wide pre- or post-
-- conditions when the condition contains calls to other primitives
-- of the ancestor type. Used to implement AI12-0195.
-- Is_Class_Wide_Equivalent_Type (Flag35)
-- Defined in record types and subtypes. Set to True, if the type acts
-- as a class-wide equivalent type, i.e. the Equivalent_Type field of
-- some class-wide subtype entity references this record type.
-- Is_Class_Wide_Type (synthesized)
-- Applies to all entities, true for class wide types and subtypes
-- Is_Compilation_Unit (Flag149)
-- Defined in all entities. Set if the entity is a package or subprogram
-- entity for a compilation unit other than a subunit (since we treat
-- subunits as part of the same compilation operation as the ultimate
-- parent, we do not consider them to be separate units for this flag).
-- Is_Completely_Hidden (Flag103)
-- Defined on discriminants. Only set on girder discriminants of
-- untagged types. When set, the entity is a girder discriminant of a
-- derived untagged type which is not directly visible in the derived
-- type because the derived type or one of its ancestors have renamed the
-- discriminants in the root type. Note: there are girder discriminants
-- which are not Completely_Hidden (e.g. discriminants of a root type).
-- Is_Composite_Type (synthesized)
-- Applies to all entities, true for all composite types and subtypes.
-- Either Is_Composite_Type or Is_Elementary_Type (but not both) is true
-- of any type.
-- Is_Concurrent_Record_Type (Flag20)
-- Defined in record types and subtypes. Set if the type was created
-- by the expander to represent a task or protected type. For every
-- concurrent type, such as record type is constructed, and task and
-- protected objects are instances of this record type at run time
-- (The backend will replace declarations of the concurrent type using
-- the declarations of the corresponding record type). See Exp_Ch9 for
-- further details.
-- Is_Concurrent_Type (synthesized)
-- Applies to all entities, true for task types and subtypes and for
-- protected types and subtypes.
-- Is_Constant_Object (synthesized)
-- Applies to all entities, true for E_Constant, E_Loop_Parameter, and
-- E_In_Parameter entities.
-- Is_Constrained (Flag12)
-- Defined in types or subtypes which may have index, discriminant
-- or range constraint (i.e. array types and subtypes, record types
-- and subtypes, string types and subtypes, and all numeric types).
-- Set if the type or subtype is constrained.
-- Is_Constr_Subt_For_U_Nominal (Flag80)
-- Defined in all types and subtypes. Set only for the constructed
-- subtype of an object whose nominal subtype is unconstrained. Note
-- that the constructed subtype itself will be constrained.
-- Is_Constr_Subt_For_UN_Aliased (Flag141)
-- Defined in all types and subtypes. This flag can be set only if
-- Is_Constr_Subt_For_U_Nominal is also set. It indicates that in
-- addition the object concerned is aliased. This flag is used by
-- the backend to determine whether a template must be constructed.
-- Is_Constructor (Flag76)
-- Defined in function and procedure entities. Set if a pragma
-- CPP_Constructor applies to the subprogram.
-- Is_Controlled_Active (Flag42) [base type only]
-- Defined in all type entities. Indicates that the type is controlled,
-- i.e. is either a descendant of Ada.Finalization.Controlled or of
-- Ada.Finalization.Limited_Controlled.
-- Is_Controlled (synth) [base type only]
-- Defined in all type entities. Set if Is_Controlled_Active is set for
-- the type, and Disable_Controlled is not set.
-- Is_Controlling_Formal (Flag97)
-- Defined in all Formal_Kind entities. Marks the controlling parameters
-- of dispatching operations.
-- Is_CPP_Class (Flag74)
-- Defined in all type entities, set only for tagged types to which a
-- valid pragma Import (CPP, ...) or pragma CPP_Class has been applied.
-- Is_CUDA_Kernel (Flag118)
-- Defined in function and procedure entities. Set if the subprogram is a
-- CUDA kernel.
-- Is_Decimal_Fixed_Point_Type (synthesized)
-- Applies to all type entities, true for decimal fixed point
-- types and subtypes.
-- Is_Descendant_Of_Address (Flag223)
-- Defined in all entities. True if the entity is type System.Address,
-- or (recursively) a subtype or derived type of System.Address.
-- Is_DIC_Procedure (Flag132)
-- Defined in functions and procedures. Set for a generated procedure
-- which verifies the assumption of pragma Default_Initial_Condition at
-- run time.
-- Is_Discrete_Or_Fixed_Point_Type (synthesized)
-- Applies to all entities, true for all discrete types and subtypes
-- and all fixed-point types and subtypes.
-- Is_Discrete_Type (synthesized)
-- Applies to all entities, true for all discrete types and subtypes
-- Is_Discrim_SO_Function (Flag176)
-- Defined in all entities. Set only in E_Function entities that Layout
-- creates to compute discriminant-dependent dynamic size/offset values.
-- Is_Discriminant_Check_Function (Flag264)
-- Defined in all entities. Set only in E_Function entities for functions
-- created to do discriminant checks.
-- Is_Discriminal (synthesized)
-- Applies to all entities, true for renamings of discriminants. Such
-- entities appear as constants or IN parameters.
-- Is_Dispatch_Table_Entity (Flag234)
-- Applies to all entities. Set to indicate to the backend that this
-- entity is associated with a dispatch table.
-- Is_Dispatching_Operation (Flag6)
-- Defined in all entities. Set for procedures, functions, generic
-- procedures, and generic functions if the corresponding operation
-- is dispatching.
-- Is_Dynamic_Scope (synthesized)
-- Applies to all Entities. Returns True if the entity is a dynamic
-- scope (i.e. a block, subprogram, task_type, entry or extended return
-- statement).
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Defined in elaboration targets (see terminology in Sem_Elab). Set when
-- the target appears in a region which is subject to elabled elaboration
-- checks. Such targets are allowed to generate run-time conditional ABE
-- checks or guaranteed ABE failures.
-- Is_Elaboration_Target (synthesized)
-- Applies to all entities, True only for elaboration targets (see the
-- terminology in Sem_Elab).
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Defined in elaboration targets (see terminology in Sem_Elab). Set when
-- the target appears in a region with elaboration warnings enabled.
-- Is_Elementary_Type (synthesized)
-- Applies to all entities, True for all elementary types and subtypes.
-- Either Is_Composite_Type or Is_Elementary_Type (but not both) is true
-- of any type.
-- Is_Eliminated (Flag124)
-- Defined in type entities, subprogram entities, and object entities.
-- Indicates that the corresponding entity has been eliminated by use
-- of pragma Eliminate. Also used to mark subprogram entities whose
-- declaration and body are within unreachable code that is removed.
-- Is_Entry (synthesized)
-- Applies to all entities, True only for entry and entry family
-- entities and False for all other entity kinds.
-- Is_Entry_Formal (Flag52)
-- Defined in all entities. Set only for entry formals (which can only
-- be in, in-out or out parameters). This flag is used to speed up the
-- test for the need to replace references in Exp_Ch2.
-- Is_Entry_Wrapper (Flag297)
-- Defined on wrappers created for entries that have precondition aspects
-- Is_Enumeration_Type (synthesized)
-- Defined in all entities, true for enumeration types and subtypes
-- Is_Exception_Handler (Flag286)
-- Defined in blocks. Set if the block serves only as a scope of an
-- exception handler with a choice parameter. Such a block does not
-- physically appear in the tree.
-- Is_Exported (Flag99)
-- Defined in all entities. Set if the entity is exported. For now we
-- only allow the export of constants, exceptions, functions, procedures
-- and variables, but that may well change later on. Exceptions can only
-- be exported in the Java VM implementation of GNAT, which is retired.
-- Is_External_State (synthesized)
-- Applies to all entities, true for abstract states that are subject to
-- option External or Synchronous.
-- Is_Finalized_Transient (Flag252)
-- Defined in constants, loop parameters of generalized iterators, and
-- variables. Set when a transient object has been finalized by one of
-- the transient finalization mechanisms. The flag prevents the double
-- finalization of the object.
-- Is_Finalizer (synthesized)
-- Applies to all entities, true for procedures containing finalization
-- code to process local or library level objects.
-- Is_First_Subtype (Flag70)
-- Defined in all entities. True for first subtypes (RM 3.2.1(6)),
-- i.e. the entity in the type declaration that introduced the type.
-- This may be the base type itself (e.g. for record declarations and
-- enumeration type declarations), or it may be the first subtype of
-- an anonymous base type (e.g. for integer type declarations or
-- constrained array declarations).
-- Is_Fixed_Point_Type (synthesized)
-- Applies to all entities, true for decimal and ordinary fixed
-- point types and subtypes.
-- Is_Floating_Point_Type (synthesized)
-- Applies to all entities, true for float types and subtypes
-- Is_Formal (synthesized)
-- Applies to all entities, true for IN, IN OUT and OUT parameters
-- Is_Formal_Object (synthesized)
-- Applies to all entities, true for generic IN and IN OUT parameters
-- Is_Formal_Subprogram (Flag111)
-- Defined in all entities. Set for generic formal subprograms.
-- Is_Frozen (Flag4)
-- Defined in all type and subtype entities. Set if type or subtype has
-- been frozen.
-- Is_Generic_Actual_Subprogram (Flag274)
-- Defined on functions and procedures. Set on the entity of the renaming
-- declaration created within an instance for an actual subprogram.
-- Used to generate constraint checks on calls to these subprograms, even
-- within an instance of a predefined run-time unit, in which checks
-- are otherwise suppressed.
--
-- The flag is also set on the entity of the expression function created
-- within an instance, for a function that has external axiomatization,
-- for use in GNATprove mode.
-- Is_Generic_Actual_Type (Flag94)
-- Defined in all type and subtype entities. Set in the subtype
-- declaration that renames the generic formal as a subtype of the
-- actual. Guarantees that the subtype is not static within the instance.
-- Also used during analysis of an instance, to simplify resolution of
-- accidental overloading that occurs when different formal types get the
-- same actual.
-- Is_Generic_Instance (Flag130)
-- Defined in all entities. Set to indicate that the entity is an
-- instance of a generic unit, or a formal package (which is an instance
-- of the template).
-- Is_Generic_Subprogram (synthesized)
-- Applies to all entities. Yields True for a generic subprogram
-- (generic function, generic subprogram), False for all other entities.
-- Is_Generic_Type (Flag13)
-- Defined in all entities. Set for types which are generic formal types.
-- Such types have an Ekind that corresponds to their classification, so
-- the Ekind cannot be used to identify generic formal types.
-- Is_Generic_Unit (synthesized)
-- Applies to all entities. Yields True for a generic unit (generic
-- package, generic function, generic procedure), and False for all
-- other entities.
-- Is_Ghost_Entity (synthesized)
-- Applies to all entities. Yields True for abstract states, [generic]
-- packages, [generic] subprograms, components, discriminants, formal
-- parameters, objects, package bodies, subprogram bodies, and [sub]types
-- subject to pragma Ghost or those that inherit the Ghost property from
-- an enclosing construct.
-- Is_Hidden (Flag57)
-- Defined in all entities. Set for all entities declared in the
-- private part or body of a package. Also marks generic formals of a
-- formal package declared without a box. For library level entities,
-- this flag is set if the entity is not publicly visible. This flag
-- is reset when compiling the body of the package where the entity
-- is declared, when compiling the private part or body of a public
-- child unit, and when compiling a private child unit (see Install_
-- Private_Declaration in sem_ch7).
-- Is_Hidden_Non_Overridden_Subpgm (Flag2)
-- Defined in all entities. Set for implicitly declared subprograms
-- that require overriding or are null procedures, and are hidden by
-- a non-fully conformant homograph with the same characteristics
-- (Ada RM 8.3 12.3/2).
-- Is_Hidden_Open_Scope (Flag171)
-- Defined in all entities. Set for a scope that contains the
-- instantiation of a child unit, and whose entities are not visible
-- during analysis of the instance.
-- Is_Ignored_Ghost_Entity (Flag278)
-- Applies to all entities. Set for abstract states, [generic] packages,
-- [generic] subprograms, components, discriminants, formal parameters,
-- objects, package bodies, subprogram bodies, and [sub]types subject to
-- pragma Ghost or inherit "ghostness" from an enclosing construct, and
-- subject to Assertion_Policy Ghost => Ignore.
-- Is_Ignored_Transient (Flag295)
-- Defined in constants, loop parameters of generalized iterators, and
-- variables. Set when a transient object must be processed by one of
-- the transient finalization mechanisms. Once marked, a transient is
-- intentionally ignored by the general finalization mechanism because
-- its clean up actions are context specific.
-- Is_Immediately_Visible (Flag7)
-- Defined in all entities. Set if entity is immediately visible, i.e.
-- is defined in some currently open scope (RM 8.3(4)).
-- Is_Implementation_Defined (Flag254)
-- Defined in all entities. Set if a pragma Implementation_Defined is
-- applied to the pragma. Used to mark all implementation defined
-- identifiers in standard library packages, and to implement the
-- restriction No_Implementation_Identifiers.
-- Is_Imported (Flag24)
-- Defined in all entities. Set if the entity is imported. For now we
-- only allow the import of exceptions, functions, procedures, packages,
-- constants, and variables. Exceptions, packages, and types can only be
-- imported in the Java VM implementation, which is retired.
-- Is_Incomplete_Or_Private_Type (synthesized)
-- Applies to all entities, true for private and incomplete types
-- Is_Incomplete_Type (synthesized)
-- Applies to all entities, true for incomplete types and subtypes
-- Is_Independent (Flag268)
-- Defined in all types and objects. Set if a valid pragma or aspect
-- Independent applies to the entity, or for a component if a valid
-- pragma or aspect Independent_Components applies to the enclosing
-- record type. Also set if a pragma Shared or pragma Atomic applies to
-- the entity, or if the declaration of the entity carries the Aliased
-- keyword. For Ada 2012, also applies to formal parameters. In the
-- case of private and incomplete types, this flag is set in both the
-- partial view and the full view.
-- Is_Initial_Condition_Procedure (Flag302)
-- Defined in functions and procedures. Set for a generated procedure
-- which verifies the assumption of pragma Initial_Condition at run time.
-- Is_Inlined (Flag11)
-- Defined in all entities. Set for functions and procedures which are
-- to be inlined. For subprograms created during expansion, this flag
-- may be set directly by the expander to request inlining. Also set
-- for packages that contain inlined subprograms, whose bodies must be
-- be compiled. Is_Inlined is also set on generic subprograms and is
-- inherited by their instances. It is also set on the body entities
-- of inlined subprograms. See also Has_Pragma_Inline.
-- Is_Inlined_Always (Flag1)
-- Defined in subprograms. Set for functions and procedures which are
-- always inlined in GNATprove mode. GNATprove uses this flag to know
-- when a body does not need to be analyzed. The value of this flag is
-- only meaningful if Body_To_Inline is not Empty for the subprogram.
-- Is_Instantiated (Flag126)
-- Defined in generic packages and generic subprograms. Set if the unit
-- is instantiated from somewhere in the extended main source unit. This
-- flag is used to control warnings about the unit being uninstantiated.
-- Also set in a package that is used as an actual for a generic package
-- formal in an instantiation. Also set on a parent instance, in the
-- instantiation of a child, which is implicitly declared in the parent.
-- Is_Integer_Type (synthesized)
-- Applies to all entities, true for integer types and subtypes
-- Is_Interface (Flag186)
-- Defined in record types and subtypes. Set to indicate that the current
-- entity corresponds to an abstract interface. Because abstract
-- interfaces are conceptually a special kind of abstract tagged type
-- we represent them by means of tagged record types and subtypes
-- marked with this attribute. This allows us to reuse most of the
-- compiler support for abstract tagged types to implement interfaces
-- (Ada 2005: AI-251).
-- Is_Internal (Flag17)
-- Defined in all entities. Set to indicate an entity created during
-- semantic processing (e.g. an implicit type, or a temporary). The
-- current uses of this flag are:
--
-- 1) Internal entities (such as temporaries generated for the result
-- of an inlined function call or dummy variables generated for the
-- debugger). Set to indicate that they need not be initialized, even
-- when scalars are initialized or normalized.
--
-- 2) Predefined primitives of tagged types. Set to mark that they
-- have specific properties: first they are primitives even if they
-- are not defined in the type scope (the freezing point is not
-- necessarily in the same scope), and second the predefined equality
-- can be overridden by a user-defined equality, no body will be
-- generated in this case.
--
-- 3) Object declarations generated by the expander that are implicitly
-- imported or exported so that they can be marked in Sprint output.
--
-- 4) Internal entities in the list of primitives of tagged types that
-- are used to handle secondary dispatch tables. These entities have
-- also the attribute Interface_Alias.
-- Is_Interrupt_Handler (Flag89)
-- Defined in procedures. Set if a pragma Interrupt_Handler applies
-- to the procedure. The procedure must be parameterless, and on all
-- targets except AAMP it must be a protected procedure.
-- Is_Intrinsic_Subprogram (Flag64)
-- Defined in functions and procedures. It is set if a valid pragma
-- Interface or Import is present for this subprogram specifying
-- convention Intrinsic. Valid means that the name and profile of the
-- subprogram match the requirements of one of the recognized intrinsic
-- subprograms (see package Sem_Intr for details). Note: the value of
-- Convention for such an entity will be set to Convention_Intrinsic,
-- but it is the setting of Is_Intrinsic_Subprogram, NOT simply having
-- convention set to intrinsic, which causes intrinsic code to be
-- generated.
-- Is_Invariant_Procedure (Flag257)
-- Defined in functions and procedures. Set for a generated invariant
-- procedure which verifies the invariants of both the partial and full
-- views of a private type or private extension as well as any inherited
-- class-wide invariants from parent types or interfaces.
-- Is_Itype (Flag91)
-- Defined in all entities. Set to indicate that a type is an Itype,
-- which means that the declaration for the type does not appear
-- explicitly in the tree. Instead the backend will elaborate the type
-- when it is first used. Has_Delayed_Freeze can be set for Itypes, and
-- the meaning is that the first use (the one which causes the type to be
-- defined) will be the freeze node. Note that an important restriction
-- on Itypes is that the first use of such a type (the one that causes it
-- to be defined) must be in the same scope as the type.
-- Is_Known_Non_Null (Flag37)
-- Defined in all entities. Relevant (and can be set) only for
-- objects of an access type. It is set if the object is currently
-- known to have a non-null value (meaning that no access checks
-- are needed). The indication can for example come from assignment
-- of an access parameter or an allocator whose value is known non-null.
--
-- Note: this flag is set according to the sequential flow of the
-- program, watching the current value of the variable. However, this
-- processing can miss cases of changing the value of an aliased or
-- constant object, so even if this flag is set, it should not be
-- believed if the variable is aliased or volatile. It would be a
-- little neater to avoid the flag being set in the first place in
-- such cases, but that's trickier, and there is only one place that
-- tests the value anyway.
--
-- The flag is dynamically set and reset as semantic analysis and
-- expansion proceeds. Its value is meaningless once the tree is
-- fully constructed, since it simply indicates the last state.
-- Thus this flag has no meaning to the backend.
-- Is_Known_Null (Flag204)
-- Defined in all entities. Relevant (and can be set ) only for
-- objects of an access type. It is set if the object is currently known
-- to have a null value (meaning that a dereference will surely raise
-- constraint error exception). The indication can come from an
-- assignment or object declaration.
--
-- The comments above about sequential flow and aliased and volatile for
-- the Is_Known_Non_Null flag apply equally to the Is_Known_Null flag.
-- Is_Known_Valid (Flag170)
-- Defined in all entities. Relevant for types (and subtype) and
-- for objects (and enumeration literals) of a discrete type.
--
-- The purpose of this flag is to implement the requirement stated
-- in (RM 13.9.1(9-11)) which require that the use of possibly invalid
-- values may not cause programs to become erroneous. See the function
-- Checks.Expr_Known_Valid for further details. Note that the setting
-- is conservative, in the sense that if the flag is set, it must be
-- right. If the flag is not set, nothing is known about the validity.
--
-- For enumeration literals, the flag is always set, since clearly
-- an enumeration literal represents a valid value. Range checks
-- where necessary will ensure that this valid value is appropriate.
--
-- For objects, the flag indicates the state of knowledge about the
-- current value of the object. This may be modified during expansion,
-- and thus the final value is not relevant to the backend.
--
-- For types and subtypes, the flag is set if all possible bit patterns
-- of length Object_Size (i.e. Esize of the type) represent valid values
-- of the type. In general for such types, all values are valid, the
-- only exception being the case where an object of the type has an
-- explicit size that is greater than Object_Size.
--
-- For non-discrete objects, the setting of the Is_Known_Valid flag is
-- not defined, and is not relevant, since the considerations of the
-- requirement in (RM 13.9.1(9-11)) do not apply.
--
-- The flag is dynamically set and reset as semantic analysis and
-- expansion proceeds. Its value is meaningless once the tree is
-- fully constructed, since it simply indicates the last state.
-- Thus this flag has no meaning to the backend.
-- Is_Limited_Composite (Flag106)
-- Defined in all entities. Set for composite types that have a limited
-- component. Used to enforce the rule that operations on the composite
-- type that depend on the full view of the component do not become
-- visible until the immediate scope of the composite type itself
-- (RM 7.3.1 (5)).
-- Is_Limited_Interface (Flag197)
-- Defined in record types and subtypes. True for interface types, if
-- interface is declared limited, task, protected, or synchronized, or
-- is derived from a limited interface.
-- Is_Limited_Record (Flag25)
-- Defined in all entities. Set to true for record (sub)types if the
-- record is declared to be limited. Note that this flag is not set
-- simply because some components of the record are limited.
-- Is_Local_Anonymous_Access (Flag194)
-- Defined in access types. Set for an anonymous access type to indicate
-- that the type is created for a record component with an access
-- definition, an array component, or (pre-Ada 2012) a standalone object.
-- Such anonymous types have an accessibility level equal to that of the
-- declaration in which they appear, unlike the anonymous access types
-- that are created for access parameters, access discriminants, and
-- (as of Ada 2012) stand-alone objects.
-- Is_Loop_Parameter (Flag307)
-- Applies to all entities. Certain loops, in particular "for ... of"
-- loops, get transformed so that the loop parameter is declared by a
-- variable declaration, so the entity is an E_Variable. This is True for
-- such E_Variables; False otherwise.
-- Is_Machine_Code_Subprogram (Flag137)
-- Defined in subprogram entities. Set to indicate that the subprogram
-- is a machine code subprogram (i.e. its body includes at least one
-- code statement). Also indicates that all necessary semantic checks
-- as required by RM 13.8(3) have been performed.
-- Is_Modular_Integer_Type (synthesized)
-- Applies to all entities. True if entity is a modular integer type
-- Is_Non_Static_Subtype (Flag109)
-- Defined in all type and subtype entities. It is set in some (but not
-- all) cases in which a subtype is known to be non-static. Before this
-- flag was added, the computation of whether a subtype was static was
-- entirely synthesized, by looking at the bounds, and the immediate
-- subtype parent. However, this method does not work for some Itypes
-- that have no parent set (and the only way to find the immediate
-- subtype parent is to go through the tree). For now, this flag is set
-- conservatively, i.e. if it is set then for sure the subtype is non-
-- static, but if it is not set, then the type may or may not be static.
-- Thus the test for a static subtype is that this flag is clear AND that
-- the bounds are static AND that the parent subtype (if available to be
-- tested) is static. Eventually we should make sure this flag is always
-- set right, at which point, these comments can be removed, and the
-- tests for static subtypes greatly simplified.
-- Is_Null_Init_Proc (Flag178)
-- Defined in procedure entities. Set for generated init proc procedures
-- (used to initialize composite types), if the code for the procedure
-- is null (i.e. is a return and nothing else). Such null initialization
-- procedures are generated in case some client is compiled using the
-- Initialize_Scalars pragma, generating a call to this null procedure,
-- but there is no need to call such procedures within a compilation
-- unit, and this flag is used to suppress such calls.
-- Is_Null_State (synthesized)
-- Applies to all entities, true for an abstract state declared with
-- keyword null.
-- Is_Numeric_Type (synthesized)
-- Applies to all entities, true for all numeric types and subtypes
-- (integer, fixed, float).
-- Is_Object (synthesized)
-- Applies to all entities, true for entities representing objects,
-- including generic formal parameters.
-- Is_Obsolescent (Flag153)
-- Defined in all entities. Set for any entity to which a valid pragma
-- or aspect Obsolescent applies.
-- Is_Only_Out_Parameter (Flag226)
-- Defined in formal parameter entities. Set if this parameter is the
-- only OUT parameter for this formal part. If there is more than one
-- out parameter, or if there is some other IN OUT parameter then this
-- flag is not set in any of them. Used in generation of warnings.
-- Is_Ordinary_Fixed_Point_Type (synthesized)
-- Applies to all entities, true for ordinary fixed point types and
-- subtypes.
-- Is_Package_Body_Entity (Flag160)
-- Defined in all entities. Set for entities defined at the top level
-- of a package body. Used to control externally generated names.
-- Is_Package_Or_Generic_Package (synthesized)
-- Applies to all entities. True for packages and generic packages.
-- False for all other entities.
-- Is_Packed (Flag51) [implementation base type only]
-- Defined in all type entities. This flag is set only for record and
-- array types which have a packed representation. There are four cases
-- which cause packing:
--
-- 1. Explicit use of pragma Pack to pack a record.
-- 2. Explicit use of pragma Pack to pack an array.
-- 3. Setting Component_Size of an array to a packable value.
-- 4. Indexing an array with a non-standard enumeration type.
--
-- For records, Is_Packed is always set if Has_Pragma_Pack is set, and
-- can also be set on its own in a derived type which inherited its
-- packed status.
--
-- For arrays, Is_Packed is set if either Has_Pragma_Pack is set and the
-- component size is either not known at compile time or known but not
-- 8/16/32/64 bits, or a Component_Size clause exists and the specified
-- value is smaller than 64 bits but not 8/16/32, or if the array has one
-- or more index types that are enumeration types with a non-standard
-- representation (in GNAT, we store such arrays compactly, using the Pos
-- of the enumeration type value). As for the case of records, Is_Packed
-- can be set on its own for a derived type.
-- Before an array type is frozen, Is_Packed will always be set if
-- Has_Pragma_Pack is set. Before the freeze point, it is not possible
-- to know the component size, since the component type is not frozen
-- until the array type is frozen. Thus Is_Packed for an array type
-- before it is frozen means that packed is required. Then if it turns
-- out that the component size doesn't require packing, the Is_Packed
-- flag gets turned off.
-- In the bit-packed array case (i.e. the component size is known by the
-- front end and is in the range 1-63 but not a multiple of 8), then the
-- Is_Bit_Packed_Array flag will be set once the array type is frozen.
--
-- Is_Packed_Array (synth)
-- Applies to all entities, true if entity is for a packed array.
-- Is_Packed_Array_Impl_Type (Flag138)
-- Defined in all entities. This flag is set on the entity for the type
-- used to implement a packed array (either a modular type or a subtype
-- of Packed_Bytes{1,2,4} in the bit-packed array case, a regular array
-- in the non-standard enumeration index case). It is set if and only
-- if the type appears in the Packed_Array_Impl_Type field of some other
-- entity. It is used by the back end to activate the special processing
-- for such types (unchecked conversions that would not otherwise be
-- allowed are allowed for such types). If Is_Packed_Array_Impl_Type is
-- set in an entity, then the Original_Array_Type field of this entity
-- points to the array type for which this is the Packed_Array_Impl_Type.
-- Is_Param_Block_Component_Type (Flag215) [base type only]
-- Defined in access types. Set to indicate that a type is the type of a
-- component of the parameter block record type generated by the compiler
-- for an entry or a select statement. Read by CodePeer.
-- Is_Partial_Invariant_Procedure (Flag292)
-- Defined in functions and procedures. Set for a generated invariant
-- procedure which verifies the invariants of the partial view of a
-- private type or private extension.
-- Is_Potentially_Use_Visible (Flag9)
-- Defined in all entities. Set if entity is potentially use visible,
-- i.e. it is defined in a package that appears in a currently active
-- use clause (RM 8.4(8)). Note that potentially use visible entities
-- are not necessarily use visible (RM 8.4(9-11)).
-- Is_Predicate_Function (Flag255)
-- Present in functions and procedures. Set for generated predicate
-- functions.
-- Is_Predicate_Function_M (Flag256)
-- Present in functions and procedures. Set for special version of
-- predicate function generated for use in membership tests, where
-- raise expressions are transformed to return False.
-- Is_Preelaborated (Flag59)
-- Defined in all entities, set in E_Package and E_Generic_Package
-- entities to which a pragma Preelaborate is applied, and also in
-- all entities within such packages. Note that the fact that this
-- flag is set does not necesarily mean that no elaboration code is
-- generated for the package.
-- Is_Primitive (Flag218)
-- Defined in overloadable entities and in generic subprograms. Set to
-- indicate that this is a primitive operation of some type, which may
-- be a tagged type or an untagged type. Used to verify overriding
-- indicators in bodies.
-- Is_Primitive_Wrapper (Flag195)
-- Defined in functions and procedures created by the expander to serve
-- as an indirection mechanism to overriding primitives of concurrent
-- types, entries and protected procedures.
-- Is_Prival (synthesized)
-- Applies to all entities, true for renamings of private protected
-- components. Such entities appear as constants or variables.
-- Is_Private_Composite (Flag107)
-- Defined in composite types that have a private component. Used to
-- enforce the rule that operations on the composite type that depend
-- on the full view of the component, do not become visible until the
-- immediate scope of the composite type itself (7.3.1 (5)). Both this
-- flag and Is_Limited_Composite are needed.
-- Is_Private_Descendant (Flag53)
-- Defined in entities that can represent library units (packages,
-- functions, procedures). Set if the library unit is itself a private
-- child unit, or if it is the descendant of a private child unit.
-- Is_Private_Primitive (Flag245)
-- Defined in subprograms. Set if the operation is a primitive of a
-- tagged type (procedure or function dispatching on result) whose
-- full view has not been seen. Used in particular for primitive
-- subprograms of a synchronized type declared between the two views
-- of the type, so that the wrapper built for such a subprogram can
-- be given the proper signature.
-- Is_Private_Type (synthesized)
-- Applies to all entities, true for private types and subtypes,
-- as well as for record with private types as subtypes.
-- Is_Protected_Component (synthesized)
-- Applicable to all entities, true if the entity denotes a private
-- component of a protected type.
-- Is_Protected_Interface (synthesized)
-- Defined in types that are interfaces. True if interface is declared
-- protected, or is derived from protected interfaces.
-- Is_Protected_Record_Type (synthesized)
-- Applies to all entities, true if Is_Concurrent_Record_Type is true and
-- Corresponding_Concurrent_Type is a protected type.
-- Is_Protected_Type (synthesized)
-- Applies to all entities, true for protected types and subtypes
-- Is_Public (Flag10)
-- Defined in all entities. Set to indicate that an entity defined in
-- one compilation unit can be referenced from other compilation units.
-- If this reference causes a reference in the generated code, for
-- example in the case of a variable name, then the backend will generate
-- an appropriate external name for use by the linker.
-- Is_Pure (Flag44)
-- Defined in all entities. Set in all entities of a unit to which a
-- pragma Pure is applied except for non-intrinsic imported subprograms,
-- and also set for the entity of the unit itself. In addition, this
-- flag may be set for any other functions or procedures that are known
-- to be side effect free, so in the case of subprograms, the Is_Pure
-- flag may be used by the optimizer to imply that it can assume freedom
-- from side effects (other than those resulting from assignment to Out
-- or In Out parameters, or to objects designated by access parameters).
-- Is_Pure_Unit_Access_Type (Flag189)
-- Defined in access type and subtype entities. Set if the type or
-- subtype appears in a pure unit. Used to give an error message at
-- freeze time if the access type has a storage pool.
-- Is_RACW_Stub_Type (Flag244)
-- Defined in all types, true for the stub types generated for remote
-- access-to-class-wide types.
-- Is_Raised (Flag224)
-- Defined in exception entities. Set if the entity is referenced by a
-- a raise statement.
-- Is_Real_Type (synthesized)
-- Applies to all entities, true for real types and subtypes
-- Is_Record_Type (synthesized)
-- Applies to all entities, true for record types and subtypes,
-- includes class-wide types and subtypes (which are also records).
-- Is_Relaxed_Initialization_State (synthesized)
-- Applies to all entities, true for abstract states that are subject to
-- option Relaxed_Initialization.
-- Is_Remote_Call_Interface (Flag62)
-- Defined in all entities. Set in E_Package and E_Generic_Package
-- entities to which a pragma Remote_Call_Interface is applied, and
-- also on entities declared in the visible part of such a package.
-- Is_Remote_Types (Flag61)
-- Defined in all entities. Set in E_Package and E_Generic_Package
-- entities to which a pragma Remote_Types is applied, and also on
-- entities declared in the visible part of the spec of such a package.
-- Also set for types which are generic formal types to which the
-- pragma Remote_Access_Type applies.
-- Is_Renaming_Of_Object (Flag112)
-- Defined in all entities, set only for a variable or constant for
-- which the Renamed_Object field is non-empty and for which the
-- renaming is handled by the front end, by macro substitution of
-- a copy of the (evaluated) name tree whereever the variable is used.
-- Is_Return_Object (Flag209)
-- Defined in all object entities. True if the object is the return
-- object of an extended_return_statement; False otherwise.
-- Is_Safe_To_Reevaluate (Flag249)
-- Defined in all entities. Set in variables that are initialized by
-- means of an assignment statement. When initialized their contents
-- never change and hence they can be seen by the backend as constants.
-- See also Is_True_Constant.
-- Is_Scalar_Type (synthesized)
-- Applies to all entities, true for scalar types and subtypes
-- Is_Shared_Passive (Flag60)
-- Defined in all entities. Set in E_Package and E_Generic_Package
-- entities to which a pragma Shared_Passive is applied, and also in
-- all entities within such packages.
-- Is_Standard_Character_Type (synthesized)
-- Applies to all entities, true for types and subtypes whose root type
-- is one of the standard character types (Character, Wide_Character, or
-- Wide_Wide_Character).
-- Is_Standard_String_Type (synthesized)
-- Applies to all entities, true for types and subtypes whose root
-- type is one of the standard string types (String, Wide_String, or
-- Wide_Wide_String).
-- Is_Static_Type (Flag281)
-- Defined in entities. Only set for (sub)types. If set, indicates that
-- the type is known to be a static type (defined as a discrete type with
-- static bounds, a record all of whose component types are static types,
-- or an array, all of whose bounds are of a static type, and also have
-- a component type that is a static type). See Set_Uplevel_Type for more
-- information on how this flag is used.
-- Is_Statically_Allocated (Flag28)
-- Defined in all entities. This can only be set for exception,
-- variable, constant, and type/subtype entities. If the flag is set,
-- then the variable or constant must be allocated statically rather
-- than on the local stack frame. For exceptions, the meaning is that
-- the exception data should be allocated statically (and indeed this
-- flag is always set for exceptions, since exceptions do not have
-- local scope). For a type, the meaning is that the type must be
-- elaborated at the global level rather than locally. No type marked
-- with this flag may depend on a local variable, or on any other type
-- which does not also have this flag set to True. For a variable or
-- or constant, if the flag is set, then the type of the object must
-- either be declared at the library level, or it must also have the
-- flag set (since to allocate the object statically, its type must
-- also be elaborated globally).
-- Is_String_Type (synthesized)
-- Applies to all type entities. Determines if the given type is a
-- string type, i.e. it is directly a string type or string subtype,
-- or a string slice type, or an array type with one dimension and a
-- component type that is a character type.
-- Is_Subprogram (synthesized)
-- Applies to all entities, true for function, procedure and operator
-- entities.
-- Is_Subprogram_Or_Generic_Subprogram
-- Applies to all entities, true for function procedure and operator
-- entities, and also for the corresponding generic entities.
-- Is_Synchronized_Interface (synthesized)
-- Defined in types that are interfaces. True if interface is declared
-- synchronized, task, or protected, or is derived from a synchronized
-- interface.
-- Is_Synchronized_State (synthesized)
-- Applies to all entities, true for abstract states that are subject to
-- option Synchronous.
-- Is_Tag (Flag78)
-- Defined in E_Component and E_Constant entities. For regular tagged
-- type this flag is set on the tag component (whose name is Name_uTag).
-- For CPP_Class tagged types, this flag marks the pointer to the main
-- vtable (i.e. the one to be extended by derivation).
-- Is_Tagged_Type (Flag55)
-- Defined in all entities, set for an entity that is a tagged type
-- Is_Task_Interface (synthesized)
-- Defined in types that are interfaces. True if interface is declared as
-- a task interface, or if it is derived from task interfaces.
-- Is_Task_Record_Type (synthesized)
-- Applies to all entities, true if Is_Concurrent_Record_Type is true and
-- Corresponding_Concurrent_Type is a task type.
-- Is_Task_Type (synthesized)
-- Applies to all entities. True for task types and subtypes
-- Is_Thunk (Flag225)
-- Defined in all entities. True for subprograms that are thunks: that is
-- small subprograms built by the expander for tagged types that cover
-- interface types. As part of the runtime call to an interface, thunks
-- displace the pointer to the object (pointer named "this" in the C++
-- terminology) from a secondary dispatch table to the primary dispatch
-- table associated with a given tagged type; if the thunk is a function
-- that returns an object which covers an interface type then the thunk
-- displaces the pointer to the object from the primary dispatch table to
-- the secondary dispatch table associated with the interface type. Set
-- by Expand_Interface_Thunk and used by Expand_Call to handle extra
-- actuals associated with accessibility level.
-- Is_Trivial_Subprogram (Flag235)
-- Defined in all entities. Set in subprograms where either the body
-- consists of a single null statement, or the first or only statement
-- of the body raises an exception. This is used for suppressing certain
-- warnings, see Sem_Ch6.Analyze_Subprogram_Body discussion for details.
-- Is_True_Constant (Flag163)
-- Defined in all entities for constants and variables. Set in constants
-- and variables which have an initial value specified but which are
-- never assigned, partially or in the whole. For variables, it means
-- that the variable was initialized but never modified, and hence can be
-- treated as a constant by the code generator. For a constant, it means
-- that the constant was not modified by generated code (e.g. to set a
-- discriminant in an init proc). Assignments by user or generated code
-- will reset this flag. See also Is_Safe_To_Reevaluate.
-- Is_Type (synthesized)
-- Applies to all entities, true for a type entity
-- Is_Unchecked_Union (Flag117) [implementation base type only]
-- Defined in all entities. Set only in record types to which the
-- pragma Unchecked_Union has been validly applied.
-- Is_Underlying_Full_View (Flag298)
-- Defined in all entities. Set for types which represent the true full
-- view of a private type completed by another private type. For further
-- details, see attribute Underlying_Full_View.
-- Is_Underlying_Record_View (Flag246) [base type only]
-- Defined in all entities. Set only in record types that represent the
-- underlying record view. This view is built for derivations of types
-- with unknown discriminants; it is a record with the same structure
-- as its corresponding record type, but whose parent is the full view
-- of the parent in the original type extension.
-- Is_Unimplemented (Flag284)
-- Defined in all entities. Set for any entity to which a valid pragma
-- or aspect Unimplemented applies.
-- Is_Unsigned_Type (Flag144)
-- Defined in all types, but can be set only for discrete and fixed-point
-- type and subtype entities. This flag is only valid if the entity is
-- frozen. If set it indicates that the representation is known to be
-- unsigned (i.e. that no negative values appear in the range). This is
-- normally just a reflection of the lower bound of the subtype or base
-- type, but there is one case in which the setting is not obvious,
-- namely the case of an unsigned subtype of a signed type from which
-- a further subtype is obtained using variable bounds. This further
-- subtype is still unsigned, but this cannot be determined by looking
-- at its bounds or the bounds of the corresponding base type.
-- For a subtype indication whose range is statically a null range,
-- the flag is set if the lower bound is non-negative, but the flag
-- cannot be used to determine the comparison operator to emit in the
-- generated code: use the base type.
-- Is_Uplevel_Referenced_Entity (Flag283)
-- Defined in all entities. Used when unnesting subprograms to indicate
-- that an entity is locally defined within a subprogram P, and there is
-- a reference to the entity within a subprogram nested within P (at any
-- depth). Set for uplevel referenced objects (variables, constants,
-- discriminants and loop parameters), and also for upreferenced dynamic
-- types, including the cases where the reference is implicit (e.g. the
-- type of an array used for computing the location of an element in an
-- array. This is used internally in Exp_Unst, see this package for
-- further details.
-- Is_Valued_Procedure (Flag127)
-- Defined in procedure entities. Set if an Import_Valued_Procedure
-- or Export_Valued_Procedure pragma applies to the procedure entity.
-- Is_Visible_Formal (Flag206)
-- Defined in all entities. Set for instances of the formals of a
-- formal package. Indicates that the entity must be made visible in the
-- body of the instance, to reproduce the visibility of the generic.
-- This simplifies visibility settings in instance bodies.
-- Is_Visible_Lib_Unit (Flag116)
-- Defined in all (root or child) library unit entities. Once compiled,
-- library units remain chained to the entities in the parent scope, and
-- a separate flag must be used to indicate whether the names are visible
-- by selected notation, or not.
-- Is_Volatile (Flag16)
-- Defined in all type entities, and also in constants, components and
-- variables. Set if a pragma Volatile applies to the entity. Also set
-- if pragma Shared or pragma Atomic applies to entity. In the case of
-- private or incomplete types, this flag is set in both the private
-- and full view. The flag is not set reliably on private subtypes,
-- and is always retrieved from the base type (but this is not a base-
-- type-only attribute because it applies to other entities). Note that
-- the backend should use Treat_As_Volatile, rather than Is_Volatile
-- to indicate code generation requirements for volatile variables.
-- Similarly, any front end test which is concerned with suppressing
-- optimizations on volatile objects should test Treat_As_Volatile
-- rather than testing this flag.
-- Is_Volatile_Full_Access (Flag285)
-- Defined in all type entities, and also in constants, components, and
-- variables. Set if a pragma Volatile_Full_Access applies to the entity.
-- In the case of private and incomplete types, this flag is set in
-- both the partial view and the full view.
-- Is_Wrapper_Package (synthesized)
-- Defined in package entities. Indicates that the package has been
-- created as a wrapper for a subprogram instantiation.
-- Itype_Printed (Flag202)
-- Defined in all type and subtype entities. Set in Itypes if the Itype
-- has been printed by Sprint. This is used to avoid printing an Itype
-- more than once.
-- Kill_Elaboration_Checks (Flag32)
-- Defined in all entities. Set by the expander to kill elaboration
-- checks which are known not to be needed. Equivalent in effect to
-- the use of pragma Suppress (Elaboration_Checks) for that entity
-- except that the effect is permanent and cannot be undone by a
-- subsequent pragma Unsuppress.
-- Kill_Range_Checks (Flag33)
-- Defined in all entities. Equivalent in effect to the use of pragma
-- Suppress (Range_Checks) for that entity except that the result is
-- permanent and cannot be undone by a subsequent pragma Unsuppress.
-- This is currently only used in one odd situation in Sem_Ch3 for
-- record types, and it would be good to get rid of it???
-- Known_To_Have_Preelab_Init (Flag207)
-- Defined in all type and subtype entities. If set, then the type is
-- known to have preelaborable initialization. In the case of a partial
-- view of a private type, it is only possible for this to be set if a
-- pragma Preelaborable_Initialization is given for the type. For other
-- types, it is never set if the type does not have preelaborable
-- initialization, it may or may not be set if the type does have
-- preelaborable initialization.
-- Last_Aggregate_Assignment (Node30)
-- Applies to controlled constants and variables initialized by an
-- aggregate. Points to the last statement associated with the expansion
-- of the aggregate. The attribute is used by the finalization machinery
-- when marking an object as successfully initialized.
-- Last_Assignment (Node26)
-- Defined in entities for variables, and OUT or IN OUT formals. Set for
-- a local variable or formal to point to the left side of an assignment
-- statement assigning a value to the variable. Cleared if the value of
-- the entity is referenced. Used to warn about dubious assignment
-- statements whose value is not used.
-- Last_Entity (Node20)
-- Defined in all entities which act as scopes to which a list of
-- associated entities is attached (blocks, class subtypes and types,
-- entries, functions, loops, packages, procedures, protected objects,
-- record types and subtypes, private types, task types and subtypes).
-- Points to the last entry in the list of associated entities chained
-- through the Next_Entity field. Empty if no entities are chained.
-- Last_Formal (synthesized)
-- Applies to subprograms and subprogram types, and also in entries
-- and entry families. Returns last formal of the subprogram or entry.
-- The formals are the first entities declared in a subprogram or in
-- a subprogram type (the designated type of an Access_To_Subprogram
-- definition) or in an entry.
-- Limited_View (Node23)
-- Defined in non-generic package entities that are not instances. Bona
-- fide package with the limited-view list through the first_entity and
-- first_private attributes. The elements of this list are the shadow
-- entities created for the types and local packages that are declared
-- in a package appearing in a limited_with clause (Ada 2005: AI-50217).
-- Linker_Section_Pragma (Node33)
-- Present in constant, variable, type and subprogram entities. Points
-- to a linker section pragma that applies to the entity, or is Empty if
-- no such pragma applies. Note that for constants and variables, this
-- field may be set as a result of a linker section pragma applied to the
-- type of the object.
-- Lit_Indexes (Node18)
-- Defined in enumeration types and subtypes. Non-empty only for the
-- case of an enumeration root type, where it contains the entity for
-- the generated indexes entity. See unit Exp_Imgv for full details of
-- the nature and use of this entity for implementing the Image and
-- Value attributes for the enumeration type in question.
-- Lit_Strings (Node16)
-- Defined in enumeration types and subtypes. Non-empty only for the
-- case of an enumeration root type, where it contains the entity for
-- the literals string entity. See unit Exp_Imgv for full details of
-- the nature and use of this entity for implementing the Image and
-- Value attributes for the enumeration type in question.
-- Low_Bound_Tested (Flag205)
-- Defined in all entities. Currently this can only be set for formal
-- parameter entries of a standard unconstrained one-dimensional array
-- or string type. Indicates that an explicit test of the low bound of
-- the formal appeared in the code, e.g. in a pragma Assert. If this
-- flag is set, warnings about assuming the index low bound to be one
-- are suppressed.
-- Machine_Radix_10 (Flag84)
-- Defined in decimal types and subtypes, set if the Machine_Radix is 10,
-- as the result of the specification of a machine radix representation
-- clause. Note that it is possible for this flag to be set without
-- having Has_Machine_Radix_Clause True. This happens when a type is
-- derived from a type with a clause present.
-- Master_Id (Node17)
-- Defined in access types and subtypes. Empty unless Has_Task is set for
-- the designated type, in which case it points to the entity for the
-- Master_Id for the access type master. Also set for access-to-limited-
-- class-wide types whose root may be extended with task components, and
-- for access-to-limited-interfaces because they can be used to reference
-- tasks implementing such interface.
-- Materialize_Entity (Flag168)
-- Defined in all entities. Set only for renamed obects which should be
-- materialized for debugging purposes. This means that a memory location
-- containing the renamed address should be allocated. This is needed so
-- that the debugger can find the entity.
-- May_Inherit_Delayed_Rep_Aspects (Flag262)
-- Defined in all entities for types and subtypes. Set if the type is
-- derived from a type which has delayed rep aspects (marked by the flag
-- Has_Delayed_Rep_Aspects being set). In this case, at the freeze point
-- for the derived type we know that the parent type is frozen, and if
-- a given attribute has not been set for the derived type, we copy the
-- value from the parent type. See Freeze.Inherit_Delayed_Rep_Aspects.
-- Mechanism (Uint8) (returned as Mechanism_Type)
-- Defined in functions and non-generic formal parameters. Indicates
-- the mechanism to be used for the function return or for the formal
-- parameter. See full description in the spec of Sem_Mech. This field
-- is also set (to the default value of zero = Default_Mechanism) in a
-- subprogram body entity but not used in this context.
-- Minimum_Accessibility (Node24)
-- Defined in formal parameters in the non-generic case. Normally Empty,
-- but if expansion is active, and a parameter exists for which a
-- dynamic accessibility check is required, then an object is generated
-- within such a subprogram representing the accessibility level of the
-- subprogram or the formal's Extra_Accessibility - whichever one is
-- lesser. The Minimum_Accessibility field then points to this object.
-- Modulus (Uint17) [base type only]
-- Defined in modular types. Contains the modulus. For the binary case,
-- this will be a power of 2, but if Non_Binary_Modulus is set, then it
-- will not be a power of 2.
-- Must_Be_On_Byte_Boundary (Flag183)
-- Defined in entities for types and subtypes. Set if objects of the type
-- must always be allocated on a byte boundary (more accurately a storage
-- unit boundary). The front end checks that component clauses respect
-- this rule, and the backend ensures that record packing does not
-- violate this rule. Currently the flag is set only for packed arrays
-- longer than 64 bits where the component size is not a power of 2.
-- Must_Have_Preelab_Init (Flag208)
-- Defined in entities for types and subtypes. Set in the full type of a
-- private type or subtype if a pragma Has_Preelaborable_Initialization
-- is present for the private type. Used to check that the full type has
-- preelaborable initialization at freeze time (this has to be deferred
-- to the freeze point because of the rule about overriding Initialize).
-- Needs_Activation_Record (Flag306)
-- Defined on generated subprogram types. Indicates that a call through
-- a named or anonymous access to subprogram requires an activation
-- record when compiling with unnesting for C or LLVM.
-- Needs_Debug_Info (Flag147)
-- Defined in all entities. Set if the entity requires normal debugging
-- information to be generated. This is true of all entities that have
-- Comes_From_Source set, and also transitively for entities associated
-- with such components (e.g. their types). It is true for all entities
-- in Debug_Generated_Code mode (-gnatD switch). This is the flag that
-- the backend should check to determine whether or not to generate
-- debugging information for an entity. Note that callers should always
-- use Sem_Util.Set_Debug_Info_Needed, rather than Set_Needs_Debug_Info,
-- so that the flag is set properly on subsidiary entities.
-- Needs_No_Actuals (Flag22)
-- Defined in callable entities (subprograms, entries, access to
-- subprograms) which can be called without actuals because all of
-- their formals (if any) have default values. This flag simplifies the
-- resolution of the syntactic ambiguity involving a call to these
-- entities when the return type is an array type, and a call can be
-- interpreted as an indexing of the result of the call. It is also
-- used to resolve various cases of entry calls.
-- Never_Set_In_Source (Flag115)
-- Defined in all entities, but can be set only for variables and
-- parameters. This flag is set if the object is never assigned a value
-- in user source code, either by assignment or by being used as an out
-- or in out parameter. Note that this flag is not reset from using an
-- initial value, so if you want to test for this case as well, test the
-- Has_Initial_Value flag also.
--
-- This flag is only for the purposes of issuing warnings, it must not
-- be used by the code generator to indicate that the variable is in
-- fact a constant, since some assignments in generated code do not
-- count (for example, the call to an init proc to assign some but
-- not all of the fields in a partially initialized record). The code
-- generator should instead use the flag Is_True_Constant.
--
-- For the purposes of this warning, the default assignment of access
-- variables to null is not considered the assignment of a value (so
-- the warning can be given for code that relies on this initial null
-- value when no other value is ever set).
--
-- In variables and out parameters, if this flag is set after full
-- processing of the corresponding declarative unit, it indicates that
-- the variable or parameter was never set, and a warning message can
-- be issued.
--
-- Note: this flag is initially set, and then cleared on encountering
-- any construct that might conceivably legitimately set the value.
-- Thus during the analysis of a declarative region and its associated
-- statement sequence, the meaning of the flag is "not set yet", and
-- once this analysis is complete the flag means "never assigned".
-- Note: for variables appearing in package declarations, this flag is
-- never set. That is because there is no way to tell if some client
-- modifies the variable (or, in the case of variables in the private
-- part, if some child unit modifies the variables).
-- Note: in the case of renamed objects, the flag must be set in the
-- ultimate renamed object. Clients noting a possible modification
-- should use the Note_Possible_Modification procedure in Sem_Util
-- rather than Set_Never_Set_In_Source precisely to deal properly with
-- the renaming possibility.
-- Next_Component (synthesized)
-- Applies to record components. Returns the next component by following
-- the chain of declared entities until one is found which corresponds to
-- a component (Ekind is E_Component). Any internal types generated from
-- the subtype indications of the record components are skipped. Returns
-- Empty if no more components.
-- Next_Component_Or_Discriminant (synthesized)
-- Similar to Next_Component, but includes components and discriminants
-- so the input can have either E_Component or E_Discriminant, and the
-- same is true for the result. Returns Empty if no more components or
-- discriminants in the record.
-- Next_Discriminant (synthesized)
-- Applies to discriminants returned by First/Next_Discriminant. Returns
-- the next language-defined (i.e. perhaps non-girder) discriminant by
-- following the chain of declared entities as long as the kind of the
-- entity corresponds to a discriminant. Note that the discriminants
-- might be the only components of the record. Returns Empty if there
-- are no more discriminants.
-- Next_Entity (Node2)
-- Defined in all entities. The entities of a scope are chained, with
-- the head of the list being in the First_Entity field of the scope
-- entity. All entities use the Next_Entity field as a forward pointer
-- for this list, with Empty indicating the end of the list. Since this
-- field is in the base part of the entity, the access routines for this
-- field are in Sinfo.
-- Next_Formal (synthesized)
-- Applies to the entity for a formal parameter. Returns the next formal
-- parameter of the subprogram or subprogram type. Returns Empty if there
-- are no more formals.
-- Next_Formal_With_Extras (synthesized)
-- Applies to the entity for a formal parameter. Returns the next
-- formal parameter of the subprogram or subprogram type. Returns
-- Empty if there are no more formals. The list returned includes
-- all the extra formals (see description of Extra_Formal field)
-- Next_Index (synthesized)
-- Applies to array types and subtypes and to string types and
-- subtypes. Yields the next index. The first index is obtained by
-- using the First_Index attribute, and then subsequent indexes are
-- obtained by applying Next_Index to the previous index. Empty is
-- returned to indicate that there are no more indexes. Note that
-- unlike most attributes in this package, Next_Index applies to
-- nodes for the indexes, not to entities.
-- Next_Inlined_Subprogram (Node12)
-- Defined in subprograms. Used to chain inlined subprograms used in
-- the current compilation, in the order in which they must be compiled
-- by the backend to ensure that all inlinings are performed.
-- Next_Literal (synthesized)
-- Applies to enumeration literals, returns the next literal, or
-- Empty if applied to the last literal. This is actually a synonym
-- for Next, but its use is preferred in this context.
-- No_Dynamic_Predicate_On_Actual (Flag276)
-- Defined in discrete types. Set for generic formal types that are used
-- in loops and quantified expressions. The corresponing actual cannot
-- have dynamic predicates.
-- No_Pool_Assigned (Flag131) [root type only]
-- Defined in access types. Set if a storage size clause applies to the
-- variable with a static expression value of zero. This flag is used to
-- generate errors if any attempt is made to allocate or free an instance
-- of such an access type. This is set only in the root type, since
-- derived types must have the same pool.
-- No_Predicate_On_Actual (Flag275)
-- Defined in discrete types. Set for generic formal types that are used
-- in the spec of a generic package, in constructs that forbid discrete
-- types with predicates.
-- No_Reordering (Flag239) [implementation base type only]
-- Defined in record types. Set only for a base type to which a valid
-- pragma No_Component_Reordering applies.
-- No_Return (Flag113)
-- Defined in all entities. Set for subprograms and generic subprograms
-- to which a valid aspect or pragma No_Return applies.
-- No_Strict_Aliasing (Flag136) [base type only]
-- Defined in access types. Set to direct the backend to avoid any
-- optimizations based on an assumption about the aliasing status of
-- objects designated by the access type. For the case of the gcc
-- backend, the effect is as though all references to objects of
-- the type were compiled with -fno-strict-aliasing. This flag is
-- set if an unchecked conversion with the access type as a target
-- type occurs in the same source unit as the declaration of the
-- access type, or if an explicit pragma No_Strict_Aliasing applies.
-- No_Tagged_Streams_Pragma (Node32)
-- Present in all subtype and type entities. Set for tagged types and
-- subtypes (i.e. entities with Is_Tagged_Type set True) if a valid
-- pragma/aspect applies to the type.
-- Non_Binary_Modulus (Flag58) [base type only]
-- Defined in all subtype and type entities. Set for modular integer
-- types if the modulus value is other than a power of 2.
-- Non_Limited_View (Node19)
-- Defined in abstract states and incomplete types that act as shadow
-- entities created when analysing a limited with clause (Ada 2005:
-- AI-50217). Points to the defining entity of the original declaration.
-- Nonzero_Is_True (Flag162) [base type only]
-- Defined in enumeration types. Set if any non-zero value is to be
-- interpreted as true. Currently this is set for derived Boolean
-- types which have a convention of C, C++ or Fortran.
-- Normalized_First_Bit (Uint8)
-- Defined in components and discriminants. Indicates the normalized
-- value of First_Bit for the component, i.e. the offset within the
-- lowest addressed storage unit containing part or all of the field.
-- Set to No_Uint if no first bit position is assigned yet.
-- Normalized_Position (Uint14)
-- Defined in components and discriminants. Indicates the normalized
-- value of Position for the component, i.e. the offset in storage
-- units from the start of the record to the lowest addressed storage
-- unit containing part or all of the field.
-- Normalized_Position_Max (Uint10)
-- Defined in components and discriminants. For almost all cases, this
-- is the same as Normalized_Position. The one exception is for the case
-- of a discriminated record containing one or more arrays whose length
-- depends on discriminants. In this case, the Normalized_Position_Max
-- field represents the maximum possible value of Normalized_Position
-- assuming min/max values for discriminant subscripts in all fields.
-- This is used by Layout in front end layout mode to properly compute
-- the maximum size of such records (needed for allocation purposes when
-- there are default discriminants, and also for the 'Size value).
-- Number_Dimensions (synthesized)
-- Applies to array types and subtypes. Returns the number of dimensions
-- of the array type or subtype as a value of type Pos.
-- Number_Entries (synthesized)
-- Applies to concurrent types. Returns the number of entries that are
-- declared within the task or protected definition for the type.
-- Number_Formals (synthesized)
-- Applies to subprograms and subprogram types. Yields the number of
-- formals as a value of type Pos.
-- Object_Size_Clause (synthesized)
-- Applies to entities for types and subtypes. If an object size clause
-- is present in the rep item chain for an entity then the attribute
-- definition clause node is returned. Otherwise Object_Size_Clause
-- returns Empty if no item is present. Usually this is only meaningful
-- if the flag Has_Object_Size_Clause is set. This is because when the
-- representation item chain is copied for a derived type, it can inherit
-- an object size clause that is not applicable to the entity.
-- OK_To_Rename (Flag247)
-- Defined only in entities for variables. If this flag is set, it
-- means that if the entity is used as the initial value of an object
-- declaration, the object declaration can be safely converted into a
-- renaming to avoid an extra copy. This is set for variables which are
-- generated by the expander to hold the result of evaluating some
-- expression. Most notably, the local variables used to store the result
-- of concatenations are so marked (see Exp_Ch4.Expand_Concatenate). It
-- is only worth setting this flag for composites, since for primitive
-- types, it is cheaper to do the copy.
-- Optimize_Alignment_Space (Flag241)
-- Defined in type, subtype, variable, and constant entities. This
-- flag records that the type or object is to be laid out in a manner
-- consistent with Optimize_Alignment (Space) mode. The compiler and
-- binder ensure a consistent view of any given type or object. If pragma
-- Optimize_Alignment (Off) mode applies to the type/object, then neither
-- of the flags Optimize_Alignment_Space/Optimize_Alignment_Time is set.
-- Optimize_Alignment_Time (Flag242)
-- Defined in type, subtype, variable, and constant entities. This
-- flag records that the type or object is to be laid out in a manner
-- consistent with Optimize_Alignment (Time) mode. The compiler and
-- binder ensure a consistent view of any given type or object. If pragma
-- Optimize_Alignment (Off) mode applies to the type/object, then neither
-- of the flags Optimize_Alignment_Space/Optimize_Alignment_Time is set.
-- Original_Access_Type (Node28)
-- Defined in E_Access_Subprogram_Type entities. Set only if the access
-- type was generated by the expander as part of processing an access-
-- to-protected-subprogram type. Points to the access-to-protected-
-- subprogram type.
-- Original_Array_Type (Node21)
-- Defined in modular types and array types and subtypes. Set only if
-- the Is_Packed_Array_Impl_Type flag is set, indicating that the type
-- is the implementation type for a packed array, and in this case it
-- points to the original array type for which this is the packed
-- array implementation type.
-- Original_Protected_Subprogram (Node41)
-- Defined in functions and procedures. Set only on internally built
-- dispatching subprograms of protected types to reference their original
-- non-dispatching protected subprogram since their names differ.
-- Original_Record_Component (Node22)
-- Defined in components, including discriminants. The usage depends
-- on whether the record is a base type and whether it is tagged.
--
-- In base tagged types:
-- When the component is inherited in a record extension, it points
-- to the original component (the entity of the ancestor component
-- which is not itself inherited) otherwise it points to itself. The
-- backend uses this attribute to implement the automatic dereference
-- in the extension and to apply the transformation:
--
-- Rec_Ext.Comp -> Rec_Ext.Parent. ... .Parent.Comp
--
-- In base untagged types:
-- Always points to itself except for non-girder discriminants, where
-- it points to the girder discriminant it renames.
--
-- In subtypes (tagged and untagged):
-- Points to the component in the base type.
-- Overlays_Constant (Flag243)
-- Defined in all entities. Set only for E_Constant or E_Variable for
-- which there is an address clause that causes the entity to overlay
-- a constant object.
-- Overridden_Operation (Node26)
-- Defined in subprograms. For overriding operations, points to the
-- user-defined parent subprogram that is being overridden. Note: this
-- attribute uses the same field as Static_Initialization. The latter
-- is only defined for internal initialization procedures, for which
-- Overridden_Operation is irrelevant. Thus this attribute must not be
-- set for init_procs.
-- Package_Instantiation (Node26)
-- Defined in packages and generic packages. When defined, this field
-- references an N_Generic_Instantiation node associated with an
-- instantiated package. In the case where the referenced node has
-- been rewritten to an N_Package_Specification, the instantiation
-- node is available from the Original_Node field of the package spec
-- node. This is currently not guaranteed to be set in all cases, but
-- when set, the field is used in Get_Unit_Instantiation_Node as
-- one of the means of obtaining the instantiation node. Eventually
-- it should be set in all cases, including package entities associated
-- with formal packages. ???
-- Packed_Array_Impl_Type (Node23)
-- Defined in array types and subtypes, except for the string literal
-- subtype case, if the corresponding type is packed and implemented
-- specially (either bit-packed or packed to eliminate holes in the
-- non-contiguous enumeration index types). References the type used to
-- represent the packed array, which is either a modular type for short
-- static arrays or an array of System.Unsigned in the bit-packed case,
-- or a regular array in the non-standard enumeration index case. Note
-- that in some situations (internal types and references to fields of
-- variant records), it is not always possible to construct this type in
-- advance of its use. If this field is empty, then the necessary type
-- is declared on the fly for each reference to the array.
-- Parameter_Mode (synthesized)
-- Applies to formal parameter entities. This is a synonym for Ekind,
-- used when obtaining the formal kind of a formal parameter (the result
-- is one of E_[In/Out/In_Out]_Parameter).
-- Parent_Subtype (Node19) [base type only]
-- Defined in E_Record_Type. Set only for derived tagged types, in which
-- case it points to the subtype of the parent type. This is the type
-- that is used as the Etype of the _parent field.
-- Part_Of_Constituents (Elist10)
-- Present in abstract state and variable entities. Contains all
-- constituents that are subject to indicator Part_Of (both aspect and
-- option variants).
-- Part_Of_References (Elist11)
-- Present in variable entities. Contains all references to the variable
-- when it is subject to pragma Part_Of. If the variable is a constituent
-- of a single protected/task type, the references are examined as they
-- must appear only within the type defintion and the corresponding body.
-- Partial_Invariant_Procedure (synthesized)
-- Defined in types and subtypes. Set for private types when one or more
-- [class-wide] type invariants apply to them. Points to the entity for a
-- procedure which checks the invariant. This invariant procedure takes a
-- single argument of the given type, and returns if the invariant holds,
-- or raises exception Assertion_Error with an appropriate message if it
-- does not hold. This attribute is defined but always Empty for private
-- subtypes. This attribute is also set for the corresponding full type.
--
-- Note: the reason this is marked as a synthesized attribute is that the
-- way this is stored is as an element of the Subprograms_For_Type field.
-- Partial_Refinement_Constituents (synthesized)
-- Defined in abstract state entities. Returns the constituents that
-- refine the state in the current scope, which are allowed in a global
-- refinement in this scope. These consist of those constituents that are
-- abstract states with no or only partial refinement visible, and those
-- that are not themselves abstract states.
-- Partial_View_Has_Unknown_Discr (Flag280)
-- Present in all types. Set to Indicate that the partial view of a type
-- has unknown discriminants. A default initialization of an object of
-- the type does not require an invariant check (AI12-0133).
-- Pending_Access_Types (Elist15)
-- Defined in all types. Set for incomplete, private, Taft-amendment
-- types, and their corresponding full views. This list contains all
-- access types, both named and anonymous, declared between the partial
-- and the full view. The list is used by the finalization machinery to
-- ensure that the finalization masters of all pending access types are
-- fully initialized when the full view is frozen.
-- Postconditions_Proc (Node14)
-- Defined in functions, procedures, entries, and entry families. Refers
-- to the entity of the _Postconditions procedure used to check contract
-- assertions on exit from a subprogram.
-- Predicate_Function (synthesized)
-- Defined in all types. Set for types for which (Has_Predicates is True)
-- and for which a predicate procedure has been built that tests that the
-- specified predicates are True. Contains the entity for the function
-- which takes a single argument of the given type, and returns True if
-- the predicate holds and False if it does not.
--
-- Note: flag Has_Predicate does not imply that Predicate_Function is set
-- to a non-empty entity; this happens, for example, for itypes created
-- when instantiating generic units with private types with predicates.
-- However, if an explicit pragma Predicate or Predicate aspect is given
-- either for private or full type declaration then both Has_Predicates
-- and a non-empty Predicate_Function will be set on both the partial and
-- full views of the type.
--
-- Note: the reason this is marked as a synthesized attribute is that the
-- way this is stored is as an element of the Subprograms_For_Type field.
-- Predicate_Function_M (synthesized)
-- Defined in all types. Present only if Predicate_Function is present,
-- and only if the predicate function has Raise_Expression nodes. It
-- is the special version created for membership tests, where if one of
-- these raise expressions is executed, the result is to return False.
-- Predicated_Parent (Node38)
-- Defined on itypes created by subtype indications, when the parent
-- subtype has predicates. The itype shares the Predicate_Function
-- of the predicated parent, but this function may not have been built
-- at the point the Itype is constructed, so this attribute allows its
-- retrieval at the point a predicate check needs to be generated.
-- The utility Predicate_Function takes this link into account.
-- Predicates_Ignored (Flag288)
-- Defined on all types. Indicates whether the subtype declaration is in
-- a context where Assertion_Policy is Ignore, in which case no checks
-- (static or dynamic) must be generated for objects of the type.
-- Prev_Entity (Node36)
-- Defined in all entities. The entities of a scope are chained, and this
-- field is used as a backward pointer for this entity list - effectivly
-- making the entity chain doubly-linked.
-- Primitive_Operations (synthesized)
-- Defined in concurrent types, tagged record types and subtypes, tagged
-- private types and tagged incomplete types. For concurrent types whose
-- Corresponding_Record_Type (CRT) is available, returns the list of
-- Direct_Primitive_Operations of its CRT; otherwise returns No_Elist.
-- For all the other types returns the Direct_Primitive_Operations.
-- Prival (Node17)
-- Defined in private components of protected types. Refers to the entity
-- of the component renaming declaration generated inside protected
-- subprograms, entries or barrier functions.
-- Prival_Link (Node20)
-- Defined in constants and variables which rename private components of
-- protected types. Set to the original private component.
-- Private_Dependents (Elist18)
-- Defined in private (sub)types. Records the subtypes of the private
-- type, derivations from it, and records and arrays with components
-- dependent on the type.
--
-- The subtypes are traversed when installing and deinstalling (the full
-- view of) a private type in order to ensure correct view of the
-- subtypes.
--
-- Used in similar fashion for incomplete types: holds list of subtypes
-- of these incomplete types that have discriminant constraints. The
-- full views of these subtypes are constructed when the full view of
-- the incomplete type is processed.
-- In addition, if the incomplete type is the designated type in an
-- access definition for an access parameter, the operation may be
-- a dispatching primitive operation, which is only known when the full
-- declaration of the type is seen. Subprograms that have such an
-- access parameter are also placed in the list of private_dependents.
-- Protected_Body_Subprogram (Node11)
-- Defined in protected operations. References the entity for the
-- subprogram which implements the body of the operation.
-- Protected_Formal (Node22)
-- Defined in formal parameters (in, in out and out parameters). Used
-- only for formals of protected operations. References corresponding
-- formal parameter in the unprotected version of the operation that
-- is created during expansion.
-- Protected_Subprogram (Node39)
-- Defined in functions and procedures. Set for the pair of subprograms
-- which emulate the runtime semantics of a protected subprogram. Denotes
-- the entity of the origial protected subprogram.
-- Protection_Object (Node23)
-- Applies to protected entries, entry families and subprograms. Denotes
-- the entity which is used to rename the _object component of protected
-- types.
-- Reachable (Flag49)
-- Defined in labels. The flag is set over the range of statements in
-- which a goto to that label is legal.
-- Receiving_Entry (Node19)
-- Defined in procedures. Set for an internally generated procedure which
-- wraps the original statements of an accept alternative. Designates the
-- entity of the task entry being accepted.
-- Referenced (Flag156)
-- Defined in all entities. Set if the entity is referenced, except for
-- the case of an appearance of a simple variable that is not a renaming
-- as the left side of an assignment in which case Referenced_As_LHS is
-- set instead, or a similar appearance as an out parameter actual, in
-- which case Referenced_As_Out_Parameter is set.
-- Referenced_As_LHS (Flag36):
-- Defined in all entities. This flag is set instead of Referenced if a
-- simple variable that is not a renaming appears as the left side of an
-- assignment. The reason we distinguish this kind of reference is that
-- we have a separate warning for variables that are only assigned and
-- never read.
-- Referenced_As_Out_Parameter (Flag227):
-- Defined in all entities. This flag is set instead of Referenced if a
-- simple variable that is not a renaming appears as an actual for an out
-- formal. The reason we distinguish this kind of reference is that
-- we have a separate warning for variables that are only assigned and
-- never read, and out parameters are a special case.
-- Refinement_Constituents (Elist8)
-- Present in abstract state entities. Contains all the constituents that
-- refine the state, in other words, all the hidden states that appear in
-- the constituent_list of aspect/pragma Refined_State.
-- Register_Exception_Call (Node20)
-- Defined in exception entities. When an exception is declared,
-- a call is expanded to Register_Exception. This field points to
-- the expanded N_Procedure_Call_Statement node for this call. It
-- is used for Import/Export_Exception processing to modify the
-- register call to make appropriate entries in the special tables
-- used for handling these pragmas at run time.
-- Related_Array_Object (Node25)
-- Defined in array types and subtypes. Used only for the base type
-- and subtype created for an anonymous array object. Set to point
-- to the entity of the corresponding array object. Currently used
-- only for type-related error messages.
-- Related_Expression (Node24)
-- Defined in variables and types. When Set for internally generated
-- entities, it may be used to denote the source expression whose
-- elaboration created the variable declaration. If set, it is used
-- for generating clearer messages from CodePeer. It is used on source
-- entities that are variables in iterator specifications, to provide
-- a link to the container that is the domain of iteration. This allows
-- for better cross-reference information when the loop modifies elements
-- of the container, and suppresses spurious warnings.
--
-- Shouldn't it also be used for the same purpose in errout? It seems
-- odd to have two mechanisms here???
-- Related_Instance (Node15)
-- Defined in the wrapper packages created for subprogram instances.
-- The internal subprogram that implements the instance is inside the
-- wrapper package, but for debugging purposes its external symbol
-- must correspond to the name and scope of the related instance.
-- Related_Type (Node27)
-- Defined in components, constants and variables. Set when there is an
-- associated dispatch table to point to entities containing primary or
-- secondary tags. Not set in the _tag component of record types.
-- Relative_Deadline_Variable (Node28) [implementation base type only]
-- Defined in task type entities. This flag is set if a valid and
-- effective pragma Relative_Deadline applies to the base type. Points
-- to the entity for a variable that is created to hold the value given
-- in a Relative_Deadline pragma for a task type.
-- Renamed_Entity (Node18)
-- Defined in exception, generic unit, package, and subprogram entities.
-- Set when the entity is defined by a renaming declaration. Denotes the
-- renamed entity, or transitively the ultimate renamed entity if there
-- is a chain of renaming declarations. Empty if no renaming.
-- Renamed_In_Spec (Flag231)
-- Defined in package entities. If a package renaming occurs within
-- a package spec, then this flag is set on the renamed package. The
-- purpose is to prevent a warning about unused entities in the renamed
-- package. Such a warning would be inappropriate since clients of the
-- package can see the entities in the package via the renaming.
-- Renamed_Object (Node18)
-- Defined in components, constants, discriminants, formal parameters,
-- generic formals, loop parameters, and variables. Set to non-Empty if
-- the object was declared by a renaming declaration. For constants and
-- variables, the attribute references the tree node for the name of the
-- renamed object. For formal parameters, the field is used in inlining
-- and maps the entities of all formal parameters of a subprogram to the
-- entities of the corresponding actuals. For formals of a task entry,
-- the attribute denotes the local renaming that replaces the actual
-- within an accept statement. For all remaining cases (discriminants,
-- loop parameters) the field is Empty.
-- Renaming_Map (Uint9)
-- Defined in generic subprograms, generic packages, and their
-- instances. Also defined in the instances of the corresponding
-- bodies. Denotes the renaming map (generic entities => instance
-- entities) used to construct the instance by giving an index into
-- the tables used to represent these maps. See Sem_Ch12 for further
-- details. The maps for package instances are also used when the
-- instance is the actual corresponding to a formal package.
-- Requires_Overriding (Flag213)
-- Defined in all subprograms and entries. Set for subprograms that
-- require overriding as defined by RM-2005-3.9.3(6/2). Note that this
-- is True only for implicitly declared subprograms; it is not set on the
-- parent type's subprogram. See also Is_Abstract_Subprogram.
-- Return_Applies_To (Node8)
-- Defined in E_Return_Statement. Points to the entity representing
-- the construct to which the return statement applies, as defined in
-- RM-6.5(4/2). Note that a (simple) return statement within an
-- extended_return_statement applies to the extended_return_statement,
-- even though it causes the whole function to return.
-- Also defined in special E_Block entities built as E_Return_Statement
-- for extended return statements and attached to the block statement
-- by Expand_N_Extended_Return_Statement before being turned into an
-- E_Block by semantic analysis.
-- Return_Present (Flag54)
-- Defined in function and generic function entities. Set if the
-- function contains a return statement (used for error checking).
-- This flag can also be set in procedure and generic procedure
-- entities (for convenience in setting it), but is only tested
-- for the function case.
-- Returns_By_Ref (Flag90)
-- Defined in subprogram type entities and functions. Set if a function
-- (or an access-to-function type) returns a result by reference, either
-- because its return type is a by-reference-type or because the function
-- explicitly uses the secondary stack.
-- Reverse_Bit_Order (Flag164) [base type only]
-- Defined in all record type entities. Set if entity has a Bit_Order
-- aspect (set by an aspect clause or attribute definition clause) that
-- has reversed the order of bits from the default value. When this flag
-- is set, a component clause must specify a set of bits entirely within
-- a single storage unit (Ada 95) or within a single machine scalar (see
-- Ada 2005 AI-133), or must occupy an integral number of storage units.
-- Reverse_Storage_Order (Flag93) [base type only]
-- Defined in all record and array type entities. Set if entity has a
-- Scalar_Storage_Order aspect (set by an aspect clause or attribute
-- definition clause) that has reversed the order of storage elements
-- from the default value. When this flag is set for a record type,
-- the Bit_Order aspect must be set to the same value (either explicitly
-- or as the target default value).
-- Rewritten_For_C (Flag287)
-- Defined on functions that return a constrained array type, when
-- Modify_Tree_For_C is set. Indicates that a procedure with an extra
-- out parameter has been created for it, and calls must be rewritten as
-- calls to the new procedure.
-- RM_Size (Uint13)
-- Defined in all type and subtype entities. Contains the value of
-- type'Size as defined in the RM. See also the Esize field and
-- and the description on "Handling of Type'Size Values". A value
-- of zero in this field for a non-discrete type means that
-- the front end has not yet determined the size value. For the
-- case of a discrete type, this field is always set by the front
-- end and zero is a legitimate value for a type with one value.
-- Root_Type (synthesized)
-- Applies to all type entities. For class-wide types, returns the root
-- type of the class covered by the CW type, otherwise returns the
-- ultimate derivation ancestor of the given type. This function
-- preserves the view, i.e. the Root_Type of a partial view is the
-- partial view of the ultimate ancestor, the Root_Type of a full view
-- is the full view of the ultimate ancestor. Note that this function
-- does not correspond exactly to the use of root type in the RM, since
-- in the RM root type applies to a class of types, not to a type.
-- Scalar_Range (Node20)
-- Defined in all scalar types (including modular types, where the
-- bounds are 0 .. modulus - 1). References a node in the tree that
-- contains the bounds for the range. Note that this information
-- could be obtained by rummaging around the tree, but it is more
-- convenient to have it immediately at hand in the entity. The
-- contents of Scalar_Range can either be an N_Subtype_Indication
-- node (with a constraint), a Range node, or an Integer_Type_Definition,
-- but not a simple subtype reference (a subtype is converted into a
-- explicit range).
-- Scale_Value (Uint16)
-- Defined in decimal fixed-point types and subtypes. Contains the scale
-- for the type (i.e. the value of type'Scale = the number of decimal
-- digits after the decimal point).
-- Scope (Node3)
-- Defined in all entities. Points to the entity for the scope (block,
-- loop, subprogram, package etc.) in which the entity is declared.
-- Since this field is in the base part of the entity node, the access
-- routines for this field are in Sinfo. Note that for a child unit,
-- the Scope will be the parent package, and for a root library unit,
-- the Scope will be Standard.
-- Scope_Depth (synthesized)
-- Applies to program units, blocks, loops, return statements,
-- concurrent types, private types and entries, and also to record types,
-- i.e. to any entity that can appear on the scope stack. Yields the
-- scope depth value, which for those entities other than records is
-- simply the scope depth value, for record entities, it is the
-- Scope_Depth of the record scope.
-- Scope_Depth_Value (Uint22)
-- Defined in program units, blocks, loops, return statements,
-- concurrent types, private types and entries.
-- Indicates the number of scopes that statically enclose the declaration
-- of the unit or type. Library units have a depth of zero. Note that
-- record types can act as scopes but do NOT have this field set (see
-- Scope_Depth above).
-- Scope_Depth_Set (synthesized)
-- Applies to a special predicate function that returns a Boolean value
-- indicating whether or not the Scope_Depth field has been set. It is
-- needed, since returns an invalid value in this case.
-- Sec_Stack_Needed_For_Return (Flag167)
-- Defined in scope entities (blocks, entries, entry families, functions,
-- and procedures). Set to True when secondary stack is used to hold the
-- returned value of a function and thus should not be released on scope
-- exit.
-- Shared_Var_Procs_Instance (Node22)
-- Defined in variables. Set non-Empty only if Is_Shared_Passive is
-- set, in which case this is the entity for the associated instance of
-- System.Shared_Storage.Shared_Var_Procs. See Exp_Smem for full details.
-- Size_Check_Code (Node19)
-- Defined in constants and variables. Normally Empty. Set if code is
-- generated to check the size of the object. This field is used to
-- suppress this code if a subsequent address clause is encountered.
-- Size_Clause (synthesized)
-- Applies to all entities. If a size clause is present in the rep
-- item chain for an entity then the attribute definition clause node
-- for the size clause is returned. Otherwise Size_Clause returns Empty
-- if no item is present. Usually this is only meaningful if the flag
-- Has_Size_Clause is set. This is because when the representation item
-- chain is copied for a derived type, it can inherit a size clause that
-- is not applicable to the entity.
-- Size_Depends_On_Discriminant (Flag177)
-- Defined in all entities for types and subtypes. Indicates that the
-- size of the type depends on the value of one or more discriminants.
-- Currently, this flag is only set for arrays which have one or more
-- bounds depending on a discriminant value.
-- Size_Known_At_Compile_Time (Flag92)
-- Defined in all entities for types and subtypes. Indicates that the
-- size of objects of the type is known at compile time. This flag is
-- used to optimize some generated code sequences, and also to enable
-- some error checks (e.g. disallowing component clauses on variable
-- length objects). It is set conservatively (i.e. if it is True, the
-- size is certainly known at compile time, if it is False, then the
-- size may or may not be known at compile time, but the code will
-- assume that it is not known). Note that the value may be known only
-- to the back end, so the fact that this flag is set does not mean that
-- the front end can access the value.
-- Small_Value (Ureal21)
-- Defined in fixed point types. Points to the universal real for the
-- Small of the type, either as given in a representation clause, or
-- as computed (as a power of two) by the compiler.
-- SPARK_Aux_Pragma (Node41)
-- Present in concurrent type, [generic] package spec and package body
-- entities. For concurrent types and package specs it refers to the
-- SPARK mode setting for the private part. This field points to the
-- N_Pragma node that either appears in the private part or is inherited
-- from the enclosing context. For package bodies, it refers to the SPARK
-- mode of the elaboration sequence after the BEGIN. The fields points to
-- the N_Pragma node that either appears in the statement sequence or is
-- inherited from the enclosing context. In all cases, if the pragma is
-- inherited, then the SPARK_Aux_Pragma_Inherited flag is set.
-- SPARK_Aux_Pragma_Inherited (Flag266)
-- Present in concurrent type, [generic] package spec and package body
-- entities. Set if the SPARK_Aux_Pragma field points to a pragma that is
-- inherited, rather than a local one.
-- SPARK_Pragma (Node40)
-- Present in the following entities:
--
-- abstract states
-- constants
-- entries
-- operators
-- [generic] packages
-- package bodies
-- [generic] subprograms
-- subprogram bodies
-- variables
-- types
--
-- Points to the N_Pragma node that applies to the initial declaration or
-- body. This is either set by a local SPARK_Mode pragma or is inherited
-- from the context (from an outer scope for the spec case or from the
-- spec for the body case). In the case where the attribute is inherited,
-- flag SPARK_Pragma_Inherited is set. Empty if no SPARK_Mode pragma is
-- applicable.
-- SPARK_Pragma_Inherited (Flag265)
-- Present in the following entities:
--
-- abstract states
-- constants
-- entries
-- operators
-- [generic] packages
-- package bodies
-- [generic] subprograms
-- subprogram bodies
-- variables
-- types
--
-- Set if the SPARK_Pragma attribute points to an inherited pragma rather
-- than a local one.
-- Spec_Entity (Node19)
-- Defined in package body entities. Points to corresponding package
-- spec entity. Also defined in subprogram body parameters in the
-- case where there is a separate spec, where this field references
-- the corresponding parameter entities in the spec.
-- SSO_Set_High_By_Default (Flag273) [base type only]
-- Defined for record and array types. Set in the base type if a pragma
-- Default_Scalar_Storage_Order (High_Order_First) was active at the time
-- the record or array was declared and therefore applies to it.
-- SSO_Set_Low_By_Default (Flag272) [base type only]
-- Defined for record and array types. Set in the base type if a pragma
-- Default_Scalar_Storage_Order (High_Order_First) was active at the time
-- the record or array was declared and therefore applies to it.
-- Static_Discrete_Predicate (List25)
-- Defined in discrete types/subtypes with static predicates (with the
-- two flags Has_Predicates and Has_Static_Predicate set). Set if the
-- type/subtype has a static predicate. Points to a list of expression
-- and N_Range nodes that represent the predicate in canonical form. The
-- canonical form has entries sorted in ascending order, with duplicates
-- eliminated, and adjacent ranges coalesced, so that there is always a
-- gap in the values between successive entries. The entries in this list
-- are fully analyzed and typed with the base type of the subtype. Note
-- that all entries are static and have values within the subtype range.
-- Static_Elaboration_Desired (Flag77)
-- Defined in library-level packages. Set by the pragma of the same
-- name, to indicate that static initialization must be attempted for
-- all types declared in the package, and that a warning must be emitted
-- for those types to which static initialization is not available.
-- Static_Initialization (Node30)
-- Defined in initialization procedures for types whose objects can be
-- initialized statically. The value of this attribute is a positional
-- aggregate whose components are compile-time static values. Used
-- when available in object declarations to eliminate the call to the
-- initialization procedure, and to minimize elaboration code. Note:
-- This attribute uses the same field as Overridden_Operation, which is
-- irrelevant in init_procs.
-- Static_Real_Or_String_Predicate (Node25)
-- Defined in real types/subtypes with static predicates (with the two
-- flags Has_Predicates and Has_Static_Predicate set). Set if the type
-- or subtype has a static predicate. Points to the return expression
-- of the predicate function. This is the original expression given as
-- the predicate except that occurrences of the type are replaced by
-- occurrences of the formal parameter of the predicate function (note
-- that the spec of this function including this formal parameter name
-- is available from the Subprograms_For_Type field; it can be accessed
-- as Predicate_Function (typ)). Also, in the case where a predicate is
-- inherited, the expression is of the form:
--
-- xxxPredicate (typ2 (ent)) AND THEN expression
--
-- where typ2 is the type from which the predicate is inherited, ent is
-- the entity for the current predicate function, and xxxPredicate is the
-- inherited predicate (from typ2). Finally for a predicate that inherits
-- from another predicate but does not add a predicate of its own, the
-- expression may consist of the above xxxPredicate call on its own.
-- Status_Flag_Or_Transient_Decl (Node15)
-- Defined in constant, loop, and variable entities. Applies to objects
-- that require special treatment by the finalization machinery, such as
-- extended return results, IF and CASE expression results, and objects
-- inside N_Expression_With_Actions nodes. The attribute contains the
-- entity of a flag which specifies particular behavior over a region of
-- code or the declaration of a "hook" object.
-- In which case is it a flag, or a hook object???
-- Storage_Size_Variable (Node26) [implementation base type only]
-- Defined in access types and task type entities. This flag is set
-- if a valid and effective pragma Storage_Size applies to the base
-- type. Points to the entity for a variable that is created to
-- hold the value given in a Storage_Size pragma for an access
-- collection or a task type. Note that in the access type case,
-- this field is defined only in the root type (since derived types
-- share the same storage pool).
-- Stored_Constraint (Elist23)
-- Defined in entities that can have discriminants (concurrent types
-- subtypes, record types and subtypes, private types and subtypes,
-- limited private types and subtypes and incomplete types). Points
-- to an element list containing the expressions for each of the
-- stored discriminants for the record (sub)type.
-- Stores_Attribute_Old_Prefix (Flag270)
-- Defined in constants. Set when the constant has been generated to save
-- the value of attribute 'Old's prefix.
-- Strict_Alignment (Flag145) [implementation base type only]
-- Defined in all type entities. Indicates that the type is by-reference
-- or contains an aliased part. This forbids packing a component of this
-- type tighter than the alignment and size of the type, as specified by
-- RM 13.2(7) modified by AI12-001 as a Binding Interpretation.
-- String_Literal_Length (Uint16)
-- Defined in string literal subtypes (which are created to correspond
-- to string literals in the program). Contains the length of the string
-- literal.
-- String_Literal_Low_Bound (Node18)
-- Defined in string literal subtypes (which are created to correspond
-- to string literals in the program). Contains an expression whose
-- value represents the low bound of the literal. This is a copy of
-- the low bound of the applicable index constraint if there is one,
-- or a copy of the low bound of the index base type if not.
-- Subprograms_For_Type (Elist29)
-- Defined in all types. The list may contain the entities of the default
-- initial condition procedure, invariant procedure, and the two versions
-- of the predicate function.
--
-- Historical note: This attribute used to be a direct linked list of
-- entities rather than an Elist. The Elist allows greater flexibility
-- in inheritance of subprograms between views of the same type.
-- Subps_Index (Uint24)
-- Present in subprogram entries. Set if the subprogram contains nested
-- subprograms, or is a subprogram nested within such a subprogram. Holds
-- the index in the Exp_Unst.Subps table for the subprogram. Note that
-- for the outer level subprogram, this is the starting index in the Subp
-- table for the entries for this subprogram.
-- Suppress_Elaboration_Warnings (Flag303)
-- NOTE: this flag is relevant only for the legacy ABE mechanism and
-- should not be used outside of that context.
--
-- Defined in all entities, can be set only for subprogram entities and
-- for variables. If this flag is set then Sem_Elab will not generate
-- elaboration warnings for the subprogram or variable. Suppression of
-- such warnings is automatic for subprograms for which elaboration
-- checks are suppressed (without the need to set this flag), but the
-- flag is also set for various internal entities (such as init procs)
-- which are known not to generate any possible access before elaboration
-- and it is set on variables when a warning is given to avoid multiple
-- elaboration warnings for the same variable.
-- Suppress_Initialization (Flag105)
-- Defined in all variable, type and subtype entities. If set for a base
-- type, then the generation of initialization procedures is suppressed
-- for the type. Any other implicit initialization (e.g. from the use of
-- pragma Initialize_Scalars) is also suppressed if this flag is set for
-- either the subtype in question, or for the base type. For variables,
-- this flag suppresses all implicit initialization for the object, even
-- if the type would normally require initialization. Set by use of
-- pragma Suppress_Initialization and also for internal entities where
-- we know that no initialization is required. For example, enumeration
-- image table entities set it.
-- Suppress_Style_Checks (Flag165)
-- Defined in all entities. Suppresses any style checks specifically
-- associated with the given entity if set.
-- Suppress_Value_Tracking_On_Call (Flag217)
-- Defined in all entities. Set in a scope entity if value tracking is to
-- be suppressed on any call within the scope. Used when an access to a
-- local subprogram is computed, to deal with the possibility that this
-- value may be passed around, and if used, may clobber a local variable.
-- Task_Body_Procedure (Node25)
-- Defined in task types and subtypes. Points to the entity for the task
-- task body procedure (as further described in Exp_Ch9, task bodies are
-- expanded into procedures). A convenient function to retrieve this
-- field is Sem_Util.Get_Task_Body_Procedure.
--
-- The last sentence is odd??? Why not have Task_Body_Procedure go to the
-- Underlying_Type of the Root_Type???
-- Thunk_Entity (Node31)
-- Defined in functions and procedures which have been classified as
-- Is_Thunk. Set to the target entity called by the thunk.
-- Treat_As_Volatile (Flag41)
-- Defined in all type entities, and also in constants, components and
-- variables. Set if this entity is to be treated as volatile for code
-- generation purposes. Always set if Is_Volatile is set, but can also
-- be set as a result of situations (such as address overlays) where
-- the front end wishes to force volatile handling to inhibit aliasing
-- optimization which might be legally ok, but is undesirable. Note
-- that the backend always tests this flag rather than Is_Volatile.
-- The front end tests Is_Volatile if it is concerned with legality
-- checks associated with declared volatile variables, but if the test
-- is for the purposes of suppressing optimizations, then the front
-- end should test Treat_As_Volatile rather than Is_Volatile.
--
-- Note: before testing Treat_As_Volatile, consider whether it would
-- be more appropriate to use Exp_Util.Is_Volatile_Reference instead,
-- which catches more cases of volatile references.
-- Type_High_Bound (synthesized)
-- Applies to scalar types. Returns the tree node (Node_Id) that contains
-- the high bound of a scalar type. The returned value is literal for a
-- base type, but may be an expression in the case of scalar type with
-- dynamic bounds. Note that in the case of a fixed point type, the high
-- bound is in units of small, and is an integer.
-- Type_Low_Bound (synthesized)
-- Applies to scalar types. Returns the tree node (Node_Id) that contains
-- the low bound of a scalar type. The returned value is literal for a
-- base type, but may be an expression in the case of scalar type with
-- dynamic bounds. Note that in the case of a fixed point type, the low
-- bound is in units of small, and is an integer.
-- Underlying_Full_View (Node19)
-- Defined in private subtypes that are the completion of other private
-- types, or in private types that are derived from private subtypes. If
-- the full view of a private type T is derived from another private type
-- with discriminants Td, the full view of T is also private, and there
-- is no way to attach to it a further full view that would convey the
-- structure of T to the backend. The Underlying_Full_View is an
-- attribute of the full view that is a subtype of Td with the same
-- constraint as the declaration for T. The declaration for this subtype
-- is built at the point of the declaration of T, either as completion,
-- or as a subtype declaration where the base type is private and has a
-- private completion. If Td is already constrained, then its full view
-- can serve directly as the full view of T.
-- Underlying_Record_View (Node28)
-- Defined in record types. Set for record types that are extensions of
-- types with unknown discriminants, and also set for internally built
-- underlying record views to reference its original record type. Record
-- types that are extensions of types with unknown discriminants do not
-- have a completion, but they cannot be used without having some
-- discriminated view at hand. This view is a record type with the same
-- structure, whose parent type is the full view of the parent in the
-- original type extension.
-- Underlying_Type (synthesized)
-- Applies to all entities. This is the identity function except in the
-- case where it is applied to an incomplete or private type, in which
-- case it is the underlying type of the type declared by the completion,
-- or Empty if the completion has not yet been encountered and analyzed.
--
-- Note: the reason this attribute applies to all entities, and not just
-- types, is to legitimize code where Underlying_Type is applied to an
-- entity which may or may not be a type, with the intent that if it is a
-- type, its underlying type is taken.
--
-- Note also that the value of this attribute is interesting only after
-- the full view of the parent type has been processed. If the parent
-- type is declared in an enclosing package, the attribute will be non-
-- trivial only after the full view of the type has been analyzed.
-- Universal_Aliasing (Flag216) [implementation base type only]
-- Defined in all type entities. Set to direct the back-end to avoid
-- any optimizations based on type-based alias analysis for this type.
-- Indicates that objects of this type can alias objects of any other
-- types, which guarantees that any objects can be referenced through
-- access types designating this type safely, whatever the actual type
-- of these objects. In other words, the effect is as though access
-- types designating this type were subject to No_Strict_Aliasing.
-- Unset_Reference (Node16)
-- Defined in variables and out parameters. This is normally Empty. It
-- is set to point to an identifier that represents a reference to the
-- entity before any value has been set. Only the first such reference
-- is identified. This field is used to generate a warning message if
-- necessary (see Sem_Warn.Check_Unset_Reference).
-- Used_As_Generic_Actual (Flag222)
-- Defined in all entities, set if the entity is used as an argument to
-- a generic instantiation. Used to tune certain warning messages, and
-- in checking type conformance within an instantiation that involves
-- incomplete formal and actual types.
-- Uses_Lock_Free (Flag188)
-- Defined in protected type entities. Set to True when the Lock Free
-- implementation is used for the protected type. This implementation is
-- based on atomic transactions and doesn't require anymore the use of
-- Protection object (see System.Tasking.Protected_Objects).
-- Uses_Sec_Stack (Flag95)
-- Defined in scope entities (blocks, entries, entry families, functions,
-- loops, and procedures). Set to True when the secondary stack is used
-- in this scope and must be released on exit unless flag
-- Sec_Stack_Needed_For_Return is set.
-- Validated_Object (Node38)
-- Defined in variables. Contains the object whose value is captured by
-- the variable for validity check purposes.
-- Warnings_Off (Flag96)
-- Defined in all entities. Set if a pragma Warnings (Off, entity-name)
-- is used to suppress warnings for a given entity. It is also used by
-- the compiler in some situations to kill spurious warnings. Note that
-- clients should generally not test this flag directly, but instead
-- use function Has_Warnings_Off.
-- Warnings_Off_Used (Flag236)
-- Defined in all entities. Can only be set if Warnings_Off is set. If
-- set indicates that a warning was suppressed by the Warnings_Off flag,
-- and Unmodified/Unreferenced would not have suppressed the warning.
-- Warnings_Off_Used_Unmodified (Flag237)
-- Defined in all entities. Can only be set if Warnings_Off is set and
-- Has_Pragma_Unmodified is not set. If set indicates that a warning was
-- suppressed by the Warnings_Off status but that pragma Unmodified
-- would also have suppressed the warning.
-- Warnings_Off_Used_Unreferenced (Flag238)
-- Defined in all entities. Can only be set if Warnings_Off is set and
-- Has_Pragma_Unreferenced is not set. If set indicates that a warning
-- was suppressed by the Warnings_Off status but that pragma Unreferenced
-- would also have suppressed the warning.
-- Was_Hidden (Flag196)
-- Defined in all entities. Used to save the value of the Is_Hidden
-- attribute when the limited-view is installed (Ada 2005: AI-217).
-- Wrapped_Entity (Node27)
-- Defined in functions and procedures which have been classified as
-- Is_Primitive_Wrapper. Set to the entity being wrapper.
---------------------------
-- Renaming and Aliasing --
---------------------------
-- Several entity attributes relate to renaming constructs, and to the use of
-- different names to refer to the same entity. The following is a summary of
-- these constructs and their prefered uses.
-- There are three related attributes:
-- Renamed_Entity
-- Renamed_Object
-- Alias
-- They all overlap because they are supposed to apply to different entity
-- kinds. They are semantically related, and have the following intended uses:
-- a) Renamed_Entity applies to entities in renaming declarations that rename
-- an entity, so the value of the attribute IS an entity. This applies to
-- generic renamings, package renamings, exception renamings, and subprograms
-- renamings that rename a subprogram (rather than an attribute, an entry, a
-- protected operation, etc).
-- b) Alias applies to overloadable entities, and the value is an overloadable
-- entity. So this is a subset of the previous one. We use the term Alias to
-- cover both renamings and inherited operations, because both cases are
-- handled in the same way when expanding a call. Namely the Alias of a given
-- subprogram is the subprogram that will actually be called.
-- Both a) and b) are set transitively, so that in fact it is not necessary to
-- traverse chains of renamings when looking for the original entity: it's
-- there in one step (this is done when analyzing renaming declarations other
-- than object renamings in sem_ch8).
-- c) Renamed_Object applies to constants and variables. Given that the name
-- in an object renaming declaration is not necessarily an entity name, the
-- value of the attribute is the tree for that name, eg AR (1).Comp. The case
-- when that name is in fact an entity is not handled specially. This is why
-- in a few cases we need to use a loop to trace a chain of object renamings
-- where all of them happen to be entities. So:
-- X : integer;
-- Y : integer renames X; -- renamed object is the identifier X
-- Z : integer renames Y; -- renamed object is the identifier Y
-- The front-end does not store explicitly the fact that Z renames X.
--------------------------------------
-- Delayed Freezing and Elaboration --
--------------------------------------
-- The flag Has_Delayed_Freeze indicates that an entity carries an explicit
-- freeze node, which appears later in the expanded tree.
-- a) The flag is used by the front-end to trigger expansion actions
-- which include the generation of that freeze node. Typically this happens at
-- the end of the current compilation unit, or before the first subprogram
-- body is encountered in the current unit. See files freeze and exp_ch13 for
-- details on the actions triggered by a freeze node, which include the
-- construction of initialization procedures and dispatch tables.
-- b) The flag is used by the backend to defer elaboration of the entity until
-- its freeze node is seen. In the absence of an explicit freeze node, an
-- entity is frozen (and elaborated) at the point of declaration.
-- For object declarations, the flag is set when an address clause for the
-- object is encountered. Legality checks on the address expression only
-- take place at the freeze point of the object.
-- Most types have an explicit freeze node, because they cannot be elaborated
-- until all representation and operational items that apply to them have been
-- analyzed. Private types and incomplete types have the flag set as well, as
-- do task and protected types.
-- Implicit base types created for type derivations, as well as classwide
-- types created for all tagged types, have the flag set.
-- If a subprogram has an access parameter whose designated type is incomplete
-- the subprogram has the flag set.
------------------
-- Access Kinds --
------------------
-- The following entity kinds are introduced by the corresponding type
-- definitions:
-- E_Access_Type,
-- E_General_Access_Type,
-- E_Access_Subprogram_Type,
-- E_Anonymous_Access_Subprogram_Type,
-- E_Access_Protected_Subprogram_Type,
-- E_Anonymous_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Type.
-- E_Access_Subtype is for an access subtype created by a subtype
-- declaration.
-- In addition, we define the kind E_Allocator_Type to label allocators.
-- This is because special resolution rules apply to this construct.
-- Eventually the constructs are labeled with the access type imposed by
-- the context. The backend should never see types with this Ekind.
-- Similarly, the type E_Access_Attribute_Type is used as the initial kind
-- associated with an access attribute. After resolution a specific access
-- type will be established as determined by the context.
-- Finally, the type Any_Access is used to label -null- during type
-- resolution. Any_Access is also replaced by the context type after
-- resolution.
--------------------------------
-- Classification of Entities --
--------------------------------
-- The classification of program entities which follows is a refinement of
-- the list given in RM 3.1(1). E.g., separate entities denote subtypes of
-- different type classes. Ada 95 entities include class wide types,
-- protected types, subprogram types, generalized access types, generic
-- formal derived types and generic formal packages.
-- The order chosen for these kinds allows us to classify related entities
-- so that they are contiguous. As a result, they do not appear in the
-- exact same order as their order of first appearance in the LRM (For
-- example, private types are listed before packages). The contiguity
-- allows us to define useful subtypes (see below) such as type entities,
-- overloaded entities, etc.
-- Each entity (explicitly or implicitly declared) has a kind, which is
-- a value of the following type:
type Entity_Kind is (
E_Void,
-- The initial Ekind value for a newly created entity. Also used as the
-- Ekind for Standard_Void_Type, a type entity in Standard used as a
-- dummy type for the return type of a procedure (the reason we create
-- this type is to share the circuits for performing overload resolution
-- on calls).
-------------
-- Objects --
-------------
E_Component,
-- Components of a record declaration, private declarations of
-- protected objects.
E_Constant,
-- Constants created by an object declaration with a constant keyword
E_Discriminant,
-- A discriminant, created by the use of a discriminant in a type
-- declaration.
E_Loop_Parameter,
-- A loop parameter created by a for loop
E_Variable,
-- Variables created by an object declaration with no constant keyword
------------------------
-- Parameter Entities --
------------------------
-- Parameters are also objects
E_Out_Parameter,
-- An out parameter of a subprogram or entry
E_In_Out_Parameter,
-- An in-out parameter of a subprogram or entry
E_In_Parameter,
-- An in parameter of a subprogram or entry
--------------------------------
-- Generic Parameter Entities --
--------------------------------
-- Generic parameters are also objects
E_Generic_In_Out_Parameter,
-- A generic in out parameter, created by the use of a generic in out
-- parameter in a generic declaration.
E_Generic_In_Parameter,
-- A generic in parameter, created by the use of a generic in
-- parameter in a generic declaration.
-------------------
-- Named Numbers --
-------------------
E_Named_Integer,
-- Named numbers created by a number declaration with an integer value
E_Named_Real,
-- Named numbers created by a number declaration with a real value
-----------------------
-- Enumeration Types --
-----------------------
E_Enumeration_Type,
-- Enumeration types, created by an enumeration type declaration
E_Enumeration_Subtype,
-- Enumeration subtypes, created by an explicit or implicit subtype
-- declaration applied to an enumeration type or subtype.
-------------------
-- Numeric Types --
-------------------
E_Signed_Integer_Type,
-- Signed integer type, used for the anonymous base type of the
-- integer subtype created by an integer type declaration.
E_Signed_Integer_Subtype,
-- Signed integer subtype, created by either an integer subtype or
-- integer type declaration (in the latter case an integer type is
-- created for the base type, and this is the first named subtype).
E_Modular_Integer_Type,
-- Modular integer type, used for the anonymous base type of the
-- integer subtype created by a modular integer type declaration.
E_Modular_Integer_Subtype,
-- Modular integer subtype, created by either an modular subtype
-- or modular type declaration (in the latter case a modular type
-- is created for the base type, and this is the first named subtype).
E_Ordinary_Fixed_Point_Type,
-- Ordinary fixed type, used for the anonymous base type of the fixed
-- subtype created by an ordinary fixed point type declaration.
E_Ordinary_Fixed_Point_Subtype,
-- Ordinary fixed point subtype, created by either an ordinary fixed
-- point subtype or ordinary fixed point type declaration (in the
-- latter case a fixed point type is created for the base type, and
-- this is the first named subtype).
E_Decimal_Fixed_Point_Type,
-- Decimal fixed type, used for the anonymous base type of the decimal
-- fixed subtype created by an ordinary fixed point type declaration.
E_Decimal_Fixed_Point_Subtype,
-- Decimal fixed point subtype, created by either a decimal fixed point
-- subtype or decimal fixed point type declaration (in the latter case
-- a fixed point type is created for the base type, and this is the
-- first named subtype).
E_Floating_Point_Type,
-- Floating point type, used for the anonymous base type of the
-- floating point subtype created by a floating point type declaration.
E_Floating_Point_Subtype,
-- Floating point subtype, created by either a floating point subtype
-- or floating point type declaration (in the latter case a floating
-- point type is created for the base type, and this is the first
-- named subtype).
------------------
-- Access Types --
------------------
E_Access_Type,
-- An access type created by an access type declaration with no all
-- keyword present. Note that the predefined type Any_Access, which
-- has E_Access_Type Ekind, is used to label NULL in the upwards pass
-- of type analysis, to be replaced by the true access type in the
-- downwards resolution pass.
E_Access_Subtype,
-- An access subtype created by a subtype declaration for any access
-- type (whether or not it is a general access type).
E_Access_Attribute_Type,
-- An access type created for an access attribute (one of 'Access,
-- 'Unrestricted_Access, or Unchecked_Access).
E_Allocator_Type,
-- A special internal type used to label allocators and references to
-- objects using 'Reference. This is needed because special resolution
-- rules apply to these constructs. On the resolution pass, this type
-- is almost always replaced by the actual access type, but if the
-- context does not provide one, the backend will see Allocator_Type
-- itself (which will already have been frozen).
E_General_Access_Type,
-- An access type created by an access type declaration with the all
-- keyword present.
E_Access_Subprogram_Type,
-- An access-to-subprogram type, created by an access-to-subprogram
-- declaration.
E_Access_Protected_Subprogram_Type,
-- An access to a protected subprogram, created by the corresponding
-- declaration. Values of such a type denote both a protected object
-- and a protected operation within, and have different compile-time
-- and run-time properties than other access-to-subprogram values.
E_Anonymous_Access_Protected_Subprogram_Type,
-- An anonymous access-to-protected-subprogram type, created by an
-- access-to-subprogram declaration.
E_Anonymous_Access_Subprogram_Type,
-- An anonymous access-to-subprogram type, created by an access-to-
-- subprogram declaration, or generated for a current instance of
-- a type name appearing within a component definition that has an
-- anonymous access-to-subprogram type.
E_Anonymous_Access_Type,
-- An anonymous access type created by an access parameter or access
-- discriminant.
---------------------
-- Composite Types --
---------------------
E_Array_Type,
-- An array type created by an array type declaration. Includes all
-- cases of arrays, except for string types.
E_Array_Subtype,
-- An array subtype, created by an explicit array subtype declaration,
-- or the use of an anonymous array subtype.
E_String_Literal_Subtype,
-- A special string subtype, used only to describe the type of a string
-- literal (will always be one dimensional, with literal bounds).
E_Class_Wide_Type,
-- A class wide type, created by any tagged type declaration (i.e. if
-- a tagged type is declared, the corresponding class type is always
-- created, using this Ekind value).
E_Class_Wide_Subtype,
-- A subtype of a class wide type, created by a subtype declaration
-- used to declare a subtype of a class type.
E_Record_Type,
-- A record type, created by a record type declaration
E_Record_Subtype,
-- A record subtype, created by a record subtype declaration
E_Record_Type_With_Private,
-- Used for types defined by a private extension declaration,
-- and for tagged private types. Includes the fields for both
-- private types and for record types (with the sole exception of
-- Corresponding_Concurrent_Type which is obviously not needed). This
-- entity is considered to be both a record type and a private type.
E_Record_Subtype_With_Private,
-- A subtype of a type defined by a private extension declaration
E_Private_Type,
-- A private type, created by a private type declaration that has
-- neither the keyword limited nor the keyword tagged.
E_Private_Subtype,
-- A subtype of a private type, created by a subtype declaration used
-- to declare a subtype of a private type.
E_Limited_Private_Type,
-- A limited private type, created by a private type declaration that
-- has the keyword limited, but not the keyword tagged.
E_Limited_Private_Subtype,
-- A subtype of a limited private type, created by a subtype declaration
-- used to declare a subtype of a limited private type.
E_Incomplete_Type,
-- An incomplete type, created by an incomplete type declaration
E_Incomplete_Subtype,
-- An incomplete subtype, created by a subtype declaration where the
-- subtype mark denotes an incomplete type.
E_Task_Type,
-- A task type, created by a task type declaration. An entity with this
-- Ekind is also created to describe the anonymous type of a task that
-- is created by a single task declaration.
E_Task_Subtype,
-- A subtype of a task type, created by a subtype declaration used to
-- declare a subtype of a task type.
E_Protected_Type,
-- A protected type, created by a protected type declaration. An entity
-- with this Ekind is also created to describe the anonymous type of
-- a protected object created by a single protected declaration.
E_Protected_Subtype,
-- A subtype of a protected type, created by a subtype declaration used
-- to declare a subtype of a protected type.
-----------------
-- Other Types --
-----------------
E_Exception_Type,
-- The type of an exception created by an exception declaration
E_Subprogram_Type,
-- This is the designated type of an Access_To_Subprogram. Has type and
-- signature like a subprogram entity, so can appear in calls, which
-- are resolved like regular calls, except that such an entity is not
-- overloadable.
---------------------------
-- Overloadable Entities --
---------------------------
E_Enumeration_Literal,
-- An enumeration literal, created by the use of the literal in an
-- enumeration type definition.
E_Function,
-- A function, created by a function declaration or a function body
-- that acts as its own declaration.
E_Operator,
-- A predefined operator, appearing in Standard, or an implicitly
-- defined concatenation operator created whenever an array is declared.
-- We do not make normal derived operators explicit in the tree, but the
-- concatenation operators are made explicit.
E_Procedure,
-- A procedure, created by a procedure declaration or a procedure
-- body that acts as its own declaration.
E_Abstract_State,
-- A state abstraction. Used to designate entities introduced by aspect
-- or pragma Abstract_State. The entity carries the various properties
-- of the state.
E_Entry,
-- An entry, created by an entry declaration in a task or protected
-- object.
--------------------
-- Other Entities --
--------------------
E_Entry_Family,
-- An entry family, created by an entry family declaration in a
-- task or protected type definition.
E_Block,
-- A block identifier, created by an explicit or implicit label on
-- a block or declare statement.
E_Entry_Index_Parameter,
-- An entry index parameter created by an entry index specification
-- for the body of a protected entry family.
E_Exception,
-- An exception created by an exception declaration. The exception
-- itself uses E_Exception for the Ekind, the implicit type that is
-- created to represent its type uses the Ekind E_Exception_Type.
E_Generic_Function,
-- A generic function. This is the entity for a generic function
-- created by a generic subprogram declaration.
E_Generic_Procedure,
-- A generic function. This is the entity for a generic procedure
-- created by a generic subprogram declaration.
E_Generic_Package,
-- A generic package, this is the entity for a generic package created
-- by a generic package declaration.
E_Label,
-- The defining entity for a label. Note that this is created by the
-- implicit label declaration, not the occurrence of the label itself,
-- which is simply a direct name referring to the label.
E_Loop,
-- A loop identifier, created by an explicit or implicit label on a
-- loop statement.
E_Return_Statement,
-- A dummy entity created for each return statement. Used to hold
-- information about the return statement (what it applies to) and in
-- rules checking. For example, a simple_return_statement that applies
-- to an extended_return_statement cannot have an expression; this
-- requires putting the E_Return_Statement entity for the
-- extended_return_statement on the scope stack.
E_Package,
-- A package, created by a package declaration
E_Package_Body,
-- A package body. This entity serves only limited functions, since
-- most semantic analysis uses the package entity (E_Package). However
-- there are some attributes that are significant for the body entity.
-- For example, collection of exception handlers.
E_Protected_Body,
-- A protected body. This entity serves almost no function, since all
-- semantic analysis uses the protected entity (E_Protected_Type).
E_Task_Body,
-- A task body. This entity serves almost no function, since all
-- semantic analysis uses the protected entity (E_Task_Type).
E_Subprogram_Body
-- A subprogram body. Used when a subprogram has a separate declaration
-- to represent the entity for the body. This entity serves almost no
-- function, since all semantic analysis uses the subprogram entity
-- for the declaration (E_Function or E_Procedure).
);
for Entity_Kind'Size use 8;
-- The data structures in Atree assume this
--------------------------
-- Subtype Declarations --
--------------------------
-- The above entities are arranged so that they can be conveniently grouped
-- into subtype ranges. Note that for each of the xxx_Kind ranges defined
-- below, there is a corresponding Is_xxx (or for types, Is_xxx_Type)
-- predicate which is to be used in preference to direct range tests using
-- the subtype name. However, the subtype names are available for direct
-- use, e.g. as choices in case statements.
subtype Access_Kind is Entity_Kind range
E_Access_Type ..
-- E_Access_Subtype
-- E_Access_Attribute_Type
-- E_Allocator_Type
-- E_General_Access_Type
-- E_Access_Subprogram_Type
-- E_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Subprogram_Type
E_Anonymous_Access_Type;
subtype Access_Subprogram_Kind is Entity_Kind range
E_Access_Subprogram_Type ..
-- E_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Protected_Subprogram_Type
E_Anonymous_Access_Subprogram_Type;
subtype Access_Protected_Kind is Entity_Kind range
E_Access_Protected_Subprogram_Type ..
E_Anonymous_Access_Protected_Subprogram_Type;
subtype Aggregate_Kind is Entity_Kind range
E_Array_Type ..
-- E_Array_Subtype
-- E_String_Literal_Subtype
-- E_Class_Wide_Type
-- E_Class_Wide_Subtype
-- E_Record_Type
E_Record_Subtype;
subtype Anonymous_Access_Kind is Entity_Kind range
E_Anonymous_Access_Protected_Subprogram_Type ..
-- E_Anonymous_Subprogram_Type
E_Anonymous_Access_Type;
subtype Array_Kind is Entity_Kind range
E_Array_Type ..
-- E_Array_Subtype
E_String_Literal_Subtype;
subtype Assignable_Kind is Entity_Kind range
E_Variable ..
-- E_Out_Parameter
E_In_Out_Parameter;
subtype Class_Wide_Kind is Entity_Kind range
E_Class_Wide_Type ..
E_Class_Wide_Subtype;
subtype Composite_Kind is Entity_Kind range
E_Array_Type ..
-- E_Array_Subtype
-- E_String_Literal_Subtype
-- E_Class_Wide_Type
-- E_Class_Wide_Subtype
-- E_Record_Type
-- E_Record_Subtype
-- E_Record_Type_With_Private
-- E_Record_Subtype_With_Private
-- E_Private_Type
-- E_Private_Subtype
-- E_Limited_Private_Type
-- E_Limited_Private_Subtype
-- E_Incomplete_Type
-- E_Incomplete_Subtype
-- E_Task_Type
-- E_Task_Subtype,
-- E_Protected_Type,
E_Protected_Subtype;
subtype Concurrent_Kind is Entity_Kind range
E_Task_Type ..
-- E_Task_Subtype,
-- E_Protected_Type,
E_Protected_Subtype;
subtype Concurrent_Body_Kind is Entity_Kind range
E_Protected_Body ..
E_Task_Body;
subtype Decimal_Fixed_Point_Kind is Entity_Kind range
E_Decimal_Fixed_Point_Type ..
E_Decimal_Fixed_Point_Subtype;
subtype Digits_Kind is Entity_Kind range
E_Decimal_Fixed_Point_Type ..
-- E_Decimal_Fixed_Point_Subtype
-- E_Floating_Point_Type
E_Floating_Point_Subtype;
subtype Discrete_Kind is Entity_Kind range
E_Enumeration_Type ..
-- E_Enumeration_Subtype
-- E_Signed_Integer_Type
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
E_Modular_Integer_Subtype;
subtype Discrete_Or_Fixed_Point_Kind is Entity_Kind range
E_Enumeration_Type ..
-- E_Enumeration_Subtype
-- E_Signed_Integer_Type
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- E_Ordinary_Fixed_Point_Type
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
E_Decimal_Fixed_Point_Subtype;
subtype Elementary_Kind is Entity_Kind range
E_Enumeration_Type ..
-- E_Enumeration_Subtype
-- E_Signed_Integer_Type
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- E_Ordinary_Fixed_Point_Type
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
-- E_Decimal_Fixed_Point_Subtype
-- E_Floating_Point_Type
-- E_Floating_Point_Subtype
-- E_Access_Type
-- E_Access_Subtype
-- E_Access_Attribute_Type
-- E_Allocator_Type
-- E_General_Access_Type
-- E_Access_Subprogram_Type
-- E_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Subprogram_Type
E_Anonymous_Access_Type;
subtype Enumeration_Kind is Entity_Kind range
E_Enumeration_Type ..
E_Enumeration_Subtype;
subtype Entry_Kind is Entity_Kind range
E_Entry ..
E_Entry_Family;
subtype Fixed_Point_Kind is Entity_Kind range
E_Ordinary_Fixed_Point_Type ..
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
E_Decimal_Fixed_Point_Subtype;
subtype Float_Kind is Entity_Kind range
E_Floating_Point_Type ..
E_Floating_Point_Subtype;
subtype Formal_Kind is Entity_Kind range
E_Out_Parameter ..
-- E_In_Out_Parameter
E_In_Parameter;
subtype Formal_Object_Kind is Entity_Kind range
E_Generic_In_Out_Parameter ..
E_Generic_In_Parameter;
subtype Generic_Subprogram_Kind is Entity_Kind range
E_Generic_Function ..
E_Generic_Procedure;
subtype Generic_Unit_Kind is Entity_Kind range
E_Generic_Function ..
-- E_Generic_Procedure
E_Generic_Package;
subtype Incomplete_Kind is Entity_Kind range
E_Incomplete_Type ..
E_Incomplete_Subtype;
subtype Incomplete_Or_Private_Kind is Entity_Kind range
E_Record_Type_With_Private ..
-- E_Record_Subtype_With_Private
-- E_Private_Type
-- E_Private_Subtype
-- E_Limited_Private_Type
-- E_Limited_Private_Subtype
-- E_Incomplete_Type
E_Incomplete_Subtype;
subtype Integer_Kind is Entity_Kind range
E_Signed_Integer_Type ..
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
E_Modular_Integer_Subtype;
subtype Modular_Integer_Kind is Entity_Kind range
E_Modular_Integer_Type ..
E_Modular_Integer_Subtype;
subtype Named_Kind is Entity_Kind range
E_Named_Integer ..
E_Named_Real;
subtype Numeric_Kind is Entity_Kind range
E_Signed_Integer_Type ..
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- E_Ordinary_Fixed_Point_Type
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
-- E_Decimal_Fixed_Point_Subtype
-- E_Floating_Point_Type
E_Floating_Point_Subtype;
subtype Object_Kind is Entity_Kind range
E_Component ..
-- E_Constant
-- E_Discriminant
-- E_Loop_Parameter
-- E_Variable
-- E_Out_Parameter
-- E_In_Out_Parameter
-- E_In_Parameter
-- E_Generic_In_Out_Parameter
E_Generic_In_Parameter;
subtype Ordinary_Fixed_Point_Kind is Entity_Kind range
E_Ordinary_Fixed_Point_Type ..
E_Ordinary_Fixed_Point_Subtype;
subtype Overloadable_Kind is Entity_Kind range
E_Enumeration_Literal ..
-- E_Function
-- E_Operator
-- E_Procedure
-- E_Abstract_State
E_Entry;
subtype Private_Kind is Entity_Kind range
E_Record_Type_With_Private ..
-- E_Record_Subtype_With_Private
-- E_Private_Type
-- E_Private_Subtype
-- E_Limited_Private_Type
E_Limited_Private_Subtype;
subtype Protected_Kind is Entity_Kind range
E_Protected_Type ..
E_Protected_Subtype;
subtype Real_Kind is Entity_Kind range
E_Ordinary_Fixed_Point_Type ..
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
-- E_Decimal_Fixed_Point_Subtype
-- E_Floating_Point_Type
E_Floating_Point_Subtype;
subtype Record_Kind is Entity_Kind range
E_Class_Wide_Type ..
-- E_Class_Wide_Subtype
-- E_Record_Type
-- E_Record_Subtype
-- E_Record_Type_With_Private
E_Record_Subtype_With_Private;
subtype Scalar_Kind is Entity_Kind range
E_Enumeration_Type ..
-- E_Enumeration_Subtype
-- E_Signed_Integer_Type
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- E_Ordinary_Fixed_Point_Type
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
-- E_Decimal_Fixed_Point_Subtype
-- E_Floating_Point_Type
E_Floating_Point_Subtype;
subtype Subprogram_Kind is Entity_Kind range
E_Function ..
-- E_Operator
E_Procedure;
subtype Signed_Integer_Kind is Entity_Kind range
E_Signed_Integer_Type ..
E_Signed_Integer_Subtype;
subtype Task_Kind is Entity_Kind range
E_Task_Type ..
E_Task_Subtype;
subtype Type_Kind is Entity_Kind range
E_Enumeration_Type ..
-- E_Enumeration_Subtype
-- E_Signed_Integer_Type
-- E_Signed_Integer_Subtype
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- E_Ordinary_Fixed_Point_Type
-- E_Ordinary_Fixed_Point_Subtype
-- E_Decimal_Fixed_Point_Type
-- E_Decimal_Fixed_Point_Subtype
-- E_Floating_Point_Type
-- E_Floating_Point_Subtype
-- E_Access_Type
-- E_Access_Subtype
-- E_Access_Attribute_Type
-- E_Allocator_Type,
-- E_General_Access_Type
-- E_Access_Subprogram_Type,
-- E_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Protected_Subprogram_Type
-- E_Anonymous_Access_Subprogram_Type
-- E_Anonymous_Access_Type
-- E_Array_Type
-- E_Array_Subtype
-- E_String_Literal_Subtype
-- E_Class_Wide_Subtype
-- E_Class_Wide_Type
-- E_Record_Type
-- E_Record_Subtype
-- E_Record_Type_With_Private
-- E_Record_Subtype_With_Private
-- E_Private_Type
-- E_Private_Subtype
-- E_Limited_Private_Type
-- E_Limited_Private_Subtype
-- E_Incomplete_Type
-- E_Incomplete_Subtype
-- E_Task_Type
-- E_Task_Subtype
-- E_Protected_Type
-- E_Protected_Subtype
-- E_Exception_Type
E_Subprogram_Type;
--------------------------------------------------------
-- Description of Defined Attributes for Entity_Kinds --
--------------------------------------------------------
-- For each enumeration value defined in Entity_Kind we list all the
-- attributes defined in Einfo which can legally be applied to an entity
-- of that kind. The implementation of the attribute functions (and for
-- non-synthesized attributes, of the corresponding set procedures) are
-- in the Einfo body.
-- The following attributes are defined in all entities
-- Ekind (Ekind)
-- Chars (Name1)
-- Next_Entity (Node2)
-- Scope (Node3)
-- Homonym (Node4)
-- Etype (Node5)
-- First_Rep_Item (Node6)
-- Freeze_Node (Node7)
-- Prev_Entity (Node36)
-- Associated_Entity (Node37)
-- Address_Taken (Flag104)
-- Can_Never_Be_Null (Flag38)
-- Checks_May_Be_Suppressed (Flag31)
-- Debug_Info_Off (Flag166)
-- Has_Convention_Pragma (Flag119)
-- Has_Delayed_Aspects (Flag200)
-- Has_Delayed_Freeze (Flag18)
-- Has_Fully_Qualified_Name (Flag173)
-- Has_Gigi_Rep_Item (Flag82)
-- Has_Homonym (Flag56)
-- Has_Pragma_Elaborate_Body (Flag150)
-- Has_Pragma_Inline (Flag157)
-- Has_Pragma_Inline_Always (Flag230)
-- Has_Pragma_No_Inline (Flag201)
-- Has_Pragma_Pure (Flag203)
-- Has_Pragma_Pure_Function (Flag179)
-- Has_Pragma_Thread_Local_Storage (Flag169)
-- Has_Pragma_Unmodified (Flag233)
-- Has_Pragma_Unreferenced (Flag180)
-- Has_Pragma_Unused (Flag294)
-- Has_Private_Declaration (Flag155)
-- Has_Qualified_Name (Flag161)
-- Has_Stream_Size_Clause (Flag184)
-- Has_Unknown_Discriminants (Flag72)
-- Has_Xref_Entry (Flag182)
-- In_Private_Part (Flag45)
-- Is_Ada_2005_Only (Flag185)
-- Is_Ada_2012_Only (Flag199)
-- Is_Bit_Packed_Array (Flag122) (base type only)
-- Is_Aliased (Flag15)
-- Is_Character_Type (Flag63)
-- Is_Checked_Ghost_Entity (Flag277)
-- Is_Child_Unit (Flag73)
-- Is_Compilation_Unit (Flag149)
-- Is_Descendant_Of_Address (Flag223)
-- Is_Discrim_SO_Function (Flag176)
-- Is_Discriminant_Check_Function (Flag264)
-- Is_Dispatch_Table_Entity (Flag234)
-- Is_Dispatching_Operation (Flag6)
-- Is_Entry_Formal (Flag52)
-- Is_Exported (Flag99)
-- Is_First_Subtype (Flag70)
-- Is_Formal_Subprogram (Flag111)
-- Is_Generic_Instance (Flag130)
-- Is_Generic_Type (Flag13)
-- Is_Hidden (Flag57)
-- Is_Hidden_Open_Scope (Flag171)
-- Is_Ignored_Ghost_Entity (Flag278)
-- Is_Immediately_Visible (Flag7)
-- Is_Implementation_Defined (Flag254)
-- Is_Imported (Flag24)
-- Is_Inlined (Flag11)
-- Is_Internal (Flag17)
-- Is_Itype (Flag91)
-- Is_Known_Non_Null (Flag37)
-- Is_Known_Null (Flag204)
-- Is_Known_Valid (Flag170)
-- Is_Limited_Composite (Flag106)
-- Is_Limited_Record (Flag25)
-- Is_Loop_Parameter (Flag307)
-- Is_Obsolescent (Flag153)
-- Is_Package_Body_Entity (Flag160)
-- Is_Packed_Array_Impl_Type (Flag138)
-- Is_Potentially_Use_Visible (Flag9)
-- Is_Preelaborated (Flag59)
-- Is_Primitive_Wrapper (Flag195)
-- Is_Public (Flag10)
-- Is_Pure (Flag44)
-- Is_Remote_Call_Interface (Flag62)
-- Is_Remote_Types (Flag61)
-- Is_Renaming_Of_Object (Flag112)
-- Is_Shared_Passive (Flag60)
-- Is_Statically_Allocated (Flag28)
-- Is_Static_Type (Flag281)
-- Is_Tagged_Type (Flag55)
-- Is_Thunk (Flag225)
-- Is_Trivial_Subprogram (Flag235)
-- Is_Unchecked_Union (Flag117)
-- Is_Unimplemented (Flag284)
-- Is_Visible_Formal (Flag206)
-- Kill_Elaboration_Checks (Flag32)
-- Kill_Range_Checks (Flag33)
-- Low_Bound_Tested (Flag205)
-- Materialize_Entity (Flag168)
-- Needs_Debug_Info (Flag147)
-- Never_Set_In_Source (Flag115)
-- No_Return (Flag113)
-- Overlays_Constant (Flag243)
-- Referenced (Flag156)
-- Referenced_As_LHS (Flag36)
-- Referenced_As_Out_Parameter (Flag227)
-- Suppress_Elaboration_Warnings (Flag303)
-- Suppress_Style_Checks (Flag165)
-- Suppress_Value_Tracking_On_Call (Flag217)
-- Used_As_Generic_Actual (Flag222)
-- Warnings_Off (Flag96)
-- Warnings_Off_Used (Flag236)
-- Warnings_Off_Used_Unmodified (Flag237)
-- Warnings_Off_Used_Unreferenced (Flag238)
-- Was_Hidden (Flag196)
-- Declaration_Node (synth)
-- Has_Foreign_Convention (synth)
-- Is_Dynamic_Scope (synth)
-- Is_Ghost_Entity (synth)
-- Is_Standard_Character_Type (synth)
-- Is_Standard_String_Type (synth)
-- Underlying_Type (synth)
-- all classification attributes (synth)
-- The following list of access functions applies to all entities for
-- types and subtypes. References to this list appear subsequently as
-- "(plus type attributes)" for each appropriate Entity_Kind.
-- Associated_Node_For_Itype (Node8)
-- Class_Wide_Type (Node9)
-- Full_View (Node11)
-- Esize (Uint12)
-- RM_Size (Uint13)
-- Alignment (Uint14)
-- Pending_Access_Types (Elist15)
-- Related_Expression (Node24)
-- Current_Use_Clause (Node27)
-- Subprograms_For_Type (Elist29)
-- Derived_Type_Link (Node31)
-- No_Tagged_Streams_Pragma (Node32)
-- Linker_Section_Pragma (Node33)
-- SPARK_Pragma (Node40)
-- Depends_On_Private (Flag14)
-- Disable_Controlled (Flag253)
-- Discard_Names (Flag88)
-- Finalize_Storage_Only (Flag158) (base type only)
-- From_Limited_With (Flag159)
-- Has_Aliased_Components (Flag135) (base type only)
-- Has_Alignment_Clause (Flag46)
-- Has_Atomic_Components (Flag86) (base type only)
-- Has_Completion_In_Body (Flag71)
-- Has_Complex_Representation (Flag140) (base type only)
-- Has_Constrained_Partial_View (Flag187)
-- Has_Controlled_Component (Flag43) (base type only)
-- Has_Default_Aspect (Flag39) (base type only)
-- Has_Delayed_Rep_Aspects (Flag261)
-- Has_Discriminants (Flag5)
-- Has_Dynamic_Predicate_Aspect (Flag258)
-- Has_Independent_Components (Flag34) (base type only)
-- Has_Inheritable_Invariants (Flag248) (base type only)
-- Has_Inherited_DIC (Flag133) (base type only)
-- Has_Inherited_Invariants (Flag291) (base type only)
-- Has_Non_Standard_Rep (Flag75) (base type only)
-- Has_Object_Size_Clause (Flag172)
-- Has_Own_DIC (Flag3) (base type only)
-- Has_Own_Invariants (Flag232) (base type only)
-- Has_Pragma_Preelab_Init (Flag221)
-- Has_Pragma_Unreferenced_Objects (Flag212)
-- Has_Predicates (Flag250)
-- Has_Primitive_Operations (Flag120) (base type only)
-- Has_Protected (Flag271) (base type only)
-- Has_Size_Clause (Flag29)
-- Has_Specified_Layout (Flag100) (base type only)
-- Has_Specified_Stream_Input (Flag190)
-- Has_Specified_Stream_Output (Flag191)
-- Has_Specified_Stream_Read (Flag192)
-- Has_Specified_Stream_Write (Flag193)
-- Has_Static_Predicate (Flag269)
-- Has_Static_Predicate_Aspect (Flag259)
-- Has_Task (Flag30) (base type only)
-- Has_Timing_Event (Flag289) (base type only)
-- Has_Unchecked_Union (Flag123) (base type only)
-- Has_Volatile_Components (Flag87) (base type only)
-- In_Use (Flag8)
-- Is_Abstract_Type (Flag146)
-- Is_Asynchronous (Flag81)
-- Is_Atomic (Flag85)
-- Is_Constr_Subt_For_U_Nominal (Flag80)
-- Is_Constr_Subt_For_UN_Aliased (Flag141)
-- Is_Controlled_Active (Flag42) (base type only)
-- Is_Eliminated (Flag124)
-- Is_Frozen (Flag4)
-- Is_Generic_Actual_Type (Flag94)
-- Is_Independent (Flag268)
-- Is_Non_Static_Subtype (Flag109)
-- Is_Packed (Flag51) (base type only)
-- Is_Private_Composite (Flag107)
-- Is_RACW_Stub_Type (Flag244)
-- Is_Unsigned_Type (Flag144)
-- Is_Volatile (Flag16)
-- Is_Volatile_Full_Access (Flag285)
-- Itype_Printed (Flag202) (itypes only)
-- Known_To_Have_Preelab_Init (Flag207)
-- May_Inherit_Delayed_Rep_Aspects (Flag262)
-- Must_Be_On_Byte_Boundary (Flag183)
-- Must_Have_Preelab_Init (Flag208)
-- Optimize_Alignment_Space (Flag241)
-- Optimize_Alignment_Time (Flag242)
-- Partial_View_Has_Unknown_Discr (Flag280)
-- Size_Depends_On_Discriminant (Flag177)
-- Size_Known_At_Compile_Time (Flag92)
-- SPARK_Pragma_Inherited (Flag265)
-- Strict_Alignment (Flag145) (base type only)
-- Suppress_Initialization (Flag105)
-- Treat_As_Volatile (Flag41)
-- Universal_Aliasing (Flag216) (impl base type only)
-- Alignment_Clause (synth)
-- Base_Type (synth)
-- DIC_Procedure (synth)
-- Has_DIC (synth)
-- Has_Invariants (synth)
-- Implementation_Base_Type (synth)
-- Invariant_Procedure (synth)
-- Is_Access_Protected_Subprogram_Type (synth)
-- Is_Atomic_Or_VFA (synth)
-- Is_Controlled (synth)
-- Object_Size_Clause (synth)
-- Partial_Invariant_Procedure (synth)
-- Predicate_Function (synth)
-- Predicate_Function_M (synth)
-- Root_Type (synth)
-- Size_Clause (synth)
------------------------------------------
-- Applicable attributes by entity kind --
------------------------------------------
-- E_Abstract_State
-- Refinement_Constituents (Elist8)
-- Part_Of_Constituents (Elist10)
-- Body_References (Elist16)
-- Non_Limited_View (Node19)
-- Encapsulating_State (Node32)
-- SPARK_Pragma (Node40)
-- From_Limited_With (Flag159)
-- Has_Partial_Visible_Refinement (Flag296)
-- Has_Visible_Refinement (Flag263)
-- SPARK_Pragma_Inherited (Flag265)
-- Has_Non_Limited_View (synth)
-- Has_Non_Null_Visible_Refinement (synth)
-- Has_Null_Visible_Refinement (synth)
-- Is_External_State (synth)
-- Is_Null_State (synth)
-- Is_Relaxed_Initialization_State (synth)
-- Is_Synchronized_State (synth)
-- Partial_Refinement_Constituents (synth)
-- E_Access_Protected_Subprogram_Type
-- Equivalent_Type (Node18)
-- Directly_Designated_Type (Node20)
-- Needs_No_Actuals (Flag22)
-- Can_Use_Internal_Rep (Flag229)
-- (plus type attributes)
-- E_Access_Subprogram_Type
-- Equivalent_Type (Node18) (remote types only)
-- Directly_Designated_Type (Node20)
-- Needs_No_Actuals (Flag22)
-- Original_Access_Type (Node28)
-- Can_Use_Internal_Rep (Flag229)
-- Needs_Activation_Record (Flag306)
-- (plus type attributes)
-- E_Access_Type
-- E_Access_Subtype
-- Master_Id (Node17)
-- Directly_Designated_Type (Node20)
-- Associated_Storage_Pool (Node22) (base type only)
-- Finalization_Master (Node23) (base type only)
-- Storage_Size_Variable (Node26) (base type only)
-- Has_Pragma_Controlled (Flag27) (base type only)
-- Has_Storage_Size_Clause (Flag23) (base type only)
-- Is_Access_Constant (Flag69)
-- Is_Local_Anonymous_Access (Flag194)
-- Is_Pure_Unit_Access_Type (Flag189)
-- No_Pool_Assigned (Flag131) (base type only)
-- No_Strict_Aliasing (Flag136) (base type only)
-- Is_Param_Block_Component_Type (Flag215) (base type only)
-- (plus type attributes)
-- E_Access_Attribute_Type
-- Directly_Designated_Type (Node20)
-- (plus type attributes)
-- E_Allocator_Type
-- Directly_Designated_Type (Node20)
-- (plus type attributes)
-- E_Anonymous_Access_Subprogram_Type
-- E_Anonymous_Access_Protected_Subprogram_Type
-- Directly_Designated_Type (Node20)
-- Storage_Size_Variable (Node26) ??? is this needed ???
-- Can_Use_Internal_Rep (Flag229)
-- Needs_Activation_Record (Flag306)
-- (plus type attributes)
-- E_Anonymous_Access_Type
-- Directly_Designated_Type (Node20)
-- Finalization_Master (Node23)
-- Storage_Size_Variable (Node26) ??? is this needed ???
-- (plus type attributes)
-- E_Array_Type
-- E_Array_Subtype
-- First_Index (Node17)
-- Default_Aspect_Component_Value (Node19) (base type only)
-- Component_Type (Node20) (base type only)
-- Original_Array_Type (Node21)
-- Component_Size (Uint22) (base type only)
-- Packed_Array_Impl_Type (Node23)
-- Related_Array_Object (Node25)
-- Predicated_Parent (Node38) (subtype only)
-- Component_Alignment (special) (base type only)
-- Has_Component_Size_Clause (Flag68) (base type only)
-- Has_Pragma_Pack (Flag121) (impl base type only)
-- Is_Constrained (Flag12)
-- Reverse_Storage_Order (Flag93) (base type only)
-- SSO_Set_High_By_Default (Flag273) (base type only)
-- SSO_Set_Low_By_Default (Flag272) (base type only)
-- Next_Index (synth)
-- Number_Dimensions (synth)
-- (plus type attributes)
-- E_Block
-- Return_Applies_To (Node8)
-- Block_Node (Node11)
-- First_Entity (Node17)
-- Last_Entity (Node20)
-- Scope_Depth_Value (Uint22)
-- Entry_Cancel_Parameter (Node23)
-- Contains_Ignored_Ghost_Code (Flag279)
-- Delay_Cleanups (Flag114)
-- Discard_Names (Flag88)
-- Has_Master_Entity (Flag21)
-- Has_Nested_Block_With_Handler (Flag101)
-- Is_Exception_Handler (Flag286)
-- Sec_Stack_Needed_For_Return (Flag167)
-- Uses_Sec_Stack (Flag95)
-- Scope_Depth (synth)
-- E_Class_Wide_Type
-- E_Class_Wide_Subtype
-- Direct_Primitive_Operations (Elist10)
-- Cloned_Subtype (Node16) (subtype case only)
-- First_Entity (Node17)
-- Equivalent_Type (Node18) (always Empty for type)
-- Non_Limited_View (Node19)
-- Last_Entity (Node20)
-- SSO_Set_High_By_Default (Flag273) (base type only)
-- SSO_Set_Low_By_Default (Flag272) (base type only)
-- First_Component (synth)
-- First_Component_Or_Discriminant (synth)
-- Has_Non_Limited_View (synth)
-- (plus type attributes)
-- E_Component
-- Normalized_First_Bit (Uint8)
-- Current_Value (Node9) (always Empty)
-- Normalized_Position_Max (Uint10)
-- Component_Bit_Offset (Uint11)
-- Esize (Uint12)
-- Component_Clause (Node13)
-- Normalized_Position (Uint14)
-- DT_Entry_Count (Uint15)
-- Entry_Formal (Node16)
-- Prival (Node17)
-- Renamed_Object (Node18) (always Empty)
-- Discriminant_Checking_Func (Node20)
-- Corresponding_Record_Component (Node21)
-- Original_Record_Component (Node22)
-- DT_Offset_To_Top_Func (Node25)
-- Related_Type (Node27)
-- Has_Biased_Representation (Flag139)
-- Has_Per_Object_Constraint (Flag154)
-- Is_Atomic (Flag85)
-- Is_Independent (Flag268)
-- Is_Return_Object (Flag209)
-- Is_Tag (Flag78)
-- Is_Volatile (Flag16)
-- Is_Volatile_Full_Access (Flag285)
-- Treat_As_Volatile (Flag41)
-- Is_Atomic_Or_VFA (synth)
-- Next_Component (synth)
-- Next_Component_Or_Discriminant (synth)
-- E_Constant
-- E_Loop_Parameter
-- Current_Value (Node9) (always Empty)
-- Discriminal_Link (Node10)
-- Full_View (Node11)
-- Esize (Uint12)
-- Extra_Accessibility (Node13) (constants only)
-- Alignment (Uint14)
-- Status_Flag_Or_Transient_Decl (Node15)
-- Actual_Subtype (Node17)
-- Renamed_Object (Node18)
-- Size_Check_Code (Node19) (constants only)
-- Prival_Link (Node20) (privals only)
-- Interface_Name (Node21) (constants only)
-- Related_Type (Node27) (constants only)
-- Initialization_Statements (Node28)
-- BIP_Initialization_Call (Node29)
-- Last_Aggregate_Assignment (Node30)
-- Activation_Record_Component (Node31)
-- Encapsulating_State (Node32) (constants only)
-- Linker_Section_Pragma (Node33)
-- Contract (Node34) (constants only)
-- SPARK_Pragma (Node40) (constants only)
-- Has_Alignment_Clause (Flag46)
-- Has_Atomic_Components (Flag86)
-- Has_Biased_Representation (Flag139)
-- Has_Completion (Flag26) (constants only)
-- Has_Independent_Components (Flag34)
-- Has_Size_Clause (Flag29)
-- Has_Thunks (Flag228) (constants only)
-- Has_Volatile_Components (Flag87)
-- Is_Atomic (Flag85)
-- Is_Elaboration_Checks_OK_Id (Flag148) (constants only)
-- Is_Elaboration_Warnings_OK_Id (Flag304) (constants only)
-- Is_Eliminated (Flag124)
-- Is_Finalized_Transient (Flag252)
-- Is_Ignored_Transient (Flag295)
-- Is_Independent (Flag268)
-- Is_Return_Object (Flag209)
-- Is_True_Constant (Flag163)
-- Is_Uplevel_Referenced_Entity (Flag283)
-- Is_Volatile (Flag16)
-- Is_Volatile_Full_Access (Flag285)
-- Optimize_Alignment_Space (Flag241) (constants only)
-- Optimize_Alignment_Time (Flag242) (constants only)
-- SPARK_Pragma_Inherited (Flag265) (constants only)
-- Stores_Attribute_Old_Prefix (Flag270) (constants only)
-- Treat_As_Volatile (Flag41)
-- Address_Clause (synth)
-- Alignment_Clause (synth)
-- Is_Atomic_Or_VFA (synth)
-- Is_Elaboration_Target (synth)
-- Size_Clause (synth)
-- E_Decimal_Fixed_Point_Type
-- E_Decimal_Fixed_Subtype
-- Scale_Value (Uint16)
-- Digits_Value (Uint17)
-- Scalar_Range (Node20)
-- Delta_Value (Ureal18)
-- Small_Value (Ureal21)
-- Static_Real_Or_String_Predicate (Node25)
-- Has_Machine_Radix_Clause (Flag83)
-- Machine_Radix_10 (Flag84)
-- Aft_Value (synth)
-- Type_Low_Bound (synth)
-- Type_High_Bound (synth)
-- (plus type attributes)
-- E_Discriminant
-- Normalized_First_Bit (Uint8)
-- Current_Value (Node9) (always Empty)
-- Normalized_Position_Max (Uint10)
-- Component_Bit_Offset (Uint11)
-- Esize (Uint12)
-- Component_Clause (Node13)
-- Normalized_Position (Uint14)
-- Discriminant_Number (Uint15)
-- Discriminal (Node17)
-- Renamed_Object (Node18) (always Empty)
-- Corresponding_Discriminant (Node19)
-- Discriminant_Default_Value (Node20)
-- Corresponding_Record_Component (Node21)
-- Original_Record_Component (Node22)
-- CR_Discriminant (Node23)
-- Is_Completely_Hidden (Flag103)
-- Is_Return_Object (Flag209)
-- Next_Component_Or_Discriminant (synth)
-- Next_Discriminant (synth)
-- Next_Stored_Discriminant (synth)
-- E_Entry
-- E_Entry_Family
-- Protected_Body_Subprogram (Node11)
-- Barrier_Function (Node12)
-- Elaboration_Entity (Node13)
-- Postconditions_Proc (Node14)
-- Entry_Parameters_Type (Node15)
-- First_Entity (Node17)
-- Alias (Node18) (for entry only. Empty)
-- Last_Entity (Node20)
-- Accept_Address (Elist21)
-- Scope_Depth_Value (Uint22)
-- Protection_Object (Node23) (protected kind)
-- Contract_Wrapper (Node25)
-- Extra_Formals (Node28)
-- Contract (Node34)
-- SPARK_Pragma (Node40) (protected kind)
-- Default_Expressions_Processed (Flag108)
-- Entry_Accepted (Flag152)
-- Has_Yield_Aspect (Flag308)
-- Has_Expanded_Contract (Flag240)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Is_Entry_Wrapper (Flag297)
-- Needs_No_Actuals (Flag22)
-- Sec_Stack_Needed_For_Return (Flag167)
-- SPARK_Pragma_Inherited (Flag265) (protected kind)
-- Uses_Sec_Stack (Flag95)
-- Address_Clause (synth)
-- Entry_Index_Type (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
-- Is_Elaboration_Target (synth)
-- Last_Formal (synth)
-- Number_Formals (synth)
-- Scope_Depth (synth)
-- E_Entry_Index_Parameter
-- Entry_Index_Constant (Node18)
-- E_Enumeration_Literal
-- Enumeration_Pos (Uint11)
-- Enumeration_Rep (Uint12)
-- Alias (Node18)
-- Enumeration_Rep_Expr (Node22)
-- Next_Literal (synth)
-- E_Enumeration_Type
-- E_Enumeration_Subtype
-- Lit_Strings (Node16) (root type only)
-- First_Literal (Node17)
-- Lit_Indexes (Node18) (root type only)
-- Default_Aspect_Value (Node19) (base type only)
-- Scalar_Range (Node20)
-- Enum_Pos_To_Rep (Node23) (type only)
-- Static_Discrete_Predicate (List25)
-- Has_Biased_Representation (Flag139)
-- Has_Contiguous_Rep (Flag181)
-- Has_Enumeration_Rep_Clause (Flag66)
-- Has_Pragma_Ordered (Flag198) (base type only)
-- Nonzero_Is_True (Flag162) (base type only)
-- No_Predicate_On_Actual (Flag275)
-- No_Dynamic_Predicate_On_Actual (Flag276)
-- Type_Low_Bound (synth)
-- Type_High_Bound (synth)
-- (plus type attributes)
-- E_Exception
-- Esize (Uint12)
-- Alignment (Uint14)
-- Renamed_Entity (Node18)
-- Register_Exception_Call (Node20)
-- Interface_Name (Node21)
-- Activation_Record_Component (Node31)
-- Discard_Names (Flag88)
-- Is_Raised (Flag224)
-- E_Exception_Type
-- Equivalent_Type (Node18)
-- (plus type attributes)
-- E_Floating_Point_Type
-- E_Floating_Point_Subtype
-- Digits_Value (Uint17)
-- Float_Rep (Uint10) (Float_Rep_Kind)
-- Default_Aspect_Value (Node19) (base type only)
-- Scalar_Range (Node20)
-- Static_Real_Or_String_Predicate (Node25)
-- Machine_Emax_Value (synth)
-- Machine_Emin_Value (synth)
-- Machine_Mantissa_Value (synth)
-- Machine_Radix_Value (synth)
-- Model_Emin_Value (synth)
-- Model_Epsilon_Value (synth)
-- Model_Mantissa_Value (synth)
-- Model_Small_Value (synth)
-- Safe_Emax_Value (synth)
-- Safe_First_Value (synth)
-- Safe_Last_Value (synth)
-- Type_Low_Bound (synth)
-- Type_High_Bound (synth)
-- (plus type attributes)
-- E_Function
-- E_Generic_Function
-- Mechanism (Uint8) (Mechanism_Type)
-- Renaming_Map (Uint9)
-- Handler_Records (List10) (non-generic case only)
-- Protected_Body_Subprogram (Node11)
-- Next_Inlined_Subprogram (Node12)
-- Elaboration_Entity (Node13) (not implicit /=)
-- Postconditions_Proc (Node14) (non-generic case only)
-- DT_Position (Uint15)
-- DTC_Entity (Node16)
-- First_Entity (Node17)
-- Alias (Node18) (non-generic case only)
-- Renamed_Entity (Node18)
-- Extra_Accessibility_Of_Result (Node19) (non-generic case only)
-- Last_Entity (Node20)
-- Interface_Name (Node21)
-- Scope_Depth_Value (Uint22)
-- Generic_Renamings (Elist23) (for an instance)
-- Inner_Instances (Elist23) (generic case only)
-- Protection_Object (Node23) (for concurrent kind)
-- Subps_Index (Uint24) (non-generic case only)
-- Interface_Alias (Node25)
-- Overridden_Operation (Node26)
-- Wrapped_Entity (Node27) (non-generic case only)
-- Extra_Formals (Node28)
-- Anonymous_Masters (Elist29) (non-generic case only)
-- Corresponding_Equality (Node30) (implicit /= only)
-- Thunk_Entity (Node31) (thunk case only)
-- Corresponding_Procedure (Node32) (generate C code only)
-- Linker_Section_Pragma (Node33)
-- Contract (Node34)
-- Import_Pragma (Node35) (non-generic case only)
-- Class_Wide_Clone (Node38)
-- Protected_Subprogram (Node39) (non-generic case only)
-- SPARK_Pragma (Node40)
-- Original_Protected_Subprogram (Node41)
-- Body_Needed_For_SAL (Flag40)
-- Contains_Ignored_Ghost_Code (Flag279)
-- Default_Expressions_Processed (Flag108)
-- Delay_Cleanups (Flag114)
-- Delay_Subprogram_Descriptors (Flag50)
-- Discard_Names (Flag88)
-- Elaboration_Entity_Required (Flag174)
-- Has_Completion (Flag26)
-- Has_Controlling_Result (Flag98)
-- Has_Expanded_Contract (Flag240) (non-generic case only)
-- Has_Master_Entity (Flag21)
-- Has_Missing_Return (Flag142)
-- Has_Nested_Block_With_Handler (Flag101)
-- Has_Nested_Subprogram (Flag282)
-- Has_Out_Or_In_Out_Parameter (Flag110)
-- Has_Recursive_Call (Flag143)
-- Has_Yield_Aspect (Flag308)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Is_Abstract_Subprogram (Flag19) (non-generic case only)
-- Is_Called (Flag102) (non-generic case only)
-- Is_Constructor (Flag76)
-- Is_CUDA_Kernel (Flag118) (non-generic case only)
-- Is_DIC_Procedure (Flag132) (non-generic case only)
-- Is_Discrim_SO_Function (Flag176)
-- Is_Discriminant_Check_Function (Flag264)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Is_Eliminated (Flag124)
-- Is_Generic_Actual_Subprogram (Flag274) (non-generic case only)
-- Is_Hidden_Non_Overridden_Subpgm (Flag2) (non-generic case only)
-- Is_Initial_Condition_Procedure (Flag302) (non-generic case only)
-- Is_Inlined_Always (Flag1) (non-generic case only)
-- Is_Instantiated (Flag126) (generic case only)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Invariant_Procedure (Flag257) (non-generic case only)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Partial_Invariant_Procedure (Flag292) (non-generic case only)
-- Is_Predicate_Function (Flag255) (non-generic case only)
-- Is_Predicate_Function_M (Flag256) (non-generic case only)
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Visible_Lib_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
-- Requires_Overriding (Flag213) (non-generic case only)
-- Return_Present (Flag54)
-- Returns_By_Ref (Flag90)
-- Rewritten_For_C (Flag287) (generate C code only)
-- Sec_Stack_Needed_For_Return (Flag167)
-- SPARK_Pragma_Inherited (Flag265)
-- Uses_Sec_Stack (Flag95)
-- Address_Clause (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
-- Is_Elaboration_Target (synth)
-- Last_Formal (synth)
-- Number_Formals (synth)
-- Scope_Depth (synth)
-- E_General_Access_Type
-- Master_Id (Node17)
-- Directly_Designated_Type (Node20)
-- Associated_Storage_Pool (Node22) (root type only)
-- Finalization_Master (Node23) (root type only)
-- Storage_Size_Variable (Node26) (base type only)
-- (plus type attributes)
-- E_Generic_In_Parameter
-- E_Generic_In_Out_Parameter
-- Current_Value (Node9) (always Empty)
-- Entry_Component (Node11)
-- Actual_Subtype (Node17)
-- Renamed_Object (Node18) (always Empty)
-- Default_Value (Node20)
-- Protected_Formal (Node22)
-- Is_Controlling_Formal (Flag97)
-- Is_Return_Object (Flag209)
-- Parameter_Mode (synth)
-- E_Incomplete_Type
-- E_Incomplete_Subtype
-- Direct_Primitive_Operations (Elist10)
-- Non_Limited_View (Node19)
-- Private_Dependents (Elist18)
-- Discriminant_Constraint (Elist21)
-- Stored_Constraint (Elist23)
-- Has_Non_Limited_View (synth)
-- (plus type attributes)
-- E_In_Parameter
-- E_In_Out_Parameter
-- E_Out_Parameter
-- Mechanism (Uint8) (Mechanism_Type)
-- Current_Value (Node9)
-- Discriminal_Link (Node10) (discriminals only)
-- Entry_Component (Node11)
-- Esize (Uint12)
-- Extra_Accessibility (Node13)
-- Alignment (Uint14)
-- Extra_Formal (Node15)
-- Unset_Reference (Node16)
-- Actual_Subtype (Node17)
-- Renamed_Object (Node18)
-- Spec_Entity (Node19)
-- Default_Value (Node20)
-- Default_Expr_Function (Node21)
-- Protected_Formal (Node22)
-- Extra_Constrained (Node23)
-- Minimum_Accessibility (Node24)
-- Last_Assignment (Node26) (OUT, IN-OUT only)
-- Activation_Record_Component (Node31)
-- Has_Initial_Value (Flag219)
-- Is_Controlling_Formal (Flag97)
-- Is_Only_Out_Parameter (Flag226)
-- Low_Bound_Tested (Flag205)
-- Is_Return_Object (Flag209)
-- Is_Activation_Record (Flag305)
-- Parameter_Mode (synth)
-- E_Label
-- Enclosing_Scope (Node18)
-- Reachable (Flag49)
-- E_Limited_Private_Type
-- E_Limited_Private_Subtype
-- First_Entity (Node17)
-- Private_Dependents (Elist18)
-- Underlying_Full_View (Node19)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
-- Stored_Constraint (Elist23)
-- Has_Completion (Flag26)
-- (plus type attributes)
-- E_Loop
-- First_Exit_Statement (Node8)
-- Has_Exit (Flag47)
-- Has_Loop_Entry_Attributes (Flag260)
-- Has_Master_Entity (Flag21)
-- Has_Nested_Block_With_Handler (Flag101)
-- Uses_Sec_Stack (Flag95)
-- E_Modular_Integer_Type
-- E_Modular_Integer_Subtype
-- Modulus (Uint17) (base type only)
-- Default_Aspect_Value (Node19) (base type only)
-- Original_Array_Type (Node21)
-- Scalar_Range (Node20)
-- Static_Discrete_Predicate (List25)
-- Non_Binary_Modulus (Flag58) (base type only)
-- Has_Biased_Representation (Flag139)
-- Has_Shift_Operator (Flag267) (base type only)
-- No_Predicate_On_Actual (Flag275)
-- No_Dynamic_Predicate_On_Actual (Flag276)
-- Type_Low_Bound (synth)
-- Type_High_Bound (synth)
-- (plus type attributes)
-- E_Named_Integer
-- E_Named_Real
-- E_Operator
-- First_Entity (Node17)
-- Alias (Node18)
-- Extra_Accessibility_Of_Result (Node19)
-- Last_Entity (Node20)
-- Subps_Index (Uint24)
-- Overridden_Operation (Node26)
-- Linker_Section_Pragma (Node33)
-- Contract (Node34)
-- Import_Pragma (Node35)
-- SPARK_Pragma (Node40)
-- Default_Expressions_Processed (Flag108)
-- Has_Nested_Subprogram (Flag282)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Machine_Code_Subprogram (Flag137)
-- Is_Primitive (Flag218)
-- Is_Pure (Flag44)
-- SPARK_Pragma_Inherited (Flag265)
-- Is_Elaboration_Target (synth)
-- Aren't there more flags and fields? seems like this list should be
-- more similar to the E_Function list, which is much longer ???
-- E_Ordinary_Fixed_Point_Type
-- E_Ordinary_Fixed_Point_Subtype
-- Delta_Value (Ureal18)
-- Default_Aspect_Value (Node19) (base type only)
-- Scalar_Range (Node20)
-- Static_Real_Or_String_Predicate (Node25)
-- Small_Value (Ureal21)
-- Has_Small_Clause (Flag67)
-- Aft_Value (synth)
-- Type_Low_Bound (synth)
-- Type_High_Bound (synth)
-- (plus type attributes)
-- E_Package
-- E_Generic_Package
-- Dependent_Instances (Elist8) (for an instance)
-- Renaming_Map (Uint9)
-- Handler_Records (List10) (non-generic case only)
-- Generic_Homonym (Node11) (generic case only)
-- Associated_Formal_Package (Node12)
-- Elaboration_Entity (Node13)
-- Related_Instance (Node15) (non-generic case only)
-- First_Private_Entity (Node16)
-- First_Entity (Node17)
-- Renamed_Entity (Node18)
-- Body_Entity (Node19)
-- Last_Entity (Node20)
-- Interface_Name (Node21)
-- Scope_Depth_Value (Uint22)
-- Generic_Renamings (Elist23) (for an instance)
-- Inner_Instances (Elist23) (generic case only)
-- Limited_View (Node23) (non-generic/instance)
-- Incomplete_Actuals (Elist24) (for an instance)
-- Abstract_States (Elist25)
-- Package_Instantiation (Node26)
-- Current_Use_Clause (Node27)
-- Finalizer (Node28) (non-generic case only)
-- Anonymous_Masters (Elist29) (non-generic case only)
-- Contract (Node34)
-- SPARK_Pragma (Node40)
-- SPARK_Aux_Pragma (Node41)
-- Body_Needed_For_Inlining (Flag299)
-- Body_Needed_For_SAL (Flag40)
-- Contains_Ignored_Ghost_Code (Flag279)
-- Delay_Subprogram_Descriptors (Flag50)
-- Discard_Names (Flag88)
-- Elaborate_Body_Desirable (Flag210) (non-generic case only)
-- Elaboration_Entity_Required (Flag174)
-- From_Limited_With (Flag159)
-- Has_All_Calls_Remote (Flag79)
-- Has_Completion (Flag26)
-- Has_Forward_Instantiation (Flag175)
-- Has_Master_Entity (Flag21)
-- Has_RACW (Flag214) (non-generic case only)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Is_Called (Flag102) (non-generic case only)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Is_Instantiated (Flag126)
-- In_Package_Body (Flag48)
-- Is_Private_Descendant (Flag53)
-- In_Use (Flag8)
-- Is_Visible_Lib_Unit (Flag116)
-- Renamed_In_Spec (Flag231) (non-generic case only)
-- SPARK_Aux_Pragma_Inherited (Flag266)
-- SPARK_Pragma_Inherited (Flag265)
-- Static_Elaboration_Desired (Flag77) (non-generic case only)
-- Has_Non_Null_Abstract_State (synth)
-- Has_Null_Abstract_State (synth)
-- Is_Elaboration_Target (synth)
-- Is_Wrapper_Package (synth) (non-generic case only)
-- Scope_Depth (synth)
-- E_Package_Body
-- Handler_Records (List10) (non-generic case only)
-- Related_Instance (Node15) (non-generic case only)
-- First_Entity (Node17)
-- Spec_Entity (Node19)
-- Last_Entity (Node20)
-- Scope_Depth_Value (Uint22)
-- Finalizer (Node28) (non-generic case only)
-- Contract (Node34)
-- SPARK_Pragma (Node40)
-- SPARK_Aux_Pragma (Node41)
-- Contains_Ignored_Ghost_Code (Flag279)
-- Delay_Subprogram_Descriptors (Flag50)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- SPARK_Aux_Pragma_Inherited (Flag266)
-- SPARK_Pragma_Inherited (Flag265)
-- Scope_Depth (synth)
-- E_Private_Type
-- E_Private_Subtype
-- Direct_Primitive_Operations (Elist10)
-- First_Entity (Node17)
-- Private_Dependents (Elist18)
-- Underlying_Full_View (Node19)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
-- Stored_Constraint (Elist23)
-- Has_Completion (Flag26)
-- Is_Controlled_Active (Flag42) (base type only)
-- (plus type attributes)
-- E_Procedure
-- E_Generic_Procedure
-- Renaming_Map (Uint9)
-- Handler_Records (List10) (non-generic case only)
-- Protected_Body_Subprogram (Node11)
-- Next_Inlined_Subprogram (Node12)
-- Elaboration_Entity (Node13)
-- Postconditions_Proc (Node14) (non-generic case only)
-- DT_Position (Uint15)
-- DTC_Entity (Node16)
-- First_Entity (Node17)
-- Alias (Node18) (non-generic case only)
-- Renamed_Entity (Node18)
-- Receiving_Entry (Node19) (non-generic case only)
-- Last_Entity (Node20)
-- Interface_Name (Node21)
-- Scope_Depth_Value (Uint22)
-- Generic_Renamings (Elist23) (for an instance)
-- Inner_Instances (Elist23) (generic case only)
-- Protection_Object (Node23) (for concurrent kind)
-- Subps_Index (Uint24) (non-generic case only)
-- Interface_Alias (Node25)
-- Overridden_Operation (Node26) (never for init proc)
-- Wrapped_Entity (Node27) (non-generic case only)
-- Extra_Formals (Node28)
-- Anonymous_Masters (Elist29) (non-generic case only)
-- Static_Initialization (Node30) (init_proc only)
-- Thunk_Entity (Node31) (thunk case only)
-- Corresponding_Function (Node32) (generate C code only)
-- Linker_Section_Pragma (Node33)
-- Contract (Node34)
-- Import_Pragma (Node35) (non-generic case only)
-- Class_Wide_Clone (Node38)
-- Protected_Subprogram (Node39) (non-generic case only)
-- SPARK_Pragma (Node40)
-- Original_Protected_Subprogram (Node41)
-- Body_Needed_For_SAL (Flag40)
-- Contains_Ignored_Ghost_Code (Flag279)
-- Delay_Cleanups (Flag114)
-- Discard_Names (Flag88)
-- Elaboration_Entity_Required (Flag174)
-- Default_Expressions_Processed (Flag108)
-- Delay_Cleanups (Flag114)
-- Delay_Subprogram_Descriptors (Flag50)
-- Discard_Names (Flag88)
-- Has_Completion (Flag26)
-- Has_Expanded_Contract (Flag240) (non-generic case only)
-- Has_Master_Entity (Flag21)
-- Has_Nested_Block_With_Handler (Flag101)
-- Has_Nested_Subprogram (Flag282)
-- Has_Yield_Aspect (Flag308)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Is_Abstract_Subprogram (Flag19) (non-generic case only)
-- Is_Asynchronous (Flag81)
-- Is_Called (Flag102) (non-generic case only)
-- Is_Constructor (Flag76)
-- Is_CUDA_Kernel (Flag118)
-- Is_DIC_Procedure (Flag132) (non-generic case only)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Is_Eliminated (Flag124)
-- Is_Generic_Actual_Subprogram (Flag274) (non-generic case only)
-- Is_Hidden_Non_Overridden_Subpgm (Flag2) (non-generic case only)
-- Is_Initial_Condition_Procedure (Flag302) (non-generic case only)
-- Is_Inlined_Always (Flag1) (non-generic case only)
-- Is_Instantiated (Flag126) (generic case only)
-- Is_Interrupt_Handler (Flag89)
-- Is_Intrinsic_Subprogram (Flag64)
-- Is_Invariant_Procedure (Flag257) (non-generic case only)
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Null_Init_Proc (Flag178)
-- Is_Partial_Invariant_Procedure (Flag292) (non-generic case only)
-- Is_Predicate_Function (Flag255) (non-generic case only)
-- Is_Predicate_Function_M (Flag256) (non-generic case only)
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Valued_Procedure (Flag127)
-- Is_Visible_Lib_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
-- No_Return (Flag113)
-- Requires_Overriding (Flag213) (non-generic case only)
-- Sec_Stack_Needed_For_Return (Flag167)
-- SPARK_Pragma_Inherited (Flag265)
-- Address_Clause (synth)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
-- Is_Elaboration_Target (synth)
-- Is_Finalizer (synth)
-- Last_Formal (synth)
-- Number_Formals (synth)
-- E_Protected_Body
-- SPARK_Pragma (Node40)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- SPARK_Pragma_Inherited (Flag265)
-- (any others??? First/Last Entity, Scope_Depth???)
-- E_Protected_Object
-- E_Protected_Type
-- E_Protected_Subtype
-- Direct_Primitive_Operations (Elist10)
-- First_Private_Entity (Node16)
-- First_Entity (Node17)
-- Corresponding_Record_Type (Node18)
-- Entry_Bodies_Array (Node19)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
-- Scope_Depth_Value (Uint22)
-- Stored_Constraint (Elist23)
-- Anonymous_Object (Node30)
-- Contract (Node34)
-- Entry_Max_Queue_Lengths_Array (Node35)
-- SPARK_Aux_Pragma (Node41)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- SPARK_Aux_Pragma_Inherited (Flag266)
-- Uses_Lock_Free (Flag188)
-- First_Component (synth)
-- First_Component_Or_Discriminant (synth)
-- Has_Entries (synth)
-- Has_Interrupt_Handler (synth)
-- Number_Entries (synth)
-- Scope_Depth (synth)
-- (plus type attributes)
-- E_Record_Type
-- E_Record_Subtype
-- Direct_Primitive_Operations (Elist10)
-- Access_Disp_Table (Elist16) (base type only)
-- Cloned_Subtype (Node16) (subtype case only)
-- First_Entity (Node17)
-- Corresponding_Concurrent_Type (Node18)
-- Parent_Subtype (Node19) (base type only)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
-- Corresponding_Remote_Type (Node22)
-- Stored_Constraint (Elist23)
-- Interfaces (Elist25)
-- Dispatch_Table_Wrappers (Elist26) (base type only)
-- Underlying_Record_View (Node28) (base type only)
-- Access_Disp_Table_Elab_Flag (Node30) (base type only)
-- Predicated_Parent (Node38) (subtype only)
-- Component_Alignment (special) (base type only)
-- C_Pass_By_Copy (Flag125) (base type only)
-- Has_Dispatch_Table (Flag220) (base tagged type only)
-- Has_Pragma_Pack (Flag121) (impl base type only)
-- Has_Private_Ancestor (Flag151)
-- Has_Private_Extension (Flag300)
-- Has_Record_Rep_Clause (Flag65) (base type only)
-- Has_Static_Discriminants (Flag211) (subtype only)
-- Is_Class_Wide_Equivalent_Type (Flag35)
-- Is_Concurrent_Record_Type (Flag20)
-- Is_Constrained (Flag12)
-- Is_Controlled_Active (Flag42) (base type only)
-- Is_Interface (Flag186)
-- Is_Limited_Interface (Flag197)
-- No_Reordering (Flag239) (base type only)
-- Reverse_Bit_Order (Flag164) (base type only)
-- Reverse_Storage_Order (Flag93) (base type only)
-- SSO_Set_High_By_Default (Flag273) (base type only)
-- SSO_Set_Low_By_Default (Flag272) (base type only)
-- First_Component (synth)
-- First_Component_Or_Discriminant (synth)
-- (plus type attributes)
-- E_Record_Type_With_Private
-- E_Record_Subtype_With_Private
-- Direct_Primitive_Operations (Elist10)
-- First_Entity (Node17)
-- Private_Dependents (Elist18)
-- Underlying_Full_View (Node19)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
-- Stored_Constraint (Elist23)
-- Interfaces (Elist25)
-- Predicated_Parent (Node38) (subtype only)
-- Has_Completion (Flag26)
-- Has_Private_Ancestor (Flag151)
-- Has_Private_Extension (Flag300)
-- Has_Record_Rep_Clause (Flag65) (base type only)
-- Is_Concurrent_Record_Type (Flag20)
-- Is_Constrained (Flag12)
-- Is_Controlled_Active (Flag42) (base type only)
-- Is_Interface (Flag186)
-- Is_Limited_Interface (Flag197)
-- No_Reordering (Flag239) (base type only)
-- Reverse_Bit_Order (Flag164) (base type only)
-- Reverse_Storage_Order (Flag93) (base type only)
-- SSO_Set_High_By_Default (Flag273) (base type only)
-- SSO_Set_Low_By_Default (Flag272) (base type only)
-- First_Component (synth)
-- First_Component_Or_Discriminant (synth)
-- (plus type attributes)
-- E_Return_Statement
-- Return_Applies_To (Node8)
-- E_Signed_Integer_Type
-- E_Signed_Integer_Subtype
-- Default_Aspect_Value (Node19) (base type only)
-- Scalar_Range (Node20)
-- Static_Discrete_Predicate (List25)
-- Has_Biased_Representation (Flag139)
-- Has_Shift_Operator (Flag267) (base type only)
-- No_Predicate_On_Actual (Flag275)
-- No_Dynamic_Predicate_On_Actual (Flag276)
-- Type_Low_Bound (synth)
-- Type_High_Bound (synth)
-- (plus type attributes)
-- E_String_Literal_Subtype
-- String_Literal_Length (Uint16)
-- First_Index (Node17) (always Empty)
-- String_Literal_Low_Bound (Node18)
-- Packed_Array_Impl_Type (Node23)
-- (plus type attributes)
-- E_Subprogram_Body
-- Mechanism (Uint8)
-- First_Entity (Node17)
-- Corresponding_Protected_Entry (Node18)
-- Last_Entity (Node20)
-- Scope_Depth_Value (Uint22)
-- Extra_Formals (Node28)
-- Anonymous_Masters (Elist29)
-- Contract (Node34)
-- SPARK_Pragma (Node40)
-- Contains_Ignored_Ghost_Code (Flag279)
-- SPARK_Pragma_Inherited (Flag265)
-- Scope_Depth (synth)
-- E_Subprogram_Type
-- Extra_Accessibility_Of_Result (Node19)
-- Directly_Designated_Type (Node20)
-- Extra_Formals (Node28)
-- Access_Subprogram_Wrapper (Node41)
-- First_Formal (synth)
-- First_Formal_With_Extras (synth)
-- Last_Formal (synth)
-- Number_Formals (synth)
-- Returns_By_Ref (Flag90)
-- (plus type attributes)
-- E_Task_Body
-- Contract (Node34)
-- SPARK_Pragma (Node40)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- SPARK_Pragma_Inherited (Flag265)
-- (any others??? First/Last Entity, Scope_Depth???)
-- E_Task_Type
-- E_Task_Subtype
-- Direct_Primitive_Operations (Elist10)
-- First_Private_Entity (Node16)
-- First_Entity (Node17)
-- Corresponding_Record_Type (Node18)
-- Last_Entity (Node20)
-- Discriminant_Constraint (Elist21)
-- Scope_Depth_Value (Uint22)
-- Stored_Constraint (Elist23)
-- Task_Body_Procedure (Node25)
-- Storage_Size_Variable (Node26) (base type only)
-- Relative_Deadline_Variable (Node28) (base type only)
-- Anonymous_Object (Node30)
-- Contract (Node34)
-- SPARK_Aux_Pragma (Node41)
-- Delay_Cleanups (Flag114)
-- Has_Master_Entity (Flag21)
-- Has_Storage_Size_Clause (Flag23) (base type only)
-- Ignore_SPARK_Mode_Pragmas (Flag301)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- SPARK_Aux_Pragma_Inherited (Flag266)
-- First_Component (synth)
-- First_Component_Or_Discriminant (synth)
-- Has_Entries (synth)
-- Is_Elaboration_Target (synth)
-- Number_Entries (synth)
-- Scope_Depth (synth)
-- (plus type attributes)
-- E_Variable
-- Hiding_Loop_Variable (Node8)
-- Current_Value (Node9)
-- Part_Of_Constituents (Elist10)
-- Part_Of_References (Elist11)
-- Esize (Uint12)
-- Extra_Accessibility (Node13)
-- Alignment (Uint14)
-- Status_Flag_Or_Transient_Decl (Node15) (transient object only)
-- Unset_Reference (Node16)
-- Actual_Subtype (Node17)
-- Renamed_Object (Node18)
-- Size_Check_Code (Node19)
-- Prival_Link (Node20)
-- Interface_Name (Node21)
-- Shared_Var_Procs_Instance (Node22)
-- Extra_Constrained (Node23)
-- Related_Expression (Node24)
-- Debug_Renaming_Link (Node25)
-- Last_Assignment (Node26)
-- Related_Type (Node27)
-- Initialization_Statements (Node28)
-- BIP_Initialization_Call (Node29)
-- Last_Aggregate_Assignment (Node30)
-- Activation_Record_Component (Node31)
-- Encapsulating_State (Node32)
-- Linker_Section_Pragma (Node33)
-- Contract (Node34)
-- Anonymous_Designated_Type (Node35)
-- Validated_Object (Node38)
-- SPARK_Pragma (Node40)
-- Has_Alignment_Clause (Flag46)
-- Has_Atomic_Components (Flag86)
-- Has_Biased_Representation (Flag139)
-- Has_Independent_Components (Flag34)
-- Has_Initial_Value (Flag219)
-- Has_Size_Clause (Flag29)
-- Has_Volatile_Components (Flag87)
-- Is_Atomic (Flag85)
-- Is_Elaboration_Checks_OK_Id (Flag148)
-- Is_Elaboration_Warnings_OK_Id (Flag304)
-- Is_Eliminated (Flag124)
-- Is_Finalized_Transient (Flag252)
-- Is_Ignored_Transient (Flag295)
-- Is_Independent (Flag268)
-- Is_Return_Object (Flag209)
-- Is_Safe_To_Reevaluate (Flag249)
-- Is_Shared_Passive (Flag60)
-- Is_True_Constant (Flag163)
-- Is_Uplevel_Referenced_Entity (Flag283)
-- Is_Volatile (Flag16)
-- Is_Volatile_Full_Access (Flag285)
-- OK_To_Rename (Flag247)
-- Optimize_Alignment_Space (Flag241)
-- Optimize_Alignment_Time (Flag242)
-- SPARK_Pragma_Inherited (Flag265)
-- Suppress_Initialization (Flag105)
-- Treat_As_Volatile (Flag41)
-- Address_Clause (synth)
-- Alignment_Clause (synth)
-- Is_Atomic_Or_VFA (synth)
-- Is_Elaboration_Target (synth)
-- Size_Clause (synth)
-- E_Void
-- Since E_Void is the initial Ekind value of an entity when it is first
-- created, one might expect that no attributes would be defined on such
-- an entity until its Ekind field is set. However, in practice, there
-- are many instances in which fields of an E_Void entity are set in the
-- code prior to setting the Ekind field. This is not well documented or
-- well controlled, and needs cleaning up later. Meanwhile, the access
-- procedures in the body of Einfo permit many, but not all, attributes
-- to be applied to an E_Void entity, precisely so that this kind of
-- pre-setting of attributes works. This is really a hole in the dynamic
-- type checking, since there is no assurance that the eventual Ekind
-- value will be appropriate for the attributes set, and the consequence
-- is that the dynamic type checking in the Einfo body is unnecessarily
-- weak. To be looked at systematically some time ???
---------------------------------
-- Component_Alignment Control --
---------------------------------
-- There are four types of alignment possible for array and record
-- types, and a field in the type entities contains a value of the
-- following type indicating which alignment choice applies. For full
-- details of the meaning of these alignment types, see description
-- of the Component_Alignment pragma.
type Component_Alignment_Kind is (
Calign_Default, -- default alignment
Calign_Component_Size, -- natural alignment for component size
Calign_Component_Size_4, -- natural for size <= 4, 4 for size >= 4
Calign_Storage_Unit); -- all components byte aligned
-----------------------------------
-- Floating Point Representation --
-----------------------------------
type Float_Rep_Kind is (
IEEE_Binary, -- IEEE 754p conforming binary format
AAMP); -- AAMP format
---------------
-- Iterators --
---------------
-- In addition to attributes that are stored as plain data, other
-- attributes are procedural, and require some small amount of
-- computation. Of course, from the point of view of a user of this
-- package, the distinction is not visible (even the field information
-- provided below should be disregarded, as it is subject to change
-- without notice). A number of attributes appear as lists: lists of
-- formals, lists of actuals, of discriminants, etc. For these, pairs
-- of functions are defined, which take the form:
-- function First_Thing (E : Enclosing_Construct) return Thing;
-- function Next_Thing (T : Thing) return Thing;
-- The end of iteration is always signaled by a value of Empty, so that
-- loops over these chains invariably have the form:
-- This : Thing;
-- ...
-- This := First_Thing (E);
-- while Present (This) loop
-- Do_Something_With (This);
-- ...
-- This := Next_Thing (This);
-- end loop;
-----------------------------------
-- Handling of Check Suppression --
-----------------------------------
-- There are three ways that checks can be suppressed:
-- 1. At the command line level
-- 2. At the scope level.
-- 3. At the entity level.
-- See spec of Sem in sem.ads for details of the data structures used
-- to keep track of these various methods for suppressing checks.
-------------------------------
-- Handling of Discriminants --
-------------------------------
-- During semantic processing, discriminants are separate entities which
-- reflect the semantic properties and allowed usage of discriminants in
-- the language.
-- In the case of discriminants used as bounds, the references are handled
-- directly, since special processing is needed in any case. However, there
-- are two circumstances in which discriminants are referenced in a quite
-- general manner, like any other variables:
-- In initialization expressions for records. Note that the expressions
-- used in Priority, Storage_Size, Task_Info and Relative_Deadline
-- pragmas are effectively in this category, since these pragmas are
-- converted to initialized record fields in the Corresponding_Record_
-- Type.
-- In task and protected bodies, where the discriminant values may be
-- referenced freely within these bodies. Discriminants can also appear
-- in bounds of entry families and in defaults of operations.
-- In both these cases, the discriminants must be treated essentially as
-- objects. The following approach is used to simplify and minimize the
-- special processing that is required.
-- When a record type with discriminants is analyzed, semantic processing
-- creates the entities for the discriminants. It also creates additional
-- sets of entities called discriminals, one for each of the discriminants,
-- and the Discriminal field of the discriminant entity points to this
-- additional entity, which is initially created as an uninitialized
-- (E_Void) entity.
-- During expansion of expressions, any discriminant reference is replaced
-- by a reference to the corresponding discriminal. When the initialization
-- procedure for the record is created (there will always be one, since
-- discriminants are present, see Exp_Ch3 for further details), the
-- discriminals are used as the entities for the formal parameters of
-- this initialization procedure. The references to these discriminants
-- have already been replaced by references to these discriminals, which
-- are now the formal parameters corresponding to the required objects.
-- In the case of a task or protected body, the semantics similarly creates
-- a set of discriminals for the discriminants of the task or protected
-- type. When the procedure is created for the task body, the parameter
-- passed in is a reference to the task value type, which contains the
-- required discriminant values. The expander creates a set of declarations
-- of the form:
-- discr_nameD : constant discr_type renames _task.discr_name;
-- where discr_nameD is the discriminal entity referenced by the task
-- discriminant, and _task is the task value passed in as the parameter.
-- Again, any references to discriminants in the task body have been
-- replaced by the discriminal reference, which is now an object that
-- contains the required value.
-- This approach for tasks means that two sets of discriminals are needed
-- for a task type, one for the initialization procedure, and one for the
-- task body. This works out nicely, since the semantics allocates one set
-- for the task itself, and one set for the corresponding record.
-- The one bit of trickiness arises in making sure that the right set of
-- discriminals is used at the right time. First the task definition is
-- processed. Any references to discriminants here are replaced by the
-- corresponding *task* discriminals (the record type doesn't even exist
-- yet, since it is constructed as part of the expansion of the task
-- declaration, which happens after the semantic processing of the task
-- definition). The discriminants to be used for the corresponding record
-- are created at the same time as the other discriminals, and held in the
-- CR_Discriminant field of the discriminant. A use of the discriminant in
-- a bound for an entry family is replaced with the CR_Discriminant because
-- it controls the bound of the entry queue array which is a component of
-- the corresponding record.
-- Just before the record initialization routine is constructed, the
-- expander exchanges the task and record discriminals. This has two
-- effects. First the generation of the record initialization routine
-- uses the discriminals that are now on the record, which is the set
-- that used to be on the task, which is what we want.
-- Second, a new set of (so far unused) discriminals is now on the task
-- discriminants, and it is this set that will be used for expanding the
-- task body, and also for the discriminal declarations at the start of
-- the task body.
---------------------------------------------------
-- Handling of private data in protected objects --
---------------------------------------------------
-- Private components in protected types pose problems similar to those
-- of discriminants. Private data is visible and can be directly referenced
-- from protected bodies. However, when protected entries and subprograms
-- are expanded into corresponding bodies and barrier functions, private
-- components lose their original context and visibility.
-- To remedy this side effect of expansion, private components are expanded
-- into renamings called "privals", by analogy with "discriminals".
-- private_comp : comp_type renames _object.private_comp;
-- Prival declarations are inserted during the analysis of subprogram and
-- entry bodies to ensure proper visibility for any subsequent expansion.
-- _Object is the formal parameter of the generated corresponding body or
-- a local renaming which denotes the protected object obtained from entry
-- parameter _O. Privals receive minimal decoration upon creation and are
-- categorized as either E_Variable for the general case or E_Constant when
-- they appear in functions.
-- Along with the local declarations, each private component carries a
-- placeholder which references the prival entity in the current body. This
-- form of indirection is used to resolve name clashes of privals and other
-- locally visible entities such as parameters, local objects, entry family
-- indexes or identifiers used in the barrier condition.
-- When analyzing the statements of a protected subprogram or entry, any
-- reference to a private component must resolve to the locally declared
-- prival through normal visibility. In case of name conflicts (the cases
-- above), the prival is marked as hidden and acts as a weakly declared
-- entity. As a result, the reference points to the correct entity. When a
-- private component is denoted by an expanded name (prot_type.comp for
-- example), the expansion mechanism uses the placeholder of the component
-- to correct the Entity and Etype of the reference.
-------------------
-- Type Synonyms --
-------------------
-- The following type synonyms are used to tidy up the function and
-- procedure declarations that follow, and also to make it possible to meet
-- the requirement for the XEINFO utility that all function specs must fit
-- on a single source line.
subtype B is Boolean;
subtype C is Component_Alignment_Kind;
subtype E is Entity_Id;
subtype F is Float_Rep_Kind;
subtype M is Mechanism_Type;
subtype N is Node_Id;
subtype U is Uint;
subtype R is Ureal;
subtype L is Elist_Id;
subtype S is List_Id;
--------------------------------
-- Attribute Access Functions --
--------------------------------
-- All attributes are manipulated through a procedural interface. This
-- section contains the functions used to obtain attribute values which
-- correspond to values in fields or flags in the entity itself.
function Abstract_States (Id : E) return L;
function Accept_Address (Id : E) return L;
function Access_Disp_Table (Id : E) return L;
function Access_Disp_Table_Elab_Flag (Id : E) return E;
function Access_Subprogram_Wrapper (Id : E) return E;
function Activation_Record_Component (Id : E) return E;
function Actual_Subtype (Id : E) return E;
function Address_Taken (Id : E) return B;
function Alias (Id : E) return E;
function Alignment (Id : E) return U;
function Anonymous_Designated_Type (Id : E) return E;
function Anonymous_Masters (Id : E) return L;
function Anonymous_Object (Id : E) return E;
function Associated_Entity (Id : E) return E;
function Associated_Formal_Package (Id : E) return E;
function Associated_Node_For_Itype (Id : E) return N;
function Associated_Storage_Pool (Id : E) return E;
function Barrier_Function (Id : E) return N;
function BIP_Initialization_Call (Id : E) return N;
function Block_Node (Id : E) return N;
function Body_Entity (Id : E) return E;
function Body_Needed_For_SAL (Id : E) return B;
function Body_Needed_For_Inlining (Id : E) return B;
function Body_References (Id : E) return L;
function C_Pass_By_Copy (Id : E) return B;
function Can_Never_Be_Null (Id : E) return B;
function Can_Use_Internal_Rep (Id : E) return B;
function Checks_May_Be_Suppressed (Id : E) return B;
function Class_Wide_Clone (Id : E) return E;
function Class_Wide_Type (Id : E) return E;
function Cloned_Subtype (Id : E) return E;
function Component_Bit_Offset (Id : E) return U;
function Component_Clause (Id : E) return N;
function Component_Size (Id : E) return U;
function Component_Type (Id : E) return E;
function Contains_Ignored_Ghost_Code (Id : E) return B;
function Contract (Id : E) return N;
function Contract_Wrapper (Id : E) return E;
function Corresponding_Concurrent_Type (Id : E) return E;
function Corresponding_Discriminant (Id : E) return E;
function Corresponding_Equality (Id : E) return E;
function Corresponding_Function (Id : E) return E;
function Corresponding_Procedure (Id : E) return E;
function Corresponding_Protected_Entry (Id : E) return E;
function Corresponding_Record_Component (Id : E) return E;
function Corresponding_Record_Type (Id : E) return E;
function Corresponding_Remote_Type (Id : E) return E;
function CR_Discriminant (Id : E) return E;
function Current_Use_Clause (Id : E) return E;
function Current_Value (Id : E) return N;
function Debug_Info_Off (Id : E) return B;
function Debug_Renaming_Link (Id : E) return E;
function Default_Aspect_Component_Value (Id : E) return N;
function Default_Aspect_Value (Id : E) return N;
function Default_Expr_Function (Id : E) return E;
function Default_Expressions_Processed (Id : E) return B;
function Default_Value (Id : E) return N;
function Delay_Cleanups (Id : E) return B;
function Delay_Subprogram_Descriptors (Id : E) return B;
function Delta_Value (Id : E) return R;
function Dependent_Instances (Id : E) return L;
function Depends_On_Private (Id : E) return B;
function Derived_Type_Link (Id : E) return E;
function Digits_Value (Id : E) return U;
function Direct_Primitive_Operations (Id : E) return L;
function Directly_Designated_Type (Id : E) return E;
function Disable_Controlled (Id : E) return B;
function Discard_Names (Id : E) return B;
function Discriminal (Id : E) return E;
function Discriminal_Link (Id : E) return E;
function Discriminant_Checking_Func (Id : E) return E;
function Discriminant_Constraint (Id : E) return L;
function Discriminant_Default_Value (Id : E) return N;
function Discriminant_Number (Id : E) return U;
function Dispatch_Table_Wrappers (Id : E) return L;
function DT_Entry_Count (Id : E) return U;
function DT_Offset_To_Top_Func (Id : E) return E;
function DT_Position (Id : E) return U;
function DTC_Entity (Id : E) return E;
function Elaborate_Body_Desirable (Id : E) return B;
function Elaboration_Entity (Id : E) return E;
function Elaboration_Entity_Required (Id : E) return B;
function Encapsulating_State (Id : E) return E;
function Enclosing_Scope (Id : E) return E;
function Entry_Accepted (Id : E) return B;
function Entry_Bodies_Array (Id : E) return E;
function Entry_Cancel_Parameter (Id : E) return E;
function Entry_Component (Id : E) return E;
function Entry_Formal (Id : E) return E;
function Entry_Index_Constant (Id : E) return E;
function Entry_Index_Type (Id : E) return E;
function Entry_Max_Queue_Lengths_Array (Id : E) return E;
function Entry_Parameters_Type (Id : E) return E;
function Enum_Pos_To_Rep (Id : E) return E;
function Enumeration_Pos (Id : E) return U;
function Enumeration_Rep (Id : E) return U;
function Enumeration_Rep_Expr (Id : E) return N;
function Equivalent_Type (Id : E) return E;
function Esize (Id : E) return U;
function Extra_Accessibility (Id : E) return E;
function Extra_Accessibility_Of_Result (Id : E) return E;
function Extra_Constrained (Id : E) return E;
function Extra_Formal (Id : E) return E;
function Extra_Formals (Id : E) return E;
function Finalization_Master (Id : E) return E;
function Finalize_Storage_Only (Id : E) return B;
function Finalizer (Id : E) return E;
function First_Entity (Id : E) return E;
function First_Exit_Statement (Id : E) return N;
function First_Index (Id : E) return N;
function First_Literal (Id : E) return E;
function First_Private_Entity (Id : E) return E;
function First_Rep_Item (Id : E) return N;
function Float_Rep (Id : E) return F;
function Freeze_Node (Id : E) return N;
function From_Limited_With (Id : E) return B;
function Full_View (Id : E) return E;
function Generic_Homonym (Id : E) return E;
function Generic_Renamings (Id : E) return L;
function Handler_Records (Id : E) return S;
function Has_Aliased_Components (Id : E) return B;
function Has_Alignment_Clause (Id : E) return B;
function Has_All_Calls_Remote (Id : E) return B;
function Has_Atomic_Components (Id : E) return B;
function Has_Biased_Representation (Id : E) return B;
function Has_Completion (Id : E) return B;
function Has_Completion_In_Body (Id : E) return B;
function Has_Complex_Representation (Id : E) return B;
function Has_Component_Size_Clause (Id : E) return B;
function Has_Constrained_Partial_View (Id : E) return B;
function Has_Contiguous_Rep (Id : E) return B;
function Has_Controlled_Component (Id : E) return B;
function Has_Controlling_Result (Id : E) return B;
function Has_Convention_Pragma (Id : E) return B;
function Has_Default_Aspect (Id : E) return B;
function Has_Delayed_Aspects (Id : E) return B;
function Has_Delayed_Freeze (Id : E) return B;
function Has_Delayed_Rep_Aspects (Id : E) return B;
function Has_Discriminants (Id : E) return B;
function Has_Dispatch_Table (Id : E) return B;
function Has_Dynamic_Predicate_Aspect (Id : E) return B;
function Has_Enumeration_Rep_Clause (Id : E) return B;
function Has_Exit (Id : E) return B;
function Has_Expanded_Contract (Id : E) return B;
function Has_Forward_Instantiation (Id : E) return B;
function Has_Fully_Qualified_Name (Id : E) return B;
function Has_Gigi_Rep_Item (Id : E) return B;
function Has_Homonym (Id : E) return B;
function Has_Implicit_Dereference (Id : E) return B;
function Has_Independent_Components (Id : E) return B;
function Has_Inheritable_Invariants (Id : E) return B;
function Has_Inherited_DIC (Id : E) return B;
function Has_Inherited_Invariants (Id : E) return B;
function Has_Initial_Value (Id : E) return B;
function Has_Loop_Entry_Attributes (Id : E) return B;
function Has_Machine_Radix_Clause (Id : E) return B;
function Has_Master_Entity (Id : E) return B;
function Has_Missing_Return (Id : E) return B;
function Has_Nested_Block_With_Handler (Id : E) return B;
function Has_Nested_Subprogram (Id : E) return B;
function Has_Non_Standard_Rep (Id : E) return B;
function Has_Object_Size_Clause (Id : E) return B;
function Has_Out_Or_In_Out_Parameter (Id : E) return B;
function Has_Own_DIC (Id : E) return B;
function Has_Own_Invariants (Id : E) return B;
function Has_Partial_Visible_Refinement (Id : E) return B;
function Has_Per_Object_Constraint (Id : E) return B;
function Has_Pragma_Controlled (Id : E) return B;
function Has_Pragma_Elaborate_Body (Id : E) return B;
function Has_Pragma_Inline (Id : E) return B;
function Has_Pragma_Inline_Always (Id : E) return B;
function Has_Pragma_No_Inline (Id : E) return B;
function Has_Pragma_Ordered (Id : E) return B;
function Has_Pragma_Pack (Id : E) return B;
function Has_Pragma_Preelab_Init (Id : E) return B;
function Has_Pragma_Pure (Id : E) return B;
function Has_Pragma_Pure_Function (Id : E) return B;
function Has_Pragma_Thread_Local_Storage (Id : E) return B;
function Has_Pragma_Unmodified (Id : E) return B;
function Has_Pragma_Unreferenced (Id : E) return B;
function Has_Pragma_Unreferenced_Objects (Id : E) return B;
function Has_Pragma_Unused (Id : E) return B;
function Has_Predicates (Id : E) return B;
function Has_Primitive_Operations (Id : E) return B;
function Has_Private_Ancestor (Id : E) return B;
function Has_Private_Declaration (Id : E) return B;
function Has_Private_Extension (Id : E) return B;
function Has_Protected (Id : E) return B;
function Has_Qualified_Name (Id : E) return B;
function Has_RACW (Id : E) return B;
function Has_Record_Rep_Clause (Id : E) return B;
function Has_Recursive_Call (Id : E) return B;
function Has_Shift_Operator (Id : E) return B;
function Has_Size_Clause (Id : E) return B;
function Has_Small_Clause (Id : E) return B;
function Has_Specified_Layout (Id : E) return B;
function Has_Specified_Stream_Input (Id : E) return B;
function Has_Specified_Stream_Output (Id : E) return B;
function Has_Specified_Stream_Read (Id : E) return B;
function Has_Specified_Stream_Write (Id : E) return B;
function Has_Static_Discriminants (Id : E) return B;
function Has_Static_Predicate (Id : E) return B;
function Has_Static_Predicate_Aspect (Id : E) return B;
function Has_Storage_Size_Clause (Id : E) return B;
function Has_Stream_Size_Clause (Id : E) return B;
function Has_Task (Id : E) return B;
function Has_Timing_Event (Id : E) return B;
function Has_Thunks (Id : E) return B;
function Has_Unchecked_Union (Id : E) return B;
function Has_Unknown_Discriminants (Id : E) return B;
function Has_Visible_Refinement (Id : E) return B;
function Has_Volatile_Components (Id : E) return B;
function Has_Xref_Entry (Id : E) return B;
function Has_Yield_Aspect (Id : E) return B;
function Hiding_Loop_Variable (Id : E) return E;
function Hidden_In_Formal_Instance (Id : E) return L;
function Homonym (Id : E) return E;
function Ignore_SPARK_Mode_Pragmas (Id : E) return B;
function Import_Pragma (Id : E) return E;
function Incomplete_Actuals (Id : E) return L;
function In_Package_Body (Id : E) return B;
function In_Private_Part (Id : E) return B;
function In_Use (Id : E) return B;
function Initialization_Statements (Id : E) return N;
function Inner_Instances (Id : E) return L;
function Interface_Alias (Id : E) return E;
function Interface_Name (Id : E) return N;
function Interfaces (Id : E) return L;
function Is_Abstract_Subprogram (Id : E) return B;
function Is_Abstract_Type (Id : E) return B;
function Is_Access_Constant (Id : E) return B;
function Is_Activation_Record (Id : E) return B;
function Is_Actual_Subtype (Id : E) return B;
function Is_Ada_2005_Only (Id : E) return B;
function Is_Ada_2012_Only (Id : E) return B;
function Is_Aliased (Id : E) return B;
function Is_Asynchronous (Id : E) return B;
function Is_Atomic (Id : E) return B;
function Is_Bit_Packed_Array (Id : E) return B;
function Is_Called (Id : E) return B;
function Is_Character_Type (Id : E) return B;
function Is_Checked_Ghost_Entity (Id : E) return B;
function Is_Child_Unit (Id : E) return B;
function Is_Class_Wide_Clone (Id : E) return B;
function Is_Class_Wide_Equivalent_Type (Id : E) return B;
function Is_Compilation_Unit (Id : E) return B;
function Is_Completely_Hidden (Id : E) return B;
function Is_Constr_Subt_For_U_Nominal (Id : E) return B;
function Is_Constr_Subt_For_UN_Aliased (Id : E) return B;
function Is_Constrained (Id : E) return B;
function Is_Constructor (Id : E) return B;
function Is_Controlled_Active (Id : E) return B;
function Is_Controlling_Formal (Id : E) return B;
function Is_CPP_Class (Id : E) return B;
function Is_CUDA_Kernel (Id : E) return B;
function Is_Descendant_Of_Address (Id : E) return B;
function Is_DIC_Procedure (Id : E) return B;
function Is_Discrim_SO_Function (Id : E) return B;
function Is_Discriminant_Check_Function (Id : E) return B;
function Is_Dispatch_Table_Entity (Id : E) return B;
function Is_Dispatching_Operation (Id : E) return B;
function Is_Elaboration_Checks_OK_Id (Id : E) return B;
function Is_Elaboration_Warnings_OK_Id (Id : E) return B;
function Is_Eliminated (Id : E) return B;
function Is_Entry_Formal (Id : E) return B;
function Is_Entry_Wrapper (Id : E) return B;
function Is_Exception_Handler (Id : E) return B;
function Is_Exported (Id : E) return B;
function Is_Finalized_Transient (Id : E) return B;
function Is_First_Subtype (Id : E) return B;
function Is_Frozen (Id : E) return B;
function Is_Generic_Instance (Id : E) return B;
function Is_Hidden (Id : E) return B;
function Is_Hidden_Non_Overridden_Subpgm (Id : E) return B;
function Is_Hidden_Open_Scope (Id : E) return B;
function Is_Ignored_Ghost_Entity (Id : E) return B;
function Is_Ignored_Transient (Id : E) return B;
function Is_Immediately_Visible (Id : E) return B;
function Is_Implementation_Defined (Id : E) return B;
function Is_Imported (Id : E) return B;
function Is_Independent (Id : E) return B;
function Is_Initial_Condition_Procedure (Id : E) return B;
function Is_Inlined (Id : E) return B;
function Is_Inlined_Always (Id : E) return B;
function Is_Instantiated (Id : E) return B;
function Is_Interface (Id : E) return B;
function Is_Internal (Id : E) return B;
function Is_Interrupt_Handler (Id : E) return B;
function Is_Intrinsic_Subprogram (Id : E) return B;
function Is_Invariant_Procedure (Id : E) return B;
function Is_Itype (Id : E) return B;
function Is_Known_Non_Null (Id : E) return B;
function Is_Known_Null (Id : E) return B;
function Is_Known_Valid (Id : E) return B;
function Is_Limited_Composite (Id : E) return B;
function Is_Limited_Interface (Id : E) return B;
function Is_Local_Anonymous_Access (Id : E) return B;
function Is_Loop_Parameter (Id : E) return B;
function Is_Machine_Code_Subprogram (Id : E) return B;
function Is_Non_Static_Subtype (Id : E) return B;
function Is_Null_Init_Proc (Id : E) return B;
function Is_Obsolescent (Id : E) return B;
function Is_Only_Out_Parameter (Id : E) return B;
function Is_Package_Body_Entity (Id : E) return B;
function Is_Packed (Id : E) return B;
function Is_Packed_Array_Impl_Type (Id : E) return B;
function Is_Potentially_Use_Visible (Id : E) return B;
function Is_Param_Block_Component_Type (Id : E) return B;
function Is_Partial_Invariant_Procedure (Id : E) return B;
function Is_Predicate_Function (Id : E) return B;
function Is_Predicate_Function_M (Id : E) return B;
function Is_Preelaborated (Id : E) return B;
function Is_Primitive (Id : E) return B;
function Is_Primitive_Wrapper (Id : E) return B;
function Is_Private_Composite (Id : E) return B;
function Is_Private_Descendant (Id : E) return B;
function Is_Private_Primitive (Id : E) return B;
function Is_Public (Id : E) return B;
function Is_Pure (Id : E) return B;
function Is_Pure_Unit_Access_Type (Id : E) return B;
function Is_RACW_Stub_Type (Id : E) return B;
function Is_Raised (Id : E) return B;
function Is_Remote_Call_Interface (Id : E) return B;
function Is_Remote_Types (Id : E) return B;
function Is_Renaming_Of_Object (Id : E) return B;
function Is_Return_Object (Id : E) return B;
function Is_Safe_To_Reevaluate (Id : E) return B;
function Is_Shared_Passive (Id : E) return B;
function Is_Static_Type (Id : E) return B;
function Is_Statically_Allocated (Id : E) return B;
function Is_Tag (Id : E) return B;
function Is_Tagged_Type (Id : E) return B;
function Is_Thunk (Id : E) return B;
function Is_Trivial_Subprogram (Id : E) return B;
function Is_True_Constant (Id : E) return B;
function Is_Unchecked_Union (Id : E) return B;
function Is_Underlying_Full_View (Id : E) return B;
function Is_Underlying_Record_View (Id : E) return B;
function Is_Unimplemented (Id : E) return B;
function Is_Unsigned_Type (Id : E) return B;
function Is_Uplevel_Referenced_Entity (Id : E) return B;
function Is_Valued_Procedure (Id : E) return B;
function Is_Visible_Formal (Id : E) return B;
function Is_Visible_Lib_Unit (Id : E) return B;
function Is_Volatile (Id : E) return B;
function Is_Volatile_Full_Access (Id : E) return B;
function Itype_Printed (Id : E) return B;
function Kill_Elaboration_Checks (Id : E) return B;
function Kill_Range_Checks (Id : E) return B;
function Known_To_Have_Preelab_Init (Id : E) return B;
function Last_Aggregate_Assignment (Id : E) return N;
function Last_Assignment (Id : E) return N;
function Last_Entity (Id : E) return E;
function Limited_View (Id : E) return E;
function Linker_Section_Pragma (Id : E) return N;
function Lit_Indexes (Id : E) return E;
function Lit_Strings (Id : E) return E;
function Low_Bound_Tested (Id : E) return B;
function Machine_Radix_10 (Id : E) return B;
function Master_Id (Id : E) return E;
function Materialize_Entity (Id : E) return B;
function May_Inherit_Delayed_Rep_Aspects (Id : E) return B;
function Mechanism (Id : E) return M;
function Minimum_Accessibility (Id : E) return E;
function Modulus (Id : E) return U;
function Must_Be_On_Byte_Boundary (Id : E) return B;
function Must_Have_Preelab_Init (Id : E) return B;
function Needs_Activation_Record (Id : E) return B;
function Needs_Debug_Info (Id : E) return B;
function Needs_No_Actuals (Id : E) return B;
function Never_Set_In_Source (Id : E) return B;
function Next_Inlined_Subprogram (Id : E) return E;
function No_Dynamic_Predicate_On_Actual (Id : E) return B;
function No_Pool_Assigned (Id : E) return B;
function No_Predicate_On_Actual (Id : E) return B;
function No_Reordering (Id : E) return B;
function No_Return (Id : E) return B;
function No_Strict_Aliasing (Id : E) return B;
function No_Tagged_Streams_Pragma (Id : E) return N;
function Non_Binary_Modulus (Id : E) return B;
function Non_Limited_View (Id : E) return E;
function Nonzero_Is_True (Id : E) return B;
function Normalized_First_Bit (Id : E) return U;
function Normalized_Position (Id : E) return U;
function Normalized_Position_Max (Id : E) return U;
function OK_To_Rename (Id : E) return B;
function Optimize_Alignment_Space (Id : E) return B;
function Optimize_Alignment_Time (Id : E) return B;
function Original_Access_Type (Id : E) return E;
function Original_Array_Type (Id : E) return E;
function Original_Protected_Subprogram (Id : E) return N;
function Original_Record_Component (Id : E) return E;
function Overlays_Constant (Id : E) return B;
function Overridden_Operation (Id : E) return E;
function Package_Instantiation (Id : E) return N;
function Packed_Array_Impl_Type (Id : E) return E;
function Parent_Subtype (Id : E) return E;
function Part_Of_Constituents (Id : E) return L;
function Part_Of_References (Id : E) return L;
function Partial_View_Has_Unknown_Discr (Id : E) return B;
function Pending_Access_Types (Id : E) return L;
function Postconditions_Proc (Id : E) return E;
function Predicated_Parent (Id : E) return E;
function Predicates_Ignored (Id : E) return B;
function Prev_Entity (Id : E) return E;
function Prival (Id : E) return E;
function Prival_Link (Id : E) return E;
function Private_Dependents (Id : E) return L;
function Protected_Body_Subprogram (Id : E) return E;
function Protected_Formal (Id : E) return E;
function Protected_Subprogram (Id : E) return N;
function Protection_Object (Id : E) return E;
function Reachable (Id : E) return B;
function Receiving_Entry (Id : E) return E;
function Referenced (Id : E) return B;
function Referenced_As_LHS (Id : E) return B;
function Referenced_As_Out_Parameter (Id : E) return B;
function Refinement_Constituents (Id : E) return L;
function Register_Exception_Call (Id : E) return N;
function Related_Array_Object (Id : E) return E;
function Related_Expression (Id : E) return N;
function Related_Instance (Id : E) return E;
function Related_Type (Id : E) return E;
function Relative_Deadline_Variable (Id : E) return E;
function Renamed_Entity (Id : E) return N;
function Renamed_In_Spec (Id : E) return B;
function Renamed_Object (Id : E) return N;
function Renaming_Map (Id : E) return U;
function Requires_Overriding (Id : E) return B;
function Return_Applies_To (Id : E) return N;
function Return_Present (Id : E) return B;
function Returns_By_Ref (Id : E) return B;
function Reverse_Bit_Order (Id : E) return B;
function Reverse_Storage_Order (Id : E) return B;
function Rewritten_For_C (Id : E) return B;
function RM_Size (Id : E) return U;
function Scalar_Range (Id : E) return N;
function Scale_Value (Id : E) return U;
function Scope_Depth_Value (Id : E) return U;
function Sec_Stack_Needed_For_Return (Id : E) return B;
function Shared_Var_Procs_Instance (Id : E) return E;
function Size_Check_Code (Id : E) return N;
function Size_Depends_On_Discriminant (Id : E) return B;
function Size_Known_At_Compile_Time (Id : E) return B;
function Small_Value (Id : E) return R;
function SPARK_Aux_Pragma (Id : E) return N;
function SPARK_Aux_Pragma_Inherited (Id : E) return B;
function SPARK_Pragma (Id : E) return N;
function SPARK_Pragma_Inherited (Id : E) return B;
function Spec_Entity (Id : E) return E;
function SSO_Set_High_By_Default (Id : E) return B;
function SSO_Set_Low_By_Default (Id : E) return B;
function Static_Discrete_Predicate (Id : E) return S;
function Static_Elaboration_Desired (Id : E) return B;
function Static_Initialization (Id : E) return N;
function Static_Real_Or_String_Predicate (Id : E) return N;
function Status_Flag_Or_Transient_Decl (Id : E) return E;
function Storage_Size_Variable (Id : E) return E;
function Stored_Constraint (Id : E) return L;
function Stores_Attribute_Old_Prefix (Id : E) return B;
function Strict_Alignment (Id : E) return B;
function String_Literal_Length (Id : E) return U;
function String_Literal_Low_Bound (Id : E) return N;
function Subprograms_For_Type (Id : E) return L;
function Subps_Index (Id : E) return U;
function Suppress_Elaboration_Warnings (Id : E) return B;
function Suppress_Initialization (Id : E) return B;
function Suppress_Style_Checks (Id : E) return B;
function Suppress_Value_Tracking_On_Call (Id : E) return B;
function Task_Body_Procedure (Id : E) return N;
function Thunk_Entity (Id : E) return E;
function Treat_As_Volatile (Id : E) return B;
function Underlying_Full_View (Id : E) return E;
function Underlying_Record_View (Id : E) return E;
function Universal_Aliasing (Id : E) return B;
function Unset_Reference (Id : E) return N;
function Used_As_Generic_Actual (Id : E) return B;
function Uses_Lock_Free (Id : E) return B;
function Uses_Sec_Stack (Id : E) return B;
function Validated_Object (Id : E) return N;
function Warnings_Off (Id : E) return B;
function Warnings_Off_Used (Id : E) return B;
function Warnings_Off_Used_Unmodified (Id : E) return B;
function Warnings_Off_Used_Unreferenced (Id : E) return B;
function Was_Hidden (Id : E) return B;
function Wrapped_Entity (Id : E) return E;
-------------------------------
-- Classification Attributes --
-------------------------------
-- These functions provide a convenient functional notation for testing
-- whether an Ekind value belongs to a specified kind, for example the
-- function Is_Elementary_Type tests if its argument is in Elementary_Kind.
-- In some cases, the test is of an entity attribute (e.g. in the case of
-- Is_Generic_Type where the Ekind does not provide the needed
-- information).
function Is_Access_Object_Type (Id : E) return B;
function Is_Access_Type (Id : E) return B;
function Is_Access_Protected_Subprogram_Type (Id : E) return B;
function Is_Access_Subprogram_Type (Id : E) return B;
function Is_Aggregate_Type (Id : E) return B;
function Is_Anonymous_Access_Type (Id : E) return B;
function Is_Array_Type (Id : E) return B;
function Is_Assignable (Id : E) return B;
function Is_Class_Wide_Type (Id : E) return B;
function Is_Composite_Type (Id : E) return B;
function Is_Concurrent_Body (Id : E) return B;
function Is_Concurrent_Record_Type (Id : E) return B;
function Is_Concurrent_Type (Id : E) return B;
function Is_Decimal_Fixed_Point_Type (Id : E) return B;
function Is_Digits_Type (Id : E) return B;
function Is_Discrete_Or_Fixed_Point_Type (Id : E) return B;
function Is_Discrete_Type (Id : E) return B;
function Is_Elementary_Type (Id : E) return B;
function Is_Entry (Id : E) return B;
function Is_Enumeration_Type (Id : E) return B;
function Is_Fixed_Point_Type (Id : E) return B;
function Is_Floating_Point_Type (Id : E) return B;
function Is_Formal (Id : E) return B;
function Is_Formal_Object (Id : E) return B;
function Is_Formal_Subprogram (Id : E) return B;
function Is_Generic_Actual_Subprogram (Id : E) return B;
function Is_Generic_Actual_Type (Id : E) return B;
function Is_Generic_Subprogram (Id : E) return B;
function Is_Generic_Type (Id : E) return B;
function Is_Generic_Unit (Id : E) return B;
function Is_Ghost_Entity (Id : E) return B;
function Is_Incomplete_Or_Private_Type (Id : E) return B;
function Is_Incomplete_Type (Id : E) return B;
function Is_Integer_Type (Id : E) return B;
function Is_Limited_Record (Id : E) return B;
function Is_Modular_Integer_Type (Id : E) return B;
function Is_Named_Access_Type (Id : E) return B;
function Is_Named_Number (Id : E) return B;
function Is_Numeric_Type (Id : E) return B;
function Is_Object (Id : E) return B;
function Is_Ordinary_Fixed_Point_Type (Id : E) return B;
function Is_Overloadable (Id : E) return B;
function Is_Private_Type (Id : E) return B;
function Is_Protected_Type (Id : E) return B;
function Is_Real_Type (Id : E) return B;
function Is_Record_Type (Id : E) return B;
function Is_Scalar_Type (Id : E) return B;
function Is_Signed_Integer_Type (Id : E) return B;
function Is_Subprogram (Id : E) return B;
function Is_Subprogram_Or_Entry (Id : E) return B;
function Is_Subprogram_Or_Generic_Subprogram (Id : E) return B;
function Is_Task_Type (Id : E) return B;
function Is_Type (Id : E) return B;
-------------------------------------
-- Synthesized Attribute Functions --
-------------------------------------
-- The functions in this section synthesize attributes from the tree,
-- so they do not correspond to defined fields in the entity itself.
function Address_Clause (Id : E) return N;
function Aft_Value (Id : E) return U;
function Alignment_Clause (Id : E) return N;
function Base_Type (Id : E) return E;
function Component_Alignment (Id : E) return C;
function Declaration_Node (Id : E) return N;
function Designated_Type (Id : E) return E;
function First_Component (Id : E) return E;
function First_Component_Or_Discriminant (Id : E) return E;
function First_Formal (Id : E) return E;
function First_Formal_With_Extras (Id : E) return E;
function Has_Attach_Handler (Id : E) return B;
function Has_DIC (Id : E) return B;
function Has_Entries (Id : E) return B;
function Has_Foreign_Convention (Id : E) return B;
function Has_Interrupt_Handler (Id : E) return B;
function Has_Invariants (Id : E) return B;
function Has_Non_Limited_View (Id : E) return B;
function Has_Non_Null_Abstract_State (Id : E) return B;
function Has_Non_Null_Visible_Refinement (Id : E) return B;
function Has_Null_Abstract_State (Id : E) return B;
function Has_Null_Visible_Refinement (Id : E) return B;
function Implementation_Base_Type (Id : E) return E;
function Is_Atomic_Or_VFA (Id : E) return B;
function Is_Base_Type (Id : E) return B;
function Is_Boolean_Type (Id : E) return B;
function Is_Constant_Object (Id : E) return B;
function Is_Controlled (Id : E) return B;
function Is_Discriminal (Id : E) return B;
function Is_Dynamic_Scope (Id : E) return B;
function Is_Elaboration_Target (Id : E) return B;
function Is_External_State (Id : E) return B;
function Is_Finalizer (Id : E) return B;
function Is_Null_State (Id : E) return B;
function Is_Package_Or_Generic_Package (Id : E) return B;
function Is_Packed_Array (Id : E) return B;
function Is_Prival (Id : E) return B;
function Is_Protected_Component (Id : E) return B;
function Is_Protected_Interface (Id : E) return B;
function Is_Protected_Record_Type (Id : E) return B;
function Is_Relaxed_Initialization_State (Id : E) return B;
function Is_Standard_Character_Type (Id : E) return B;
function Is_Standard_String_Type (Id : E) return B;
function Is_String_Type (Id : E) return B;
function Is_Synchronized_Interface (Id : E) return B;
function Is_Synchronized_State (Id : E) return B;
function Is_Task_Interface (Id : E) return B;
function Is_Task_Record_Type (Id : E) return B;
function Is_Wrapper_Package (Id : E) return B;
function Last_Formal (Id : E) return E;
function Machine_Emax_Value (Id : E) return U;
function Machine_Emin_Value (Id : E) return U;
function Machine_Mantissa_Value (Id : E) return U;
function Machine_Radix_Value (Id : E) return U;
function Model_Emin_Value (Id : E) return U;
function Model_Epsilon_Value (Id : E) return R;
function Model_Mantissa_Value (Id : E) return U;
function Model_Small_Value (Id : E) return R;
function Next_Component (Id : E) return E;
function Next_Component_Or_Discriminant (Id : E) return E;
function Next_Discriminant (Id : E) return E;
function Next_Formal (Id : E) return E;
function Next_Formal_With_Extras (Id : E) return E;
function Next_Index (Id : N) return N;
function Next_Literal (Id : E) return E;
function Next_Stored_Discriminant (Id : E) return E;
function Number_Dimensions (Id : E) return Pos;
function Number_Entries (Id : E) return Nat;
function Number_Formals (Id : E) return Pos;
function Object_Size_Clause (Id : E) return N;
function Parameter_Mode (Id : E) return Formal_Kind;
function Partial_Refinement_Constituents (Id : E) return L;
function Primitive_Operations (Id : E) return L;
function Root_Type (Id : E) return E;
function Safe_Emax_Value (Id : E) return U;
function Safe_First_Value (Id : E) return R;
function Safe_Last_Value (Id : E) return R;
function Scope_Depth (Id : E) return U;
function Scope_Depth_Set (Id : E) return B;
function Size_Clause (Id : E) return N;
function Stream_Size_Clause (Id : E) return N;
function Type_High_Bound (Id : E) return N;
function Type_Low_Bound (Id : E) return N;
function Underlying_Type (Id : E) return E;
----------------------------------------------
-- Type Representation Attribute Predicates --
----------------------------------------------
-- These predicates test the setting of the indicated attribute. If the
-- value has been set, then Known is True, and Unknown is False. If no
-- value is set, then Known is False and Unknown is True. The Known_Static
-- predicate is true only if the value is set (Known) and is set to a
-- compile time known value. Note that in the case of Alignment and
-- Normalized_First_Bit, dynamic values are not possible, so we do not
-- need a separate Known_Static calls in these cases. The not set (unknown)
-- values are as follows:
-- Alignment Uint_0 or No_Uint
-- Component_Size Uint_0 or No_Uint
-- Component_Bit_Offset No_Uint
-- Digits_Value Uint_0 or No_Uint
-- Esize Uint_0 or No_Uint
-- Normalized_First_Bit No_Uint
-- Normalized_Position No_Uint
-- Normalized_Position_Max No_Uint
-- RM_Size Uint_0 or No_Uint
-- It would be cleaner to use No_Uint in all these cases, but historically
-- we chose to use Uint_0 at first, and the change over will take time ???
-- This is particularly true for the RM_Size field, where a value of zero
-- is legitimate. We deal with this by a considering that the value is
-- always known static for discrete types (and no other types can have
-- an RM_Size value of zero).
-- In two cases, Known_Static_Esize and Known_Static_RM_Size, there is one
-- more consideration, which is that we always return False for generic
-- types. Within a template, the size can look known, because of the fake
-- size values we put in template types, but they are not really known and
-- anyone testing if they are known within the template should get False as
-- a result to prevent incorrect assumptions.
function Known_Alignment (E : Entity_Id) return B;
function Known_Component_Bit_Offset (E : Entity_Id) return B;
function Known_Component_Size (E : Entity_Id) return B;
function Known_Esize (E : Entity_Id) return B;
function Known_Normalized_First_Bit (E : Entity_Id) return B;
function Known_Normalized_Position (E : Entity_Id) return B;
function Known_Normalized_Position_Max (E : Entity_Id) return B;
function Known_RM_Size (E : Entity_Id) return B;
function Known_Static_Component_Bit_Offset (E : Entity_Id) return B;
function Known_Static_Component_Size (E : Entity_Id) return B;
function Known_Static_Esize (E : Entity_Id) return B;
function Known_Static_Normalized_First_Bit (E : Entity_Id) return B;
function Known_Static_Normalized_Position (E : Entity_Id) return B;
function Known_Static_Normalized_Position_Max (E : Entity_Id) return B;
function Known_Static_RM_Size (E : Entity_Id) return B;
function Unknown_Alignment (E : Entity_Id) return B;
function Unknown_Component_Bit_Offset (E : Entity_Id) return B;
function Unknown_Component_Size (E : Entity_Id) return B;
function Unknown_Esize (E : Entity_Id) return B;
function Unknown_Normalized_First_Bit (E : Entity_Id) return B;
function Unknown_Normalized_Position (E : Entity_Id) return B;
function Unknown_Normalized_Position_Max (E : Entity_Id) return B;
function Unknown_RM_Size (E : Entity_Id) return B;
------------------------------
-- Attribute Set Procedures --
------------------------------
-- WARNING: There is a matching C declaration of a few subprograms in fe.h
procedure Set_Abstract_States (Id : E; V : L);
procedure Set_Accept_Address (Id : E; V : L);
procedure Set_Access_Disp_Table (Id : E; V : L);
procedure Set_Access_Disp_Table_Elab_Flag (Id : E; V : E);
procedure Set_Access_Subprogram_Wrapper (Id : E; V : E);
procedure Set_Activation_Record_Component (Id : E; V : E);
procedure Set_Actual_Subtype (Id : E; V : E);
procedure Set_Address_Taken (Id : E; V : B := True);
procedure Set_Alias (Id : E; V : E);
procedure Set_Alignment (Id : E; V : U);
procedure Set_Anonymous_Designated_Type (Id : E; V : E);
procedure Set_Anonymous_Masters (Id : E; V : L);
procedure Set_Anonymous_Object (Id : E; V : E);
procedure Set_Associated_Entity (Id : E; V : E);
procedure Set_Associated_Formal_Package (Id : E; V : E);
procedure Set_Associated_Node_For_Itype (Id : E; V : N);
procedure Set_Associated_Storage_Pool (Id : E; V : E);
procedure Set_Barrier_Function (Id : E; V : N);
procedure Set_BIP_Initialization_Call (Id : E; V : N);
procedure Set_Block_Node (Id : E; V : N);
procedure Set_Body_Entity (Id : E; V : E);
procedure Set_Body_Needed_For_Inlining (Id : E; V : B := True);
procedure Set_Body_Needed_For_SAL (Id : E; V : B := True);
procedure Set_Body_References (Id : E; V : L);
procedure Set_C_Pass_By_Copy (Id : E; V : B := True);
procedure Set_Can_Never_Be_Null (Id : E; V : B := True);
procedure Set_Can_Use_Internal_Rep (Id : E; V : B := True);
procedure Set_Checks_May_Be_Suppressed (Id : E; V : B := True);
procedure Set_Class_Wide_Clone (Id : E; V : E);
procedure Set_Class_Wide_Type (Id : E; V : E);
procedure Set_Cloned_Subtype (Id : E; V : E);
procedure Set_Component_Alignment (Id : E; V : C);
procedure Set_Component_Bit_Offset (Id : E; V : U);
procedure Set_Component_Clause (Id : E; V : N);
procedure Set_Component_Size (Id : E; V : U);
procedure Set_Component_Type (Id : E; V : E);
procedure Set_Contains_Ignored_Ghost_Code (Id : E; V : B := True);
procedure Set_Contract (Id : E; V : N);
procedure Set_Contract_Wrapper (Id : E; V : E);
procedure Set_Corresponding_Concurrent_Type (Id : E; V : E);
procedure Set_Corresponding_Discriminant (Id : E; V : E);
procedure Set_Corresponding_Equality (Id : E; V : E);
procedure Set_Corresponding_Function (Id : E; V : E);
procedure Set_Corresponding_Procedure (Id : E; V : E);
procedure Set_Corresponding_Protected_Entry (Id : E; V : E);
procedure Set_Corresponding_Record_Component (Id : E; V : E);
procedure Set_Corresponding_Record_Type (Id : E; V : E);
procedure Set_Corresponding_Remote_Type (Id : E; V : E);
procedure Set_CR_Discriminant (Id : E; V : E);
procedure Set_Current_Use_Clause (Id : E; V : E);
procedure Set_Current_Value (Id : E; V : N);
procedure Set_Debug_Info_Off (Id : E; V : B := True);
procedure Set_Debug_Renaming_Link (Id : E; V : E);
procedure Set_Default_Aspect_Component_Value (Id : E; V : N);
procedure Set_Default_Aspect_Value (Id : E; V : N);
procedure Set_Default_Expr_Function (Id : E; V : E);
procedure Set_Default_Expressions_Processed (Id : E; V : B := True);
procedure Set_Default_Value (Id : E; V : N);
procedure Set_Delay_Cleanups (Id : E; V : B := True);
procedure Set_Delay_Subprogram_Descriptors (Id : E; V : B := True);
procedure Set_Delta_Value (Id : E; V : R);
procedure Set_Dependent_Instances (Id : E; V : L);
procedure Set_Depends_On_Private (Id : E; V : B := True);
procedure Set_Derived_Type_Link (Id : E; V : E);
procedure Set_Digits_Value (Id : E; V : U);
procedure Set_Predicated_Parent (Id : E; V : E);
procedure Set_Predicates_Ignored (Id : E; V : B);
procedure Set_Direct_Primitive_Operations (Id : E; V : L);
procedure Set_Directly_Designated_Type (Id : E; V : E);
procedure Set_Disable_Controlled (Id : E; V : B := True);
procedure Set_Discard_Names (Id : E; V : B := True);
procedure Set_Discriminal (Id : E; V : E);
procedure Set_Discriminal_Link (Id : E; V : E);
procedure Set_Discriminant_Checking_Func (Id : E; V : E);
procedure Set_Discriminant_Constraint (Id : E; V : L);
procedure Set_Discriminant_Default_Value (Id : E; V : N);
procedure Set_Discriminant_Number (Id : E; V : U);
procedure Set_Dispatch_Table_Wrappers (Id : E; V : L);
procedure Set_DT_Entry_Count (Id : E; V : U);
procedure Set_DT_Offset_To_Top_Func (Id : E; V : E);
procedure Set_DT_Position (Id : E; V : U);
procedure Set_DTC_Entity (Id : E; V : E);
procedure Set_Elaborate_Body_Desirable (Id : E; V : B := True);
procedure Set_Elaboration_Entity (Id : E; V : E);
procedure Set_Elaboration_Entity_Required (Id : E; V : B := True);
procedure Set_Encapsulating_State (Id : E; V : E);
procedure Set_Enclosing_Scope (Id : E; V : E);
procedure Set_Entry_Accepted (Id : E; V : B := True);
procedure Set_Entry_Bodies_Array (Id : E; V : E);
procedure Set_Entry_Cancel_Parameter (Id : E; V : E);
procedure Set_Entry_Component (Id : E; V : E);
procedure Set_Entry_Formal (Id : E; V : E);
procedure Set_Entry_Index_Constant (Id : E; V : E);
procedure Set_Entry_Max_Queue_Lengths_Array (Id : E; V : E);
procedure Set_Entry_Parameters_Type (Id : E; V : E);
procedure Set_Enum_Pos_To_Rep (Id : E; V : E);
procedure Set_Enumeration_Pos (Id : E; V : U);
procedure Set_Enumeration_Rep (Id : E; V : U);
procedure Set_Enumeration_Rep_Expr (Id : E; V : N);
procedure Set_Equivalent_Type (Id : E; V : E);
procedure Set_Esize (Id : E; V : U);
procedure Set_Extra_Accessibility (Id : E; V : E);
procedure Set_Extra_Accessibility_Of_Result (Id : E; V : E);
procedure Set_Extra_Constrained (Id : E; V : E);
procedure Set_Extra_Formal (Id : E; V : E);
procedure Set_Extra_Formals (Id : E; V : E);
procedure Set_Finalization_Master (Id : E; V : E);
procedure Set_Finalize_Storage_Only (Id : E; V : B := True);
procedure Set_Finalizer (Id : E; V : E);
procedure Set_First_Entity (Id : E; V : E);
procedure Set_First_Exit_Statement (Id : E; V : N);
procedure Set_First_Index (Id : E; V : N);
procedure Set_First_Literal (Id : E; V : E);
procedure Set_First_Private_Entity (Id : E; V : E);
procedure Set_First_Rep_Item (Id : E; V : N);
procedure Set_Float_Rep (Id : E; V : F);
procedure Set_Freeze_Node (Id : E; V : N);
procedure Set_From_Limited_With (Id : E; V : B := True);
procedure Set_Full_View (Id : E; V : E);
procedure Set_Generic_Homonym (Id : E; V : E);
procedure Set_Generic_Renamings (Id : E; V : L);
procedure Set_Handler_Records (Id : E; V : S);
procedure Set_Has_Aliased_Components (Id : E; V : B := True);
procedure Set_Has_Alignment_Clause (Id : E; V : B := True);
procedure Set_Has_All_Calls_Remote (Id : E; V : B := True);
procedure Set_Has_Atomic_Components (Id : E; V : B := True);
procedure Set_Has_Biased_Representation (Id : E; V : B := True);
procedure Set_Has_Completion (Id : E; V : B := True);
procedure Set_Has_Completion_In_Body (Id : E; V : B := True);
procedure Set_Has_Complex_Representation (Id : E; V : B := True);
procedure Set_Has_Component_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Constrained_Partial_View (Id : E; V : B := True);
procedure Set_Has_Contiguous_Rep (Id : E; V : B := True);
procedure Set_Has_Controlled_Component (Id : E; V : B := True);
procedure Set_Has_Controlling_Result (Id : E; V : B := True);
procedure Set_Has_Convention_Pragma (Id : E; V : B := True);
procedure Set_Has_Default_Aspect (Id : E; V : B := True);
procedure Set_Has_Delayed_Aspects (Id : E; V : B := True);
procedure Set_Has_Delayed_Freeze (Id : E; V : B := True);
procedure Set_Has_Delayed_Rep_Aspects (Id : E; V : B := True);
procedure Set_Has_Discriminants (Id : E; V : B := True);
procedure Set_Has_Dispatch_Table (Id : E; V : B := True);
procedure Set_Has_Dynamic_Predicate_Aspect (Id : E; V : B := True);
procedure Set_Has_Enumeration_Rep_Clause (Id : E; V : B := True);
procedure Set_Has_Exit (Id : E; V : B := True);
procedure Set_Has_Expanded_Contract (Id : E; V : B := True);
procedure Set_Has_Forward_Instantiation (Id : E; V : B := True);
procedure Set_Has_Fully_Qualified_Name (Id : E; V : B := True);
procedure Set_Has_Gigi_Rep_Item (Id : E; V : B := True);
procedure Set_Has_Homonym (Id : E; V : B := True);
procedure Set_Has_Implicit_Dereference (Id : E; V : B := True);
procedure Set_Has_Independent_Components (Id : E; V : B := True);
procedure Set_Has_Inheritable_Invariants (Id : E; V : B := True);
procedure Set_Has_Inherited_DIC (Id : E; V : B := True);
procedure Set_Has_Inherited_Invariants (Id : E; V : B := True);
procedure Set_Has_Initial_Value (Id : E; V : B := True);
procedure Set_Has_Loop_Entry_Attributes (Id : E; V : B := True);
procedure Set_Has_Machine_Radix_Clause (Id : E; V : B := True);
procedure Set_Has_Master_Entity (Id : E; V : B := True);
procedure Set_Has_Missing_Return (Id : E; V : B := True);
procedure Set_Has_Nested_Block_With_Handler (Id : E; V : B := True);
procedure Set_Has_Nested_Subprogram (Id : E; V : B := True);
procedure Set_Has_Non_Standard_Rep (Id : E; V : B := True);
procedure Set_Has_Object_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Out_Or_In_Out_Parameter (Id : E; V : B := True);
procedure Set_Has_Own_DIC (Id : E; V : B := True);
procedure Set_Has_Own_Invariants (Id : E; V : B := True);
procedure Set_Has_Partial_Visible_Refinement (Id : E; V : B := True);
procedure Set_Has_Per_Object_Constraint (Id : E; V : B := True);
procedure Set_Has_Pragma_Controlled (Id : E; V : B := True);
procedure Set_Has_Pragma_Elaborate_Body (Id : E; V : B := True);
procedure Set_Has_Pragma_Inline (Id : E; V : B := True);
procedure Set_Has_Pragma_Inline_Always (Id : E; V : B := True);
procedure Set_Has_Pragma_No_Inline (Id : E; V : B := True);
procedure Set_Has_Pragma_Ordered (Id : E; V : B := True);
procedure Set_Has_Pragma_Pack (Id : E; V : B := True);
procedure Set_Has_Pragma_Preelab_Init (Id : E; V : B := True);
procedure Set_Has_Pragma_Pure (Id : E; V : B := True);
procedure Set_Has_Pragma_Pure_Function (Id : E; V : B := True);
procedure Set_Has_Pragma_Thread_Local_Storage (Id : E; V : B := True);
procedure Set_Has_Pragma_Unmodified (Id : E; V : B := True);
procedure Set_Has_Pragma_Unreferenced (Id : E; V : B := True);
procedure Set_Has_Pragma_Unreferenced_Objects (Id : E; V : B := True);
procedure Set_Has_Pragma_Unused (Id : E; V : B := True);
procedure Set_Has_Predicates (Id : E; V : B := True);
procedure Set_Has_Primitive_Operations (Id : E; V : B := True);
procedure Set_Has_Private_Ancestor (Id : E; V : B := True);
procedure Set_Has_Private_Declaration (Id : E; V : B := True);
procedure Set_Has_Private_Extension (Id : E; V : B := True);
procedure Set_Has_Protected (Id : E; V : B := True);
procedure Set_Has_Qualified_Name (Id : E; V : B := True);
procedure Set_Has_RACW (Id : E; V : B := True);
procedure Set_Has_Record_Rep_Clause (Id : E; V : B := True);
procedure Set_Has_Recursive_Call (Id : E; V : B := True);
procedure Set_Has_Shift_Operator (Id : E; V : B := True);
procedure Set_Has_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Small_Clause (Id : E; V : B := True);
procedure Set_Has_Specified_Layout (Id : E; V : B := True);
procedure Set_Has_Specified_Stream_Input (Id : E; V : B := True);
procedure Set_Has_Specified_Stream_Output (Id : E; V : B := True);
procedure Set_Has_Specified_Stream_Read (Id : E; V : B := True);
procedure Set_Has_Specified_Stream_Write (Id : E; V : B := True);
procedure Set_Has_Static_Discriminants (Id : E; V : B := True);
procedure Set_Has_Static_Predicate (Id : E; V : B := True);
procedure Set_Has_Static_Predicate_Aspect (Id : E; V : B := True);
procedure Set_Has_Storage_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Stream_Size_Clause (Id : E; V : B := True);
procedure Set_Has_Task (Id : E; V : B := True);
procedure Set_Has_Timing_Event (Id : E; V : B := True);
procedure Set_Has_Thunks (Id : E; V : B := True);
procedure Set_Has_Unchecked_Union (Id : E; V : B := True);
procedure Set_Has_Unknown_Discriminants (Id : E; V : B := True);
procedure Set_Has_Visible_Refinement (Id : E; V : B := True);
procedure Set_Has_Volatile_Components (Id : E; V : B := True);
procedure Set_Has_Xref_Entry (Id : E; V : B := True);
procedure Set_Has_Yield_Aspect (Id : E; V : B := True);
procedure Set_Hiding_Loop_Variable (Id : E; V : E);
procedure Set_Hidden_In_Formal_Instance (Id : E; V : L);
procedure Set_Homonym (Id : E; V : E);
procedure Set_Ignore_SPARK_Mode_Pragmas (Id : E; V : B := True);
procedure Set_Import_Pragma (Id : E; V : E);
procedure Set_Incomplete_Actuals (Id : E; V : L);
procedure Set_In_Package_Body (Id : E; V : B := True);
procedure Set_In_Private_Part (Id : E; V : B := True);
procedure Set_In_Use (Id : E; V : B := True);
procedure Set_Initialization_Statements (Id : E; V : N);
procedure Set_Inner_Instances (Id : E; V : L);
procedure Set_Interface_Alias (Id : E; V : E);
procedure Set_Interface_Name (Id : E; V : N);
procedure Set_Interfaces (Id : E; V : L);
procedure Set_Is_Abstract_Subprogram (Id : E; V : B := True);
procedure Set_Is_Abstract_Type (Id : E; V : B := True);
procedure Set_Is_Access_Constant (Id : E; V : B := True);
procedure Set_Is_Activation_Record (Id : E; V : B := True);
procedure Set_Is_Actual_Subtype (Id : E; V : B := True);
procedure Set_Is_Ada_2005_Only (Id : E; V : B := True);
procedure Set_Is_Ada_2012_Only (Id : E; V : B := True);
procedure Set_Is_Aliased (Id : E; V : B := True);
procedure Set_Is_Asynchronous (Id : E; V : B := True);
procedure Set_Is_Atomic (Id : E; V : B := True);
procedure Set_Is_Bit_Packed_Array (Id : E; V : B := True);
procedure Set_Is_Called (Id : E; V : B := True);
procedure Set_Is_Character_Type (Id : E; V : B := True);
procedure Set_Is_Checked_Ghost_Entity (Id : E; V : B := True);
procedure Set_Is_Child_Unit (Id : E; V : B := True);
procedure Set_Is_Class_Wide_Clone (Id : E; V : B := True);
procedure Set_Is_Class_Wide_Equivalent_Type (Id : E; V : B := True);
procedure Set_Is_Compilation_Unit (Id : E; V : B := True);
procedure Set_Is_Completely_Hidden (Id : E; V : B := True);
procedure Set_Is_Concurrent_Record_Type (Id : E; V : B := True);
procedure Set_Is_Constr_Subt_For_U_Nominal (Id : E; V : B := True);
procedure Set_Is_Constr_Subt_For_UN_Aliased (Id : E; V : B := True);
procedure Set_Is_Constrained (Id : E; V : B := True);
procedure Set_Is_Constructor (Id : E; V : B := True);
procedure Set_Is_Controlled_Active (Id : E; V : B := True);
procedure Set_Is_Controlling_Formal (Id : E; V : B := True);
procedure Set_Is_CPP_Class (Id : E; V : B := True);
procedure Set_Is_CUDA_Kernel (Id : E; V : B := True);
procedure Set_Is_Descendant_Of_Address (Id : E; V : B := True);
procedure Set_Is_DIC_Procedure (Id : E; V : B := True);
procedure Set_Is_Discrim_SO_Function (Id : E; V : B := True);
procedure Set_Is_Discriminant_Check_Function (Id : E; V : B := True);
procedure Set_Is_Dispatch_Table_Entity (Id : E; V : B := True);
procedure Set_Is_Dispatching_Operation (Id : E; V : B := True);
procedure Set_Is_Elaboration_Checks_OK_Id (Id : E; V : B := True);
procedure Set_Is_Elaboration_Warnings_OK_Id (Id : E; V : B := True);
procedure Set_Is_Eliminated (Id : E; V : B := True);
procedure Set_Is_Entry_Formal (Id : E; V : B := True);
procedure Set_Is_Entry_Wrapper (Id : E; V : B := True);
procedure Set_Is_Exception_Handler (Id : E; V : B := True);
procedure Set_Is_Exported (Id : E; V : B := True);
procedure Set_Is_Finalized_Transient (Id : E; V : B := True);
procedure Set_Is_First_Subtype (Id : E; V : B := True);
procedure Set_Is_Formal_Subprogram (Id : E; V : B := True);
procedure Set_Is_Frozen (Id : E; V : B := True);
procedure Set_Is_Generic_Actual_Subprogram (Id : E; V : B := True);
procedure Set_Is_Generic_Actual_Type (Id : E; V : B := True);
procedure Set_Is_Generic_Instance (Id : E; V : B := True);
procedure Set_Is_Generic_Type (Id : E; V : B := True);
procedure Set_Is_Hidden (Id : E; V : B := True);
procedure Set_Is_Hidden_Non_Overridden_Subpgm (Id : E; V : B := True);
procedure Set_Is_Hidden_Open_Scope (Id : E; V : B := True);
procedure Set_Is_Ignored_Ghost_Entity (Id : E; V : B := True);
procedure Set_Is_Ignored_Transient (Id : E; V : B := True);
procedure Set_Is_Immediately_Visible (Id : E; V : B := True);
procedure Set_Is_Implementation_Defined (Id : E; V : B := True);
procedure Set_Is_Imported (Id : E; V : B := True);
procedure Set_Is_Independent (Id : E; V : B := True);
procedure Set_Is_Initial_Condition_Procedure (Id : E; V : B := True);
procedure Set_Is_Inlined (Id : E; V : B := True);
procedure Set_Is_Inlined_Always (Id : E; V : B := True);
procedure Set_Is_Instantiated (Id : E; V : B := True);
procedure Set_Is_Interface (Id : E; V : B := True);
procedure Set_Is_Internal (Id : E; V : B := True);
procedure Set_Is_Interrupt_Handler (Id : E; V : B := True);
procedure Set_Is_Intrinsic_Subprogram (Id : E; V : B := True);
procedure Set_Is_Invariant_Procedure (Id : E; V : B := True);
procedure Set_Is_Itype (Id : E; V : B := True);
procedure Set_Is_Known_Non_Null (Id : E; V : B := True);
procedure Set_Is_Known_Null (Id : E; V : B := True);
procedure Set_Is_Known_Valid (Id : E; V : B := True);
procedure Set_Is_Limited_Composite (Id : E; V : B := True);
procedure Set_Is_Limited_Interface (Id : E; V : B := True);
procedure Set_Is_Limited_Record (Id : E; V : B := True);
procedure Set_Is_Local_Anonymous_Access (Id : E; V : B := True);
procedure Set_Is_Loop_Parameter (Id : E; V : B := True);
procedure Set_Is_Machine_Code_Subprogram (Id : E; V : B := True);
procedure Set_Is_Non_Static_Subtype (Id : E; V : B := True);
procedure Set_Is_Null_Init_Proc (Id : E; V : B := True);
procedure Set_Is_Obsolescent (Id : E; V : B := True);
procedure Set_Is_Only_Out_Parameter (Id : E; V : B := True);
procedure Set_Is_Package_Body_Entity (Id : E; V : B := True);
procedure Set_Is_Packed (Id : E; V : B := True);
procedure Set_Is_Packed_Array_Impl_Type (Id : E; V : B := True);
procedure Set_Is_Param_Block_Component_Type (Id : E; V : B := True);
procedure Set_Is_Partial_Invariant_Procedure (Id : E; V : B := True);
procedure Set_Is_Potentially_Use_Visible (Id : E; V : B := True);
procedure Set_Is_Predicate_Function (Id : E; V : B := True);
procedure Set_Is_Predicate_Function_M (Id : E; V : B := True);
procedure Set_Is_Preelaborated (Id : E; V : B := True);
procedure Set_Is_Primitive (Id : E; V : B := True);
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True);
procedure Set_Is_Private_Composite (Id : E; V : B := True);
procedure Set_Is_Private_Descendant (Id : E; V : B := True);
procedure Set_Is_Private_Primitive (Id : E; V : B := True);
procedure Set_Is_Public (Id : E; V : B := True);
procedure Set_Is_Pure (Id : E; V : B := True);
procedure Set_Is_Pure_Unit_Access_Type (Id : E; V : B := True);
procedure Set_Is_RACW_Stub_Type (Id : E; V : B := True);
procedure Set_Is_Raised (Id : E; V : B := True);
procedure Set_Is_Remote_Call_Interface (Id : E; V : B := True);
procedure Set_Is_Remote_Types (Id : E; V : B := True);
procedure Set_Is_Renaming_Of_Object (Id : E; V : B := True);
procedure Set_Is_Return_Object (Id : E; V : B := True);
procedure Set_Is_Safe_To_Reevaluate (Id : E; V : B := True);
procedure Set_Is_Shared_Passive (Id : E; V : B := True);
procedure Set_Is_Static_Type (Id : E; V : B := True);
procedure Set_Is_Statically_Allocated (Id : E; V : B := True);
procedure Set_Is_Tag (Id : E; V : B := True);
procedure Set_Is_Tagged_Type (Id : E; V : B := True);
procedure Set_Is_Thunk (Id : E; V : B := True);
procedure Set_Is_Trivial_Subprogram (Id : E; V : B := True);
procedure Set_Is_True_Constant (Id : E; V : B := True);
procedure Set_Is_Unchecked_Union (Id : E; V : B := True);
procedure Set_Is_Underlying_Full_View (Id : E; V : B := True);
procedure Set_Is_Underlying_Record_View (Id : E; V : B := True);
procedure Set_Is_Unimplemented (Id : E; V : B := True);
procedure Set_Is_Unsigned_Type (Id : E; V : B := True);
procedure Set_Is_Uplevel_Referenced_Entity (Id : E; V : B := True);
procedure Set_Is_Valued_Procedure (Id : E; V : B := True);
procedure Set_Is_Visible_Formal (Id : E; V : B := True);
procedure Set_Is_Visible_Lib_Unit (Id : E; V : B := True);
procedure Set_Is_Volatile (Id : E; V : B := True);
procedure Set_Is_Volatile_Full_Access (Id : E; V : B := True);
procedure Set_Itype_Printed (Id : E; V : B := True);
procedure Set_Kill_Elaboration_Checks (Id : E; V : B := True);
procedure Set_Kill_Range_Checks (Id : E; V : B := True);
procedure Set_Known_To_Have_Preelab_Init (Id : E; V : B := True);
procedure Set_Last_Aggregate_Assignment (Id : E; V : N);
procedure Set_Last_Assignment (Id : E; V : N);
procedure Set_Last_Entity (Id : E; V : E);
procedure Set_Limited_View (Id : E; V : E);
procedure Set_Linker_Section_Pragma (Id : E; V : N);
procedure Set_Lit_Indexes (Id : E; V : E);
procedure Set_Lit_Strings (Id : E; V : E);
procedure Set_Low_Bound_Tested (Id : E; V : B := True);
procedure Set_Machine_Radix_10 (Id : E; V : B := True);
procedure Set_Master_Id (Id : E; V : E);
procedure Set_Materialize_Entity (Id : E; V : B := True);
procedure Set_May_Inherit_Delayed_Rep_Aspects (Id : E; V : B := True);
procedure Set_Mechanism (Id : E; V : M);
procedure Set_Minimum_Accessibility (Id : E; V : E);
procedure Set_Modulus (Id : E; V : U);
procedure Set_Must_Be_On_Byte_Boundary (Id : E; V : B := True);
procedure Set_Must_Have_Preelab_Init (Id : E; V : B := True);
procedure Set_Needs_Activation_Record (Id : E; V : B := True);
procedure Set_Needs_Debug_Info (Id : E; V : B := True);
procedure Set_Needs_No_Actuals (Id : E; V : B := True);
procedure Set_Never_Set_In_Source (Id : E; V : B := True);
procedure Set_Next_Inlined_Subprogram (Id : E; V : E);
procedure Set_No_Dynamic_Predicate_On_Actual (Id : E; V : B := True);
procedure Set_No_Pool_Assigned (Id : E; V : B := True);
procedure Set_No_Predicate_On_Actual (Id : E; V : B := True);
procedure Set_No_Reordering (Id : E; V : B := True);
procedure Set_No_Return (Id : E; V : B := True);
procedure Set_No_Strict_Aliasing (Id : E; V : B := True);
procedure Set_No_Tagged_Streams_Pragma (Id : E; V : N);
procedure Set_Non_Binary_Modulus (Id : E; V : B := True);
procedure Set_Non_Limited_View (Id : E; V : E);
procedure Set_Nonzero_Is_True (Id : E; V : B := True);
procedure Set_Normalized_First_Bit (Id : E; V : U);
procedure Set_Normalized_Position (Id : E; V : U);
procedure Set_Normalized_Position_Max (Id : E; V : U);
procedure Set_OK_To_Rename (Id : E; V : B := True);
procedure Set_Optimize_Alignment_Space (Id : E; V : B := True);
procedure Set_Optimize_Alignment_Time (Id : E; V : B := True);
procedure Set_Original_Access_Type (Id : E; V : E);
procedure Set_Original_Array_Type (Id : E; V : E);
procedure Set_Original_Protected_Subprogram (Id : E; V : N);
procedure Set_Original_Record_Component (Id : E; V : E);
procedure Set_Overlays_Constant (Id : E; V : B := True);
procedure Set_Overridden_Operation (Id : E; V : E);
procedure Set_Package_Instantiation (Id : E; V : N);
procedure Set_Packed_Array_Impl_Type (Id : E; V : E);
procedure Set_Parent_Subtype (Id : E; V : E);
procedure Set_Part_Of_Constituents (Id : E; V : L);
procedure Set_Part_Of_References (Id : E; V : L);
procedure Set_Partial_View_Has_Unknown_Discr (Id : E; V : B := True);
procedure Set_Pending_Access_Types (Id : E; V : L);
procedure Set_Postconditions_Proc (Id : E; V : E);
procedure Set_Prev_Entity (Id : E; V : E);
procedure Set_Prival (Id : E; V : E);
procedure Set_Prival_Link (Id : E; V : E);
procedure Set_Private_Dependents (Id : E; V : L);
procedure Set_Protected_Body_Subprogram (Id : E; V : E);
procedure Set_Protected_Formal (Id : E; V : E);
procedure Set_Protected_Subprogram (Id : E; V : N);
procedure Set_Protection_Object (Id : E; V : E);
procedure Set_Reachable (Id : E; V : B := True);
procedure Set_Receiving_Entry (Id : E; V : E);
procedure Set_Referenced (Id : E; V : B := True);
procedure Set_Referenced_As_LHS (Id : E; V : B := True);
procedure Set_Referenced_As_Out_Parameter (Id : E; V : B := True);
procedure Set_Refinement_Constituents (Id : E; V : L);
procedure Set_Register_Exception_Call (Id : E; V : N);
procedure Set_Related_Array_Object (Id : E; V : E);
procedure Set_Related_Expression (Id : E; V : N);
procedure Set_Related_Instance (Id : E; V : E);
procedure Set_Related_Type (Id : E; V : E);
procedure Set_Relative_Deadline_Variable (Id : E; V : E);
procedure Set_Renamed_Entity (Id : E; V : N);
procedure Set_Renamed_In_Spec (Id : E; V : B := True);
procedure Set_Renamed_Object (Id : E; V : N);
procedure Set_Renaming_Map (Id : E; V : U);
procedure Set_Requires_Overriding (Id : E; V : B := True);
procedure Set_Return_Applies_To (Id : E; V : N);
procedure Set_Return_Present (Id : E; V : B := True);
procedure Set_Returns_By_Ref (Id : E; V : B := True);
procedure Set_Reverse_Bit_Order (Id : E; V : B := True);
procedure Set_Reverse_Storage_Order (Id : E; V : B := True);
procedure Set_Rewritten_For_C (Id : E; V : B := True);
procedure Set_RM_Size (Id : E; V : U);
procedure Set_Scalar_Range (Id : E; V : N);
procedure Set_Scale_Value (Id : E; V : U);
procedure Set_Scope_Depth_Value (Id : E; V : U);
procedure Set_Sec_Stack_Needed_For_Return (Id : E; V : B := True);
procedure Set_Shared_Var_Procs_Instance (Id : E; V : E);
procedure Set_Size_Check_Code (Id : E; V : N);
procedure Set_Size_Depends_On_Discriminant (Id : E; V : B := True);
procedure Set_Size_Known_At_Compile_Time (Id : E; V : B := True);
procedure Set_Small_Value (Id : E; V : R);
procedure Set_SPARK_Aux_Pragma (Id : E; V : N);
procedure Set_SPARK_Aux_Pragma_Inherited (Id : E; V : B := True);
procedure Set_SPARK_Pragma (Id : E; V : N);
procedure Set_SPARK_Pragma_Inherited (Id : E; V : B := True);
procedure Set_Spec_Entity (Id : E; V : E);
procedure Set_SSO_Set_High_By_Default (Id : E; V : B := True);
procedure Set_SSO_Set_Low_By_Default (Id : E; V : B := True);
procedure Set_Static_Discrete_Predicate (Id : E; V : S);
procedure Set_Static_Elaboration_Desired (Id : E; V : B);
procedure Set_Static_Initialization (Id : E; V : N);
procedure Set_Static_Real_Or_String_Predicate (Id : E; V : N);
procedure Set_Status_Flag_Or_Transient_Decl (Id : E; V : E);
procedure Set_Storage_Size_Variable (Id : E; V : E);
procedure Set_Stored_Constraint (Id : E; V : L);
procedure Set_Stores_Attribute_Old_Prefix (Id : E; V : B := True);
procedure Set_Strict_Alignment (Id : E; V : B := True);
procedure Set_String_Literal_Length (Id : E; V : U);
procedure Set_String_Literal_Low_Bound (Id : E; V : N);
procedure Set_Subprograms_For_Type (Id : E; V : L);
procedure Set_Subps_Index (Id : E; V : U);
procedure Set_Suppress_Elaboration_Warnings (Id : E; V : B := True);
procedure Set_Suppress_Initialization (Id : E; V : B := True);
procedure Set_Suppress_Style_Checks (Id : E; V : B := True);
procedure Set_Suppress_Value_Tracking_On_Call (Id : E; V : B := True);
procedure Set_Task_Body_Procedure (Id : E; V : N);
procedure Set_Thunk_Entity (Id : E; V : E);
procedure Set_Treat_As_Volatile (Id : E; V : B := True);
procedure Set_Underlying_Full_View (Id : E; V : E);
procedure Set_Underlying_Record_View (Id : E; V : E);
procedure Set_Universal_Aliasing (Id : E; V : B := True);
procedure Set_Unset_Reference (Id : E; V : N);
procedure Set_Used_As_Generic_Actual (Id : E; V : B := True);
procedure Set_Uses_Lock_Free (Id : E; V : B := True);
procedure Set_Uses_Sec_Stack (Id : E; V : B := True);
procedure Set_Validated_Object (Id : E; V : N);
procedure Set_Warnings_Off (Id : E; V : B := True);
procedure Set_Warnings_Off_Used (Id : E; V : B := True);
procedure Set_Warnings_Off_Used_Unmodified (Id : E; V : B := True);
procedure Set_Warnings_Off_Used_Unreferenced (Id : E; V : B := True);
procedure Set_Was_Hidden (Id : E; V : B := True);
procedure Set_Wrapped_Entity (Id : E; V : E);
---------------------------------------------------
-- Access to Subprograms in Subprograms_For_Type --
---------------------------------------------------
function DIC_Procedure (Id : E) return E;
function Invariant_Procedure (Id : E) return E;
function Partial_Invariant_Procedure (Id : E) return E;
function Predicate_Function (Id : E) return E;
function Predicate_Function_M (Id : E) return E;
procedure Set_DIC_Procedure (Id : E; V : E);
procedure Set_Invariant_Procedure (Id : E; V : E);
procedure Set_Partial_Invariant_Procedure (Id : E; V : E);
procedure Set_Predicate_Function (Id : E; V : E);
procedure Set_Predicate_Function_M (Id : E; V : E);
-----------------------------------
-- Field Initialization Routines --
-----------------------------------
-- These routines are overloadings of some of the above Set procedures
-- where the argument is normally a Uint. The overloadings take an Int
-- parameter instead, and appropriately convert it. There are also
-- versions that implicitly initialize to the appropriate "not set"
-- value. The not set (unknown) values are as follows:
-- Alignment Uint_0
-- Component_Size Uint_0
-- Component_Bit_Offset No_Uint
-- Digits_Value Uint_0
-- Esize Uint_0
-- Normalized_First_Bit No_Uint
-- Normalized_Position No_Uint
-- Normalized_Position_Max No_Uint
-- RM_Size Uint_0
-- It would be cleaner to use No_Uint in all these cases, but historically
-- we chose to use Uint_0 at first, and the change over will take time ???
-- This is particularly true for the RM_Size field, where a value of zero
-- is legitimate and causes some special tests around the code.
-- Contrary to the corresponding Set procedures above, these routines
-- do NOT check the entity kind of their argument, instead they set the
-- underlying Uint fields directly (this allows them to be used for
-- entities whose Ekind has not been set yet).
procedure Init_Alignment (Id : E; V : Int);
procedure Init_Component_Bit_Offset (Id : E; V : Int);
procedure Init_Component_Size (Id : E; V : Int);
procedure Init_Digits_Value (Id : E; V : Int);
procedure Init_Esize (Id : E; V : Int);
procedure Init_Normalized_First_Bit (Id : E; V : Int);
procedure Init_Normalized_Position (Id : E; V : Int);
procedure Init_Normalized_Position_Max (Id : E; V : Int);
procedure Init_RM_Size (Id : E; V : Int);
procedure Init_Alignment (Id : E);
procedure Init_Component_Bit_Offset (Id : E);
procedure Init_Component_Size (Id : E);
procedure Init_Digits_Value (Id : E);
procedure Init_Esize (Id : E);
procedure Init_Normalized_First_Bit (Id : E);
procedure Init_Normalized_Position (Id : E);
procedure Init_Normalized_Position_Max (Id : E);
procedure Init_RM_Size (Id : E);
procedure Init_Component_Location (Id : E);
-- Initializes all fields describing the location of a component
-- (Normalized_Position, Component_Bit_Offset, Normalized_First_Bit,
-- Normalized_Position_Max, Esize) to all be Unknown.
procedure Init_Size (Id : E; V : Int);
-- Initialize both the Esize and RM_Size fields of E to V
procedure Init_Size_Align (Id : E);
-- This procedure initializes both size fields and the alignment
-- field to all be Unknown.
procedure Init_Object_Size_Align (Id : E);
-- Same as Init_Size_Align except RM_Size field (which is only for types)
-- is unaffected.
---------------
-- Iterators --
---------------
-- The call to Next_xxx (obj) is equivalent to obj := Next_xxx (obj)
-- We define the set of Proc_Next_xxx routines simply for the purposes
-- of inlining them without necessarily inlining the function.
procedure Proc_Next_Component (N : in out Node_Id);
procedure Proc_Next_Component_Or_Discriminant (N : in out Node_Id);
procedure Proc_Next_Discriminant (N : in out Node_Id);
procedure Proc_Next_Formal (N : in out Node_Id);
procedure Proc_Next_Formal_With_Extras (N : in out Node_Id);
procedure Proc_Next_Index (N : in out Node_Id);
procedure Proc_Next_Inlined_Subprogram (N : in out Node_Id);
procedure Proc_Next_Literal (N : in out Node_Id);
procedure Proc_Next_Stored_Discriminant (N : in out Node_Id);
pragma Inline (Proc_Next_Component);
pragma Inline (Proc_Next_Component_Or_Discriminant);
pragma Inline (Proc_Next_Discriminant);
pragma Inline (Proc_Next_Formal);
pragma Inline (Proc_Next_Formal_With_Extras);
pragma Inline (Proc_Next_Index);
pragma Inline (Proc_Next_Inlined_Subprogram);
pragma Inline (Proc_Next_Literal);
pragma Inline (Proc_Next_Stored_Discriminant);
procedure Next_Component (N : in out Node_Id)
renames Proc_Next_Component;
procedure Next_Component_Or_Discriminant (N : in out Node_Id)
renames Proc_Next_Component_Or_Discriminant;
procedure Next_Discriminant (N : in out Node_Id)
renames Proc_Next_Discriminant;
procedure Next_Formal (N : in out Node_Id)
renames Proc_Next_Formal;
procedure Next_Formal_With_Extras (N : in out Node_Id)
renames Proc_Next_Formal_With_Extras;
procedure Next_Index (N : in out Node_Id)
renames Proc_Next_Index;
procedure Next_Inlined_Subprogram (N : in out Node_Id)
renames Proc_Next_Inlined_Subprogram;
procedure Next_Literal (N : in out Node_Id)
renames Proc_Next_Literal;
procedure Next_Stored_Discriminant (N : in out Node_Id)
renames Proc_Next_Stored_Discriminant;
---------------------------
-- Testing Warning Flags --
---------------------------
-- These routines are to be used rather than testing flags Warnings_Off,
-- Has_Pragma_Unmodified, Has_Pragma_Unreferenced. They deal with setting
-- the flags Warnings_Off_Used[_Unmodified|Unreferenced] for later access.
function Has_Warnings_Off (E : Entity_Id) return Boolean;
-- If Warnings_Off is set on E, then returns True and also sets the flag
-- Warnings_Off_Used on E. If Warnings_Off is not set on E, returns False
-- and has no side effect.
function Has_Unmodified (E : Entity_Id) return Boolean;
-- If flag Has_Pragma_Unmodified is set on E, returns True with no side
-- effects. Otherwise if Warnings_Off is set on E, returns True and also
-- sets the flag Warnings_Off_Used_Unmodified on E. If neither of the flags
-- Warnings_Off nor Has_Pragma_Unmodified is set, returns False with no
-- side effects.
function Has_Unreferenced (E : Entity_Id) return Boolean;
-- If flag Has_Pragma_Unreferenced is set on E, returns True with no side
-- effects. Otherwise if Warnings_Off is set on E, returns True and also
-- sets the flag Warnings_Off_Used_Unreferenced on E. If neither of the
-- flags Warnings_Off nor Has_Pragma_Unreferenced is set, returns False
-- with no side effects.
----------------------------------------------
-- Subprograms for Accessing Rep Item Chain --
----------------------------------------------
-- The First_Rep_Item field of every entity points to a linked list (linked
-- through Next_Rep_Item) of representation pragmas, attribute definition
-- clauses, representation clauses, and aspect specifications that apply to
-- the item. Note that in the case of types, it is assumed that any such
-- rep items for a base type also apply to all subtypes. This is achieved
-- by having the chain for subtypes link onto the chain for the base type,
-- so that new entries for the subtype are added at the start of the chain.
--
-- Note: aspect specification nodes are linked only when evaluation of the
-- expression is deferred to the freeze point. For further details see
-- Sem_Ch13.Analyze_Aspect_Specifications.
function Get_Attribute_Definition_Clause
(E : Entity_Id;
Id : Attribute_Id) return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for an instance of an
-- attribute definition clause with the given attribute Id. If found, the
-- value returned is the N_Attribute_Definition_Clause node, otherwise
-- Empty is returned.
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function Get_Pragma (E : Entity_Id; Id : Pragma_Id) return Node_Id;
-- Searches the Rep_Item chain of entity E, for an instance of a pragma
-- with the given pragma Id. If found, the value returned is the N_Pragma
-- node, otherwise Empty is returned. The following contract pragmas that
-- appear in N_Contract nodes are also handled by this routine:
-- Abstract_State
-- Async_Readers
-- Async_Writers
-- Attach_Handler
-- Constant_After_Elaboration
-- Contract_Cases
-- Depends
-- Effective_Reads
-- Effective_Writes
-- Global
-- Initial_Condition
-- Initializes
-- Interrupt_Handler
-- No_Caching
-- Part_Of
-- Precondition
-- Postcondition
-- Refined_Depends
-- Refined_Global
-- Refined_Post
-- Refined_State
-- Subprogram_Variant
-- Test_Case
-- Volatile_Function
function Get_Class_Wide_Pragma
(E : Entity_Id;
Id : Pragma_Id) return Node_Id;
-- Examine Rep_Item chain to locate a classwide pre- or postcondition of a
-- primitive operation. Returns Empty if not present.
function Get_Record_Representation_Clause (E : Entity_Id) return Node_Id;
-- Searches the Rep_Item chain for a given entity E, for a record
-- representation clause, and if found, returns it. Returns Empty
-- if no such clause is found.
function Present_In_Rep_Item (E : Entity_Id; N : Node_Id) return Boolean;
-- Return True if N is present in the Rep_Item chain for a given entity E
procedure Record_Rep_Item (E : Entity_Id; N : Node_Id);
-- N is the node for a representation pragma, representation clause, an
-- attribute definition clause, or an aspect specification that applies to
-- entity E. This procedure links the node N onto the Rep_Item chain for
-- entity E. Note that it is an error to call this procedure with E being
-- overloadable, and N being a pragma that applies to multiple overloadable
-- entities (Convention, Interface, Inline, Inline_Always, Import, Export,
-- External). This is not allowed even in the case where the entity is not
-- overloaded, since we can't rely on it being present in the overloaded
-- case, it is not useful to have it present in the non-overloaded case.
-------------------------------
-- Miscellaneous Subprograms --
-------------------------------
procedure Append_Entity (Id : Entity_Id; Scop : Entity_Id);
-- Add an entity to the list of entities declared in the scope Scop
function Get_Full_View (T : Entity_Id) return Entity_Id;
-- If T is an incomplete type and the full declaration has been seen, or
-- is the name of a class_wide type whose root is incomplete, return the
-- corresponding full declaration, else return T itself.
function Is_Entity_Name (N : Node_Id) return Boolean;
-- Test if the node N is the name of an entity (i.e. is an identifier,
-- expanded name, or an attribute reference that returns an entity).
-- WARNING: There is a matching C declaration of this subprogram in fe.h
procedure Link_Entities (First : Entity_Id; Second : Entity_Id);
-- Link entities First and Second in one entity chain.
--
-- NOTE: No updates are done to the First_Entity and Last_Entity fields
-- of the scope.
procedure Remove_Entity (Id : Entity_Id);
-- Remove entity Id from the entity chain of its scope
function Subtype_Kind (K : Entity_Kind) return Entity_Kind;
-- Given an entity_kind K this function returns the entity_kind
-- corresponding to subtype kind of the type represented by K. For
-- example if K is E_Signed_Integer_Type then E_Signed_Integer_Subtype
-- is returned. If K is already a subtype kind it itself is returned. An
-- internal error is generated if no such correspondence exists for K.
procedure Unlink_Next_Entity (Id : Entity_Id);
-- Unchain entity Id's forward link within the entity chain of its scope
----------------------------------
-- Debugging Output Subprograms --
----------------------------------
procedure Write_Entity_Flags (Id : Entity_Id; Prefix : String);
-- Writes a series of entries giving a line for each flag that is
-- set to True. Each line is prefixed by the given string.
procedure Write_Entity_Info (Id : Entity_Id; Prefix : String);
-- A debugging procedure to write out information about an entity
procedure Write_Field6_Name (Id : Entity_Id);
procedure Write_Field7_Name (Id : Entity_Id);
procedure Write_Field8_Name (Id : Entity_Id);
procedure Write_Field9_Name (Id : Entity_Id);
procedure Write_Field10_Name (Id : Entity_Id);
procedure Write_Field11_Name (Id : Entity_Id);
procedure Write_Field12_Name (Id : Entity_Id);
procedure Write_Field13_Name (Id : Entity_Id);
procedure Write_Field14_Name (Id : Entity_Id);
procedure Write_Field15_Name (Id : Entity_Id);
procedure Write_Field16_Name (Id : Entity_Id);
procedure Write_Field17_Name (Id : Entity_Id);
procedure Write_Field18_Name (Id : Entity_Id);
procedure Write_Field19_Name (Id : Entity_Id);
procedure Write_Field20_Name (Id : Entity_Id);
procedure Write_Field21_Name (Id : Entity_Id);
procedure Write_Field22_Name (Id : Entity_Id);
procedure Write_Field23_Name (Id : Entity_Id);
procedure Write_Field24_Name (Id : Entity_Id);
procedure Write_Field25_Name (Id : Entity_Id);
procedure Write_Field26_Name (Id : Entity_Id);
procedure Write_Field27_Name (Id : Entity_Id);
procedure Write_Field28_Name (Id : Entity_Id);
procedure Write_Field29_Name (Id : Entity_Id);
procedure Write_Field30_Name (Id : Entity_Id);
procedure Write_Field31_Name (Id : Entity_Id);
procedure Write_Field32_Name (Id : Entity_Id);
procedure Write_Field33_Name (Id : Entity_Id);
procedure Write_Field34_Name (Id : Entity_Id);
procedure Write_Field35_Name (Id : Entity_Id);
procedure Write_Field36_Name (Id : Entity_Id);
procedure Write_Field37_Name (Id : Entity_Id);
procedure Write_Field38_Name (Id : Entity_Id);
procedure Write_Field39_Name (Id : Entity_Id);
procedure Write_Field40_Name (Id : Entity_Id);
procedure Write_Field41_Name (Id : Entity_Id);
-- These routines are used in Treepr to output a nice symbolic name for
-- the given field, depending on the Ekind. No blanks or end of lines are
-- output, just the characters of the field name.
----------------------------------
-- Inline Pragmas for functions --
----------------------------------
-- Note that these inline pragmas are referenced by the XEINFO utility
-- program in preparing the corresponding C header, and only those
-- subprograms meeting the requirements documented in the section on
-- XEINFO may be referenced in this section.
pragma Inline (Abstract_States);
pragma Inline (Accept_Address);
pragma Inline (Access_Disp_Table);
pragma Inline (Access_Disp_Table_Elab_Flag);
pragma Inline (Access_Subprogram_Wrapper);
pragma Inline (Activation_Record_Component);
pragma Inline (Actual_Subtype);
pragma Inline (Address_Taken);
pragma Inline (Alias);
pragma Inline (Alignment);
pragma Inline (Anonymous_Designated_Type);
pragma Inline (Anonymous_Masters);
pragma Inline (Anonymous_Object);
pragma Inline (Associated_Entity);
pragma Inline (Associated_Formal_Package);
pragma Inline (Associated_Node_For_Itype);
pragma Inline (Associated_Storage_Pool);
pragma Inline (Barrier_Function);
pragma Inline (BIP_Initialization_Call);
pragma Inline (Block_Node);
pragma Inline (Body_Entity);
pragma Inline (Body_Needed_For_Inlining);
pragma Inline (Body_Needed_For_SAL);
pragma Inline (Body_References);
pragma Inline (C_Pass_By_Copy);
pragma Inline (Can_Never_Be_Null);
pragma Inline (Can_Use_Internal_Rep);
pragma Inline (Checks_May_Be_Suppressed);
pragma Inline (Class_Wide_Clone);
pragma Inline (Class_Wide_Type);
pragma Inline (Cloned_Subtype);
pragma Inline (Component_Bit_Offset);
pragma Inline (Component_Clause);
pragma Inline (Component_Size);
pragma Inline (Component_Type);
pragma Inline (Contains_Ignored_Ghost_Code);
pragma Inline (Contract);
pragma Inline (Contract_Wrapper);
pragma Inline (Corresponding_Concurrent_Type);
pragma Inline (Corresponding_Discriminant);
pragma Inline (Corresponding_Equality);
pragma Inline (Corresponding_Function);
pragma Inline (Corresponding_Procedure);
pragma Inline (Corresponding_Protected_Entry);
pragma Inline (Corresponding_Record_Component);
pragma Inline (Corresponding_Record_Type);
pragma Inline (Corresponding_Remote_Type);
pragma Inline (CR_Discriminant);
pragma Inline (Current_Use_Clause);
pragma Inline (Current_Value);
pragma Inline (Debug_Info_Off);
pragma Inline (Debug_Renaming_Link);
pragma Inline (Default_Aspect_Component_Value);
pragma Inline (Default_Aspect_Value);
pragma Inline (Default_Expr_Function);
pragma Inline (Default_Expressions_Processed);
pragma Inline (Default_Value);
pragma Inline (Delay_Cleanups);
pragma Inline (Delay_Subprogram_Descriptors);
pragma Inline (Delta_Value);
pragma Inline (Dependent_Instances);
pragma Inline (Depends_On_Private);
pragma Inline (Derived_Type_Link);
pragma Inline (Digits_Value);
pragma Inline (Direct_Primitive_Operations);
pragma Inline (Directly_Designated_Type);
pragma Inline (Disable_Controlled);
pragma Inline (Discard_Names);
pragma Inline (Discriminal);
pragma Inline (Discriminal_Link);
pragma Inline (Discriminant_Checking_Func);
pragma Inline (Discriminant_Constraint);
pragma Inline (Discriminant_Default_Value);
pragma Inline (Discriminant_Number);
pragma Inline (Dispatch_Table_Wrappers);
pragma Inline (DT_Entry_Count);
pragma Inline (DT_Offset_To_Top_Func);
pragma Inline (DT_Position);
pragma Inline (DTC_Entity);
pragma Inline (Elaborate_Body_Desirable);
pragma Inline (Elaboration_Entity);
pragma Inline (Elaboration_Entity_Required);
pragma Inline (Encapsulating_State);
pragma Inline (Enclosing_Scope);
pragma Inline (Entry_Accepted);
pragma Inline (Entry_Bodies_Array);
pragma Inline (Entry_Cancel_Parameter);
pragma Inline (Entry_Component);
pragma Inline (Entry_Formal);
pragma Inline (Entry_Index_Constant);
pragma Inline (Entry_Index_Type);
pragma Inline (Entry_Max_Queue_Lengths_Array);
pragma Inline (Entry_Parameters_Type);
pragma Inline (Enum_Pos_To_Rep);
pragma Inline (Enumeration_Pos);
pragma Inline (Enumeration_Rep);
pragma Inline (Enumeration_Rep_Expr);
pragma Inline (Equivalent_Type);
pragma Inline (Esize);
pragma Inline (Extra_Accessibility);
pragma Inline (Extra_Accessibility_Of_Result);
pragma Inline (Extra_Constrained);
pragma Inline (Extra_Formal);
pragma Inline (Extra_Formals);
pragma Inline (Finalize_Storage_Only);
pragma Inline (Finalization_Master);
pragma Inline (Finalizer);
pragma Inline (First_Entity);
pragma Inline (First_Exit_Statement);
pragma Inline (First_Index);
pragma Inline (First_Literal);
pragma Inline (First_Private_Entity);
pragma Inline (First_Rep_Item);
pragma Inline (Freeze_Node);
pragma Inline (From_Limited_With);
pragma Inline (Full_View);
pragma Inline (Generic_Homonym);
pragma Inline (Generic_Renamings);
pragma Inline (Handler_Records);
pragma Inline (Has_Aliased_Components);
pragma Inline (Has_Alignment_Clause);
pragma Inline (Has_All_Calls_Remote);
pragma Inline (Has_Atomic_Components);
pragma Inline (Has_Biased_Representation);
pragma Inline (Has_Completion);
pragma Inline (Has_Completion_In_Body);
pragma Inline (Has_Complex_Representation);
pragma Inline (Has_Component_Size_Clause);
pragma Inline (Has_Constrained_Partial_View);
pragma Inline (Has_Contiguous_Rep);
pragma Inline (Has_Controlled_Component);
pragma Inline (Has_Controlling_Result);
pragma Inline (Has_Convention_Pragma);
pragma Inline (Has_Default_Aspect);
pragma Inline (Has_Delayed_Aspects);
pragma Inline (Has_Delayed_Freeze);
pragma Inline (Has_Delayed_Rep_Aspects);
pragma Inline (Has_DIC);
pragma Inline (Has_Discriminants);
pragma Inline (Has_Dispatch_Table);
pragma Inline (Has_Dynamic_Predicate_Aspect);
pragma Inline (Has_Enumeration_Rep_Clause);
pragma Inline (Has_Exit);
pragma Inline (Has_Expanded_Contract);
pragma Inline (Has_Forward_Instantiation);
pragma Inline (Has_Fully_Qualified_Name);
pragma Inline (Has_Gigi_Rep_Item);
pragma Inline (Has_Homonym);
pragma Inline (Has_Implicit_Dereference);
pragma Inline (Has_Independent_Components);
pragma Inline (Has_Inheritable_Invariants);
pragma Inline (Has_Inherited_DIC);
pragma Inline (Has_Inherited_Invariants);
pragma Inline (Has_Initial_Value);
pragma Inline (Has_Invariants);
pragma Inline (Has_Loop_Entry_Attributes);
pragma Inline (Has_Machine_Radix_Clause);
pragma Inline (Has_Master_Entity);
pragma Inline (Has_Missing_Return);
pragma Inline (Has_Nested_Block_With_Handler);
pragma Inline (Has_Nested_Subprogram);
pragma Inline (Has_Non_Standard_Rep);
pragma Inline (Has_Object_Size_Clause);
pragma Inline (Has_Out_Or_In_Out_Parameter);
pragma Inline (Has_Own_DIC);
pragma Inline (Has_Own_Invariants);
pragma Inline (Has_Partial_Visible_Refinement);
pragma Inline (Has_Per_Object_Constraint);
pragma Inline (Has_Pragma_Controlled);
pragma Inline (Has_Pragma_Elaborate_Body);
pragma Inline (Has_Pragma_Inline);
pragma Inline (Has_Pragma_Inline_Always);
pragma Inline (Has_Pragma_No_Inline);
pragma Inline (Has_Pragma_Ordered);
pragma Inline (Has_Pragma_Pack);
pragma Inline (Has_Pragma_Preelab_Init);
pragma Inline (Has_Pragma_Pure);
pragma Inline (Has_Pragma_Pure_Function);
pragma Inline (Has_Pragma_Thread_Local_Storage);
pragma Inline (Has_Pragma_Unmodified);
pragma Inline (Has_Pragma_Unreferenced);
pragma Inline (Has_Pragma_Unreferenced_Objects);
pragma Inline (Has_Pragma_Unused);
pragma Inline (Has_Predicates);
pragma Inline (Has_Primitive_Operations);
pragma Inline (Has_Private_Ancestor);
pragma Inline (Has_Private_Declaration);
pragma Inline (Has_Private_Extension);
pragma Inline (Has_Protected);
pragma Inline (Has_Qualified_Name);
pragma Inline (Has_RACW);
pragma Inline (Has_Record_Rep_Clause);
pragma Inline (Has_Recursive_Call);
pragma Inline (Has_Shift_Operator);
pragma Inline (Has_Size_Clause);
pragma Inline (Has_Small_Clause);
pragma Inline (Has_Specified_Layout);
pragma Inline (Has_Specified_Stream_Input);
pragma Inline (Has_Specified_Stream_Output);
pragma Inline (Has_Specified_Stream_Read);
pragma Inline (Has_Specified_Stream_Write);
pragma Inline (Has_Static_Discriminants);
pragma Inline (Has_Static_Predicate);
pragma Inline (Has_Static_Predicate_Aspect);
pragma Inline (Has_Storage_Size_Clause);
pragma Inline (Has_Stream_Size_Clause);
pragma Inline (Has_Task);
pragma Inline (Has_Timing_Event);
pragma Inline (Has_Thunks);
pragma Inline (Has_Unchecked_Union);
pragma Inline (Has_Unknown_Discriminants);
pragma Inline (Has_Visible_Refinement);
pragma Inline (Has_Volatile_Components);
pragma Inline (Has_Xref_Entry);
pragma Inline (Has_Yield_Aspect);
pragma Inline (Hiding_Loop_Variable);
pragma Inline (Hidden_In_Formal_Instance);
pragma Inline (Homonym);
pragma Inline (Ignore_SPARK_Mode_Pragmas);
pragma Inline (Import_Pragma);
pragma Inline (Incomplete_Actuals);
pragma Inline (In_Package_Body);
pragma Inline (In_Private_Part);
pragma Inline (In_Use);
pragma Inline (Initialization_Statements);
pragma Inline (Inner_Instances);
pragma Inline (Interface_Alias);
pragma Inline (Interface_Name);
pragma Inline (Interfaces);
pragma Inline (Is_Abstract_Subprogram);
pragma Inline (Is_Abstract_Type);
pragma Inline (Is_Access_Constant);
pragma Inline (Is_Activation_Record);
pragma Inline (Is_Actual_Subtype);
pragma Inline (Is_Access_Protected_Subprogram_Type);
pragma Inline (Is_Access_Subprogram_Type);
pragma Inline (Is_Access_Type);
pragma Inline (Is_Ada_2005_Only);
pragma Inline (Is_Ada_2012_Only);
pragma Inline (Is_Aggregate_Type);
pragma Inline (Is_Aliased);
pragma Inline (Is_Anonymous_Access_Type);
pragma Inline (Is_Array_Type);
pragma Inline (Is_Assignable);
pragma Inline (Is_Asynchronous);
pragma Inline (Is_Atomic);
pragma Inline (Is_Atomic_Or_VFA);
pragma Inline (Is_Bit_Packed_Array);
pragma Inline (Is_Called);
pragma Inline (Is_Character_Type);
pragma Inline (Is_Checked_Ghost_Entity);
pragma Inline (Is_Child_Unit);
pragma Inline (Is_Class_Wide_Clone);
pragma Inline (Is_Class_Wide_Equivalent_Type);
pragma Inline (Is_Class_Wide_Type);
pragma Inline (Is_Compilation_Unit);
pragma Inline (Is_Completely_Hidden);
pragma Inline (Is_Composite_Type);
pragma Inline (Is_Concurrent_Body);
pragma Inline (Is_Concurrent_Record_Type);
pragma Inline (Is_Concurrent_Type);
pragma Inline (Is_Constr_Subt_For_U_Nominal);
pragma Inline (Is_Constr_Subt_For_UN_Aliased);
pragma Inline (Is_Constrained);
pragma Inline (Is_Constructor);
pragma Inline (Is_Controlled_Active);
pragma Inline (Is_Controlling_Formal);
pragma Inline (Is_CPP_Class);
pragma Inline (Is_CUDA_Kernel);
pragma Inline (Is_Decimal_Fixed_Point_Type);
pragma Inline (Is_Descendant_Of_Address);
pragma Inline (Is_DIC_Procedure);
pragma Inline (Is_Digits_Type);
pragma Inline (Is_Discrete_Or_Fixed_Point_Type);
pragma Inline (Is_Discrete_Type);
pragma Inline (Is_Discrim_SO_Function);
pragma Inline (Is_Discriminant_Check_Function);
pragma Inline (Is_Dispatch_Table_Entity);
pragma Inline (Is_Dispatching_Operation);
pragma Inline (Is_Elaboration_Checks_OK_Id);
pragma Inline (Is_Elaboration_Warnings_OK_Id);
pragma Inline (Is_Elementary_Type);
pragma Inline (Is_Eliminated);
pragma Inline (Is_Entry);
pragma Inline (Is_Entry_Formal);
pragma Inline (Is_Entry_Wrapper);
pragma Inline (Is_Enumeration_Type);
pragma Inline (Is_Exception_Handler);
pragma Inline (Is_Exported);
pragma Inline (Is_Finalized_Transient);
pragma Inline (Is_First_Subtype);
pragma Inline (Is_Fixed_Point_Type);
pragma Inline (Is_Floating_Point_Type);
pragma Inline (Is_Formal);
pragma Inline (Is_Formal_Object);
pragma Inline (Is_Formal_Subprogram);
pragma Inline (Is_Frozen);
pragma Inline (Is_Generic_Actual_Subprogram);
pragma Inline (Is_Generic_Actual_Type);
pragma Inline (Is_Generic_Instance);
pragma Inline (Is_Generic_Subprogram);
pragma Inline (Is_Generic_Type);
pragma Inline (Is_Generic_Unit);
pragma Inline (Is_Ghost_Entity);
pragma Inline (Is_Hidden);
pragma Inline (Is_Hidden_Non_Overridden_Subpgm);
pragma Inline (Is_Hidden_Open_Scope);
pragma Inline (Is_Ignored_Ghost_Entity);
pragma Inline (Is_Ignored_Transient);
pragma Inline (Is_Immediately_Visible);
pragma Inline (Is_Implementation_Defined);
pragma Inline (Is_Imported);
pragma Inline (Is_Incomplete_Or_Private_Type);
pragma Inline (Is_Incomplete_Type);
pragma Inline (Is_Independent);
pragma Inline (Is_Initial_Condition_Procedure);
pragma Inline (Is_Inlined);
pragma Inline (Is_Inlined_Always);
pragma Inline (Is_Instantiated);
pragma Inline (Is_Integer_Type);
pragma Inline (Is_Interface);
pragma Inline (Is_Internal);
pragma Inline (Is_Interrupt_Handler);
pragma Inline (Is_Intrinsic_Subprogram);
pragma Inline (Is_Invariant_Procedure);
pragma Inline (Is_Itype);
pragma Inline (Is_Known_Non_Null);
pragma Inline (Is_Known_Null);
pragma Inline (Is_Known_Valid);
pragma Inline (Is_Limited_Composite);
pragma Inline (Is_Limited_Interface);
pragma Inline (Is_Limited_Record);
pragma Inline (Is_Local_Anonymous_Access);
pragma Inline (Is_Loop_Parameter);
pragma Inline (Is_Machine_Code_Subprogram);
pragma Inline (Is_Modular_Integer_Type);
pragma Inline (Is_Named_Number);
pragma Inline (Is_Non_Static_Subtype);
pragma Inline (Is_Null_Init_Proc);
pragma Inline (Is_Numeric_Type);
pragma Inline (Is_Object);
pragma Inline (Is_Obsolescent);
pragma Inline (Is_Only_Out_Parameter);
pragma Inline (Is_Ordinary_Fixed_Point_Type);
pragma Inline (Is_Overloadable);
pragma Inline (Is_Package_Body_Entity);
pragma Inline (Is_Packed);
pragma Inline (Is_Packed_Array_Impl_Type);
pragma Inline (Is_Param_Block_Component_Type);
pragma Inline (Is_Partial_Invariant_Procedure);
pragma Inline (Is_Potentially_Use_Visible);
pragma Inline (Is_Predicate_Function);
pragma Inline (Is_Predicate_Function_M);
pragma Inline (Is_Preelaborated);
pragma Inline (Is_Primitive);
pragma Inline (Is_Primitive_Wrapper);
pragma Inline (Is_Private_Composite);
pragma Inline (Is_Private_Descendant);
pragma Inline (Is_Private_Primitive);
pragma Inline (Is_Private_Type);
pragma Inline (Is_Protected_Type);
pragma Inline (Is_Public);
pragma Inline (Is_Pure);
pragma Inline (Is_Pure_Unit_Access_Type);
pragma Inline (Is_RACW_Stub_Type);
pragma Inline (Is_Raised);
pragma Inline (Is_Real_Type);
pragma Inline (Is_Record_Type);
pragma Inline (Is_Remote_Call_Interface);
pragma Inline (Is_Remote_Types);
pragma Inline (Is_Renaming_Of_Object);
pragma Inline (Is_Return_Object);
pragma Inline (Is_Safe_To_Reevaluate);
pragma Inline (Is_Scalar_Type);
pragma Inline (Is_Shared_Passive);
pragma Inline (Is_Signed_Integer_Type);
pragma Inline (Is_Static_Type);
pragma Inline (Is_Statically_Allocated);
pragma Inline (Is_Subprogram);
pragma Inline (Is_Subprogram_Or_Entry);
pragma Inline (Is_Subprogram_Or_Generic_Subprogram);
pragma Inline (Is_Tag);
pragma Inline (Is_Tagged_Type);
pragma Inline (Is_Task_Type);
pragma Inline (Is_Thunk);
pragma Inline (Is_Trivial_Subprogram);
pragma Inline (Is_True_Constant);
pragma Inline (Is_Type);
pragma Inline (Is_Unchecked_Union);
pragma Inline (Is_Underlying_Full_View);
pragma Inline (Is_Underlying_Record_View);
pragma Inline (Is_Unimplemented);
pragma Inline (Is_Unsigned_Type);
pragma Inline (Is_Uplevel_Referenced_Entity);
pragma Inline (Is_Valued_Procedure);
pragma Inline (Is_Visible_Formal);
pragma Inline (Is_Visible_Lib_Unit);
pragma Inline (Is_Volatile_Full_Access);
pragma Inline (Itype_Printed);
pragma Inline (Kill_Elaboration_Checks);
pragma Inline (Kill_Range_Checks);
pragma Inline (Known_To_Have_Preelab_Init);
pragma Inline (Last_Aggregate_Assignment);
pragma Inline (Last_Assignment);
pragma Inline (Last_Entity);
pragma Inline (Limited_View);
pragma Inline (Link_Entities);
pragma Inline (Linker_Section_Pragma);
pragma Inline (Lit_Indexes);
pragma Inline (Lit_Strings);
pragma Inline (Low_Bound_Tested);
pragma Inline (Machine_Radix_10);
pragma Inline (Master_Id);
pragma Inline (Materialize_Entity);
pragma Inline (May_Inherit_Delayed_Rep_Aspects);
pragma Inline (Mechanism);
pragma Inline (Minimum_Accessibility);
pragma Inline (Modulus);
pragma Inline (Must_Be_On_Byte_Boundary);
pragma Inline (Must_Have_Preelab_Init);
pragma Inline (Needs_Activation_Record);
pragma Inline (Needs_Debug_Info);
pragma Inline (Needs_No_Actuals);
pragma Inline (Never_Set_In_Source);
pragma Inline (Next_Index);
pragma Inline (Next_Inlined_Subprogram);
pragma Inline (Next_Literal);
pragma Inline (Next_Stored_Discriminant);
pragma Inline (No_Dynamic_Predicate_On_Actual);
pragma Inline (No_Pool_Assigned);
pragma Inline (No_Predicate_On_Actual);
pragma Inline (No_Reordering);
pragma Inline (No_Return);
pragma Inline (No_Strict_Aliasing);
pragma Inline (No_Tagged_Streams_Pragma);
pragma Inline (Non_Binary_Modulus);
pragma Inline (Non_Limited_View);
pragma Inline (Nonzero_Is_True);
pragma Inline (Normalized_First_Bit);
pragma Inline (Normalized_Position);
pragma Inline (Normalized_Position_Max);
pragma Inline (OK_To_Rename);
pragma Inline (Optimize_Alignment_Space);
pragma Inline (Optimize_Alignment_Time);
pragma Inline (Original_Access_Type);
pragma Inline (Original_Array_Type);
pragma Inline (Original_Protected_Subprogram);
pragma Inline (Original_Record_Component);
pragma Inline (Overlays_Constant);
pragma Inline (Overridden_Operation);
pragma Inline (Package_Instantiation);
pragma Inline (Packed_Array_Impl_Type);
pragma Inline (Parameter_Mode);
pragma Inline (Parent_Subtype);
pragma Inline (Part_Of_Constituents);
pragma Inline (Part_Of_References);
pragma Inline (Partial_View_Has_Unknown_Discr);
pragma Inline (Pending_Access_Types);
pragma Inline (Postconditions_Proc);
pragma Inline (Predicated_Parent);
pragma Inline (Predicates_Ignored);
pragma Inline (Prev_Entity);
pragma Inline (Prival);
pragma Inline (Prival_Link);
pragma Inline (Private_Dependents);
pragma Inline (Protected_Body_Subprogram);
pragma Inline (Protected_Formal);
pragma Inline (Protected_Subprogram);
pragma Inline (Protection_Object);
pragma Inline (Reachable);
pragma Inline (Receiving_Entry);
pragma Inline (Referenced);
pragma Inline (Referenced_As_LHS);
pragma Inline (Referenced_As_Out_Parameter);
pragma Inline (Refinement_Constituents);
pragma Inline (Register_Exception_Call);
pragma Inline (Related_Array_Object);
pragma Inline (Related_Expression);
pragma Inline (Related_Instance);
pragma Inline (Related_Type);
pragma Inline (Relative_Deadline_Variable);
pragma Inline (Remove_Entity);
pragma Inline (Renamed_Entity);
pragma Inline (Renamed_In_Spec);
pragma Inline (Renamed_Object);
pragma Inline (Renaming_Map);
pragma Inline (Requires_Overriding);
pragma Inline (Return_Applies_To);
pragma Inline (Return_Present);
pragma Inline (Returns_By_Ref);
pragma Inline (Reverse_Bit_Order);
pragma Inline (Reverse_Storage_Order);
pragma Inline (Rewritten_For_C);
pragma Inline (RM_Size);
pragma Inline (Scalar_Range);
pragma Inline (Scale_Value);
pragma Inline (Scope_Depth_Value);
pragma Inline (Sec_Stack_Needed_For_Return);
pragma Inline (Shared_Var_Procs_Instance);
pragma Inline (Size_Check_Code);
pragma Inline (Size_Depends_On_Discriminant);
pragma Inline (Size_Known_At_Compile_Time);
pragma Inline (Small_Value);
pragma Inline (SPARK_Aux_Pragma);
pragma Inline (SPARK_Aux_Pragma_Inherited);
pragma Inline (SPARK_Pragma);
pragma Inline (SPARK_Pragma_Inherited);
pragma Inline (Spec_Entity);
pragma Inline (SSO_Set_High_By_Default);
pragma Inline (SSO_Set_Low_By_Default);
pragma Inline (Static_Discrete_Predicate);
pragma Inline (Static_Elaboration_Desired);
pragma Inline (Static_Initialization);
pragma Inline (Static_Real_Or_String_Predicate);
pragma Inline (Status_Flag_Or_Transient_Decl);
pragma Inline (Storage_Size_Variable);
pragma Inline (Stored_Constraint);
pragma Inline (Stores_Attribute_Old_Prefix);
pragma Inline (Strict_Alignment);
pragma Inline (String_Literal_Length);
pragma Inline (String_Literal_Low_Bound);
pragma Inline (Subprograms_For_Type);
pragma Inline (Subps_Index);
pragma Inline (Suppress_Elaboration_Warnings);
pragma Inline (Suppress_Initialization);
pragma Inline (Suppress_Style_Checks);
pragma Inline (Suppress_Value_Tracking_On_Call);
pragma Inline (Task_Body_Procedure);
pragma Inline (Thunk_Entity);
pragma Inline (Treat_As_Volatile);
pragma Inline (Underlying_Full_View);
pragma Inline (Underlying_Record_View);
pragma Inline (Universal_Aliasing);
pragma Inline (Unlink_Next_Entity);
pragma Inline (Unset_Reference);
pragma Inline (Used_As_Generic_Actual);
pragma Inline (Uses_Lock_Free);
pragma Inline (Uses_Sec_Stack);
pragma Inline (Validated_Object);
pragma Inline (Warnings_Off);
pragma Inline (Warnings_Off_Used);
pragma Inline (Warnings_Off_Used_Unmodified);
pragma Inline (Warnings_Off_Used_Unreferenced);
pragma Inline (Was_Hidden);
pragma Inline (Wrapped_Entity);
-- END XEINFO INLINES
-- The following Inline pragmas are *not* read by XEINFO when building the
-- C version of this interface automatically (so the C version will end up
-- making out of line calls). The pragma scan in XEINFO will be terminated
-- on encountering the END XEINFO INLINES line. We inline things here which
-- are small, but not of the canonical attribute access/set format that can
-- be handled by XEINFO.
pragma Inline (Address_Clause);
pragma Inline (Alignment_Clause);
pragma Inline (Base_Type);
pragma Inline (Float_Rep);
pragma Inline (Has_Foreign_Convention);
pragma Inline (Has_Non_Limited_View);
pragma Inline (Is_Base_Type);
pragma Inline (Is_Boolean_Type);
pragma Inline (Is_Constant_Object);
pragma Inline (Is_Controlled);
pragma Inline (Is_Discriminal);
pragma Inline (Is_Entity_Name);
pragma Inline (Is_Finalizer);
pragma Inline (Is_Null_State);
pragma Inline (Is_Package_Or_Generic_Package);
pragma Inline (Is_Packed_Array);
pragma Inline (Is_Prival);
pragma Inline (Is_Protected_Component);
pragma Inline (Is_Protected_Record_Type);
pragma Inline (Is_String_Type);
pragma Inline (Is_Task_Record_Type);
pragma Inline (Is_Volatile);
pragma Inline (Is_Wrapper_Package);
pragma Inline (Scope_Depth);
pragma Inline (Scope_Depth_Set);
pragma Inline (Size_Clause);
pragma Inline (Stream_Size_Clause);
pragma Inline (Type_High_Bound);
pragma Inline (Type_Low_Bound);
pragma Inline (Known_Alignment);
pragma Inline (Known_Component_Bit_Offset);
pragma Inline (Known_Component_Size);
pragma Inline (Known_Esize);
pragma Inline (Known_Normalized_First_Bit);
pragma Inline (Known_Normalized_Position);
pragma Inline (Known_Normalized_Position_Max);
pragma Inline (Known_RM_Size);
pragma Inline (Known_Static_Component_Bit_Offset);
pragma Inline (Known_Static_Component_Size);
pragma Inline (Known_Static_Esize);
pragma Inline (Known_Static_Normalized_First_Bit);
pragma Inline (Known_Static_Normalized_Position);
pragma Inline (Known_Static_Normalized_Position_Max);
pragma Inline (Known_Static_RM_Size);
pragma Inline (Unknown_Alignment);
pragma Inline (Unknown_Component_Bit_Offset);
pragma Inline (Unknown_Component_Size);
pragma Inline (Unknown_Esize);
pragma Inline (Unknown_Normalized_First_Bit);
pragma Inline (Unknown_Normalized_Position);
pragma Inline (Unknown_Normalized_Position_Max);
pragma Inline (Unknown_RM_Size);
-----------------------------------
-- Inline Pragmas for procedures --
-----------------------------------
-- The following inline pragmas are *not* referenced by the XEINFO utility
-- program in preparing the corresponding C header, and therefore do *not*
-- need to meet the requirements documented in the section on XEINFO.
pragma Inline (Set_Abstract_States);
pragma Inline (Set_Accept_Address);
pragma Inline (Set_Access_Disp_Table);
pragma Inline (Set_Access_Disp_Table_Elab_Flag);
pragma Inline (Set_Access_Subprogram_Wrapper);
pragma Inline (Set_Activation_Record_Component);
pragma Inline (Set_Actual_Subtype);
pragma Inline (Set_Address_Taken);
pragma Inline (Set_Alias);
pragma Inline (Set_Alignment);
pragma Inline (Set_Anonymous_Designated_Type);
pragma Inline (Set_Anonymous_Masters);
pragma Inline (Set_Anonymous_Object);
pragma Inline (Set_Associated_Entity);
pragma Inline (Set_Associated_Formal_Package);
pragma Inline (Set_Associated_Node_For_Itype);
pragma Inline (Set_Associated_Storage_Pool);
pragma Inline (Set_Barrier_Function);
pragma Inline (Set_BIP_Initialization_Call);
pragma Inline (Set_Block_Node);
pragma Inline (Set_Body_Entity);
pragma Inline (Set_Body_Needed_For_Inlining);
pragma Inline (Set_Body_Needed_For_SAL);
pragma Inline (Set_Body_References);
pragma Inline (Set_C_Pass_By_Copy);
pragma Inline (Set_Can_Never_Be_Null);
pragma Inline (Set_Can_Use_Internal_Rep);
pragma Inline (Set_Checks_May_Be_Suppressed);
pragma Inline (Set_Class_Wide_Clone);
pragma Inline (Set_Class_Wide_Type);
pragma Inline (Set_Cloned_Subtype);
pragma Inline (Set_Component_Bit_Offset);
pragma Inline (Set_Component_Clause);
pragma Inline (Set_Component_Size);
pragma Inline (Set_Component_Type);
pragma Inline (Set_Contains_Ignored_Ghost_Code);
pragma Inline (Set_Contract);
pragma Inline (Set_Contract_Wrapper);
pragma Inline (Set_Corresponding_Concurrent_Type);
pragma Inline (Set_Corresponding_Discriminant);
pragma Inline (Set_Corresponding_Equality);
pragma Inline (Set_Corresponding_Function);
pragma Inline (Set_Corresponding_Procedure);
pragma Inline (Set_Corresponding_Protected_Entry);
pragma Inline (Set_Corresponding_Record_Component);
pragma Inline (Set_Corresponding_Record_Type);
pragma Inline (Set_Corresponding_Remote_Type);
pragma Inline (Set_CR_Discriminant);
pragma Inline (Set_Current_Use_Clause);
pragma Inline (Set_Current_Value);
pragma Inline (Set_Debug_Info_Off);
pragma Inline (Set_Debug_Renaming_Link);
pragma Inline (Set_Default_Aspect_Component_Value);
pragma Inline (Set_Default_Aspect_Value);
pragma Inline (Set_Default_Expr_Function);
pragma Inline (Set_Default_Expressions_Processed);
pragma Inline (Set_Default_Value);
pragma Inline (Set_Delay_Cleanups);
pragma Inline (Set_Delay_Subprogram_Descriptors);
pragma Inline (Set_Delta_Value);
pragma Inline (Set_Dependent_Instances);
pragma Inline (Set_Depends_On_Private);
pragma Inline (Set_Derived_Type_Link);
pragma Inline (Set_Digits_Value);
pragma Inline (Set_Direct_Primitive_Operations);
pragma Inline (Set_Directly_Designated_Type);
pragma Inline (Set_Disable_Controlled);
pragma Inline (Set_Discard_Names);
pragma Inline (Set_Discriminal);
pragma Inline (Set_Discriminal_Link);
pragma Inline (Set_Discriminant_Checking_Func);
pragma Inline (Set_Discriminant_Constraint);
pragma Inline (Set_Discriminant_Default_Value);
pragma Inline (Set_Discriminant_Number);
pragma Inline (Set_Dispatch_Table_Wrappers);
pragma Inline (Set_DT_Entry_Count);
pragma Inline (Set_DT_Offset_To_Top_Func);
pragma Inline (Set_DT_Position);
pragma Inline (Set_DTC_Entity);
pragma Inline (Set_Elaborate_Body_Desirable);
pragma Inline (Set_Elaboration_Entity);
pragma Inline (Set_Elaboration_Entity_Required);
pragma Inline (Set_Encapsulating_State);
pragma Inline (Set_Enclosing_Scope);
pragma Inline (Set_Entry_Accepted);
pragma Inline (Set_Entry_Bodies_Array);
pragma Inline (Set_Entry_Cancel_Parameter);
pragma Inline (Set_Entry_Component);
pragma Inline (Set_Entry_Formal);
pragma Inline (Set_Entry_Max_Queue_Lengths_Array);
pragma Inline (Set_Entry_Parameters_Type);
pragma Inline (Set_Enum_Pos_To_Rep);
pragma Inline (Set_Enumeration_Pos);
pragma Inline (Set_Enumeration_Rep);
pragma Inline (Set_Enumeration_Rep_Expr);
pragma Inline (Set_Equivalent_Type);
pragma Inline (Set_Esize);
pragma Inline (Set_Extra_Accessibility);
pragma Inline (Set_Extra_Accessibility_Of_Result);
pragma Inline (Set_Extra_Constrained);
pragma Inline (Set_Extra_Formal);
pragma Inline (Set_Extra_Formals);
pragma Inline (Set_Finalize_Storage_Only);
pragma Inline (Set_Finalization_Master);
pragma Inline (Set_Finalizer);
pragma Inline (Set_First_Entity);
pragma Inline (Set_First_Exit_Statement);
pragma Inline (Set_First_Index);
pragma Inline (Set_First_Literal);
pragma Inline (Set_First_Private_Entity);
pragma Inline (Set_First_Rep_Item);
pragma Inline (Set_Float_Rep);
pragma Inline (Set_Freeze_Node);
pragma Inline (Set_From_Limited_With);
pragma Inline (Set_Full_View);
pragma Inline (Set_Generic_Homonym);
pragma Inline (Set_Generic_Renamings);
pragma Inline (Set_Handler_Records);
pragma Inline (Set_Has_Aliased_Components);
pragma Inline (Set_Has_Alignment_Clause);
pragma Inline (Set_Has_All_Calls_Remote);
pragma Inline (Set_Has_Atomic_Components);
pragma Inline (Set_Has_Biased_Representation);
pragma Inline (Set_Has_Completion);
pragma Inline (Set_Has_Completion_In_Body);
pragma Inline (Set_Has_Complex_Representation);
pragma Inline (Set_Has_Component_Size_Clause);
pragma Inline (Set_Has_Constrained_Partial_View);
pragma Inline (Set_Has_Contiguous_Rep);
pragma Inline (Set_Has_Controlled_Component);
pragma Inline (Set_Has_Controlling_Result);
pragma Inline (Set_Has_Convention_Pragma);
pragma Inline (Set_Has_Default_Aspect);
pragma Inline (Set_Has_Delayed_Aspects);
pragma Inline (Set_Has_Delayed_Freeze);
pragma Inline (Set_Has_Delayed_Rep_Aspects);
pragma Inline (Set_Has_Discriminants);
pragma Inline (Set_Has_Dispatch_Table);
pragma Inline (Set_Has_Dynamic_Predicate_Aspect);
pragma Inline (Set_Has_Enumeration_Rep_Clause);
pragma Inline (Set_Has_Exit);
pragma Inline (Set_Has_Expanded_Contract);
pragma Inline (Set_Has_Forward_Instantiation);
pragma Inline (Set_Has_Fully_Qualified_Name);
pragma Inline (Set_Has_Gigi_Rep_Item);
pragma Inline (Set_Has_Homonym);
pragma Inline (Set_Has_Implicit_Dereference);
pragma Inline (Set_Has_Independent_Components);
pragma Inline (Set_Has_Inheritable_Invariants);
pragma Inline (Set_Has_Inherited_DIC);
pragma Inline (Set_Has_Inherited_Invariants);
pragma Inline (Set_Has_Initial_Value);
pragma Inline (Set_Has_Loop_Entry_Attributes);
pragma Inline (Set_Has_Machine_Radix_Clause);
pragma Inline (Set_Has_Master_Entity);
pragma Inline (Set_Has_Missing_Return);
pragma Inline (Set_Has_Nested_Block_With_Handler);
pragma Inline (Set_Has_Nested_Subprogram);
pragma Inline (Set_Has_Non_Standard_Rep);
pragma Inline (Set_Has_Object_Size_Clause);
pragma Inline (Set_Has_Out_Or_In_Out_Parameter);
pragma Inline (Set_Has_Own_DIC);
pragma Inline (Set_Has_Own_Invariants);
pragma Inline (Set_Has_Partial_Visible_Refinement);
pragma Inline (Set_Has_Per_Object_Constraint);
pragma Inline (Set_Has_Pragma_Controlled);
pragma Inline (Set_Has_Pragma_Elaborate_Body);
pragma Inline (Set_Has_Pragma_Inline);
pragma Inline (Set_Has_Pragma_Inline_Always);
pragma Inline (Set_Has_Pragma_No_Inline);
pragma Inline (Set_Has_Pragma_Ordered);
pragma Inline (Set_Has_Pragma_Pack);
pragma Inline (Set_Has_Pragma_Preelab_Init);
pragma Inline (Set_Has_Pragma_Pure);
pragma Inline (Set_Has_Pragma_Pure_Function);
pragma Inline (Set_Has_Pragma_Thread_Local_Storage);
pragma Inline (Set_Has_Pragma_Unmodified);
pragma Inline (Set_Has_Pragma_Unreferenced);
pragma Inline (Set_Has_Pragma_Unreferenced_Objects);
pragma Inline (Set_Has_Predicates);
pragma Inline (Set_Has_Primitive_Operations);
pragma Inline (Set_Has_Private_Ancestor);
pragma Inline (Set_Has_Private_Declaration);
pragma Inline (Set_Has_Private_Extension);
pragma Inline (Set_Has_Protected);
pragma Inline (Set_Has_Qualified_Name);
pragma Inline (Set_Has_RACW);
pragma Inline (Set_Has_Record_Rep_Clause);
pragma Inline (Set_Has_Recursive_Call);
pragma Inline (Set_Has_Shift_Operator);
pragma Inline (Set_Has_Size_Clause);
pragma Inline (Set_Has_Small_Clause);
pragma Inline (Set_Has_Specified_Layout);
pragma Inline (Set_Has_Specified_Stream_Input);
pragma Inline (Set_Has_Specified_Stream_Output);
pragma Inline (Set_Has_Specified_Stream_Read);
pragma Inline (Set_Has_Specified_Stream_Write);
pragma Inline (Set_Has_Static_Discriminants);
pragma Inline (Set_Has_Static_Predicate);
pragma Inline (Set_Has_Static_Predicate_Aspect);
pragma Inline (Set_Has_Storage_Size_Clause);
pragma Inline (Set_Has_Stream_Size_Clause);
pragma Inline (Set_Has_Task);
pragma Inline (Set_Has_Timing_Event);
pragma Inline (Set_Has_Thunks);
pragma Inline (Set_Has_Unchecked_Union);
pragma Inline (Set_Has_Unknown_Discriminants);
pragma Inline (Set_Has_Visible_Refinement);
pragma Inline (Set_Has_Volatile_Components);
pragma Inline (Set_Has_Xref_Entry);
pragma Inline (Set_Has_Yield_Aspect);
pragma Inline (Set_Hiding_Loop_Variable);
pragma Inline (Set_Hidden_In_Formal_Instance);
pragma Inline (Set_Homonym);
pragma Inline (Set_Ignore_SPARK_Mode_Pragmas);
pragma Inline (Set_Import_Pragma);
pragma Inline (Set_Incomplete_Actuals);
pragma Inline (Set_In_Package_Body);
pragma Inline (Set_In_Private_Part);
pragma Inline (Set_In_Use);
pragma Inline (Set_Initialization_Statements);
pragma Inline (Set_Inner_Instances);
pragma Inline (Set_Interface_Alias);
pragma Inline (Set_Interface_Name);
pragma Inline (Set_Interfaces);
pragma Inline (Set_Is_Abstract_Subprogram);
pragma Inline (Set_Is_Abstract_Type);
pragma Inline (Set_Is_Access_Constant);
pragma Inline (Set_Is_Activation_Record);
pragma Inline (Set_Is_Actual_Subtype);
pragma Inline (Set_Is_Ada_2005_Only);
pragma Inline (Set_Is_Ada_2012_Only);
pragma Inline (Set_Is_Aliased);
pragma Inline (Set_Is_Asynchronous);
pragma Inline (Set_Is_Atomic);
pragma Inline (Set_Is_Bit_Packed_Array);
pragma Inline (Set_Is_Called);
pragma Inline (Set_Is_Character_Type);
pragma Inline (Set_Is_Checked_Ghost_Entity);
pragma Inline (Set_Is_Child_Unit);
pragma Inline (Set_Is_Class_Wide_Clone);
pragma Inline (Set_Is_Class_Wide_Equivalent_Type);
pragma Inline (Set_Is_Compilation_Unit);
pragma Inline (Set_Is_Completely_Hidden);
pragma Inline (Set_Is_Concurrent_Record_Type);
pragma Inline (Set_Is_Constr_Subt_For_U_Nominal);
pragma Inline (Set_Is_Constr_Subt_For_UN_Aliased);
pragma Inline (Set_Is_Constrained);
pragma Inline (Set_Is_Constructor);
pragma Inline (Set_Is_Controlled_Active);
pragma Inline (Set_Is_Controlling_Formal);
pragma Inline (Set_Is_CPP_Class);
pragma Inline (Set_Is_CUDA_Kernel);
pragma Inline (Set_Is_Descendant_Of_Address);
pragma Inline (Set_Is_DIC_Procedure);
pragma Inline (Set_Is_Discrim_SO_Function);
pragma Inline (Set_Is_Discriminant_Check_Function);
pragma Inline (Set_Is_Dispatch_Table_Entity);
pragma Inline (Set_Is_Dispatching_Operation);
pragma Inline (Set_Is_Elaboration_Checks_OK_Id);
pragma Inline (Set_Is_Elaboration_Warnings_OK_Id);
pragma Inline (Set_Is_Eliminated);
pragma Inline (Set_Is_Entry_Formal);
pragma Inline (Set_Is_Entry_Wrapper);
pragma Inline (Set_Is_Exception_Handler);
pragma Inline (Set_Is_Exported);
pragma Inline (Set_Is_Finalized_Transient);
pragma Inline (Set_Is_First_Subtype);
pragma Inline (Set_Is_Formal_Subprogram);
pragma Inline (Set_Is_Frozen);
pragma Inline (Set_Is_Generic_Actual_Subprogram);
pragma Inline (Set_Is_Generic_Actual_Type);
pragma Inline (Set_Is_Generic_Instance);
pragma Inline (Set_Is_Generic_Type);
pragma Inline (Set_Is_Hidden);
pragma Inline (Set_Is_Hidden_Non_Overridden_Subpgm);
pragma Inline (Set_Is_Hidden_Open_Scope);
pragma Inline (Set_Is_Ignored_Ghost_Entity);
pragma Inline (Set_Is_Ignored_Transient);
pragma Inline (Set_Is_Immediately_Visible);
pragma Inline (Set_Is_Implementation_Defined);
pragma Inline (Set_Is_Imported);
pragma Inline (Set_Is_Independent);
pragma Inline (Set_Is_Initial_Condition_Procedure);
pragma Inline (Set_Is_Inlined);
pragma Inline (Set_Is_Inlined_Always);
pragma Inline (Set_Is_Instantiated);
pragma Inline (Set_Is_Interface);
pragma Inline (Set_Is_Internal);
pragma Inline (Set_Is_Interrupt_Handler);
pragma Inline (Set_Is_Intrinsic_Subprogram);
pragma Inline (Set_Is_Invariant_Procedure);
pragma Inline (Set_Is_Itype);
pragma Inline (Set_Is_Known_Non_Null);
pragma Inline (Set_Is_Known_Null);
pragma Inline (Set_Is_Known_Valid);
pragma Inline (Set_Is_Limited_Composite);
pragma Inline (Set_Is_Limited_Interface);
pragma Inline (Set_Is_Limited_Record);
pragma Inline (Set_Is_Local_Anonymous_Access);
pragma Inline (Set_Is_Loop_Parameter);
pragma Inline (Set_Is_Machine_Code_Subprogram);
pragma Inline (Set_Is_Non_Static_Subtype);
pragma Inline (Set_Is_Null_Init_Proc);
pragma Inline (Set_Is_Obsolescent);
pragma Inline (Set_Is_Only_Out_Parameter);
pragma Inline (Set_Is_Package_Body_Entity);
pragma Inline (Set_Is_Packed);
pragma Inline (Set_Is_Packed_Array_Impl_Type);
pragma Inline (Set_Is_Param_Block_Component_Type);
pragma Inline (Set_Is_Partial_Invariant_Procedure);
pragma Inline (Set_Is_Potentially_Use_Visible);
pragma Inline (Set_Is_Predicate_Function);
pragma Inline (Set_Is_Predicate_Function_M);
pragma Inline (Set_Is_Preelaborated);
pragma Inline (Set_Is_Primitive);
pragma Inline (Set_Is_Primitive_Wrapper);
pragma Inline (Set_Is_Private_Composite);
pragma Inline (Set_Is_Private_Descendant);
pragma Inline (Set_Is_Private_Primitive);
pragma Inline (Set_Is_Public);
pragma Inline (Set_Is_Pure);
pragma Inline (Set_Is_Pure_Unit_Access_Type);
pragma Inline (Set_Is_RACW_Stub_Type);
pragma Inline (Set_Is_Raised);
pragma Inline (Set_Is_Remote_Call_Interface);
pragma Inline (Set_Is_Remote_Types);
pragma Inline (Set_Is_Renaming_Of_Object);
pragma Inline (Set_Is_Return_Object);
pragma Inline (Set_Is_Safe_To_Reevaluate);
pragma Inline (Set_Is_Shared_Passive);
pragma Inline (Set_Is_Static_Type);
pragma Inline (Set_Is_Statically_Allocated);
pragma Inline (Set_Is_Tag);
pragma Inline (Set_Is_Tagged_Type);
pragma Inline (Set_Is_Thunk);
pragma Inline (Set_Is_Trivial_Subprogram);
pragma Inline (Set_Is_True_Constant);
pragma Inline (Set_Is_Unchecked_Union);
pragma Inline (Set_Is_Underlying_Full_View);
pragma Inline (Set_Is_Underlying_Record_View);
pragma Inline (Set_Is_Unimplemented);
pragma Inline (Set_Is_Unsigned_Type);
pragma Inline (Set_Is_Uplevel_Referenced_Entity);
pragma Inline (Set_Is_Valued_Procedure);
pragma Inline (Set_Is_Visible_Formal);
pragma Inline (Set_Is_Visible_Lib_Unit);
pragma Inline (Set_Is_Volatile);
pragma Inline (Set_Is_Volatile_Full_Access);
pragma Inline (Set_Itype_Printed);
pragma Inline (Set_Kill_Elaboration_Checks);
pragma Inline (Set_Kill_Range_Checks);
pragma Inline (Set_Known_To_Have_Preelab_Init);
pragma Inline (Set_Last_Aggregate_Assignment);
pragma Inline (Set_Last_Assignment);
pragma Inline (Set_Last_Entity);
pragma Inline (Set_Limited_View);
pragma Inline (Set_Linker_Section_Pragma);
pragma Inline (Set_Lit_Indexes);
pragma Inline (Set_Lit_Strings);
pragma Inline (Set_Low_Bound_Tested);
pragma Inline (Set_Machine_Radix_10);
pragma Inline (Set_Master_Id);
pragma Inline (Set_Materialize_Entity);
pragma Inline (Set_May_Inherit_Delayed_Rep_Aspects);
pragma Inline (Set_Mechanism);
pragma Inline (Set_Minimum_Accessibility);
pragma Inline (Set_Modulus);
pragma Inline (Set_Must_Be_On_Byte_Boundary);
pragma Inline (Set_Must_Have_Preelab_Init);
pragma Inline (Set_Needs_Activation_Record);
pragma Inline (Set_Needs_Debug_Info);
pragma Inline (Set_Needs_No_Actuals);
pragma Inline (Set_Never_Set_In_Source);
pragma Inline (Set_Next_Inlined_Subprogram);
pragma Inline (Set_No_Dynamic_Predicate_On_Actual);
pragma Inline (Set_No_Pool_Assigned);
pragma Inline (Set_No_Predicate_On_Actual);
pragma Inline (Set_No_Reordering);
pragma Inline (Set_No_Return);
pragma Inline (Set_No_Strict_Aliasing);
pragma Inline (Set_No_Tagged_Streams_Pragma);
pragma Inline (Set_Non_Binary_Modulus);
pragma Inline (Set_Non_Limited_View);
pragma Inline (Set_Nonzero_Is_True);
pragma Inline (Set_Normalized_First_Bit);
pragma Inline (Set_Normalized_Position);
pragma Inline (Set_Normalized_Position_Max);
pragma Inline (Set_OK_To_Rename);
pragma Inline (Set_Optimize_Alignment_Space);
pragma Inline (Set_Optimize_Alignment_Time);
pragma Inline (Set_Original_Access_Type);
pragma Inline (Set_Original_Array_Type);
pragma Inline (Set_Original_Protected_Subprogram);
pragma Inline (Set_Original_Record_Component);
pragma Inline (Set_Overlays_Constant);
pragma Inline (Set_Overridden_Operation);
pragma Inline (Set_Package_Instantiation);
pragma Inline (Set_Packed_Array_Impl_Type);
pragma Inline (Set_Parent_Subtype);
pragma Inline (Set_Part_Of_Constituents);
pragma Inline (Set_Part_Of_References);
pragma Inline (Set_Partial_View_Has_Unknown_Discr);
pragma Inline (Set_Pending_Access_Types);
pragma Inline (Set_Postconditions_Proc);
pragma Inline (Set_Predicated_Parent);
pragma Inline (Set_Predicates_Ignored);
pragma Inline (Set_Prev_Entity);
pragma Inline (Set_Prival);
pragma Inline (Set_Prival_Link);
pragma Inline (Set_Private_Dependents);
pragma Inline (Set_Protected_Body_Subprogram);
pragma Inline (Set_Protected_Formal);
pragma Inline (Set_Protected_Subprogram);
pragma Inline (Set_Protection_Object);
pragma Inline (Set_Reachable);
pragma Inline (Set_Receiving_Entry);
pragma Inline (Set_Referenced);
pragma Inline (Set_Referenced_As_LHS);
pragma Inline (Set_Referenced_As_Out_Parameter);
pragma Inline (Set_Refinement_Constituents);
pragma Inline (Set_Register_Exception_Call);
pragma Inline (Set_Related_Array_Object);
pragma Inline (Set_Related_Expression);
pragma Inline (Set_Related_Instance);
pragma Inline (Set_Related_Type);
pragma Inline (Set_Relative_Deadline_Variable);
pragma Inline (Set_Renamed_Entity);
pragma Inline (Set_Renamed_In_Spec);
pragma Inline (Set_Renamed_Object);
pragma Inline (Set_Renaming_Map);
pragma Inline (Set_Requires_Overriding);
pragma Inline (Set_Return_Applies_To);
pragma Inline (Set_Return_Present);
pragma Inline (Set_Returns_By_Ref);
pragma Inline (Set_Reverse_Bit_Order);
pragma Inline (Set_Reverse_Storage_Order);
pragma Inline (Set_Rewritten_For_C);
pragma Inline (Set_RM_Size);
pragma Inline (Set_Scalar_Range);
pragma Inline (Set_Scale_Value);
pragma Inline (Set_Scope_Depth_Value);
pragma Inline (Set_Sec_Stack_Needed_For_Return);
pragma Inline (Set_Shared_Var_Procs_Instance);
pragma Inline (Set_Size_Check_Code);
pragma Inline (Set_Size_Depends_On_Discriminant);
pragma Inline (Set_Size_Known_At_Compile_Time);
pragma Inline (Set_Small_Value);
pragma Inline (Set_SPARK_Aux_Pragma);
pragma Inline (Set_SPARK_Aux_Pragma_Inherited);
pragma Inline (Set_SPARK_Pragma);
pragma Inline (Set_SPARK_Pragma_Inherited);
pragma Inline (Set_Spec_Entity);
pragma Inline (Set_SSO_Set_High_By_Default);
pragma Inline (Set_SSO_Set_Low_By_Default);
pragma Inline (Set_Static_Discrete_Predicate);
pragma Inline (Set_Static_Elaboration_Desired);
pragma Inline (Set_Static_Initialization);
pragma Inline (Set_Static_Real_Or_String_Predicate);
pragma Inline (Set_Status_Flag_Or_Transient_Decl);
pragma Inline (Set_Storage_Size_Variable);
pragma Inline (Set_Stored_Constraint);
pragma Inline (Set_Stores_Attribute_Old_Prefix);
pragma Inline (Set_Strict_Alignment);
pragma Inline (Set_String_Literal_Length);
pragma Inline (Set_String_Literal_Low_Bound);
pragma Inline (Set_Subprograms_For_Type);
pragma Inline (Set_Subps_Index);
pragma Inline (Set_Suppress_Elaboration_Warnings);
pragma Inline (Set_Suppress_Initialization);
pragma Inline (Set_Suppress_Style_Checks);
pragma Inline (Set_Suppress_Value_Tracking_On_Call);
pragma Inline (Set_Task_Body_Procedure);
pragma Inline (Set_Thunk_Entity);
pragma Inline (Set_Treat_As_Volatile);
pragma Inline (Set_Underlying_Full_View);
pragma Inline (Set_Underlying_Record_View);
pragma Inline (Set_Universal_Aliasing);
pragma Inline (Set_Unset_Reference);
pragma Inline (Set_Used_As_Generic_Actual);
pragma Inline (Set_Uses_Lock_Free);
pragma Inline (Set_Uses_Sec_Stack);
pragma Inline (Set_Validated_Object);
pragma Inline (Set_Warnings_Off);
pragma Inline (Set_Warnings_Off_Used);
pragma Inline (Set_Warnings_Off_Used_Unmodified);
pragma Inline (Set_Warnings_Off_Used_Unreferenced);
pragma Inline (Set_Was_Hidden);
pragma Inline (Set_Wrapped_Entity);
pragma Inline (Init_Alignment);
pragma Inline (Init_Component_Bit_Offset);
pragma Inline (Init_Component_Size);
pragma Inline (Init_Digits_Value);
pragma Inline (Init_Esize);
pragma Inline (Init_Normalized_First_Bit);
pragma Inline (Init_Normalized_Position);
pragma Inline (Init_Normalized_Position_Max);
pragma Inline (Init_RM_Size);
end Einfo;
|
-- C64104C.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 UNDER THE
-- APPROPRIATE CIRCUMSTANCES FOR ARRAY PARAMETERS, NAMELY
-- WHEN THE ACTUAL BOUNDS DON'T MATCH THE FORMAL BOUNDS
-- (BEFORE THE CALL FOR ALL MODES).
-- SUBTESTS ARE:
-- (A) IN MODE, ONE DIMENSION, STATIC AGGREGATE.
-- (B) IN MODE, TWO DIMENSIONS, DYNAMIC AGGREGATE.
-- (C) IN MODE, TWO DIMENSIONS, DYNAMIC VARIABLE.
-- (D) IN OUT MODE, THREE DIMENSIONS, STATIC VARIABLE.
-- (E) OUT MODE, ONE DIMENSION, DYNAMIC VARIABLE.
-- (F) IN OUT MODE, NULL STRING AGGREGATE.
-- (G) IN OUT MODE, TWO DIMENSIONS, NULL AGGREGATE (OK CASE).
-- IN OUT MODE, TWO DIMENSIONS, NULL AGGREGATE.
-- JRK 3/17/81
-- SPS 10/26/82
-- CPP 8/6/84
-- PWN 11/30/94 REMOVED TEST ILLEGAL IN ADA 9X.
WITH REPORT;
PROCEDURE C64104C IS
USE REPORT;
BEGIN
TEST ("C64104C", "CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN " &
"ACTUAL ARRAY BOUNDS DON'T MATCH FORMAL BOUNDS");
--------------------------------------------------
DECLARE -- (A)
SUBTYPE ST IS STRING (1..3);
PROCEDURE P (A : ST) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALL - (A)");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE - (A)");
END P;
BEGIN -- (A)
P ("AB");
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - (A)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - (A)");
END; -- (A)
--------------------------------------------------
DECLARE -- (B)
SUBTYPE S IS INTEGER RANGE 1..3;
TYPE T IS ARRAY (S,S) OF INTEGER;
PROCEDURE P (A : T) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALL - (B)");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE - (B)");
END P;
BEGIN -- (B)
P ((1..3 => (1..IDENT_INT(2) => 0)));
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - (B)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - (B)");
END; -- (B)
--------------------------------------------------
DECLARE -- (C)
SUBTYPE S IS INTEGER RANGE 1..5;
TYPE T IS ARRAY (S RANGE <>, S RANGE <>) OF INTEGER;
SUBTYPE ST IS T (1..3,1..3);
V : T (1..IDENT_INT(2), 1..3) :=
(1..IDENT_INT(2) => (1..3 => 0));
PROCEDURE P (A :ST) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALL - (C)");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE - (C)");
END P;
BEGIN -- (C)
P (V);
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - (C)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - (C)");
END; -- (C)
--------------------------------------------------
DECLARE -- (D)
SUBTYPE S IS INTEGER RANGE 1..5;
TYPE T IS ARRAY (S RANGE <>, S RANGE <>, S RANGE <>) OF
INTEGER;
SUBTYPE ST IS T (1..3, 1..3, 1..3);
V : T (1..3, 1..2, 1..3) :=
(1..3 => (1..2 => (1..3 => 0)));
PROCEDURE P (A : IN OUT ST) IS
BEGIN
FAILED ("EXCEPTION NOT RAISED ON CALLL - (D)");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE - (D)");
END P;
BEGIN -- (D)
P (V);
FAILED ("EXCEPTION NOT RAISED BEFORE CALL - (D)");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - (D)");
END; -- (D)
--------------------------------------------------
DECLARE -- (G)
SUBTYPE S IS INTEGER RANGE 1..5;
TYPE T IS ARRAY (S RANGE <>, S RANGE <>) OF CHARACTER;
SUBTYPE ST IS T (2..1, 2..1);
V : T (2..1, 2..1) := (2..1 => (2..1 => ' '));
PROCEDURE P (A : IN OUT ST) IS
BEGIN
COMMENT ("OK CASE CALLED CORRECTLY");
EXCEPTION
WHEN OTHERS =>
FAILED ("EXCEPTION RAISED IN PROCEDURE - (G)");
END P;
BEGIN -- (G)
P (V);
EXCEPTION
WHEN CONSTRAINT_ERROR =>
FAILED ("CONSTRAINT_ERROR RAISED ON OK CASE - (G)");
WHEN OTHERS =>
FAILED ("OTHER EXCEPTION RAISED ON OK CASE - (G)");
END; -- (G)
--------------------------------------------------
--------------------------------------------------
RESULT;
END C64104C;
|
--------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (gh+si_units@heisenbug.eu)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with Ada.Text_IO;
--------------------------------------------------------------------------------
-- Image subprograms for binary (i.e. information technology related) values.
--------------------------------------------------------------------------------
package SI_Units.Binary is
type Prefixes is (None, kibi, mebi, gibi, tebi, pebi, exbi, zebi, yobi);
-- Prefixes supported in instantiated Image subprograms.
Magnitude : constant := 1024.0;
-- Magnitude change when trying to find the best representation for a given
-- value.
-- As this is intended for binary values (i.e. kibiBytes etc.), we neither
-- support negative nor non-integral values.
--
-- TODO: We could support non-modular integral types, though.
generic
type Item is mod <>;
Default_Aft : in Ada.Text_IO.Field;
Unit : in Unit_Name;
function Image
(Value : in Item;
Aft : in Ada.Text_IO.Field := Default_Aft) return String with
Global => null;
-- Image function for modular types.
--
-- Parameters:
--
-- Item - the type you want an Image function instantiated for.
-- Default_Aft - the default number of digits after the decimal point
-- (regardless of the prefix finally used).
-- Unit - The name of your unit, e.g. "Bytes", "Bit/s" or such.
end SI_Units.Binary;
|
package body Crawler.Entities is
function Make(Symbol : Standard.Character;
Row : Curses.Line_Position;
Col : Curses.Column_Position) return Character
is
begin
return (Symbol => Symbol, Row => Row, Col => Col);
end Make;
procedure Set_Position(This : out Character;
Row : Curses.Line_Position;
Col : Curses.Column_Position)
is
begin
This.Row := Row;
This.Col := Col;
end Set_Position;
function Get_Row (This : in Character) return Curses.Line_Position
is
begin
return This.Row;
end Get_Row;
function Get_Col (This : in Character) return Curses.Column_Position
is
begin
return This.Col;
end Get_Col;
function Get_Symbol (This : in Character) return Standard.Character
is
begin
return This.Symbol;
end Get_Symbol;
end Crawler.Entities;
|
with Lv.Style;
with Lv.Area;
with Lv.Objx.Page;
with Lv.Objx.Btn;
with Lv.Objx.Cont;
with System;
package Lv.Objx.Win is
subtype Instance is Obj_T;
type Style_T is (Style_Bg,
Style_Content_Bg,
Style_Content_Scrl,
Style_Sb,
Style_Header,
Style_Btn_Rel,
Style_Btn_Pr);
-- Create a window objects
-- @param par pointer to an object, it will be the parent of the new window
-- @param copy pointer to a window object, if not NULL then the new object will be copied from it
-- @return pointer to the created window
function Create (Parent : Obj_T; Copy : Instance) return Instance;
-- Delete all children of the scrl object, without deleting scrl child.
-- @param self pointer to an object
procedure Clean (Self : Instance);
-- Add control button to the header of the window
-- @param self pointer to a window object
-- @param img_src an image source ('lv_img_t' variable, path to file or a symbol)
-- @param rel_action a function pointer to call when the button is released
-- @return pointer to the created button object
function Add_Btn
(Self : Instance;
Img_Src : System.Address;
Rel_Action : Action_Func_T) return Btn.Instance;
-- A release action which can be assigned to a window control button to close it
-- @param btn pointer to the released button
-- @return always LV_ACTION_RES_INV because the button is deleted with the window
function Close_Action (Self : Instance) return Res_T;
----------------------
-- Setter functions --
----------------------
-- Set the title of a window
-- @param self pointer to a window object
-- @param title string of the new title
procedure Set_Title
(Self : Instance;
Title : C_String_Ptr);
-- Set the control button size of a window
-- @param self pointer to a window object
-- @return control button size
procedure Set_Btn_Size (Self : Instance; Size : Lv.Area.Coord_T);
-- Set the layout of the window
-- @param self pointer to a window object
-- @param layout the layout from 'lv_layout_t'
procedure Set_Layout (Self : Instance; Layout : Lv.Objx.Cont.Layout_T);
-- Set the scroll bar mode of a window
-- @param self pointer to a window object
-- @param sb_mode the new scroll bar mode from 'lv_sb_mode_t'
procedure Set_Sb_Mode (Self : Instance; Sb_Mode : Lv.Objx.Page.Mode_T);
-- Set a style of a window
-- @param self pointer to a window object
-- @param type which style should be set
-- @param style pointer to a style
procedure Set_Style
(Self : Instance;
Type_P : Style_T;
Style : access Lv.Style.Style);
----------------------
-- Getter functions --
----------------------
-- Get the title of a window
-- @param self pointer to a window object
-- @return title string of the window
function Title (Self : Instance) return C_String_Ptr;
-- Get the content holder object of window (`lv_page`) to allow additional customization
-- @param self pointer to a window object
-- @return the Page object where the window's content is
function Content (Self : Instance) return Page.Instance;
-- Get the control button size of a window
-- @param self pointer to a window object
-- @return control button size
function Btn_Size (Self : Instance) return Lv.Area.Coord_T;
-- Get the pointer of a widow from one of its control button.
-- It is useful in the action of the control buttons where only button is known.
-- @param ctrl_btn pointer to a control button of a window
-- @return pointer to the window of 'ctrl_btn'
function From_Btn (Ctrl_Btn : Btn.Instance) return Instance;
-- Get the layout of a window
-- @param self pointer to a window object
-- @return the layout of the window (from 'lv_layout_t')
function Layout (Self : Instance) return Lv.Objx.Cont.Layout_T;
-- Get the scroll bar mode of a window
-- @param self pointer to a window object
-- @return the scroll bar mode of the window (from 'lv_sb_mode_t')
function Sb_Mode (Self : Instance) return Lv.Objx.Page.Mode_T;
-- Get width of the content area (page scrollable) of the window
-- @param self pointer to a window object
-- @return the width of the content area
function Width (Self : Instance) return Lv.Area.Coord_T;
-- Get a style of a window
-- @param self pointer to a button object
-- @param type which style window be get
-- @return style pointer to a style
function Style
(Self : Instance;
Type_P : Style_T) return access Lv.Style.Style;
---------------------
-- Other functions --
---------------------
-- Focus on an object. It ensures that the object will be visible in the window.
-- @param self pointer to a window object
-- @param obj pointer to an object to focus (must be in the window)
-- @param anim_time scroll animation time in milliseconds (0: no animation)
procedure Focus (Self : Instance; Obj : Obj_T; Anim_Time : Uint16_T);
-- Scroll the window horizontally
-- @param self pointer to a window object
-- @param dist the distance to scroll (< 0: scroll right; > 0 scroll left)
procedure Scroll_Hor (Self : Instance; Dist : Lv.Area.Coord_T);
-- Scroll the window vertically
-- @param self pointer to a window object
-- @param dist the distance to scroll (< 0: scroll down; > 0 scroll up)
procedure Scroll_Ver (Self : Instance; Dist : Lv.Area.Coord_T);
-------------
-- Imports --
-------------
pragma Import (C, Create, "lv_win_create");
pragma Import (C, Clean, "lv_win_clean");
pragma Import (C, Add_Btn, "lv_win_add_btn");
pragma Import (C, Close_Action, "lv_win_close_action");
pragma Import (C, Set_Title, "lv_win_set_title");
pragma Import (C, Set_Btn_Size, "lv_win_set_btn_size");
pragma Import (C, Set_Layout, "lv_win_set_layout");
pragma Import (C, Set_Sb_Mode, "lv_win_set_sb_mode");
pragma Import (C, Set_Style, "lv_win_set_style");
pragma Import (C, Title, "lv_win_get_title");
pragma Import (C, Content, "lv_win_get_content");
pragma Import (C, Btn_Size, "lv_win_get_btn_size");
pragma Import (C, From_Btn, "lv_win_get_from_btn");
pragma Import (C, Layout, "lv_win_get_layout");
pragma Import (C, Sb_Mode, "lv_win_get_sb_mode");
pragma Import (C, Width, "lv_win_get_width");
pragma Import (C, Style, "lv_win_get_style");
pragma Import (C, Focus, "lv_win_focus");
pragma Import (C, Scroll_Hor, "lv_win_scroll_hor_inline");
pragma Import (C, Scroll_Ver, "lv_win_scroll_ver_inline");
for Style_T'Size use 8;
for Style_T use (Style_Bg => 0,
Style_Content_Bg => 1,
Style_Content_Scrl => 2,
Style_Sb => 3,
Style_Header => 4,
Style_Btn_Rel => 5,
Style_Btn_Pr => 6);
end Lv.Objx.Win;
|
-- { dg-do run }
procedure Sizetype4 is
type Float_Array is array (Integer range <>) of Float;
NoFloats : Float_Array (1 .. 0);
procedure Q (Results : Float_Array := NoFloats) is
type Reply_Msg is
record
Request_Id : Integer;
Status : Integer;
Data : Float_Array (Results'Range);
end record;
begin
if Reply_Msg'Size /= 64 then
raise Program_Error;
end if;
end;
begin
Q;
end;
|
package body DFA
with SPARK_Mode => On
is
function F1 (X : in Integer) return Integer
is
Tmp : Integer;
begin
-- The most basic form of DFA bug - Tmp is definitely not initialized. We
-- call this an Unconditional Data Flow Error
return X + Tmp;
end F1;
function F2 (X : in Integer) return Integer
is
Tmp : Integer;
begin
case X is
when Integer'First .. -1 =>
Tmp := -1;
when 0 =>
null;
when 1 .. Integer'Last =>
Tmp := 1;
end case;
-- Slightly more subtle - Tmp _might_ not be initialized, depending on
-- the initial value of X. We call this a Conditional Data Flow Error.
-- Note that the error message issued here is different from that issued
-- in F1 above.
return X + Tmp;
end F2;
end DFA;
|
package body Selection with SPARK_Mode is
procedure Sort (A: in out Arr) is
Tmp: Integer;
Min: Integer;
begin
for I in Integer range A'First .. A'Last loop
Min := I;
for J in Integer range I + 1 .. A'Last loop
pragma Loop_Invariant (for all K in I .. J - 1 => A (Min) <= A (K));
pragma Loop_Invariant (Min in I .. A'Last);
if A (J) < A(Min) then
Min := J;
end if;
end loop;
Tmp := A (I);
A (I) := A (Min);
A (Min) := Tmp;
pragma Loop_Invariant (for all K in A'First .. I => (for all M in K + 1 .. A'Last => A (K) <= A (M)));
end loop;
end Sort;
end Selection;
|
with
bullet_c.Binding,
c_math_c.Vector_2,
c_math_c.Vector_3,
c_math_c.Conversion,
c_math_c.Triangle,
ada.unchecked_Deallocation,
ada.Unchecked_Conversion,
interfaces.C;
package body bullet_Physics.Shape
is
use c_math_c.Conversion,
bullet_c.Binding,
Interfaces;
---------
-- Forge
--
overriding
procedure define (Self : in out Item)
is
begin
raise Error with "Bullet shape not supported.";
end define;
overriding
procedure destruct (Self : in out Item)
is
begin
null;
end destruct;
-------
--- Box
--
type Box_view is access Box;
function new_box_Shape (half_Extents : in Vector_3) return physics.Shape.view
is
Self : constant Box_view := new Box;
c_half_Extents : aliased c_math_c.Vector_3.item := +half_Extents;
begin
Self.C := b3d_new_Box (c_half_Extents'unchecked_Access);
return physics.Shape.view (Self);
end new_box_Shape;
-----------
--- Capsule
--
type Capsule_view is access Capsule;
function new_capsule_Shape (Radii : in Vector_2;
Height : in Real) return physics.Shape.view
is
Self : constant Capsule_view := new Capsule;
c_Radii : aliased c_math_c.Vector_2.item := +Radii;
begin
Self.C := b3d_new_Capsule (c_Radii'unchecked_Access, +Height);
return physics.Shape.view (Self);
end new_capsule_Shape;
--------
--- Cone
--
type Cone_view is access Cone;
function new_cone_Shape (Radius,
Height : in Real) return physics.Shape.view
is
Self : constant Cone_view := new Cone;
begin
Self.C := b3d_new_Cone (+Radius, +Height);
return physics.Shape.view (Self);
end new_cone_Shape;
---------------
--- convex_Hull
--
type convex_Hull_view is access convex_Hull;
function new_convex_hull_Shape (Points : in physics.Vector_3_array) return physics.Shape.view
is
Self : constant convex_Hull_view := new convex_Hull;
c_Points : array (1 .. Points'Length) of aliased c_math_c.Vector_3.item;
begin
for i in c_Points'Range
loop
c_Points (i) := +Points (i);
end loop;
Self.C := b3d_new_convex_Hull (c_Points (1)'unchecked_Access,
c_Points'Length);
return physics.Shape.view (Self);
end new_convex_hull_Shape;
--------
--- Mesh
--
type Mesh_view is access Mesh;
function new_mesh_Shape (Model : access math.Geometry.d3.a_Model) return physics.Shape.view
is
Self : constant Mesh_view := new Mesh;
c_Points : array (1 .. Model.site_Count) of aliased c_math_c.Vector_3.item;
type Triangles is array (1 .. Model.tri_Count) of aliased c_math_c.Triangle.item;
pragma Pack (Triangles);
c_Triangles : Triangles;
begin
for i in c_Points'Range
loop
c_Points (i) := +Model.Sites (i);
end loop;
for i in c_Triangles'Range
loop
c_Triangles (i) := (a => C.int (Model.Triangles (i)(1)),
b => C.int (Model.Triangles (i)(2)),
c => C.int (Model.Triangles (i)(3)));
end loop;
Self.C := b3d_new_Mesh (Points => c_Points (c_Points'First)'unchecked_Access,
point_Count => 0,
Triangles => c_Triangles (c_Triangles'First)'unchecked_Access,
triangle_Count => C.int (Model.tri_Count));
return physics.Shape.view (Self);
end new_mesh_Shape;
------------
--- Cylinder
--
type Cylinder_view is access Cylinder;
function new_cylinder_Shape (half_Extents : in Vector_3) return physics.Shape.view
is
Self : constant Cylinder_view := new Cylinder;
c_half_Extents : aliased c_math_c.Vector_3.item := +half_Extents;
begin
Self.C := b3d_new_Cylinder (c_half_Extents'unchecked_Access);
return physics.Shape.view (Self);
end new_cylinder_Shape;
---------------
--- Heightfield
--
type Heightfield_view is access Heightfield;
function new_heightfield_Shape (Width,
Depth : in Positive;
Heights : in c_math_c.Pointers.Real_Pointer;
min_Height,
max_Height : in Real;
Scale : in Vector_3) return physics.Shape.view
is
use c_math_c.Pointers;
Self : constant Heightfield_view := new Heightfield;
c_Scale : aliased c_math_c.Vector_3.item := +Scale;
begin
Self.C := b3d_new_Heightfield (+Width,
+Depth,
Heights,
c_math_c.Real (min_Height),
c_math_c.Real (max_Height),
c_Scale'unchecked_Access);
return physics.Shape.view (Self);
end new_heightfield_Shape;
---------------
--- multiSphere
--
type multiSphere_view is access multiSphere;
function new_multiSphere_Shape (Positions : in physics.Vector_3_array;
Radii : in math.Vector) return physics.Shape.view
is
pragma Assert (Positions'Length = Radii'Length);
Self : constant multiSphere_view := new multiSphere;
c_Positions : array (1 .. Positions'Length) of aliased c_math_c.Vector_3.item;
c_Radii : array (1 .. Radii 'Length) of aliased c_math_c.Real;
begin
for i in c_Radii'Range
loop
c_Positions (i) := +Positions (i);
c_Radii (i) := +Radii (i);
end loop;
Self.C := b3d_new_multiSphere (c_Positions (1)'unchecked_Access,
c_Radii (1)'unchecked_Access,
Radii'Length);
return physics.Shape.view (Self);
end new_multiSphere_Shape;
---------
--- Plane
--
type Plane_view is access Plane;
function new_plane_Shape (Normal : in Vector_3;
Offset : in Real) return physics.Shape.view
is
Self : constant Plane_view := new Plane;
c_Vector : aliased c_math_c.Vector_3.item := +Normal;
begin
Self.C := b3d_new_Plane (c_Vector'unchecked_Access, +Offset);
return physics.Shape.view (Self);
end new_plane_Shape;
----------
--- Sphere
--
type Sphere_view is access Sphere;
function new_sphere_Shape (Radius : in math.Real) return physics.Shape.view
is
Self : constant Sphere_view := new Sphere;
begin
Self.C := b3d_new_Sphere (+Radius);
return physics.Shape.view (Self);
end new_sphere_Shape;
---------------
--- Attributes
--
overriding
procedure Scale_is (Self : in out Item; Now : Vector_3)
is
begin
null;
end Scale_is;
--------
--- Free
--
procedure free (the_Shape : in out physics.Shape.view)
is
procedure deallocate is new ada.unchecked_Deallocation (physics.Shape.item'Class,
physics.Shape.view);
begin
the_Shape.destruct;
deallocate (the_Shape);
end free;
end bullet_Physics.Shape;
|
package body Benchmark.Matrix.MM is
function Create_MM return Benchmark_Pointer is
begin
return new MM_Type;
end Create_MM;
procedure Run(benchmark : in MM_Type) is
msize : constant Address_Type := Get_Size(benchmark);
srca : constant Address_Type := 0 * msize;
srcb : constant Address_Type := 1 * msize;
dest : constant Address_Type := 2 * msize;
begin
for i in 1 .. benchmark.iterations loop
for a in 0 .. benchmark.size - 1 loop
for b in 0 .. benchmark.size - 1 loop
Write(benchmark, dest, a, b);
Idle(benchmark, benchmark.spacing);
for c in 0 .. benchmark.size - 1 loop
Read(benchmark, srca, b, c);
Idle(benchmark, benchmark.spacing);
Read(benchmark, srcb, c, a);
Idle(benchmark, benchmark.spacing);
Write(benchmark, dest, a, b);
Idle(benchmark, benchmark.spacing);
end loop;
end loop;
end loop;
end loop;
end Run;
end Benchmark.Matrix.MM;
|
-- SPDX-FileCopyrightText: 2020 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Directories;
with Ada.Environment_Variables;
with League.Application;
with League.String_Vectors;
with League.Strings;
with Ada_Kernels;
with Jupyter.Start_Kernel;
procedure Ada_Kernel is
function Get_Top_Directory return League.Strings.Universal_String;
-----------------------
-- Get_Top_Directory --
-----------------------
function Get_Top_Directory return League.Strings.Universal_String is
function Append (Root : String) return League.Strings.Universal_String;
------------
-- Append --
------------
function Append (Root : String) return League.Strings.Universal_String is
Value : constant String := Ada.Directories.Compose (Root, "jupyter");
Result : League.Strings.Universal_String;
begin
Ada.Directories.Create_Path (Value);
Result := League.Strings.From_UTF_8_String (Value);
Result.Append ('/');
return Result;
end Append;
Tmp : constant String := Ada.Environment_Variables.Value ("TMPDIR", "");
Temp : constant String := Ada.Environment_Variables.Value ("TEMP", "");
begin
if Tmp /= "" then
return Append (Tmp);
elsif Temp /= "" then
return Append (Temp);
else
return Append ("/tmp");
end if;
end Get_Top_Directory;
Kernel : Ada_Kernels.Kernel;
Error : League.Strings.Universal_String;
Args : constant League.String_Vectors.Universal_String_Vector :=
League.Application.Arguments;
begin
Kernel.Initialize (Get_Top_Directory, Error);
if Error.Is_Empty then
Jupyter.Start_Kernel (Kernel, Args (1));
else
raise Program_Error with Error.To_UTF_8_String;
end if;
end Ada_Kernel;
|
package body Matrices is
procedure Swap_Rows (From : in out Matrix; First, Second : in Positive) is
Temporary : Element_Type;
begin
for Col in From'Range (2) loop
Temporary := From (First, Col);
From (First, Col) := From (Second, Col);
From (Second, Col) := Temporary;
end loop;
end Swap_Rows;
procedure Divide_Row
(From : in out Matrix;
Row : in Positive;
Divisor : in Element_Type)
is
begin
for Col in From'Range (2) loop
From (Row, Col) := From (Row, Col) / Divisor;
end loop;
end Divide_Row;
procedure Subtract_Rows
(From : in out Matrix;
Subtrahend, Minuend : in Positive;
Factor : in Element_Type)
is
begin
for Col in From'Range (2) loop
From (Minuend, Col) := From (Minuend, Col) -
From (Subtrahend, Col) * Factor;
end loop;
end Subtract_Rows;
function Reduced_Row_Echelon_form (Source : Matrix) return Matrix is
Result : Matrix := Source;
Lead : Positive := Result'First (2);
I : Positive;
begin
Rows : for Row in Result'Range (1) loop
exit Rows when Lead > Result'Last (2);
I := Row;
while Result (I, Lead) = Zero loop
I := I + 1;
if I = Result'Last (1) then
I := Row;
Lead := Lead + 1;
exit Rows when Lead = Result'Last (2);
end if;
end loop;
if I /= Row then
Swap_Rows (From => Result, First => I, Second => Row);
end if;
Divide_Row
(From => Result,
Row => Row,
Divisor => Result (Row, Lead));
for Other_Row in Result'Range (1) loop
if Other_Row /= Row then
Subtract_Rows
(From => Result,
Subtrahend => Row,
Minuend => Other_Row,
Factor => Result (Other_Row, Lead));
end if;
end loop;
Lead := Lead + 1;
end loop Rows;
return Result;
end Reduced_Row_Echelon_form;
end Matrices;
|
package World is
type Boolean_Matrix is array (Positive range <>, Positive range <>) of Boolean;
type World_Grid (Size : Positive) is record
Grid1 : Boolean_Matrix (1 .. Size, 1 .. Size);
Grid2 : Boolean_Matrix (1 .. Size, 1 .. Size);
Step : Natural;
end record;
function New_World (Size : Positive) return World_Grid;
function Get_Spot (W : World_Grid; X, Y : Positive) return Boolean;
procedure Set_Spot (W : in out World_Grid; X, Y : Positive; B : Boolean);
procedure Run_Step (W : in out World_Grid);
private
function Live_Neighbors (W : World_Grid; X, Y : Positive) return Natural;
end;
|
-- { dg-do run }
with Bug_Elaboration_Code; use Bug_Elaboration_Code;
procedure Check_Elaboration_Code is
begin
if I /= J then
raise Program_Error;
end if;
end Check_Elaboration_Code;
|
with agar.core.event;
with agar.gui.widget.button;
with agar.gui.widget.tlist;
with agar.gui.window;
package agar.gui.widget.ucombo is
use type c.unsigned;
type flags_t is new c.unsigned;
UCOMBO_HFILL : constant flags_t := 16#01#;
UCOMBO_VFILL : constant flags_t := 16#02#;
UCOMBO_EXPAND : constant flags_t := UCOMBO_HFILL or UCOMBO_VFILL;
type ucombo_t is limited private;
type ucombo_access_t is access all ucombo_t;
pragma convention (c, ucombo_access_t);
-- API
function allocate
(parent : widget_access_t;
flags : flags_t) return ucombo_access_t;
pragma import (c, allocate, "AG_UComboNew");
function allocate_polled
(parent : widget_access_t;
flags : flags_t;
callback : agar.core.event.callback_t) return ucombo_access_t;
pragma inline (allocate_polled);
procedure size_hint
(ucombo : ucombo_access_t;
text : string;
items : natural);
pragma inline (size_hint);
procedure size_hint_pixels
(ucombo : ucombo_access_t;
width : natural;
height : natural);
pragma inline (size_hint_pixels);
-- selection
procedure combo_select
(ucombo : ucombo_access_t;
item : agar.gui.widget.tlist.item_access_t);
pragma import (c, combo_select, "AG_ComboSelect");
--
function widget (ucombo : ucombo_access_t) return widget_access_t;
pragma inline (widget);
private
type ucombo_t is record
widget : aliased widget_t;
flags : flags_t;
button : agar.gui.widget.button.button_access_t;
list : agar.gui.widget.tlist.tlist_access_t;
panel : agar.gui.window.window_access_t;
w_saved : c.int;
h_saved : c.int;
w_pre_list : c.int;
h_pre_list : c.int;
end record;
pragma convention (c, ucombo_t);
end agar.gui.widget.ucombo;
|
gcc -c main.c
gnatmake -c exported.adb
gnatbind -n exported.ali
gnatlink exported.ali main.o -o main
|
with datos;
use datos;
with Buscar_Posicion_De_Insercion, Desplazar_Una_Posicion_A_La_Derecha;
procedure Ordenar_Por_Insercion (L : in Lista_Enteros; L_Ordenada : out Lista_Enteros) is
-- pre:
-- post: L_ordenada contiene los valores de L en orden ascendente
pos, PosActual : Integer;
begin
L_Ordenada := L;
PosActual := L_Ordenada.Numeros'First+1;
if L.Cont > 1 then
loop exit when PosActual > L_Ordenada.Cont;
buscar_posicion_de_insercion( L_Ordenada.Numeros(PosActual), L_Ordenada, PosActual, Pos);
if pos /= -1 then
desplazar_una_posicion_a_la_derecha(L_Ordenada, PosActual, Pos);
end if;
PosActual := PosActual+1;
end loop;
end if;
end Ordenar_Por_Insercion;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . U T I L I T I E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2014, 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 RTS Internal Declarations
-- These declarations are not part of the GNARLI
pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during tasking
-- operations. It causes infinite loops and other problems.
with System.Tasking.Debug;
with System.Task_Primitives.Operations;
with System.Tasking.Initialization;
with System.Tasking.Queuing;
with System.Parameters;
with System.Traces.Tasking;
package body System.Tasking.Utilities is
package STPO renames System.Task_Primitives.Operations;
use Parameters;
use Tasking.Debug;
use Task_Primitives;
use Task_Primitives.Operations;
use System.Traces;
use System.Traces.Tasking;
--------------------
-- Abort_One_Task --
--------------------
-- Similar to Locked_Abort_To_Level (Self_ID, T, 0), but:
-- (1) caller should be holding no locks except RTS_Lock when Single_Lock
-- (2) may be called for tasks that have not yet been activated
-- (3) always aborts whole task
procedure Abort_One_Task (Self_ID : Task_Id; T : Task_Id) is
begin
if Parameters.Runtime_Traces then
Send_Trace_Info (T_Abort, Self_ID, T);
end if;
Write_Lock (T);
if T.Common.State = Unactivated then
T.Common.Activator := null;
T.Common.State := Terminated;
T.Callable := False;
Cancel_Queued_Entry_Calls (T);
elsif T.Common.State /= Terminated then
Initialization.Locked_Abort_To_Level (Self_ID, T, 0);
end if;
Unlock (T);
end Abort_One_Task;
-----------------
-- Abort_Tasks --
-----------------
-- This must be called to implement the abort statement.
-- Much of the actual work of the abort is done by the abortee,
-- via the Abort_Handler signal handler, and propagation of the
-- Abort_Signal special exception.
procedure Abort_Tasks (Tasks : Task_List) is
Self_Id : constant Task_Id := STPO.Self;
C : Task_Id;
P : Task_Id;
begin
-- If pragma Detect_Blocking is active then Program_Error must be
-- raised if this potentially blocking operation is called from a
-- protected action.
if System.Tasking.Detect_Blocking
and then Self_Id.Common.Protected_Action_Nesting > 0
then
raise Program_Error with "potentially blocking operation";
end if;
Initialization.Defer_Abort_Nestable (Self_Id);
-- ?????
-- Really should not be nested deferral here.
-- Patch for code generation error that defers abort before
-- evaluating parameters of an entry call (at least, timed entry
-- calls), and so may propagate an exception that causes abort
-- to remain undeferred indefinitely. See C97404B. When all
-- such bugs are fixed, this patch can be removed.
Lock_RTS;
for J in Tasks'Range loop
C := Tasks (J);
Abort_One_Task (Self_Id, C);
end loop;
C := All_Tasks_List;
while C /= null loop
if C.Pending_ATC_Level > 0 then
P := C.Common.Parent;
while P /= null loop
if P.Pending_ATC_Level = 0 then
Abort_One_Task (Self_Id, C);
exit;
end if;
P := P.Common.Parent;
end loop;
end if;
C := C.Common.All_Tasks_Link;
end loop;
Unlock_RTS;
Initialization.Undefer_Abort_Nestable (Self_Id);
end Abort_Tasks;
-------------------------------
-- Cancel_Queued_Entry_Calls --
-------------------------------
-- This should only be called by T, unless T is a terminated previously
-- unactivated task.
procedure Cancel_Queued_Entry_Calls (T : Task_Id) is
Next_Entry_Call : Entry_Call_Link;
Entry_Call : Entry_Call_Link;
Self_Id : constant Task_Id := STPO.Self;
Caller : Task_Id;
pragma Unreferenced (Caller);
-- Should this be removed ???
Level : Integer;
pragma Unreferenced (Level);
-- Should this be removed ???
begin
pragma Assert (T = Self or else T.Common.State = Terminated);
for J in 1 .. T.Entry_Num loop
Queuing.Dequeue_Head (T.Entry_Queues (J), Entry_Call);
while Entry_Call /= null loop
-- Leave Entry_Call.Done = False, since this is cancelled
Caller := Entry_Call.Self;
Entry_Call.Exception_To_Raise := Tasking_Error'Identity;
Queuing.Dequeue_Head (T.Entry_Queues (J), Next_Entry_Call);
Level := Entry_Call.Level - 1;
Unlock (T);
Write_Lock (Entry_Call.Self);
Initialization.Wakeup_Entry_Caller
(Self_Id, Entry_Call, Cancelled);
Unlock (Entry_Call.Self);
Write_Lock (T);
Entry_Call.State := Done;
Entry_Call := Next_Entry_Call;
end loop;
end loop;
end Cancel_Queued_Entry_Calls;
------------------------
-- Exit_One_ATC_Level --
------------------------
-- Call only with abort deferred and holding lock of Self_Id.
-- This is a bit of common code for all entry calls.
-- The effect is to exit one level of ATC nesting.
-- If we have reached the desired ATC nesting level, reset the
-- requested level to effective infinity, to allow further calls.
-- In any case, reset Self_Id.Aborting, to allow re-raising of
-- Abort_Signal.
procedure Exit_One_ATC_Level (Self_ID : Task_Id) is
begin
Self_ID.ATC_Nesting_Level := Self_ID.ATC_Nesting_Level - 1;
pragma Debug
(Debug.Trace (Self_ID, "EOAL: exited to ATC level: " &
ATC_Level'Image (Self_ID.ATC_Nesting_Level), 'A'));
pragma Assert (Self_ID.ATC_Nesting_Level >= 1);
if Self_ID.Pending_ATC_Level < ATC_Level_Infinity then
if Self_ID.Pending_ATC_Level = Self_ID.ATC_Nesting_Level then
Self_ID.Pending_ATC_Level := ATC_Level_Infinity;
Self_ID.Aborting := False;
else
-- Force the next Undefer_Abort to re-raise Abort_Signal
pragma Assert
(Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level);
if Self_ID.Aborting then
Self_ID.ATC_Hack := True;
Self_ID.Pending_Action := True;
end if;
end if;
end if;
end Exit_One_ATC_Level;
----------------------
-- Make_Independent --
----------------------
function Make_Independent return Boolean is
Self_Id : constant Task_Id := STPO.Self;
Environment_Task : constant Task_Id := STPO.Environment_Task;
Parent : constant Task_Id := Self_Id.Common.Parent;
begin
if Self_Id.Known_Tasks_Index /= -1 then
Known_Tasks (Self_Id.Known_Tasks_Index) := null;
end if;
Initialization.Defer_Abort (Self_Id);
if Single_Lock then
Lock_RTS;
end if;
Write_Lock (Environment_Task);
Write_Lock (Self_Id);
-- The run time assumes that the parent of an independent task is the
-- environment task.
pragma Assert (Parent = Environment_Task);
Self_Id.Master_of_Task := Independent_Task_Level;
-- Update Independent_Task_Count that is needed for the GLADE
-- termination rule. See also pending update in
-- System.Tasking.Stages.Check_Independent
Independent_Task_Count := Independent_Task_Count + 1;
-- This should be called before the task reaches its "begin" (see spec),
-- which ensures that the environment task cannot race ahead and be
-- already waiting for children to complete.
Unlock (Self_Id);
pragma Assert (Environment_Task.Common.State /= Master_Completion_Sleep);
Unlock (Environment_Task);
if Single_Lock then
Unlock_RTS;
end if;
Initialization.Undefer_Abort (Self_Id);
-- Return True. Actually the return value is junk, since we expect it
-- always to be ignored (see spec), but we have to return something!
return True;
end Make_Independent;
------------------
-- Make_Passive --
------------------
procedure Make_Passive (Self_ID : Task_Id; Task_Completed : Boolean) is
C : Task_Id := Self_ID;
P : Task_Id := C.Common.Parent;
Master_Completion_Phase : Integer;
begin
if P /= null then
Write_Lock (P);
end if;
Write_Lock (C);
if Task_Completed then
Self_ID.Common.State := Terminated;
if Self_ID.Awake_Count = 0 then
-- We are completing via a terminate alternative.
-- Our parent should wait in Phase 2 of Complete_Master.
Master_Completion_Phase := 2;
pragma Assert (Task_Completed);
pragma Assert (Self_ID.Terminate_Alternative);
pragma Assert (Self_ID.Alive_Count = 1);
else
-- We are NOT on a terminate alternative.
-- Our parent should wait in Phase 1 of Complete_Master.
Master_Completion_Phase := 1;
pragma Assert (Self_ID.Awake_Count >= 1);
end if;
-- We are accepting with a terminate alternative
else
if Self_ID.Open_Accepts = null then
-- Somebody started a rendezvous while we had our lock open.
-- Skip the terminate alternative.
Unlock (C);
if P /= null then
Unlock (P);
end if;
return;
end if;
Self_ID.Terminate_Alternative := True;
Master_Completion_Phase := 0;
pragma Assert (Self_ID.Terminate_Alternative);
pragma Assert (Self_ID.Awake_Count >= 1);
end if;
if Master_Completion_Phase = 2 then
-- Since our Awake_Count is zero but our Alive_Count
-- is nonzero, we have been accepting with a terminate
-- alternative, and we now have been told to terminate
-- by a completed master (in some ancestor task) that
-- is waiting (with zero Awake_Count) in Phase 2 of
-- Complete_Master.
pragma Debug (Debug.Trace (Self_ID, "Make_Passive: Phase 2", 'M'));
pragma Assert (P /= null);
C.Alive_Count := C.Alive_Count - 1;
if C.Alive_Count > 0 then
Unlock (C);
Unlock (P);
return;
end if;
-- C's count just went to zero, indicating that
-- all of C's dependents are terminated.
-- C has a parent, P.
loop
-- C's count just went to zero, indicating that all of C's
-- dependents are terminated. C has a parent, P. Notify P that
-- C and its dependents have all terminated.
P.Alive_Count := P.Alive_Count - 1;
exit when P.Alive_Count > 0;
Unlock (C);
Unlock (P);
C := P;
P := C.Common.Parent;
-- Environment task cannot have terminated yet
pragma Assert (P /= null);
Write_Lock (P);
Write_Lock (C);
end loop;
if P.Common.State = Master_Phase_2_Sleep
and then C.Master_of_Task = P.Master_Within
then
pragma Assert (P.Common.Wait_Count > 0);
P.Common.Wait_Count := P.Common.Wait_Count - 1;
if P.Common.Wait_Count = 0 then
Wakeup (P, Master_Phase_2_Sleep);
end if;
end if;
Unlock (C);
Unlock (P);
return;
end if;
-- We are terminating in Phase 1 or Complete_Master,
-- or are accepting on a terminate alternative.
C.Awake_Count := C.Awake_Count - 1;
if Task_Completed then
C.Alive_Count := C.Alive_Count - 1;
end if;
if C.Awake_Count > 0 or else P = null then
Unlock (C);
if P /= null then
Unlock (P);
end if;
return;
end if;
-- C's count just went to zero, indicating that all of C's
-- dependents are terminated or accepting with terminate alt.
-- C has a parent, P.
loop
-- Notify P that C has gone passive
if P.Awake_Count > 0 then
P.Awake_Count := P.Awake_Count - 1;
end if;
if Task_Completed and then C.Alive_Count = 0 then
P.Alive_Count := P.Alive_Count - 1;
end if;
exit when P.Awake_Count > 0;
Unlock (C);
Unlock (P);
C := P;
P := C.Common.Parent;
if P = null then
return;
end if;
Write_Lock (P);
Write_Lock (C);
end loop;
-- P has non-passive dependents
if P.Common.State = Master_Completion_Sleep
and then C.Master_of_Task = P.Master_Within
then
pragma Debug
(Debug.Trace
(Self_ID, "Make_Passive: Phase 1, parent waiting", 'M'));
-- If parent is in Master_Completion_Sleep, it cannot be on a
-- terminate alternative, hence it cannot have Wait_Count of zero.
pragma Assert (P.Common.Wait_Count > 0);
P.Common.Wait_Count := P.Common.Wait_Count - 1;
if P.Common.Wait_Count = 0 then
Wakeup (P, Master_Completion_Sleep);
end if;
else
pragma Debug
(Debug.Trace (Self_ID, "Make_Passive: Phase 1, parent awake", 'M'));
null;
end if;
Unlock (C);
Unlock (P);
end Make_Passive;
end System.Tasking.Utilities;
|
package openGL.Errors
--
-- Provides utilities for displaying openGL errors.
--
is
function Current return String;
--
-- Returns a descriptive string of the last occurring openGL error.
-- Returns "", when no error exists.
-- Clears any existing error.
procedure log (Prefix : in String := "");
--
-- Displays 'Current' error via 'ada.Text_IO.put_Line'.
-- Clears any existing error.
-- Raises 'openGL_Error' when an openGL error has been detected.
procedure log (Prefix : in String := ""; Error_occurred : out Boolean);
--
-- Displays 'Current' error via 'ada.Text_IO.put_Line'.
-- Clears any existing error.
-- Sets 'Error_occurred' to true, if a GL error was detected.
end openGL.Errors;
|
-- SPDX-FileCopyrightText: 2019-2021 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Complete_Contexts.Assignment_Statements;
with Program.Complete_Contexts.Call_Statements;
with Program.Complete_Contexts.Case_Statements;
with Program.Element_Filters;
with Program.Element_Vectors;
with Program.Elements.Assignment_Statements;
with Program.Elements.Call_Statements;
with Program.Elements.Component_Declarations;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Defining_Names;
with Program.Elements.Discriminant_Specifications;
with Program.Elements.Enumeration_Literal_Specifications;
with Program.Elements.Exception_Handlers;
with Program.Elements.Function_Declarations;
with Program.Elements.Identifiers;
with Program.Elements.Incomplete_Type_Definitions;
with Program.Elements.Object_Access_Types;
with Program.Elements.Object_Declarations;
with Program.Elements.Package_Declarations;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Procedure_Body_Declarations;
with Program.Elements.Procedure_Declarations;
with Program.Elements.Record_Definitions;
with Program.Elements.Record_Types;
with Program.Elements.Use_Clauses;
with Program.Elements.With_Clauses;
with Program.Elements.Variant_Parts;
with Program.Elements.Variants;
with Program.Elements;
with Program.Interpretations;
with Program.Lexical_Elements;
with Program.Node_Symbols;
with Program.Resolvers.Basic;
with Program.Resolvers.Name_In_Region;
with Program.Safe_Element_Visitors;
with Program.Symbols;
with Program.Type_Resolvers;
with Program.Elements.Case_Statements;
package body Program.Resolvers is
package Visitors is
type Snapshot_Registry is limited interface;
type Snapshot_Registry_Access is access all Snapshot_Registry'Class
with Storage_Size => 0;
not overriding procedure Put_Public_View
(Self : in out Snapshot_Registry;
Name : Program.Symbols.Symbol;
Value : Program.Visibility.Snapshot_Access) is abstract;
not overriding procedure Push
(Self : in out Snapshot_Registry;
Name : Program.Symbols.Symbol) is abstract;
not overriding procedure Pop
(Self : in out Snapshot_Registry) is abstract;
type Visitor
(Env : not null Program.Visibility.Context_Access;
Unit : not null Program.Elements.Element_Access;
Clause : Program.Element_Vectors.Element_Vector_Access;
Setter : not null
Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access)
is new Program.Resolvers.Basic.Visitor (Env, Setter) with record
-- is new Program.Safe_Element_Visitors.Safe_Element_Visitor with record
Snapshot_Registry : Snapshot_Registry_Access;
Discriminant : Program.Visibility.View;
end record;
overriding procedure Assignment_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Assignment_Statements
.Assignment_Statement_Access);
overriding procedure Call_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Call_Statements
.Call_Statement_Access);
overriding procedure Case_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Case_Statements
.Case_Statement_Access);
overriding procedure Component_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Component_Declarations
.Component_Declaration_Access);
overriding procedure Discriminant_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access);
overriding procedure Enumeration_Literal_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access);
overriding procedure Exception_Handler
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Handlers
.Exception_Handler_Access);
overriding procedure Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Declarations
.Function_Declaration_Access);
overriding procedure Incomplete_Type_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Incomplete_Type_Definitions
.Incomplete_Type_Definition_Access);
overriding procedure Object_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Object_Access_Types
.Object_Access_Type_Access);
overriding procedure Object_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Object_Declarations
.Object_Declaration_Access);
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access);
overriding procedure Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Specifications
.Parameter_Specification_Access);
overriding procedure Procedure_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access);
overriding procedure Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access);
overriding procedure Record_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Record_Definitions
.Record_Definition_Access);
overriding procedure Record_Type
(Self : in out Visitor;
Element : not null Program.Elements.Record_Types.Record_Type_Access);
overriding procedure Variant
(Self : in out Visitor;
Element : not null Program.Elements.Variants.Variant_Access);
overriding procedure Variant_Part
(Self : in out Visitor;
Element : not null Program.Elements.Variant_Parts
.Variant_Part_Access);
end Visitors;
package Environment_Level is
type Visitor
(Unit_Name_Resolver : not null
Program.Simple_Resolvers.Simple_Resolver_Access;
Setter : not null
Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access)
is new Program.Safe_Element_Visitors.Safe_Element_Visitor
with null record;
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access);
overriding procedure Procedure_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access);
overriding procedure Use_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Use_Clauses.Use_Clause_Access);
overriding procedure With_Clause
(Self : in out Visitor;
Element : not null Program.Elements.With_Clauses.With_Clause_Access);
end Environment_Level;
package body Environment_Level is
-------------------------
-- Package_Declaration --
-------------------------
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access)
is
begin
-- Find parent name and resolve it
null;
end Package_Declaration;
--------------------------------
-- Procedure_Body_Declaration --
--------------------------------
overriding procedure Procedure_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access) is
begin
null; -- FIXME: Find parent name and resolve it
end Procedure_Body_Declaration;
----------------
-- Use_Clause --
----------------
overriding procedure Use_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Use_Clauses.Use_Clause_Access) is
begin
pragma Assert (not Element.Has_Type);
for Name in Element.Clause_Names.Each_Element loop
Self.Unit_Name_Resolver.Resolve
(Name.Element.To_Expression, Self.Setter);
end loop;
end Use_Clause;
-----------------
-- With_Clause --
-----------------
overriding procedure With_Clause
(Self : in out Visitor;
Element : not null Program.Elements.With_Clauses.With_Clause_Access)
is
begin
pragma Assert (not Element.Has_Limited);
for Name in Element.Clause_Names.Each_Element loop
Self.Unit_Name_Resolver.Resolve
(Name.Element.To_Expression, Self.Setter);
end loop;
end With_Clause;
end Environment_Level;
package Global_Snapshots is
type Library_Environment_Access is
access all Program.Library_Environments.Library_Environment'Class
with Storage_Size => 0;
type Snapshot_Registry
(Lists : not null Program.Symbol_Lists.Symbol_List_Table_Access;
Lib : not null Library_Environment_Access) is
new Visitors.Snapshot_Registry with
record
Parent : Program.Symbol_Lists.Symbol_List;
end record;
overriding procedure Put_Public_View
(Self : in out Snapshot_Registry;
Name : Program.Symbols.Symbol;
Value : Program.Visibility.Snapshot_Access);
overriding procedure Push
(Self : in out Snapshot_Registry;
Name : Program.Symbols.Symbol);
overriding procedure Pop
(Self : in out Snapshot_Registry);
end Global_Snapshots;
package body Global_Snapshots is
overriding procedure Put_Public_View
(Self : in out Snapshot_Registry;
Name : Program.Symbols.Symbol;
Value : Program.Visibility.Snapshot_Access)
is
List : Program.Symbol_Lists.Symbol_List;
begin
Self.Lists.Find_Or_Create (Self.Parent, Name, List);
Self.Lib.Put_Public_View (List, Value);
end Put_Public_View;
overriding procedure Push
(Self : in out Snapshot_Registry;
Name : Program.Symbols.Symbol)
is
Next : Program.Symbol_Lists.Symbol_List;
begin
Self.Lists.Find_Or_Create (Self.Parent, Name, Next);
Self.Parent := Next;
end Push;
overriding procedure Pop (Self : in out Snapshot_Registry) is
begin
Self.Parent := Self.Lists.Prefix (Self.Parent);
end Pop;
end Global_Snapshots;
-------------------
-- Resolve_Names --
-------------------
procedure Resolve_Names
(Unit : not null Program.Compilation_Units.Compilation_Unit_Access;
Unit_Name_Resolver : not null
Program.Simple_Resolvers.Simple_Resolver_Access;
Lists : in out Program.Symbol_Lists.Symbol_List_Table'Class;
Context : not null Program.Visibility.Context_Access;
Library : in out Program.Library_Environments.Library_Environment;
Setter : not null
Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access)
is
procedure Create_Context (Unit_Name : Program.Symbol_Lists.Symbol_List);
--------------------
-- Create_Context --
--------------------
procedure Create_Context
(Unit_Name : Program.Symbol_Lists.Symbol_List)
is
Parent : constant Program.Symbol_Lists.Symbol_List :=
Lists.Prefix (Unit_Name);
begin
if Unit.Is_Library_Unit_Declaration then
Context.Restore_Snapshot (Library.Public_View (Parent));
else
null; -- FIXME
end if;
end Create_Context;
Global : aliased Global_Snapshots.Snapshot_Registry
(Lists'Unchecked_Access, Library'Unchecked_Access);
Unit_Name : Program.Symbol_Lists.Symbol_List;
Element : constant Program.Elements.Element_Access :=
Unit.Unit_Declaration;
Visitor : Visitors.Visitor
(Context, Element, Unit.Context_Clause_Elements, Setter);
EL : Environment_Level.Visitor
(Unit_Name_Resolver, Setter);
begin
EL.Visit (Element);
for Clause in Unit.Context_Clause_Elements.Each_Element loop
EL.Visit (Clause.Element);
end loop;
Program.Node_Symbols.Unit_Full_Name (Lists, Unit, Unit_Name);
Create_Context (Unit_Name);
Global.Parent := Lists.Prefix (Unit_Name);
Visitor.Snapshot_Registry := Global'Unchecked_Access;
Element.Visit (Visitor);
end Resolve_Names;
--------------
-- Visitors --
--------------
package body Visitors is
procedure Append_Unit_Use_Clauses
(Self : in out Visitor'Class;
Element : Program.Elements.Element_Access);
-----------------------------
-- Append_Unit_Use_Clauses --
-----------------------------
procedure Append_Unit_Use_Clauses
(Self : in out Visitor'Class;
Element : Program.Elements.Element_Access)
is
use type Program.Elements.Element_Access;
Clause : Program.Elements.Use_Clauses.Use_Clause_Access;
begin
if Self.Unit /= Element then -- Return if nested element
return;
end if;
for Item in Self.Clause.Each_Element
(Program.Element_Filters.Is_Use_Clause'Access)
loop
Clause := Item.Element.To_Use_Clause;
for Name in Clause.Clause_Names.Each_Element loop
declare
View : constant Program.Visibility.View :=
Self.Env.Get_Name_View (Name.Element);
begin
if Clause.Has_Type then
raise Program_Error;
else
Self.Env.Add_Use_Package (View);
end if;
end;
end loop;
end loop;
end Append_Unit_Use_Clauses;
--------------------------
-- Assignment_Statement --
--------------------------
overriding procedure Assignment_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Assignment_Statements
.Assignment_Statement_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
begin
Program.Complete_Contexts.Assignment_Statements.Assignment_Statement
(Sets'Unchecked_Access, Self.Setter, Element);
end Assignment_Statement;
--------------------
-- Call_Statement --
--------------------
overriding procedure Call_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Call_Statements
.Call_Statement_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
begin
Program.Complete_Contexts.Call_Statements.Call_Statement
(Sets'Unchecked_Access, Self.Setter, Element);
end Call_Statement;
--------------------
-- Case_Statement --
--------------------
overriding procedure Case_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Case_Statements
.Case_Statement_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
begin
Program.Complete_Contexts.Case_Statements.Case_Statement
(Sets'Unchecked_Access, Self.Setter, Element);
end Case_Statement;
---------------------------
-- Component_Declaration --
---------------------------
overriding procedure Component_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Component_Declarations
.Component_Declaration_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
Has_Default : constant Boolean := Element.Default_Expression.Assigned;
Type_View : Program.Visibility.View;
Names : constant Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access := Element.Names;
begin
for Name in Names.Each_Element loop
declare
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name.Element);
begin
Self.Env.Create_Component
(Symbol,
Name.Element.To_Defining_Name,
Has_Default);
Program.Type_Resolvers.Resolve_Type_Definition
(Element.Object_Subtype.Subtype_Indication,
Self.Env,
Self.Setter,
Sets'Unchecked_Access,
Type_View);
Self.Env.Leave_Declarative_Region;
Self.Env.Set_Object_Type (Type_View);
end;
end loop;
end Component_Declaration;
--------------------------------
-- Discriminant_Specification --
--------------------------------
overriding procedure Discriminant_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
Has_Default : constant Boolean := Element.Default_Expression.Assigned;
Type_View : Program.Visibility.View;
Names : constant Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access := Element.Names;
begin
for Name in Names.Each_Element loop
declare
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name.Element);
begin
Self.Env.Create_Component
(Symbol,
Name.Element.To_Defining_Name,
Has_Default);
Program.Type_Resolvers.Resolve_Type_Definition
(Element.Object_Subtype.To_Element,
Self.Env,
Self.Setter,
Sets'Unchecked_Access,
Type_View);
Self.Env.Leave_Declarative_Region;
Self.Env.Set_Object_Type (Type_View);
end;
end loop;
end Discriminant_Specification;
---------------------------------------
-- Enumeration_Literal_Specification --
---------------------------------------
overriding procedure Enumeration_Literal_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access)
is
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Element.Name);
begin
if Program.Symbols.Is_Character_Literal (Symbol) then
Self.Env.Create_Character_Literal
(Symbol,
Element.Name,
Self.Type_View);
else
Self.Env.Create_Enumeration_Literal
(Symbol,
Element.Name,
Self.Type_View);
end if;
end Enumeration_Literal_Specification;
--------------------------------
-- Incomplete_Type_Definition --
--------------------------------
overriding procedure Incomplete_Type_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Incomplete_Type_Definitions
.Incomplete_Type_Definition_Access)
is
pragma Unreferenced (Element);
begin
Self.Env.Create_Incomplete_Type
(Symbol => Program.Node_Symbols.Get_Symbol (Self.Type_Name),
Name => Self.Type_Name);
Self.Type_View := Self.Env.Latest_View;
if Self.Discriminants.Assigned
and then Self.Discriminants.Is_Known_Discriminant_Part
then
declare
List : constant Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Vector_Access :=
Self.Discriminants.To_Known_Discriminant_Part.Discriminants;
begin
for J in List.Each_Element loop
J.Element.Visit (Self);
end loop;
end;
end if;
Self.Env.Leave_Declarative_Region;
end Incomplete_Type_Definition;
------------------------
-- Object_Access_Type --
------------------------
overriding procedure Object_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Object_Access_Types
.Object_Access_Type_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
Type_View : Program.Visibility.View;
begin
Program.Type_Resolvers.Resolve_Type
(Element.Subtype_Indication.Subtype_Mark,
Self.Env,
Self.Setter,
Sets'Unchecked_Access,
Type_View);
Self.Env.Create_Object_Access_Type
(Symbol => Program.Node_Symbols.Get_Symbol (Self.Type_Name),
Name => Self.Type_Name,
Designated => Type_View);
end Object_Access_Type;
------------------------
-- Object_Declaration --
------------------------
overriding procedure Object_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Object_Declarations
.Object_Declaration_Access)
is
Type_View : Program.Visibility.View;
Sets : aliased Program.Interpretations.Context (Self.Env);
Names : constant Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access := Element.Names;
begin
for Name in Names.Each_Element loop
declare
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name.Element);
begin
Self.Env.Create_Variable
(Symbol,
Name.Element.To_Defining_Name);
Program.Type_Resolvers.Resolve_Type_Definition
(Element.Object_Subtype.To_Element,
Self.Env,
Self.Setter,
Sets'Unchecked_Access,
Type_View);
if Element.Initialization_Expression.Assigned then
Program.Complete_Contexts.Resolve_To_Expected_Type
(Element => Program.Elements.Element_Access
(Element.Initialization_Expression),
Sets => Sets'Unchecked_Access,
Setter => Self.Setter,
Expect => Program.Visibility.First_Subtype (Type_View));
end if;
Self.Env.Leave_Declarative_Region;
Self.Env.Set_Object_Type (Type_View);
end;
end loop;
end Object_Declaration;
-------------------------
-- Package_Declaration --
-------------------------
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null
Program.Elements.Package_Declarations.Package_Declaration_Access)
is
Name : constant
Program.Elements.Defining_Names.Defining_Name_Access :=
Element.Name;
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name);
begin
Self.Env.Create_Package
(Symbol => Symbol,
Name => Name);
Self.Append_Unit_Use_Clauses (Element.all'Access);
for Cursor in Element.Visible_Declarations.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
Self.Snapshot_Registry.Put_Public_View
(Symbol, Self.Env.Create_Snapshot);
if not Element.Private_Declarations.Is_Empty then
raise Program_Error;
end if;
Self.Env.Leave_Declarative_Region;
end Package_Declaration;
-----------------------------
-- Parameter_Specification --
-----------------------------
overriding procedure Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Specifications
.Parameter_Specification_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
Modes : constant array (Boolean, Boolean) of
Program.Visibility.Parameter_Mode :=
(False =>
(False => Program.Visibility.In_Mode,
True => Program.Visibility.Out_Mode),
True =>
(False => Program.Visibility.In_Mode,
True => Program.Visibility.In_Out_Mode));
Mode : constant Program.Visibility.Parameter_Mode :=
Modes (Element.Has_In, Element.Has_Out);
Has_Default : constant Boolean := Element.Default_Expression.Assigned;
Type_View : Program.Visibility.View;
Names : constant Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access := Element.Names;
begin
for Name in Names.Each_Element loop
declare
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name.Element);
begin
Self.Env.Create_Parameter
(Symbol,
Name.Element.To_Defining_Name,
Mode,
Has_Default);
Program.Type_Resolvers.Resolve_Type_Definition
(Element.Parameter_Subtype,
Self.Env,
Self.Setter,
Sets'Unchecked_Access,
Type_View);
Self.Env.Leave_Declarative_Region;
Self.Env.Set_Object_Type (Type_View);
end;
end loop;
end Parameter_Specification;
--------------------------------
-- Procedure_Body_Declaration --
--------------------------------
overriding procedure Procedure_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access)
is
Name : constant
Program.Elements.Defining_Names.Defining_Name_Access :=
Element.Name;
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name);
begin
Self.Env.Create_Procedure
(Symbol => Symbol,
Name => Name);
Self.Append_Unit_Use_Clauses (Element.all'Access);
for Cursor in Element.Parameters.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
for Cursor in Element.Declarations.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
for Cursor in Element.Statements.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
for Cursor in Element.Exception_Handlers.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
Self.Env.Leave_Declarative_Region;
end Procedure_Body_Declaration;
overriding procedure Exception_Handler
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Handlers
.Exception_Handler_Access)
is
use all type Program.Visibility.View_Kind;
Sets : aliased Program.Interpretations.Context (Self.Env);
View : Program.Visibility.View;
begin
for J in Element.Choices.Each_Element loop
if J.Element.Is_Expression then
Program.Type_Resolvers.Resolve_Type
(Element => J.Element.To_Expression,
Context => Self.Env,
Setter => Self.Setter,
Sets => Sets'Unchecked_Access,
Value => View);
pragma Assert (View.Kind = Exception_View);
end if;
end loop;
end Exception_Handler;
overriding procedure Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Declarations
.Function_Declaration_Access)
is
Name : constant
Program.Elements.Defining_Names.Defining_Name_Access :=
Element.Name;
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name);
Type_View : Program.Visibility.View;
Sets : aliased Program.Interpretations.Context (Self.Env);
begin
Self.Env.Create_Function
(Symbol => Symbol,
Name => Name);
Self.Append_Unit_Use_Clauses (Element.all'Access);
for Cursor in Element.Parameters.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
for Aspect in Element.Aspects.Each_Element loop
Aspect.Element.Visit (Self);
end loop;
Program.Type_Resolvers.Resolve_Type_Definition
(Element.Result_Subtype,
Self.Env,
Self.Setter,
Sets'Unchecked_Access,
Type_View);
Self.Env.Set_Result_Type (Type_View);
Self.Env.Leave_Declarative_Region;
end Function_Declaration;
---------------------------
-- Procedure_Declaration --
---------------------------
overriding procedure Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access)
is
Name : constant
Program.Elements.Defining_Names.Defining_Name_Access :=
Element.Name;
Symbol : constant Program.Symbols.Symbol :=
Program.Node_Symbols.Get_Symbol (Name);
begin
Self.Env.Create_Procedure
(Symbol => Symbol,
Name => Name);
Self.Append_Unit_Use_Clauses (Element.all'Access);
for Cursor in Element.Parameters.Each_Element loop
Cursor.Element.Visit (Self);
end loop;
for Aspect in Element.Aspects.Each_Element loop
Aspect.Element.Visit (Self);
end loop;
Self.Env.Leave_Declarative_Region;
end Procedure_Declaration;
overriding procedure Record_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Record_Definitions
.Record_Definition_Access) is
begin
Self.Env.Create_Record_Type
(Symbol => Program.Node_Symbols.Get_Symbol (Self.Type_Name),
Name => Self.Type_Name);
Self.Type_View := Self.Env.Latest_View;
if Self.Discriminants.Assigned
and then Self.Discriminants.Is_Known_Discriminant_Part
then
declare
List : constant Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Vector_Access :=
Self.Discriminants.To_Known_Discriminant_Part.Discriminants;
begin
for J in List.Each_Element loop
J.Element.Visit (Self);
end loop;
end;
end if;
for J in Element.Components.Each_Element loop
J.Element.Visit (Self);
end loop;
Self.Env.Leave_Declarative_Region;
end Record_Definition;
overriding procedure Record_Type
(Self : in out Visitor;
Element : not null Program.Elements.Record_Types.Record_Type_Access)
is
begin
Self.Visit_Each_Child (Element);
end Record_Type;
overriding procedure Variant
(Self : in out Visitor;
Element : not null Program.Elements.Variants.Variant_Access)
is
Sets : aliased Program.Interpretations.Context (Self.Env);
begin
for J in Element.Choices.Each_Element loop
Program.Complete_Contexts.Resolve_To_Expected_Type
(Element => J.Element,
Sets => Sets'Unchecked_Access,
Setter => Self.Setter,
Expect => Program.Visibility.Subtype_Mark (Self.Discriminant));
end loop;
Self.Visit_Each_Child (Element);
end Variant;
overriding procedure Variant_Part
(Self : in out Visitor;
Element : not null Program.Elements.Variant_Parts
.Variant_Part_Access) is
begin
Program.Resolvers.Name_In_Region.Resolve_Name
(Region => Self.Type_View,
Name => Element.Discriminant.To_Expression,
Setter => Self.Setter);
Self.Discriminant := Self.Env.Get_Name_View
(Element.Discriminant.To_Element);
Self.Visit_Each_Child (Element);
end Variant_Part;
end Visitors;
end Program.Resolvers;
|
package GDNative.Console is
---------
-- Put --
---------
procedure Put (Item : in Wide_String);
end; |
--
--
--
package body Sessions is
procedure Append_State_To_Sorted (State : in States.State_Access);
Sorted_Vector : State_Vectors.Vector := State_Vectors.Empty_Vector;
procedure Append_State_To_Sorted (State : in States.State_Access)
is
begin
Sorted_Vector.Append (State);
end Append_State_To_Sorted;
procedure Create_Sorted_States (Session : in out Session_Type)
is
begin
Sorted_Vector.Clear;
States.Iterate (Append_State_To_Sorted'Access);
Session.Sorted := Sorted_Vector;
Sorted_Vector.Clear;
end Create_Sorted_States;
function Clean_Session return Session_Type is
begin
return
Session_Type'(Sorted => State_Vectors.Empty_Vector,
Rule => Rule_Lists.Lists.Empty_List,
Start_Rule => Rule_Lists.Lists.No_Element,
Num_X_State => 0,
Num_Symbol => 0, Num_Terminal => 0,
Min_Shift_Reduce => 0, Err_Action => 0,
Acc_Action => 0, No_Action => 0,
Min_Reduce => 0, Max_Action => 0,
Symbols2 => 999,
Error_Cnt => 0, Error_Symbol => null,
Wildcard => null,
Names => Parser_Names'Access,
File_Name => Null_UString,
Out_Name => Null_UString,
Num_Conflict => 0,
Num_Action_Tab => 0,
Num_Lookahead_Tab => 0,
Table_Size => 0,
Basis_Flag => False,
Has_Fallback => False,
No_Linenos_Flag => False,
Argv0 => Null_UString,
Parser => Report_Parsers.Get_Context,
Num_Rule_With_Action => 0);
end Clean_Session;
end Sessions;
|
with System;
package Init7 is
type Nested1 is record
C1 : Integer;
C2 : Integer;
C3 : Integer;
end record;
for Nested1'Bit_Order use System.Low_Order_First;
for Nested1'Scalar_Storage_Order use System.Low_Order_First;
for Nested1 use record
C1 at 0 range 0 .. 31;
C2 at 4 range 0 .. 31;
C3 at 8 range 0 .. 31;
end record;
type R1 is record
I : Integer;
N : Nested1;
end record;
for R1'Bit_Order use System.Low_Order_First;
for R1'Scalar_Storage_Order use System.Low_Order_First;
for R1 use record
I at 0 range 0 .. 31;
N at 4 range 0 .. 95;
end record;
type Nested2 is record
C1 : Integer;
C2 : Integer;
C3 : Integer;
end record;
for Nested2'Bit_Order use System.High_Order_First;
for Nested2'Scalar_Storage_Order use System.High_Order_First;
for Nested2 use record
C1 at 0 range 0 .. 31;
C2 at 4 range 0 .. 31;
C3 at 8 range 0 .. 31;
end record;
type R2 is record
I : Integer;
N : Nested2;
end record;
for R2'Bit_Order use System.High_Order_First;
for R2'Scalar_Storage_Order use System.High_Order_First;
for R2 use record
I at 0 range 0 .. 31;
N at 4 range 0 .. 95;
end record;
My_R1 : constant R1 := (I => 16#12345678#,
N => (16#AB0012#, 16#CD0034#, 16#EF0056#));
My_R2 : constant R2 := (I => 16#12345678#,
N => (16#AB0012#, 16#CD0034#, 16#EF0056#));
end Init7;
|
-- This spec has been automatically generated from STM32F103.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
package STM32_SVD.GPIO is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CRL_MODE0_Field is STM32_SVD.UInt2;
subtype CRL_CNF0_Field is STM32_SVD.UInt2;
subtype CRL_MODE1_Field is STM32_SVD.UInt2;
subtype CRL_CNF1_Field is STM32_SVD.UInt2;
subtype CRL_MODE2_Field is STM32_SVD.UInt2;
subtype CRL_CNF2_Field is STM32_SVD.UInt2;
subtype CRL_MODE3_Field is STM32_SVD.UInt2;
subtype CRL_CNF3_Field is STM32_SVD.UInt2;
subtype CRL_MODE4_Field is STM32_SVD.UInt2;
subtype CRL_CNF4_Field is STM32_SVD.UInt2;
subtype CRL_MODE5_Field is STM32_SVD.UInt2;
subtype CRL_CNF5_Field is STM32_SVD.UInt2;
subtype CRL_MODE6_Field is STM32_SVD.UInt2;
subtype CRL_CNF6_Field is STM32_SVD.UInt2;
subtype CRL_MODE7_Field is STM32_SVD.UInt2;
subtype CRL_CNF7_Field is STM32_SVD.UInt2;
-- Port configuration register low (GPIOn_CRL)
type CRL_Register is record
-- Port n.0 mode bits
MODE0 : CRL_MODE0_Field := 16#0#;
-- Port n.0 configuration bits
CNF0 : CRL_CNF0_Field := 16#1#;
-- Port n.1 mode bits
MODE1 : CRL_MODE1_Field := 16#0#;
-- Port n.1 configuration bits
CNF1 : CRL_CNF1_Field := 16#1#;
-- Port n.2 mode bits
MODE2 : CRL_MODE2_Field := 16#0#;
-- Port n.2 configuration bits
CNF2 : CRL_CNF2_Field := 16#1#;
-- Port n.3 mode bits
MODE3 : CRL_MODE3_Field := 16#0#;
-- Port n.3 configuration bits
CNF3 : CRL_CNF3_Field := 16#1#;
-- Port n.4 mode bits
MODE4 : CRL_MODE4_Field := 16#0#;
-- Port n.4 configuration bits
CNF4 : CRL_CNF4_Field := 16#1#;
-- Port n.5 mode bits
MODE5 : CRL_MODE5_Field := 16#0#;
-- Port n.5 configuration bits
CNF5 : CRL_CNF5_Field := 16#1#;
-- Port n.6 mode bits
MODE6 : CRL_MODE6_Field := 16#0#;
-- Port n.6 configuration bits
CNF6 : CRL_CNF6_Field := 16#1#;
-- Port n.7 mode bits
MODE7 : CRL_MODE7_Field := 16#0#;
-- Port n.7 configuration bits
CNF7 : CRL_CNF7_Field := 16#1#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CRL_Register use record
MODE0 at 0 range 0 .. 1;
CNF0 at 0 range 2 .. 3;
MODE1 at 0 range 4 .. 5;
CNF1 at 0 range 6 .. 7;
MODE2 at 0 range 8 .. 9;
CNF2 at 0 range 10 .. 11;
MODE3 at 0 range 12 .. 13;
CNF3 at 0 range 14 .. 15;
MODE4 at 0 range 16 .. 17;
CNF4 at 0 range 18 .. 19;
MODE5 at 0 range 20 .. 21;
CNF5 at 0 range 22 .. 23;
MODE6 at 0 range 24 .. 25;
CNF6 at 0 range 26 .. 27;
MODE7 at 0 range 28 .. 29;
CNF7 at 0 range 30 .. 31;
end record;
subtype CRH_MODE8_Field is STM32_SVD.UInt2;
subtype CRH_CNF8_Field is STM32_SVD.UInt2;
subtype CRH_MODE9_Field is STM32_SVD.UInt2;
subtype CRH_CNF9_Field is STM32_SVD.UInt2;
subtype CRH_MODE10_Field is STM32_SVD.UInt2;
subtype CRH_CNF10_Field is STM32_SVD.UInt2;
subtype CRH_MODE11_Field is STM32_SVD.UInt2;
subtype CRH_CNF11_Field is STM32_SVD.UInt2;
subtype CRH_MODE12_Field is STM32_SVD.UInt2;
subtype CRH_CNF12_Field is STM32_SVD.UInt2;
subtype CRH_MODE13_Field is STM32_SVD.UInt2;
subtype CRH_CNF13_Field is STM32_SVD.UInt2;
subtype CRH_MODE14_Field is STM32_SVD.UInt2;
subtype CRH_CNF14_Field is STM32_SVD.UInt2;
subtype CRH_MODE15_Field is STM32_SVD.UInt2;
subtype CRH_CNF15_Field is STM32_SVD.UInt2;
-- Port configuration register high (GPIOn_CRL)
type CRH_Register is record
-- Port n.8 mode bits
MODE8 : CRH_MODE8_Field := 16#0#;
-- Port n.8 configuration bits
CNF8 : CRH_CNF8_Field := 16#1#;
-- Port n.9 mode bits
MODE9 : CRH_MODE9_Field := 16#0#;
-- Port n.9 configuration bits
CNF9 : CRH_CNF9_Field := 16#1#;
-- Port n.10 mode bits
MODE10 : CRH_MODE10_Field := 16#0#;
-- Port n.10 configuration bits
CNF10 : CRH_CNF10_Field := 16#1#;
-- Port n.11 mode bits
MODE11 : CRH_MODE11_Field := 16#0#;
-- Port n.11 configuration bits
CNF11 : CRH_CNF11_Field := 16#1#;
-- Port n.12 mode bits
MODE12 : CRH_MODE12_Field := 16#0#;
-- Port n.12 configuration bits
CNF12 : CRH_CNF12_Field := 16#1#;
-- Port n.13 mode bits
MODE13 : CRH_MODE13_Field := 16#0#;
-- Port n.13 configuration bits
CNF13 : CRH_CNF13_Field := 16#1#;
-- Port n.14 mode bits
MODE14 : CRH_MODE14_Field := 16#0#;
-- Port n.14 configuration bits
CNF14 : CRH_CNF14_Field := 16#1#;
-- Port n.15 mode bits
MODE15 : CRH_MODE15_Field := 16#0#;
-- Port n.15 configuration bits
CNF15 : CRH_CNF15_Field := 16#1#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CRH_Register use record
MODE8 at 0 range 0 .. 1;
CNF8 at 0 range 2 .. 3;
MODE9 at 0 range 4 .. 5;
CNF9 at 0 range 6 .. 7;
MODE10 at 0 range 8 .. 9;
CNF10 at 0 range 10 .. 11;
MODE11 at 0 range 12 .. 13;
CNF11 at 0 range 14 .. 15;
MODE12 at 0 range 16 .. 17;
CNF12 at 0 range 18 .. 19;
MODE13 at 0 range 20 .. 21;
CNF13 at 0 range 22 .. 23;
MODE14 at 0 range 24 .. 25;
CNF14 at 0 range 26 .. 27;
MODE15 at 0 range 28 .. 29;
CNF15 at 0 range 30 .. 31;
end record;
-- IDR array element
subtype IDR_Element is STM32_SVD.Bit;
-- IDR array
type IDR_Field_Array is array (0 .. 15) of IDR_Element
with Component_Size => 1, Size => 16;
-- Type definition for IDR
type IDR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IDR as a value
Val : STM32_SVD.UInt16;
when True =>
-- IDR as an array
Arr : IDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for IDR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- Port input data register (GPIOn_IDR)
type IDR_Register is record
-- Read-only. Port input data
IDR : IDR_Field;
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IDR_Register use record
IDR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- ODR array element
subtype ODR_Element is STM32_SVD.Bit;
-- ODR array
type ODR_Field_Array is array (0 .. 15) of ODR_Element
with Component_Size => 1, Size => 16;
-- Type definition for ODR
type ODR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- ODR as a value
Val : STM32_SVD.UInt16;
when True =>
-- ODR as an array
Arr : ODR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for ODR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- Port output data register (GPIOn_ODR)
type ODR_Register is record
-- Port output data
ODR : ODR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ODR_Register use record
ODR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- BSRR_BS array element
subtype BSRR_BS_Element is STM32_SVD.Bit;
-- BSRR_BS array
type BSRR_BS_Field_Array is array (0 .. 15) of BSRR_BS_Element
with Component_Size => 1, Size => 16;
-- Type definition for BSRR_BS
type BSRR_BS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BS as a value
Val : STM32_SVD.UInt16;
when True =>
-- BS as an array
Arr : BSRR_BS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BSRR_BS_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- BSRR_BR array element
subtype BSRR_BR_Element is STM32_SVD.Bit;
-- BSRR_BR array
type BSRR_BR_Field_Array is array (0 .. 15) of BSRR_BR_Element
with Component_Size => 1, Size => 16;
-- Type definition for BSRR_BR
type BSRR_BR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : STM32_SVD.UInt16;
when True =>
-- BR as an array
Arr : BSRR_BR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BSRR_BR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- Port bit set/reset register (GPIOn_BSRR)
type BSRR_Register is record
-- Write-only. Set bit 0
BS : BSRR_BS_Field := (As_Array => False, Val => 16#0#);
-- Write-only. Reset bit 0
BR : BSRR_BR_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BSRR_Register use record
BS at 0 range 0 .. 15;
BR at 0 range 16 .. 31;
end record;
-- BRR_BR array element
subtype BRR_BR_Element is STM32_SVD.Bit;
-- BRR_BR array
type BRR_BR_Field_Array is array (0 .. 15) of BRR_BR_Element
with Component_Size => 1, Size => 16;
-- Type definition for BRR_BR
type BRR_BR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : STM32_SVD.UInt16;
when True =>
-- BR as an array
Arr : BRR_BR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BRR_BR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- Port bit reset register (GPIOn_BRR)
type BRR_Register is record
-- Write-only. Reset bit 0
BR : BRR_BR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : STM32_SVD.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register use record
BR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- LCKR_LCK array element
subtype LCKR_LCK_Element is STM32_SVD.Bit;
-- LCKR_LCK array
type LCKR_LCK_Field_Array is array (0 .. 15) of LCKR_LCK_Element
with Component_Size => 1, Size => 16;
-- Type definition for LCKR_LCK
type LCKR_LCK_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LCK as a value
Val : STM32_SVD.UInt16;
when True =>
-- LCK as an array
Arr : LCKR_LCK_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for LCKR_LCK_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
subtype LCKR_LCKK_Field is STM32_SVD.Bit;
-- Port configuration lock register
type LCKR_Register is record
-- Port A Lock bit 0
LCK : LCKR_LCK_Field := (As_Array => False, Val => 16#0#);
-- Lock key
LCKK : LCKR_LCKK_Field := 16#0#;
-- unspecified
Reserved_17_31 : STM32_SVD.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LCKR_Register use record
LCK at 0 range 0 .. 15;
LCKK at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- General purpose I/O
type GPIO_Peripheral is record
-- Port configuration register low (GPIOn_CRL)
CRL : aliased CRL_Register;
-- Port configuration register high (GPIOn_CRL)
CRH : aliased CRH_Register;
-- Port input data register (GPIOn_IDR)
IDR : aliased IDR_Register;
-- Port output data register (GPIOn_ODR)
ODR : aliased ODR_Register;
-- Port bit set/reset register (GPIOn_BSRR)
BSRR : aliased BSRR_Register;
-- Port bit reset register (GPIOn_BRR)
BRR : aliased BRR_Register;
-- Port configuration lock register
LCKR : aliased LCKR_Register;
end record
with Volatile;
for GPIO_Peripheral use record
CRL at 16#0# range 0 .. 31;
CRH at 16#4# range 0 .. 31;
IDR at 16#8# range 0 .. 31;
ODR at 16#C# range 0 .. 31;
BSRR at 16#10# range 0 .. 31;
BRR at 16#14# range 0 .. 31;
LCKR at 16#18# range 0 .. 31;
end record;
-- General purpose I/O
GPIOA_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40010800#);
-- General purpose I/O
GPIOB_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40010C00#);
-- General purpose I/O
GPIOC_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40011000#);
-- General purpose I/O
GPIOD_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40011400#);
-- General purpose I/O
GPIOE_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40011800#);
-- General purpose I/O
GPIOF_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40011C00#);
-- General purpose I/O
GPIOG_Periph : aliased GPIO_Peripheral
with Import, Address => System'To_Address (16#40012000#);
end STM32_SVD.GPIO;
|
with Ada.Numerics.Discrete_Random;
with Bitmaps.RGB;
package body ImageOps is
package Random_Luminance is new Ada.Numerics.Discrete_Random
(Bitmaps.Luminance);
Random_Luminance_G : Random_Luminance.Generator;
function Manhattan_Distance (A, B : in Bitmaps.RGB.Pixel) return Natural is
(abs (Integer (A.R) - Integer (B.R)) +
abs (Integer (A.G) - Integer (B.G)) +
abs (Integer (A.B) - Integer (B.B)));
function Adj_Distance_Sum
(Source : in Bitmaps.RGB.Image) return Long_Integer
is
S : Long_Integer := 0;
begin
for Y in 1 .. Bitmaps.RGB.Max_Y (Source) loop
for X in 1 .. Bitmaps.RGB.Max_X (Source) loop
S :=
S +
Long_Integer
(Manhattan_Distance
(Bitmaps.RGB.Get_Pixel (Source, X, Y),
Bitmaps.RGB.Get_Pixel (Source, X - 1, Y)));
S :=
S +
Long_Integer
(Manhattan_Distance
(Bitmaps.RGB.Get_Pixel (Source, X, Y),
Bitmaps.RGB.Get_Pixel (Source, X, Y - 1)));
end loop;
end loop;
return S;
end Adj_Distance_Sum;
procedure Noise (Target : in out Bitmaps.RGB.Image) is
begin
for Y in 0 .. Bitmaps.RGB.Max_Y (Target) loop
for X in 0 .. Bitmaps.RGB.Max_X (Target) loop
Bitmaps.RGB.Set_Pixel
(Target, X, Y,
(R => Random_Luminance.Random (Random_Luminance_G),
G => Random_Luminance.Random (Random_Luminance_G),
B => Random_Luminance.Random (Random_Luminance_G)));
end loop;
end loop;
end Noise;
end ImageOps;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- T B U I L 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 various utility procedures to assist in
-- building specific types of tree nodes.
with Types; use Types;
package Tbuild is
function Make_DT_Component
(Loc : Source_Ptr;
Typ : Entity_Id;
I : Positive)
return Node_Id;
-- Gives a reference to the Ith component of the Dispatch Table of
-- a given Tagged Type.
--
-- I = 1 --> Inheritance_Depth
-- I = 2 --> Tags (array of ancestors)
-- I = 3, 4 --> predefined primitive
-- function _Size (X : Typ) return Long_Long_Integer;
-- function _Equality (X : Typ; Y : Typ'Class) return Boolean;
-- I >= 5 --> User-Defined Primitive Operations
function Make_DT_Access
(Loc : Source_Ptr; Rec : Node_Id; Typ : Entity_Id) return Node_Id;
-- Create an access to the Dispatch Table by using the Tag field
-- of a tagged record : Acc_Dt (Rec.tag).all
function Make_Implicit_If_Statement
(Node : Node_Id;
Condition : Node_Id;
Then_Statements : List_Id;
Elsif_Parts : List_Id := No_List;
Else_Statements : List_Id := No_List)
return Node_Id;
pragma Inline (Make_Implicit_If_Statement);
-- This function makes an N_If_Statement node whose fields are filled
-- in with the indicated values (see Sinfo), and whose Sloc field is
-- is set to Sloc (Node). The effect is identical to calling function
-- Nmake.Make_If_Statement except that there is a check for restriction
-- No_Implicit_Conditionals, and if this restriction is being violated,
-- an error message is posted on Node.
function Make_Implicit_Label_Declaration
(Loc : Source_Ptr;
Defining_Identifier : Node_Id;
Label_Construct : Node_Id)
return Node_Id;
-- Used to construct an implicit label declaration node, including setting
-- the proper Label_Construct field (since Label_Construct is a semantic
-- field, the normal call to Make_Implicit_Label_Declaration does not
-- set this field).
function Make_Implicit_Loop_Statement
(Node : Node_Id;
Statements : List_Id;
Identifier : Node_Id := Empty;
Iteration_Scheme : Node_Id := Empty;
Has_Created_Identifier : Boolean := False;
End_Label : Node_Id := Empty)
return Node_Id;
-- This function makes an N_Loop_Statement node whose fields are filled
-- in with the indicated values (see Sinfo), and whose Sloc field is
-- is set to Sloc (Node). The effect is identical to calling function
-- Nmake.Make_Loop_Statement except that there is a check for restrictions
-- No_Implicit_Loops and No_Implicit_Conditionals (the first applying in
-- all cases, and the second only for while loops), and if one of these
-- restrictions is being violated, an error message is posted on Node.
function Make_Integer_Literal
(Loc : Source_Ptr;
Intval : Int)
return Node_Id;
pragma Inline (Make_Integer_Literal);
-- A convenient form of Make_Integer_Literal taking Int instead of Uint
function Make_Unsuppress_Block
(Loc : Source_Ptr;
Check : Name_Id;
Stmts : List_Id)
return Node_Id;
-- Build a block with a pragma Suppress on 'Check'. Stmts is the
-- statements list that needs protection against the check
function New_Constraint_Error (Loc : Source_Ptr) return Node_Id;
-- This function builds a tree corresponding to the Ada statement
-- "raise Constraint_Error" and returns the root of this tree,
-- the N_Raise_Statement node.
function New_External_Name
(Related_Id : Name_Id;
Suffix : Character := ' ';
Suffix_Index : Int := 0;
Prefix : Character := ' ')
return Name_Id;
function New_External_Name
(Related_Id : Name_Id;
Suffix : String;
Suffix_Index : Int := 0;
Prefix : Character := ' ')
return Name_Id;
-- Builds a new entry in the names table of the form:
--
-- [Prefix &] Related_Id [& Suffix] [& Suffix_Index]
--
-- Prefix is prepended only if Prefix is non-blank (in which case it
-- must be an upper case letter other than O,Q,U,W (which are used for
-- identifier encoding, see Namet), and T is reserved for use by implicit
-- types. and X is reserved for use by debug type encoding (see package
-- Exp_Dbug). Note: the reason that Prefix is last is that it is almost
-- always omitted. The notable case of Prefix being non-null is when
-- it is 'T' for an implicit type.
-- Suffix_Index'Image is appended only if the value of Suffix_Index is
-- positive, or if Suffix_Index is negative 1, then a unique serialized
-- suffix is added. If Suffix_Index is zero, then no index is appended.
-- Suffix is also a single upper case letter other than O,Q,U,W,X and is a
-- required parameter (T is permitted). The constructed name is stored
-- using Find_Name so that it can be located using a subsequent Find_Name
-- operation (i.e. it is properly hashed into the names table). The upper
-- case letter given as the Suffix argument ensures that the name does
-- not clash with any Ada identifier name. These generated names are
-- permitted, but not required, to be made public by setting the flag
-- Is_Public in the associated entity.
function New_External_Name
(Suffix : Character;
Suffix_Index : Nat)
return Name_Id;
-- Builds a new entry in the names table of the form
-- Suffix & Suffix_Index'Image
-- where Suffix is a single upper case letter other than O,Q,U,W,X and is
-- a required parameter (T is permitted). The constructed name is stored
-- using Find_Name so that it can be located using a subsequent Find_Name
-- operation (i.e. it is properly hashed into the names table). The upper
-- case letter given as the Suffix argument ensures that the name does
-- not clash with any Ada identifier name. These generated names are
-- permitted, but not required, to be made public by setting the flag
-- Is_Public in the associated entity.
function New_Internal_Name (Id_Char : Character) return Name_Id;
-- Id_Char is an upper case letter other than O,Q,U,W (which are reserved
-- for identifier encoding (see Namet package for details) and X which is
-- used for debug encoding (see Exp_Dbug). The letter T is permitted, but
-- is reserved by convention for the case of internally generated types.
-- The result of the call is a new generated unique name of the form XyyyU
-- where X is Id_Char, yyy is a unique serial number, and U is either a
-- lower case s or b indicating if the current unit is a spec or a body.
--
-- The name is entered into the names table using Name_Enter rather than
-- Name_Find, because there can never be a need to locate the entry using
-- the Name_Find procedure later on. Names created by New_Internal_Name
-- are guaranteed to be consistent from one compilation to another (i.e.
-- if the identical unit is compiled with a semantically consistent set
-- of sources, the numbers will be consistent. This means that it is fine
-- to use these as public symbols.
function New_Suffixed_Name
(Related_Id : Name_Id;
Suffix : String)
return Name_Id;
-- This function is used to create special suffixed names used by the
-- debugger. Suffix is a string of upper case letters, used to construct
-- the required name. For instance, the special type used to record the
-- fixed-point small is called typ_SMALL where typ is the name of the
-- fixed-point type (as passed in Related_Id), and Suffix is "SMALL".
function New_Occurrence_Of
(Def_Id : Entity_Id;
Loc : Source_Ptr)
return Node_Id;
-- New_Occurrence_Of creates an N_Identifier node which is an
-- occurrence of the defining identifier which is passed as its
-- argument. The Entity and Etype of the result are set from
-- the given defining identifier as follows: Entity is simply
-- a copy of Def_Id. Etype is a copy of Def_Id for types, and
-- a copy of the Etype of Def_Id for other entities.
function New_Reference_To
(Def_Id : Entity_Id;
Loc : Source_Ptr)
return Node_Id;
-- This is like New_Occurrence_Of, but it does not set the Etype field.
-- It is used from the expander, where Etype fields are generally not set,
-- since they are set when the expanded tree is reanalyzed.
function Checks_Off (N : Node_Id) return Node_Id;
pragma Inline (Checks_Off);
-- Returns an N_Unchecked_Expression node whose expression is the given
-- argument. The results is a subexpression identical to the argument,
-- except that it will be analyzed and resolved with checks off.
function Convert_To (Typ : Entity_Id; Expr : Node_Id) return Node_Id;
-- Returns an expression that represents the result of a checked convert
-- of expression Exp to type T. If the base type of Exp is T, then no
-- conversion is required, and Exp is returned unchanged. Otherwise an
-- N_Type_Conversion node is constructed to convert the expression.
-- If an N_Type_Conversion node is required, Relocate_Node is used on
-- Exp. This means that it is safe to replace a node by a Convert_To
-- of itself to some other type.
function OK_Convert_To (Typ : Entity_Id; Expr : Node_Id) return Node_Id;
-- Like Convert_To, except that a conversion node is always generated,
-- and the Conversion_OK flag is set on this conversion node.
function Unchecked_Convert_To
(Typ : Entity_Id;
Expr : Node_Id)
return Node_Id;
-- Like Convert_To, but if a conversion is actually needed, constructs
-- an N_Unchecked_Type_Conversion node to do the required conversion.
end Tbuild;
|
with Ada.Text_IO, Ada.Numerics.Discrete_Random;
use Ada.Text_IO;
package body tools is
protected body Output is
procedure Puts(str: String; num:Natural := 0) is
begin
Put(str);
if num > 0 then
New_Line; -- most csak 0 vagy 1 uj sor
end if;
end;
end Output;
package body Random_Generator is
package Gen_Pack is new Ada.Numerics.Discrete_Random(T);
protected Generator is
function GetRand return T;
procedure Init;
private
g: Gen_Pack.Generator;
end Generator;
protected body Generator is
function GetRand return T is
begin
return Gen_Pack.Random(g);
end GetRand;
procedure Init is
begin
Gen_Pack.Reset(g);
end Init;
end Generator;
function GetRandom return T is
begin
return Generator.GetRand;
end GetRandom;
begin
Generator.Init;
end Random_Generator;
end tools;
|
-- { dg-do compile }
package body Pack15 is
procedure Transfer is
begin
O.Status_Flags := Status_Flags;
end;
end Pack15;
|
with arbre_binaire;
with Ada.Text_IO ; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure test_arbre_binaire is
procedure Afficher_Entier ( entier : Integer) is
begin
Put( entier );
end Afficher_Entier ;
package arbre_binaire_entier is
new arbre_binaire( Integer, Afficher_Entier );
use arbre_binaire_entier ;
Arbre : T_Abr;
-- Construire un arbre binaire, l'arbre à construire est le suivant :
--
-- 1
-- 3 2
-- 7 6 5 4
-- Afficher l'arbre binaire après construction
procedure Construire_Arbre_Binaire ( Arbre : out T_Abr ) is
begin
Put("Construire l'arbre");New_Line;
Initialiser ( Arbre );
Pragma Assert ( Vide ( Arbre ) );
Pragma Assert ( Taille ( Arbre ) = 0 );
Creer_Arbre ( Arbre , 1 );
Ajouter_Fils_Droit ( Arbre , 1, 2 );
Ajouter_Fils_Gauche ( Arbre , 1,3 );
Ajouter_Fils_Droit ( Arbre,2, 4);
Ajouter_Fils_Gauche ( Arbre,2, 5);
Ajouter_Fils_Droit (Arbre , 3 , 6);
Ajouter_Fils_Gauche ( Arbre , 3 , 7);
Pragma Assert ( Not Vide ( Arbre ) );
Pragma Assert ( Taille ( Arbre ) = 7 );
Afficher_Arbre_Binaire ( Arbre , 1 );
New_Line;
end Construire_Arbre_Binaire;
-- Vider l'arbre binaire construit
procedure Vider_Arbre_Binaire_Test is
begin
Put ("Tester Vider_Arbre_Test");New_Line;
Construire_Arbre_Binaire ( Arbre );
Vider_Arbre ( Arbre );
Pragma Assert ( Vide ( Arbre ));
Pragma Assert ( Taille ( Arbre ) = 0 );
Afficher_Arbre_Binaire ( Arbre , 1 );New_Line;
Put_line ("=> Succès : Fin du test de Vider_Arbre_Test");New_Line;
end Vider_Arbre_Binaire_Test;
-- Modifier l'arbre binaire construit par le suivant :
--
-- 1
-- 3 15
-- 0 8 10 4
-- Afficher l'arbre binaire après construction
-- Vider l'arbre après la fin du test
procedure Modifier_Arbre_Binaire_Test is
begin
Put ( "Tester Modifier Arbre_Binaire_Test");New_Line;
Construire_Arbre_Binaire ( Arbre );
Modifier ( Arbre , 2 , 15 );
Modifier ( Arbre , 5 , 10 );
Modifier ( Arbre , 6 , 8 );
Modifier ( Arbre , 7 , 0 );
Pragma Assert ( Not Vide( Arbre ) );
Pragma Assert ( Taille ( Arbre ) = 7 );
Afficher_Arbre_Binaire ( Arbre , 1 ); New_Line ;
Pragma Assert ( Avoir_Cle ( Arbre_Cle ( Arbre , 15 ),15) = 15 );
Pragma Assert ( Avoir_Cle ( Arbre_Cle ( Arbre , 1 ),1) = 1 );
Pragma Assert ( Avoir_Cle ( Arbre_Cle ( Arbre , 3 ),3) = 3 );
Put_line ("=> Succès : Fin du test de Modifier_Arbre_Binaire_Test"); New_Line;
Vider_Arbre ( Arbre );
Pragma Assert ( Vide ( Arbre ));
New_Line;
end Modifier_Arbre_Binaire_Test ;
-- Modifier l'arbre binaire construit en supprimant quelques clés .
--
-- 1
-- 3 2
-- 7 4
-- Afficher l'arbre binaire après construction
-- Vider l'arbre après la fin du test
procedure Supprimer_Arbre_Binaire_Test is
begin
Put ("Tester Supprimer_Arbre_Binaire_Test" );New_line;
Construire_Arbre_Binaire ( Arbre );
Supprimer ( Arbre , 5 );
Pragma Assert ( Taille ( Arbre ) = 6 );
Supprimer ( Arbre , 6 );
Pragma Assert ( Taille ( Arbre ) = 5 );
Afficher_Arbre_Binaire ( Arbre , 1 );
Vider_Arbre ( Arbre );
Pragma Assert ( Vide ( Arbre ) );
New_line;
Put_line ("=> Succès : Fin du test Supprimer_Arbre_Binaire_Test" );New_line;
end Supprimer_Arbre_Binaire_Test;
-- Modifier l'arbre binaire construit en supprimant quelques clés .
--
-- 1
-- 3 2
-- 5 10
--
-- Verifier si les clés 4 ,6 et 7 existe encore après la modification
-- Afficher l'arbre binaire après construction
-- Vider l'arbre après la fin du test
procedure Existe_Arbre_Binaire_Test is
begin
Put ("Tester Existe_Arbre_Binaire_Test ");New_Line;
Construire_Arbre_Binaire ( Arbre );
Modifier ( Arbre , 4 , 10 );
Pragma Assert ( not Existe ( Arbre , 4 ));
Pragma Assert ( Existe ( Arbre , 10 ));
Supprimer ( Arbre , 6 );
Supprimer ( Arbre , 7 );
Pragma Assert ( not Existe ( Arbre , 6 ));
Pragma Assert ( not Existe ( Arbre , 7 ));
Afficher_Arbre_Binaire ( Arbre , 1 );New_Line;
Vider_Arbre ( Arbre );
Pragma Assert ( Taille ( Arbre ) = 0 );
Put_line ("=> Succès : Fin du test de Existe_Arbre_Binaire");New_Line;
end Existe_Arbre_Binaire_Test;
begin
Construire_Arbre_Binaire ( Arbre );
Vider_Arbre_Binaire_Test;
Modifier_Arbre_Binaire_Test;
Supprimer_Arbre_Binaire_Test;
Existe_Arbre_Binaire_Test;
end test_arbre_binaire;
|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Unchecked_Deallocation;
with Ada.Unchecked_Conversion;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C; use Interfaces.C;
with System; use System;
with Xlib;
with xcb; use xcb;
with xcb_ewmh; use xcb_ewmh;
with xproto; use xproto;
with Compositor;
with Desktop;
with Events;
with Render;
with Render.Fonts;
with Render.Shaders;
with Setup;
with Taskbar;
procedure Main is
use Render;
display : access Xlib.Display;
connection : access xcb.xcb_connection_t;
rend : Render.Renderer;
compMode : Compositor.CompositeMode := Compositor.MANUAL;
ignore : int;
begin
-- @TODO perform a check for required libraries, and offer helpful
-- suggestions for what the user needs to install and how, depending on
-- their distro.
-- We can do that with:
-- $ LD_TRACE_LOADED_OBJECTS=1 ./troodon
display := Setup.initXlib;
connection := Setup.initXcb (display);
if connection = null then
Ada.Text_IO.Put_Line ("Unable to connect to X Server. Exiting.");
Ada.Command_Line.Set_Exit_Status (1);
end if;
Setup.initExtensions (connection);
rend := Render.start (connection, display);
Compositor.start (connection, rend, compMode);
Render.Fonts.start;
Desktop.start (connection, rend);
Render.Shaders.start;
Desktop.changeWallpaper (connection, rend, "bg.jpg");
Setup.initDamage (connection);
Setup.initEwmh (connection);
Taskbar.start;
-- Main loop
Events.eventLoop (connection, rend, compMode);
-- Cleanup
Taskbar.stop (connection);
Desktop.stop (connection, rend);
Compositor.stop (connection, rend, compMode);
Render.Fonts.stop;
Render.Shaders.stop;
Render.stop (connection, rend);
Ada.Text_IO.Put_Line ("Troodon: Disconnecting from X server.");
ignore := Xlib.XCloseDisplay (display);
Ada.Text_IO.Put_Line ("Troodon: Going extinct.");
end Main;
|
package IntList is
type T is limited private;
function IsInList( List: in T; Number: in Integer ) return Boolean;
procedure Insert( List: in out T; Number: in Integer );
procedure Remove( List: in out T; Number: in Integer );
procedure Print( List: in T );
private
type IntList_Node;
type IntList_Node_Ptr is access IntList_Node;
type IntList_Node is
record
Datum : Integer;
Next : IntList_Node_Ptr;
end record;
type T is
record
Head : IntList_Node_Ptr := null;
Tail : IntList_Node_Ptr := null;
end record;
function Find_Element( List: in T; Number: in Integer )
return IntList_Node_Ptr;
end IntList;
|
with Message.Reader; use Message.Reader;
package body Message.Post is
procedure Quote (Msgid : Unbounded_String) is
FileName, scratch : Unbounded_String;
File : File_Type;
Sender, HeaderType,HeaderText : Unbounded_String;
begin
FileName := "messages/"& Msgid &".msg";
Text_Buffer.Clear;
Open (File => File,
Mode => In_File,
Name => To_String(Filename));
scratch := SUIO.Get_Line(File);
while scratch /= "" loop
HeaderType := To_Unbounded_String(SU.Slice(scratch,1,SU.Index(scratch,":")-1));
HeaderText := To_Unbounded_String(SU.Slice(scratch,SU.Index(scratch,":")+2,SU.Length(scratch)));
if HeaderType = "Sender" then
Sender := HeaderText;
end if;
scratch := SUIO.Get_Line(File);
end loop;
Text_Buffer.Append("In reply to "& Sender);
scratch := SUIO.Get_Line(File);
loop
Text_Buffer.Append(" > "& scratch);
scratch := SUIO.Get_Line(File);
end loop;
exception
when End_Error =>
Close (File);
when Name_Error => null;
end Quote;
function Pad (InStr : String;PadWdth : Integer) return String is
padstr,tmpstr : Unbounded_String;
begin
tmpstr := To_Unbounded_String(SF.Trim(Instr,Ada.Strings.Left));
if SU.Length(tmpstr) < PadWdth then
for i in SU.Length(tmpstr) .. PadWdth-1 loop
padstr := padstr & '0';
end loop;
return To_String(padstr) & To_String(tmpstr);
else
return To_String(tmpstr);
end if;
end Pad;
function Generate_UID return Unbounded_String is
Now : Time := Clock;
Now_Year : Year_Number;
Now_Month : Month_Number;
Now_Day : Day_Number;
Now_Seconds : Day_Duration;
begin
Split (Now,
Now_Year,
Now_Month,
Now_Day,
Now_Seconds);
return To_Unbounded_String(SF.Trim(Year_Number'Image (Now_Year),Ada.Strings.Left) &
Pad(Month_Number'Image (Now_Month),2) &
Pad(Day_Number'Image (Now_Day),2) &
Pad(Duration'Image (Now_Seconds),16));
end Generate_UID;
procedure Post_Message (ReplyID : in Unbounded_String := To_Unbounded_String("");
ReplySubject : in Unbounded_String := To_Unbounded_String("")) is
-- FileName : Unbounded_String := To_Unbounded_String("messages/test.txt");
File : File_Type;
Nick, Subject, Msgid, FName : Unbounded_String;
PostDate : Time := Clock;
Cancelled : Boolean := False;
procedure Write_Line (Position : String_List.Cursor) is
begin
SUIO.Put_Line(File,String_List.Element(Position));
end Write_Line;
begin
if UserLoggedIn then
Clear;
Get_Size(Standard_Window,Number_Of_Lines => TermLnth,Number_Of_Columns => TermWdth);
TopLine := 4;
BottomLine := TermLnth - 4;
Nick := UserLoggedName;
Add (Line => 1,Column => 0,Str => "Nick : " & To_String(Nick));
if (SU.Length(ReplySubject) > 0) then
if SU.Index(ReplySubject,"Re.") = 1 then
Subject := ReplySubject;
else
Subject := "Re. " & ReplySubject;
end if;
end if;
Add (Line => 2,Column => 0,Str => "Subject : ");
loop
Texaco.Line_Editor(Standard_Window,
StartLine => 2,
StartColumn => 11,
Editlength => 60,
Edline => Subject,
MaxLength => 60);
exit when Subject /= "";
end loop;
Add (Line => 3,Column => 0, Str => "Enter your Message text. Esc to exit");
Refresh;
Texaco.Text_Editor(Standard_Window,TopLine => TopLine,BottomLine => BottomLine,MaxLines => 100);
if not Text_Buffer.Is_Empty then
if Texaco.Save then
Msgid := Generate_UID;
FName := "messages/" & Msgid & ".msg";
Create (File => File,
Mode => Out_File,
Name => To_String(FName));
SUIO.Put_Line(File,"Sender: " & Nick);
SUIO.Put_Line(File,"Subject: " & Subject);
SUIO.Put_Line(File,"PostDate: " & To_Unbounded_String(Image (PostDate)));
SUIO.Put_Line(File,"Msgid: " & Msgid);
if SU.Length(ReplyID) /= 0 then
SUIO.Put_Line(File,"ReplyTo: " & ReplyID);
end if;
SUIO.Put_Line(File,To_Unbounded_String(""));
Text_Buffer.Iterate(Write_Line'access);
Close (File);
Directory_Buffer.Append(New_Item => (To_Unbounded_String(Curr_Dir&"/"&To_String(FName)),
CharPad(Nick,15) & Subject) );
else
Display_Warning.Warning("Posting Cancelled");
end if;
end if;
else
Display_Warning.Warning("You Must be Logged In to Post");
end if;
end Post_Message;
end Message.Post;
|
--------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2013-2020, Luke A. Guest
--
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
--
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
--
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
--
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
--
-- 3. This notice may not be removed or altered from any source
-- distribution.
--------------------------------------------------------------------------------------------------------------------
with Interfaces.C;
with SDL.Error;
package body SDL.Video.Renderers is
package C renames Interfaces.C;
use type SDL.C_Pointers.Renderer_Pointer;
type Internal_Flip is mod 2 ** 32 with
Convention => C;
-- type Internal_Flip_Array is array (Renderer_Flip) of Internal_Flip;
Internal_Flip_None : constant Internal_Flip := 16#0000_0000#;
Internal_Flip_Horizontal : constant Internal_Flip := 16#0000_0001#;
Internal_Flip_Vertical : constant Internal_Flip := 16#0000_0002#;
Internal_Flips : constant array (Renderer_Flip) of Internal_Flip :=
(Internal_Flip_None,
Internal_Flip_Horizontal,
Internal_Flip_Vertical,
Internal_Flip_Horizontal or Internal_Flip_Vertical);
function Get_Internal_Window (Self : in SDL.Video.Windows.Window) return SDL.C_Pointers.Windows_Pointer with
Convention => Ada,
Import => True;
function Get_Internal_Texture (Self : in SDL.Video.Textures.Texture) return SDL.C_Pointers.Texture_Pointer with
Import => True,
Convention => Ada;
function Total_Drivers return Positive is
function SDL_Get_Num_Render_Drivers return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GetNumRenderDrivers";
Result : constant C.int := SDL_Get_Num_Render_Drivers;
begin
if Result < C.int (Positive'First) then
raise Renderer_Error with SDL.Error.Get;
end if;
return Positive (Result);
end Total_Drivers;
overriding
procedure Finalize (Self : in out Renderer) is
procedure SDL_Destroy_Renderer (R : in SDL.C_Pointers.Renderer_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_DestroyRenderer";
begin
if Self.Internal /= null and then Self.Owns then
SDL_Destroy_Renderer (Self.Internal);
Self.Internal := null;
end if;
end Finalize;
function Get_Blend_Mode (Self : in Renderer) return Blend_Modes is
function SDL_Get_Render_Draw_Blend_Mode (R : in SDL.C_Pointers.Renderer_Pointer;
M : out Blend_Modes) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GetRenderDrawBlendMode";
Mode : Blend_Modes;
Result : constant C.int := SDL_Get_Render_Draw_Blend_Mode (Self.Internal, Mode);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
return Mode;
end Get_Blend_Mode;
procedure Set_Blend_Mode (Self : in out Renderer; Mode : in Blend_Modes) is
function SDL_Set_Render_Draw_Blend_Mode (R : in SDL.C_Pointers.Renderer_Pointer;
M : in Blend_Modes) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_SetRenderDrawBlendMode";
Result : constant C.int := SDL_Set_Render_Draw_Blend_Mode (Self.Internal, Mode);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Blend_Mode;
function Get_Draw_Colour (Self : in Renderer) return SDL.Video.Palettes.Colour is
function SDL_Get_Render_Draw_Color
(R : in SDL.C_Pointers.Renderer_Pointer;
Red, Green, Blue, Alpha : out SDL.Video.Palettes.Colour_Component) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_GetRenderDrawColor";
Colour : SDL.Video.Palettes.Colour;
Result : constant C.int := SDL_Get_Render_Draw_Color (Self.Internal,
Colour.Red,
Colour.Green,
Colour.Blue,
Colour.Alpha);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
return Colour;
end Get_Draw_Colour;
procedure Set_Draw_Colour (Self : in out Renderer; Colour : in SDL.Video.Palettes.Colour) is
function SDL_Set_Render_Draw_Color
(R : in SDL.C_Pointers.Renderer_Pointer;
Red, Green, Blue, Alpha : in SDL.Video.Palettes.Colour_Component) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_SetRenderDrawColor";
Result : constant C.int := SDL_Set_Render_Draw_Color (Self.Internal,
Colour.Red,
Colour.Green,
Colour.Blue,
Colour.Alpha);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Draw_Colour;
procedure Clear (Self : in out Renderer) is
function SDL_Render_Clear (R : in SDL.C_Pointers.Renderer_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderClear";
Result : constant C.int := SDL_Render_Clear (Self.Internal);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Clear;
procedure Copy
(Self : in out Renderer;
Copy_From : in SDL.Video.Textures.Texture) is
function SDL_Render_Copy
(R : in SDL.C_Pointers.Renderer_Pointer;
T : in SDL.C_Pointers.Texture_Pointer;
Src, Dest : in SDL.Video.Rectangles.Rectangle_Access) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderCopy";
Result : constant C.int := SDL_Render_Copy (Self.Internal,
Get_Internal_Texture (Copy_From),
null,
null);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Copy;
-- TODO: Check to make sure this works, if it does, apply the same logic to CopyEx, see below.
procedure Copy
(Self : in out Renderer;
Copy_From : in SDL.Video.Textures.Texture;
From : in SDL.Video.Rectangles.Rectangle;
To : in SDL.Video.Rectangles.Rectangle) is
function SDL_Render_Copy
(R : in SDL.C_Pointers.Renderer_Pointer;
T : in SDL.C_Pointers.Texture_Pointer;
Src, Dest : in SDL.Video.Rectangles.Rectangle) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderCopy";
Result : constant C.int := SDL_Render_Copy (Self.Internal,
Get_Internal_Texture (Copy_From),
From,
To);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Copy;
procedure Copy
(Self : in out Renderer;
Copy_From : in SDL.Video.Textures.Texture;
To : in SDL.Video.Rectangles.Rectangle) is
function SDL_Render_Copy
(R : in SDL.C_Pointers.Renderer_Pointer;
T : in SDL.C_Pointers.Texture_Pointer;
Src : in SDL.Video.Rectangles.Rectangle_Access;
Dest : in SDL.Video.Rectangles.Rectangle) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderCopy";
Result : constant C.int := SDL_Render_Copy (Self.Internal,
Get_Internal_Texture (Copy_From),
null,
To);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Copy;
-- TODO: See above, rearrange the params so that the rectangles are the last elements and make
-- them default to null_rectangle.
procedure Copy
(Self : in out Renderer;
Copy_From : in SDL.Video.Textures.Texture;
From : in SDL.Video.Rectangles.Rectangle;
To : in SDL.Video.Rectangles.Rectangle;
Angle : in Long_Float;
Centre : in SDL.Video.Rectangles.Point;
Flip : in Renderer_Flip) is
function SDL_Render_Copy_Ex
(R : in SDL.C_Pointers.Renderer_Pointer;
T : in SDL.C_Pointers.Texture_Pointer;
Src, Dest : in SDL.Video.Rectangles.Rectangle;
A : in C.double;
Centre : in SDL.Video.Rectangles.Point;
F : in Internal_Flip) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderCopyEx";
Result : constant C.int := SDL_Render_Copy_Ex (Self.Internal,
Get_Internal_Texture (Copy_From),
From,
To,
C.double (Angle),
Centre,
Internal_Flips (Flip));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Copy;
procedure Draw (Self : in out Renderer; Line : in SDL.Video.Rectangles.Line_Segment) is
function SDL_Render_Draw_Line (R : in SDL.C_Pointers.Renderer_Pointer;
X1, Y1, X2, Y2 : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderDrawLine";
Result : constant C.int := SDL_Render_Draw_Line (Self.Internal,
Line.Start.X,
Line.Start.Y,
Line.Finish.X,
Line.Finish.Y);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Draw;
-- TODO: Check this works!
procedure Draw (Self : in out Renderer; Lines : in SDL.Video.Rectangles.Line_Arrays) is
-- As the records and arrays are defined as C types, an array of lines is also an array of points.
function SDL_Render_Draw_Lines (R : in SDL.C_Pointers.Renderer_Pointer;
P : in SDL.Video.Rectangles.Line_Arrays;
Count : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderDrawLines";
Result : constant C.int := SDL_Render_Draw_Lines (Self.Internal, Lines, C.int (Lines'Length * 2));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Draw;
procedure Draw (Self : in out Renderer; Point : in SDL.Video.Rectangles.Point) is
function SDL_Render_Draw_Point (R : in SDL.C_Pointers.Renderer_Pointer; X, Y : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderDrawPoint";
Result : constant C.int := SDL_Render_Draw_Point (Self.Internal, Point.X, Point.Y);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Draw;
procedure Draw (Self : in out Renderer; Points : in SDL.Video.Rectangles.Point_Arrays) is
function SDL_Render_Draw_Points (R : in SDL.C_Pointers.Renderer_Pointer;
P : in SDL.Video.Rectangles.Point_Arrays;
Count : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderDrawPoints";
Result : constant C.int := SDL_Render_Draw_Points (Self.Internal, Points, C.int (Points'Length));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Draw;
procedure Draw (Self : in out Renderer; Rectangle : in SDL.Video.Rectangles.Rectangle) is
function SDL_Render_Draw_Rect (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : in SDL.Video.Rectangles.Rectangle) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderDrawRect";
Result : constant C.int := SDL_Render_Draw_Rect (Self.Internal, Rectangle);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Draw;
procedure Draw (Self : in out Renderer; Rectangles : in SDL.Video.Rectangles.Rectangle_Arrays) is
function SDL_Render_Draw_Rects (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : in SDL.Video.Rectangles.Rectangle_Arrays;
Count : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderDrawRects";
Result : constant C.int := SDL_Render_Draw_Rects (Self.Internal, Rectangles, C.int (Rectangles'Length));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Draw;
procedure Fill (Self : in out Renderer; Rectangle : in SDL.Video.Rectangles.Rectangle) is
function SDL_Render_Fill_Rect (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : in SDL.Video.Rectangles.Rectangle) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderFillRect";
Result : constant C.int := SDL_Render_Fill_Rect (Self.Internal, Rectangle);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Fill;
procedure Fill (Self : in out Renderer; Rectangles : in SDL.Video.Rectangles.Rectangle_Arrays) is
function SDL_Render_Fill_Rects (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : in SDL.Video.Rectangles.Rectangle_Arrays;
Count : in C.int) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderFillRects";
Result : constant C.int := SDL_Render_Fill_Rects (Self.Internal, Rectangles, C.int (Rectangles'Length));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Fill;
procedure Get_Clip (Self : in Renderer; Rectangle : out SDL.Video.Rectangles.Rectangle) is
procedure SDL_Render_Get_Clip_Rect (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : out SDL.Video.Rectangles.Rectangle) with
Import => True,
Convention => C,
External_Name => "SDL_RenderGetClipRect";
begin
SDL_Render_Get_Clip_Rect (Self.Internal, Rectangle);
end Get_Clip;
procedure Set_Clip (Self : in out Renderer; Rectangle : in SDL.Video.Rectangles.Rectangle) is
function SDL_Render_Set_Clip_Rect (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : in SDL.Video.Rectangles.Rectangle) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderSetClipRect";
Result : constant C.int := SDL_Render_Set_Clip_Rect (Self.Internal, Rectangle);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Clip;
procedure Get_Logical_Size (Self : in Renderer; Size : out SDL.Sizes) is
procedure SDL_Render_Get_Logical_Size (R : in SDL.C_Pointers.Renderer_Pointer;
S : out SDL.Sizes) with
Import => True,
Convention => C,
External_Name => "SDL_RenderGetLogicalSize";
begin
SDL_Render_Get_Logical_Size (Self.Internal, Size);
end Get_Logical_Size;
procedure Set_Logical_Size (Self : in out Renderer; Size : in SDL.Sizes) is
function SDL_Render_Set_Logical_Size (R : in SDL.C_Pointers.Renderer_Pointer;
S : in SDL.Sizes) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderSetLogicalSize";
Result : constant C.int := SDL_Render_Set_Logical_Size (Self.Internal, Size);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Logical_Size;
procedure Get_Scale (Self : in Renderer; X, Y : out Float) is
procedure SDL_Render_Get_Scale (R : in SDL.C_Pointers.Renderer_Pointer; X, Y : out C.C_float) with
Import => True,
Convention => C,
External_Name => "SDL_RenderGetScale";
begin
SDL_Render_Get_Scale (Self.Internal, C.C_float (X), C.C_float (Y));
end Get_Scale;
procedure Set_Scale (Self : in out Renderer; X, Y : in Float) is
function SDL_Render_Set_Scale (R : in SDL.C_Pointers.Renderer_Pointer; X, Y : in C.C_float) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderSetScale";
Result : constant C.int := SDL_Render_Set_Scale (Self.Internal, C.C_float (X), C.C_float (Y));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Scale;
procedure Get_Viewport (Self : in Renderer; Rectangle : out SDL.Video.Rectangles.Rectangle) is
procedure SDL_Render_Get_Viewport (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : out SDL.Video.Rectangles.Rectangle) with
Import => True,
Convention => C,
External_Name => "SDL_RenderGetViewport";
begin
SDL_Render_Get_Viewport (Self.Internal, Rectangle);
end Get_Viewport;
procedure Set_Viewport (Self : in out Renderer; Rectangle : in SDL.Video.Rectangles.Rectangle) is
function SDL_Render_Set_Viewport (R : in SDL.C_Pointers.Renderer_Pointer;
Rect : in SDL.Video.Rectangles.Rectangle) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_RenderSetViewport";
Result : constant C.int := SDL_Render_Set_Viewport (Self.Internal, Rectangle);
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Viewport;
procedure Present (Self : in Renderer) is
procedure SDL_Render_Present (R : in SDL.C_Pointers.Renderer_Pointer) with
Import => True,
Convention => C,
External_Name => "SDL_RenderPresent";
begin
SDL_Render_Present (Self.Internal);
end Present;
function Supports_Targets (Self : in Renderer) return Boolean is
function SDL_Render_Target_Supported (R : in SDL.C_Pointers.Renderer_Pointer) return SDL_Bool with
Import => True,
Convention => C,
External_Name => "SDL_RenderTargetSupported";
begin
return (if SDL_Render_Target_Supported (Self.Internal) = SDL_True then True else False);
end Supports_Targets;
procedure Set_Target (Self : in out Renderer; Target : in SDL.Video.Textures.Texture) is
function SDL_Set_Render_Target (R : in SDL.C_Pointers.Renderer_Pointer;
T : in SDL.C_Pointers.Texture_Pointer) return C.int with
Import => True,
Convention => C,
External_Name => "SDL_SetRenderTarget";
Result : constant C.int := SDL_Set_Render_Target (Self.Internal, Get_Internal_Texture (Target));
begin
if Result /= Success then
raise Renderer_Error with SDL.Error.Get;
end if;
end Set_Target;
function Get_Renderer (Window : in SDL.Video.Windows.Window) return Renderer is
function SDL_Get_Renderer (W : in SDL.C_Pointers.Windows_Pointer) return SDL.C_Pointers.Renderer_Pointer with
Import => True,
Convention => C,
External_Name => "SDL_GetRenderer";
begin
return Result : constant Renderer :=
(Ada.Finalization.Limited_Controlled with
Internal => SDL_Get_Renderer (Get_Internal_Window (Window)), Owns => False) do
null;
end return;
end Get_Renderer;
function Get_Internal_Renderer (Self : in Renderer) return SDL.C_Pointers.Renderer_Pointer is
begin
return Self.Internal;
end Get_Internal_Renderer;
end SDL.Video.Renderers;
|
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . A _ O U T P U T --
-- --
-- S p e c --
-- --
-- $Revision: 15311 $
-- --
-- Copyright (c) 1995-2002, 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, 59 Temple Place --
-- - Suite 330, Boston, MA 02111-1307, 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 Ada Core Technologies Inc --
-- (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package contains the utility routines used for providing ASIS
-- warnings, debug images for ASIS types and internal debugging information.
with Asis; use Asis;
with Asis.Errors; use Asis.Errors;
with Types; use Types;
package A4G.A_Output is
Max_Debug_Buffer_Len : Natural := 8 * 1024;
Debug_Buffer : String (1 .. Max_Debug_Buffer_Len);
Debug_Buffer_Len : Natural range 0 .. Max_Debug_Buffer_Len;
-- buffer to form debug image strings
procedure Add (Phrase : String);
-- Adds Phrase to Debug_Buffer and resets Debug_Buffer_Len
procedure ASIS_Warning
(Message : String;
Error : Asis.Errors.Error_Kinds := Not_An_Error);
-- Produces a warning message (the text of the message is the string
-- passed as an actual for the Message parameter. The effect of calling
-- this procedure depends on which ASIS warning mode was set when ASIS was
-- initialized. In case of Suppress nothing happens, in case of Normal
-- Message is sent to Stderr, and in case of Treat_As_Error the warning
-- is converted into raising ASIS_Failed, Message is sent to ASIS diagnosis
-- and the value of the Error parameter is set to the ASIS Error Status
function Debug_String (CUnit : Compilation_Unit) return String;
-- Produces the string containing debug information about CUnit
function Debug_String (Cont : Context) return String;
-- Produces the string containing debug information about Cont
procedure Debug_String
(CUnit : Compilation_Unit;
No_Abort : Boolean := False);
-- Produces the string containing debug information about CUnit
-- Forms in Debug_Buffer the string containing debug information about
-- the argument unit. If No_Abort is set ON, then any exception raised
-- inside this procedure is suppressed and the message about suppressed
-- exception is added to the result string. This is needed to avoid
-- circularity during reporting of ASIS implementation bug.
procedure Debug_String
(E : Element;
No_Abort : Boolean := False);
-- Forms in Debug_Buffer the string containing debug information about E
-- If No_Abort is set ON, then any exception raised inside this procedure
-- is suppressed and the message about suppressed exception is added to
-- the result string. This is needed to avoid circularity during reporting
-- of ASIS implementation bug.
procedure Write_Node (N : Node_Id; Prefix : String := "");
-- outputs the tree node attributes without using any facilities
-- from the GNAT Treepr package. The string passed as an actual for
-- Prefix is outputted in the beginning of every string
end A4G.A_Output;
|
--
-- Many consider a "Utilities" package bad style and maybe it is true.
-- However, often you need some "odds and ends" stuff that is not
-- strictly related to the main code.
--
with Ada.Streams.Stream_IO;
use Ada;
package Utilities is
-- A generic function and a generic procedure to write "stuff" to
-- a stream. Maybe the usual stream functions would suffice.
generic
type Chunk_Type is private;
function Read_Chunk (From : Streams.Stream_IO.File_Type) return Chunk_Type;
generic
type Chunk_Type is private;
procedure Write_Chunk (To : Streams.Stream_IO.File_Type;
Item : Chunk_Type);
end Utilities;
|
with Deferred_Constant;
procedure Subprogram_Unit is
J : constant Integer := Deferred_Constant.I;
begin
null;
end Subprogram_Unit;
|
with Ada.Calendar; use Ada.Calendar;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Unchecked_Conversion;
with AWS.MIME;
with AWS.Messages;
with AWS.Utils; use AWS.Utils;
with Fractal;
package body Router_Cb is
procedure Init
is
begin
Float_Julia_Fractal.Init (Viewport => Viewport);
Fixed_Julia_Fractal.Init (Viewport => Viewport);
end Init;
procedure Color_Pixel (Z_Escape : Boolean;
Iter_Escape : Natural;
Px : out RGB888_Pixel)
is
Value : constant Integer := 765 * (Iter_Escape - 1) / Max_Iterations;
begin
if Z_Escape then
if Value > 510 then
Px := RGB888_Pixel'(Red => Color'Last - Frame_Counter,
Green => Color'Last,
Blue => Color (Value rem Integer (Color'Last)),
Alpha => Color'Last);
elsif Value > 255 then
Px := RGB888_Pixel'(Red => Color'Last - Frame_Counter,
Green => Color (Value rem Integer (Color'Last)),
Blue => Color'First + Frame_Counter,
Alpha => Color'Last);
else
Px := RGB888_Pixel'(Red => Color (Value rem Integer (Color'Last)),
Green => Color'First + Frame_Counter,
Blue => Color'First,
Alpha => Color'Last);
end if;
else
Px := RGB888_Pixel'(Red => Color'First + Frame_Counter,
Green => Color'First + Frame_Counter,
Blue => Color'First + Frame_Counter,
Alpha => Color'Last);
end if;
end Color_Pixel;
function Router (Request : AWS.Status.Data) return AWS.Response.Data
is
URI : constant String := AWS.Status.URI (Request);
Filename : constant String := "web/" & URI (2 .. URI'Last);
function Buffer_To_Stream is new
Ada.Unchecked_Conversion (Source => Buffer_Access,
Target => Stream_Element_Array_Access);
Data_Stream : constant Stream_Element_Array_Access :=
Buffer_To_Stream (RawData);
Buffer_Size : Stream_Element_Offset;
begin
-- Put_Line ("URI: " & URI);
-- Main server access point
if URI = "/" then
-- main page
return AWS.Response.File (AWS.MIME.Text_HTML, "web/html/index.html");
-- Requests a new image from the server with fixed point numbers
elsif URI = "/fixed_fractal" then
Buffer_Size := Stream_Element_Offset (Compute_Image (Comp_Type => Fixed_Type));
return AWS.Response.Build
(Content_Type => AWS.MIME.Application_Octet_Stream,
Message_Body => Data_Stream (Data_Stream'First ..
Data_Stream'First + Buffer_Size));
-- Requests a new image from the server with floating point numbers
elsif URI = "/float_fractal" then
Buffer_Size := Stream_Element_Offset (Compute_Image (Comp_Type => Float_Type));
return AWS.Response.Build
(Content_Type => AWS.MIME.Application_Octet_Stream,
Message_Body => Data_Stream (Data_Stream'First ..
Data_Stream'First + Buffer_Size));
-- Resets the viewport to the default view
elsif URI = "/reset" then
Reset_Viewport;
return AWS.Response.Build (AWS.MIME.Text_HTML, "reset");
-- Quits the application and kills the server
elsif URI = "/quit" then
Router_Cb.Server_Alive := False;
Put_Line ("quitting...");
return AWS.Response.Build (AWS.MIME.Text_HTML, "quitting...");
-- Requests last compute time
elsif URI = "/compute_time" then
return AWS.Response.Build
(AWS.MIME.Text_HTML, Duration'Image (Compute_Time));
-- Looking for window size information
elsif URI'Length > 8 and then
URI (URI'First .. URI'First + 7) = "/window|"
then
ImgSize_Parse (URI => URI (URI'First + 8 .. URI'Last));
return AWS.Response.Build (AWS.MIME.Text_HTML, "Success");
-- Serve basic files
elsif AWS.Utils.Is_Regular_File (Filename) then
return AWS.Response.File
(Content_Type => AWS.MIME.Content_Type (Filename),
Filename => Filename);
-- 404 not found
else
Put_Line ("Could not find file: " & Filename);
return AWS.Response.Acknowledge
(AWS.Messages.S404,
"<p>Page '" & URI & "' Not found.");
end if;
end Router;
procedure ImgSize_Parse (URI : String)
is
Width, Height, Zoom, MouseX, MouseY : Natural;
Seps : array (Natural range 1 .. 4) of Integer :=
(others => (-1));
Sep_Counter : Natural := Seps'First;
Invalid_Get : exception;
begin
-- Put_Line ("RawStr: " & URI);
-- find position of all separators
for I in URI'Range loop
if URI (I) = '|' then
Seps (Sep_Counter) := I;
if Sep_Counter = Seps'Last then
exit;
end if;
Sep_Counter := Sep_Counter + 1;
end if;
end loop;
if Sep_Counter /= Seps'Last then
raise Invalid_Get;
end if;
Width := Natural'Value (URI (URI'First .. Seps (1) - 1));
Height := Natural'Value (URI (Seps (1) + 1 .. Seps (2) - 1));
Zoom := Natural'Value (URI (Seps (2) + 1 .. Seps (3) - 1));
MouseX := Natural'Value (URI (Seps (3) + 1 .. Seps (4) - 1));
MouseY := Natural'Value (URI (Seps (4) + 1 .. URI'Last));
if Width >= 0 then
if Width > ImgWidth'Last then
Width := ImgWidth'Last;
end if;
Viewport.Width := Width;
end if;
if Height >= 0 then
if Height > ImgHeight'Last then
Height := ImgHeight'Last;
end if;
Viewport.Height := Height;
end if;
if Zoom /= 0 then
Zoom := Viewport.Zoom + Zoom;
if Zoom > ImgZoom'Last then
Zoom := ImgZoom'Last;
elsif Zoom < ImgZoom'First then
Zoom := ImgZoom'First;
end if;
Viewport.Zoom := Zoom;
end if;
if MouseX >= 0 then
if MouseX > ImgWidth'Last then
MouseX := ImgWidth'Last;
elsif MouseX < ImgWidth'First then
MouseX := ImgWidth'First;
end if;
Viewport.Center.X := MouseX;
end if;
if MouseY >= 0 then
if MouseY > ImgHeight'Last then
MouseY := ImgHeight'Last;
elsif MouseY < ImgHeight'First then
MouseY := ImgHeight'First;
end if;
Viewport.Center.Y := MouseY;
end if;
Put_Line ("Float");
Float_Julia_Fractal.Set_Size (Viewport => Viewport);
Put_Line ("Fixed");
Fixed_Julia_Fractal.Set_Size (Viewport => Viewport);
Put_Line ("Width:" & Viewport.Width'Img &
" Height:" & Viewport.Height'Img &
" Zoom:" & Viewport.Zoom'Img &
" MouseX:" & Viewport.Center.X'Img &
" MouseY:" & Viewport.Center.Y'Img);
end ImgSize_Parse;
procedure Increment_Frame
is
begin
if Cnt_Up then
if Frame_Counter = Color'Last then
Cnt_Up := not Cnt_Up;
return;
else
Frame_Counter := Frame_Counter + 5;
return;
end if;
end if;
if Frame_Counter = Color'First then
Cnt_Up := not Cnt_Up;
return;
end if;
Frame_Counter := Frame_Counter - 5;
end Increment_Frame;
function Compute_Image (Comp_Type : Computation_Enum)
return Buffer_Offset
is
Start_Time : constant Time := Clock;
Ret : Buffer_Offset;
begin
case Comp_Type is
when Fixed_Type =>
Increment_Frame;
Fixed_Julia_Fractal.Calculate_Image
(Buffer => RawData);
Ret := Fixed_Julia_Fractal.Get_Buffer_Size;
when Float_Type =>
Increment_Frame;
Float_Julia_Fractal.Calculate_Image
(Buffer => RawData);
Ret := Float_Julia_Fractal.Get_Buffer_Size;
end case;
Compute_Time := (Clock - Start_Time) * 1000.0;
-- Put_Line ("Time:" & Duration'Image (Compute_Time) & " ms");
return Ret;
end Compute_Image;
procedure Reset_Viewport
is
begin
Viewport.Zoom := 10;
Viewport.Center.X := Viewport.Width / 2;
Viewport.Center.Y := Viewport.Height / 2;
Float_Julia_Fractal.Set_Size (Viewport => Viewport);
Fixed_Julia_Fractal.Set_Size (Viewport => Viewport);
Put_Line ("Width:" & Viewport.Width'Img &
" Height:" & Viewport.Height'Img &
" Zoom:" & Viewport.Zoom'Img &
" MouseX:" & Viewport.Center.X'Img &
" MouseY:" & Viewport.Center.Y'Img);
end Reset_Viewport;
end Router_Cb;
|
with
eGL.Pointers,
eGL.NativeDisplayType,
Interfaces.C.Strings,
System;
package eGL.Binding
is
function eglGetError return eGL.EGLint;
function eglGetDisplay
(display_id : in eGL.NativeDisplayType.Item) return eGL.EGLDisplay;
function eglInitialize
(dpy : in eGL.EGLDisplay;
major : in eGL.Pointers.EGLint_Pointer;
minor : in eGL.Pointers.EGLint_Pointer) return eGL.EGLBoolean;
function eglTerminate (dpy : in eGL.EGLDisplay) return eGL.EGLBoolean;
function eglQueryString
(dpy : in eGL.EGLDisplay;
name : in eGL.EGLint) return Interfaces.C.Strings.chars_ptr;
function eglGetConfigs
(dpy : in eGL.EGLDisplay;
configs : in eGL.Pointers.EGLConfig_Pointer;
config_size : in eGL.EGLint;
num_config : in eGL.Pointers.EGLint_Pointer) return eGL.EGLBoolean;
function eglChooseConfig
(dpy : in eGL.EGLDisplay;
attrib_list : in eGL.Pointers.EGLint_Pointer;
configs : in eGL.Pointers.EGLConfig_Pointer;
config_size : in eGL.EGLint;
num_config : in eGL.Pointers.EGLint_Pointer) return eGL.EGLBoolean;
function eglGetConfigAttrib
(dpy : in eGL.EGLDisplay;
config : in eGL.EGLConfig;
attribute : in eGL.EGLint;
value : in eGL.Pointers.EGLint_Pointer) return eGL.EGLBoolean;
function eglCreateWindowSurface
(dpy : in eGL.EGLDisplay;
config : in eGL.EGLConfig;
win : in eGL.NativeWindowType;
attrib_list : in eGL.Pointers.EGLint_Pointer) return eGL.EGLSurface;
function eglCreatePbufferSurface
(dpy : in eGL.EGLDisplay;
config : in eGL.EGLConfig;
attrib_list : in eGL.Pointers.EGLint_Pointer) return eGL.EGLSurface;
function eglCreatePixmapSurface
(dpy : in eGL.EGLDisplay;
config : in eGL.EGLConfig;
pixmap : in eGL.NativePixmapType;
attrib_list : in eGL.Pointers.EGLint_Pointer) return eGL.EGLSurface;
function eglDestroySurface
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface) return eGL.EGLBoolean;
function eglQuerySurface
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface;
attribute : in eGL.EGLint;
value : in eGL.Pointers.EGLint_Pointer) return eGL.EGLBoolean;
function eglBindAPI (api : in eGL.EGLenum) return eGL.EGLBoolean;
function eglQueryAPI return eGL.EGLenum;
function eglWaitClient return eGL.EGLBoolean;
function eglReleaseThread return eGL.EGLBoolean;
function eglCreatePbufferFromClientBuffer
(dpy : in eGL.EGLDisplay;
buftype : in eGL.EGLenum;
buffer : in eGL.EGLClientBuffer;
config : in eGL.EGLConfig;
attrib_list : in eGL.Pointers.EGLint_Pointer) return eGL.EGLSurface;
function eglSurfaceAttrib
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface;
attribute : in eGL.EGLint;
value : in eGL.EGLint) return eGL.EGLBoolean;
function eglBindTexImage
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface;
buffer : in eGL.EGLint) return eGL.EGLBoolean;
function eglReleaseTexImage
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface;
buffer : in eGL.EGLint) return eGL.EGLBoolean;
function eglSwapInterval
(dpy : in eGL.EGLDisplay;
interval : in eGL.EGLint)
return eGL.EGLBoolean;
function eglCreateContext
(dpy : in eGL.EGLDisplay;
config : in eGL.EGLConfig;
share_context : in eGL.EGLContext;
attrib_list : in eGL.Pointers.EGLint_Pointer) return eGL.EGLContext;
function eglDestroyContext
(dpy : in eGL.EGLDisplay;
ctx : in eGL.EGLContext) return eGL.EGLBoolean;
function eglMakeCurrent
(dpy : in eGL.EGLDisplay;
draw : in eGL.EGLSurface;
read : in eGL.EGLSurface;
ctx : in eGL.EGLContext) return eGL.EGLBoolean;
function eglGetCurrentContext return eGL.EGLContext;
function eglGetCurrentSurface
(readdraw : in eGL.EGLint) return eGL.EGLSurface;
function eglGetCurrentDisplay return eGL.EGLDisplay;
function eglQueryContext
(dpy : in eGL.EGLDisplay;
ctx : in eGL.EGLContext;
attribute : in eGL.EGLint;
value : in eGL.Pointers.EGLint_Pointer) return eGL.EGLBoolean;
function eglWaitGL return eGL.EGLBoolean;
function eglWaitNative (engine : in eGL.EGLint) return eGL.EGLBoolean;
function eglSwapBuffers
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface) return eGL.EGLBoolean;
function eglCopyBuffers
(dpy : in eGL.EGLDisplay;
surface : in eGL.EGLSurface;
target : in eGL.NativePixmapType) return eGL.EGLBoolean;
function eglGetProcAddress
(procname : in Interfaces.C.Strings.chars_ptr) return void_ptr;
-- Out-of-band handle values.
--
egl_DEFAULT_DISPLAY : constant access eGL.Display;
egl_NO_CONTEXT : constant eGL.EGLContext;
egl_NO_DISPLAY : constant eGL.EGLDisplay;
egl_NO_SURFACE : constant eGL.EGLSurface;
-- Out-of-band attribute value.
--
egl_DONT_CARE : constant eGL.EGLint;
private
use System;
egl_DEFAULT_DISPLAY : constant access eGL.Display := null;
egl_NO_CONTEXT : constant eGL.EGLContext := null_Address;
egl_NO_DISPLAY : constant eGL.EGLDisplay := null_Address;
egl_NO_SURFACE : constant eGL.EGLSurface := null_Address;
egl_DONT_CARE : constant eGL.EGLint := -1;
pragma Import (C, eglGetError, "eglGetError");
pragma Import (C, eglGetDisplay, "eglGetDisplay");
pragma Import (C, eglInitialize, "eglInitialize");
pragma Import (C, eglTerminate, "eglTerminate");
pragma Import (C, eglQueryString, "eglQueryString");
pragma Import (C, eglGetConfigs, "eglGetConfigs");
pragma Import (C, eglChooseConfig, "eglChooseConfig");
pragma Import (C, eglGetConfigAttrib, "eglGetConfigAttrib");
pragma Import (C, eglCreateWindowSurface, "eglCreateWindowSurface");
pragma Import (C, eglCreatePbufferSurface, "eglCreatePbufferSurface");
pragma Import (C, eglCreatePixmapSurface, "eglCreatePixmapSurface");
pragma Import (C, eglDestroySurface, "eglDestroySurface");
pragma Import (C, eglQuerySurface, "eglQuerySurface");
pragma Import (C, eglBindAPI, "eglBindAPI");
pragma Import (C, eglQueryAPI, "eglQueryAPI");
pragma Import (C, eglWaitClient, "eglWaitClient");
pragma Import (C, eglReleaseThread, "eglReleaseThread");
pragma Import (C, eglCreatePbufferFromClientBuffer,
"eglCreatePbufferFromClientBuffer");
pragma Import (C, eglSurfaceAttrib, "eglSurfaceAttrib");
pragma Import (C, eglBindTexImage, "eglBindTexImage");
pragma Import (C, eglReleaseTexImage, "eglReleaseTexImage");
pragma Import (C, eglSwapInterval, "eglSwapInterval");
pragma Import (C, eglCreateContext, "eglCreateContext");
pragma Import (C, eglDestroyContext, "eglDestroyContext");
pragma Import (C, eglMakeCurrent, "eglMakeCurrent");
pragma Import (C, eglGetCurrentContext, "eglGetCurrentContext");
pragma Import (C, eglGetCurrentSurface, "eglGetCurrentSurface");
pragma Import (C, eglGetCurrentDisplay, "eglGetCurrentDisplay");
pragma Import (C, eglQueryContext, "eglQueryContext");
pragma Import (C, eglWaitGL, "eglWaitGL");
pragma Import (C, eglWaitNative, "eglWaitNative");
pragma Import (C, eglSwapBuffers, "eglSwapBuffers");
pragma Import (C, eglCopyBuffers, "eglCopyBuffers");
pragma Import (C, eglGetProcAddress, "eglGetProcAddress");
end eGL.Binding;
|
------------------------------------------------------------------------------
-- randoms.adb
--
-- Body for the simple random number generation package. The implementation
-- uses a single private random number generator for floats; this generator is
-- called to obtain both integers and floats by using appropriate scaling.
------------------------------------------------------------------------------
with Ada.Numerics.Float_Random;
use Ada.Numerics.Float_Random;
package body Randoms is
G: Generator;
procedure Reset is
begin
Reset (G);
end Reset;
procedure Reset (Seed: Integer) is
begin
Reset (G, Seed);
end Reset;
-- To generate a random float in X .. Y inclusive we first use the built-in
-- generator to get a value R in 0.0 .. 1.0. Mapping R into the range
-- X .. Y is done essentially by computing X+R*(Y-X), however the compu-
-- tation Y-X may overflow for very large Y and very small X. So we
-- distribute the multiplication, and order terms in such a way as to
-- avoid overflow.
function Random (X, Y: Float) return Float is
R: Float := Random(G);
begin
return X - X*R + Y*R;
end Random;
-- Obtaining a random integer in a given range is a little tricky. We
-- start by obtaining a random float R such that 0.0 <= R < 1.0.
-- We essentially partition the range [0.0, 1.0> into Y-X+1 equal
-- subranges so that each subrange corresponds to an integer in X..Y
-- inclusive. To map the random float into the right integer we compute
-- Floor(X+R*(Y-X+1)). Note the importance of the open upper bound!
-- Of course we have to guard against overflow and maximize precision
-- of the floating point computations by ordering the terms in a nice
-- manner.
function Random (X, Y: Integer) return Integer is
R: Float := Random(G);
begin
while R = 1.0 loop
R := Random(G);
end loop;
return Integer(Float'Floor(Float(X) - Float(X)*R + Float(Y)*R + R));
end Random;
-- Random values in a discrete range are easy to generate; we just get a
-- random integer and convert the type.
function Random_Discrete return Element is
Min: Integer := Element'Pos(Element'First);
Max: Integer := Element'Pos(Element'Last);
begin
return Element'Val(Random(Min, Max));
end Random_Discrete;
begin
Reset (G);
end Randoms;
|
-----------------------------------------------------------------------
-- net-protos-Ipv4 -- IPv4 Network protocol
-- Copyright (C) 2016, 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Net.Protos.Arp;
package body Net.Protos.IPv4 is
use type Net.Protos.Arp.Arp_Status;
Packet_Id : Uint16 := 1;
-- ------------------------------
-- Send the raw IPv4 packet to the interface. The destination Ethernet address is
-- resolved from the ARP table and the packet Ethernet header updated. The packet
-- is send immediately when the destination Ethernet address is known, otherwise
-- it is queued and sent when the ARP resolution is successful.
-- ------------------------------
procedure Send_Raw (Ifnet : in out Net.Interfaces.Ifnet_Type'Class;
Target_Ip : in Ip_Addr;
Packet : in out Net.Buffers.Buffer_Type;
Status : out Error_Code) is
Ether : constant Net.Headers.Ether_Header_Access := Packet.Ethernet;
Arp_Status : Net.Protos.Arp.Arp_Status;
begin
Ether.Ether_Shost := Ifnet.Mac;
Ether.Ether_Type := Net.Headers.To_Network (Net.Protos.ETHERTYPE_IP);
if Ifnet.Is_Local_Network (Target_Ip) then
Net.Protos.Arp.Resolve (Ifnet, Target_Ip, Ether.Ether_Dhost, Packet, Arp_Status);
elsif Ifnet.Gateway /= (0, 0, 0, 0) then
Net.Protos.Arp.Resolve (Ifnet, Ifnet.Gateway, Ether.Ether_Dhost, Packet, Arp_Status);
else
Arp_Status := Net.Protos.Arp.ARP_UNREACHABLE;
end if;
case Arp_Status is
when Net.Protos.Arp.ARP_FOUND =>
Ifnet.Send (Packet);
Status := EOK;
when Net.Protos.Arp.ARP_PENDING | Net.Protos.Arp.ARP_NEEDED =>
Status := EINPROGRESS;
when Net.Protos.Arp.ARP_UNREACHABLE | Net.Protos.Arp.ARP_QUEUE_FULL =>
Net.Buffers.Release (Packet);
Status := ENETUNREACH;
end case;
end Send_Raw;
-- ------------------------------
-- Make an IP packet identifier.
-- ------------------------------
procedure Make_Ident (Ip : in Net.Headers.IP_Header_Access) is
begin
Ip.Ip_Id := Net.Headers.To_Network (Packet_Id);
Packet_Id := Packet_Id + 1;
end Make_Ident;
-- ------------------------------
-- Make the IPv4 header for the source and destination IP addresses and protocol.
-- ------------------------------
procedure Make_Header (Ip : in Net.Headers.IP_Header_Access;
Src : in Ip_Addr;
Dst : in Ip_Addr;
Proto : in Uint8;
Length : in Uint16) is
begin
Ip.Ip_Ihl := 16#45#;
Ip.Ip_Tos := 0;
Ip.Ip_Off := Net.Headers.To_Network (16#4000#);
Ip.Ip_Ttl := 64;
Ip.Ip_Sum := 0;
Ip.Ip_Src := Src;
Ip.Ip_Dst := Dst;
Ip.Ip_P := Proto;
Ip.Ip_Len := Net.Headers.To_Network (Length);
Make_Ident (Ip);
end Make_Header;
procedure Send (Ifnet : in out Net.Interfaces.Ifnet_Type'Class;
Target_Ip : in Ip_Addr;
Packet : in out Net.Buffers.Buffer_Type;
Status : out Error_Code) is
Ip : constant Net.Headers.IP_Header_Access := Packet.IP;
begin
Make_Header (Ip, Ifnet.Ip, Target_Ip, P_UDP, Packet.Get_Length);
Ip.Ip_Ihl := 4;
Ip.Ip_Tos := 0;
Ip.Ip_Id := 2;
Ip.Ip_Off := 0;
Ip.Ip_Ttl := 255;
Ip.Ip_Sum := 0;
Ip.Ip_Src := Ifnet.Ip;
Ip.Ip_Dst := Target_Ip;
Ip.Ip_P := 4;
-- Ip.Ip_Len := Net.Headers.To_Network (Packet.Get_Length);
-- if Ifnet.Is_Local_Address (Target_Ip) then
Send_Raw (Ifnet, Target_Ip, Packet, Status);
end Send;
end Net.Protos.IPv4;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Element_Vectors;
with Program.Elements.Clauses;
with Program.Elements.Identifiers;
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Simple_Expression_Ranges;
package Program.Elements.Component_Clauses is
pragma Pure (Program.Elements.Component_Clauses);
type Component_Clause is
limited interface and Program.Elements.Clauses.Clause;
type Component_Clause_Access is access all Component_Clause'Class
with Storage_Size => 0;
not overriding function Clause_Name
(Self : Component_Clause)
return not null Program.Elements.Identifiers.Identifier_Access
is abstract;
not overriding function Position
(Self : Component_Clause)
return not null Program.Elements.Expressions.Expression_Access
is abstract;
not overriding function Clause_Range
(Self : Component_Clause)
return not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access is abstract;
type Component_Clause_Text is limited interface;
type Component_Clause_Text_Access is access all Component_Clause_Text'Class
with Storage_Size => 0;
not overriding function To_Component_Clause_Text
(Self : aliased in out Component_Clause)
return Component_Clause_Text_Access is abstract;
not overriding function At_Token
(Self : Component_Clause_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Range_Token
(Self : Component_Clause_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Semicolon_Token
(Self : Component_Clause_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
type Component_Clause_Vector is
limited interface and Program.Element_Vectors.Element_Vector;
type Component_Clause_Vector_Access is
access all Component_Clause_Vector'Class with Storage_Size => 0;
overriding function Element
(Self : Component_Clause_Vector;
Index : Positive)
return not null Program.Elements.Element_Access is abstract
with Post'Class => Element'Result.Is_Component_Clause;
function To_Component_Clause
(Self : Component_Clause_Vector'Class;
Index : Positive)
return not null Component_Clause_Access
is (Self.Element (Index).To_Component_Clause);
end Program.Elements.Component_Clauses;
|
-- Copyright © by Jeff Foley 2021-2022. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
-- SPDX-License-Identifier: Apache-2.0
local json = require("json")
name = "CommonCrawl"
type = "crawl"
local urls = {}
function start()
set_rate_limit(7)
end
function vertical(ctx, domain)
if (urls == nil or #urls == 0) then
get_urls(ctx)
end
for _, url in pairs(urls) do
scrape(ctx, {['url']=url .. domain})
end
end
function get_urls(ctx)
local u = "https://index.commoncrawl.org"
local resp, err = request(ctx, {['url']=u})
if (err ~= nil and err ~= "") then
log(ctx, "get_urls request to service failed: " .. err)
return
end
local matches = find(resp, 'CC-MAIN[0-9-]*-index')
if (matches == nil or #matches == 0) then
log(ctx, "get_urls failed to extract endpoints")
return
end
for _, endpoint in pairs(matches) do
table.insert(urls, u .. "/" .. endpoint .. "?output=json&fl=url&url=*.")
end
end
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ D I S T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Casing; use Casing;
with Einfo; use Einfo;
with Errout; use Errout;
with Exp_Dist; use Exp_Dist;
with Exp_Tss; use Exp_Tss;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Namet; use Namet;
with Opt; use Opt;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Disp; use Sem_Disp;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Stand; use Stand;
with Stringt; use Stringt;
with Tbuild; use Tbuild;
with Uintp; use Uintp;
package body Sem_Dist is
-----------------------
-- Local Subprograms --
-----------------------
procedure RAS_E_Dereference (Pref : Node_Id);
-- Handles explicit dereference of Remote Access to Subprograms
function Full_Qualified_Name (E : Entity_Id) return String_Id;
-- returns the full qualified name of the entity in lower case
-------------------------
-- Add_Stub_Constructs --
-------------------------
procedure Add_Stub_Constructs (N : Node_Id) is
U : constant Node_Id := Unit (N);
Spec : Entity_Id := Empty;
Exp : Node_Id := U;
-- Unit that will be expanded
begin
pragma Assert (Distribution_Stub_Mode /= No_Stubs);
if Nkind (U) = N_Package_Declaration then
Spec := Defining_Entity (Specification (U));
elsif Nkind (U) = N_Package_Body then
Spec := Corresponding_Spec (U);
else pragma Assert (Nkind (U) = N_Package_Instantiation);
Exp := Instance_Spec (U);
Spec := Defining_Entity (Specification (Exp));
end if;
pragma Assert (Is_Shared_Passive (Spec)
or else Is_Remote_Call_Interface (Spec));
if Distribution_Stub_Mode = Generate_Caller_Stub_Body then
if Is_Shared_Passive (Spec) then
null;
elsif Nkind (U) = N_Package_Body then
Error_Msg_N
("Specification file expected from command line", U);
else
Expand_Calling_Stubs_Bodies (Exp);
end if;
else
if Is_Shared_Passive (Spec) then
Build_Passive_Partition_Stub (Exp);
else
Expand_Receiving_Stubs_Bodies (Exp);
end if;
end if;
end Add_Stub_Constructs;
---------------------------------------
-- Build_RAS_Primitive_Specification --
---------------------------------------
function Build_RAS_Primitive_Specification
(Subp_Spec : Node_Id;
Remote_Object_Type : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (Subp_Spec);
Primitive_Spec : constant Node_Id :=
Copy_Specification (Loc,
Spec => Subp_Spec,
New_Name => Name_uCall);
Subtype_Mark_For_Self : Node_Id;
begin
if No (Parameter_Specifications (Primitive_Spec)) then
Set_Parameter_Specifications (Primitive_Spec, New_List);
end if;
if Nkind (Remote_Object_Type) in N_Entity then
Subtype_Mark_For_Self :=
New_Occurrence_Of (Remote_Object_Type, Loc);
else
Subtype_Mark_For_Self := Remote_Object_Type;
end if;
Prepend_To (
Parameter_Specifications (Primitive_Spec),
Make_Parameter_Specification (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_uS),
Parameter_Type =>
Make_Access_Definition (Loc,
Subtype_Mark =>
Subtype_Mark_For_Self)));
-- Trick later semantic analysis into considering this operation as a
-- primitive (dispatching) operation of tagged type Obj_Type.
Set_Comes_From_Source (
Defining_Unit_Name (Primitive_Spec), True);
return Primitive_Spec;
end Build_RAS_Primitive_Specification;
-------------------------
-- Full_Qualified_Name --
-------------------------
function Full_Qualified_Name (E : Entity_Id) return String_Id is
Ent : Entity_Id := E;
Parent_Name : String_Id := No_String;
begin
-- Deals properly with child units
if Nkind (Ent) = N_Defining_Program_Unit_Name then
Ent := Defining_Identifier (Ent);
end if;
-- Compute recursively the qualification (only "Standard" has no scope)
if Present (Scope (Scope (Ent))) then
Parent_Name := Full_Qualified_Name (Scope (Ent));
end if;
-- Every entity should have a name except some expanded blocks. Do not
-- bother about those.
if Chars (Ent) = No_Name then
return Parent_Name;
end if;
-- Add a period between Name and qualification
if Parent_Name /= No_String then
Start_String (Parent_Name);
Store_String_Char (Get_Char_Code ('.'));
else
Start_String;
end if;
-- Generates the entity name in upper case
Get_Name_String (Chars (Ent));
Set_Casing (All_Lower_Case);
Store_String_Chars (Name_Buffer (1 .. Name_Len));
return End_String;
end Full_Qualified_Name;
------------------
-- Get_PCS_Name --
------------------
function Get_PCS_Name return PCS_Names is
begin
return
Chars (Entity (Expression (Parent (RTE (RE_DSA_Implementation)))));
end Get_PCS_Name;
---------------------
-- Get_PCS_Version --
---------------------
function Get_PCS_Version return Int is
PCS_Version_Entity : Entity_Id;
PCS_Version : Int;
begin
if RTE_Available (RE_PCS_Version) then
PCS_Version_Entity := RTE (RE_PCS_Version);
pragma Assert (Ekind (PCS_Version_Entity) = E_Named_Integer);
PCS_Version :=
UI_To_Int (Expr_Value (Constant_Value (PCS_Version_Entity)));
else
-- Case of System.Partition_Interface.PCS_Version not found:
-- return a null version.
PCS_Version := 0;
end if;
return PCS_Version;
end Get_PCS_Version;
------------------------
-- Is_All_Remote_Call --
------------------------
function Is_All_Remote_Call (N : Node_Id) return Boolean is
Par : Node_Id;
begin
if Nkind (N) in N_Subprogram_Call
and then Nkind (Name (N)) in N_Has_Entity
and then Is_Remote_Call_Interface (Entity (Name (N)))
and then Has_All_Calls_Remote (Scope (Entity (Name (N))))
and then Comes_From_Source (N)
then
Par := Parent (Entity (Name (N)));
while Present (Par)
and then (Nkind (Par) /= N_Package_Specification
or else Is_Wrapper_Package (Defining_Entity (Par)))
loop
Par := Parent (Par);
end loop;
if Present (Par) then
return
not Scope_Within_Or_Same (Current_Scope, Defining_Entity (Par));
else
return False;
end if;
else
return False;
end if;
end Is_All_Remote_Call;
---------------------------------
-- Is_RACW_Stub_Type_Operation --
---------------------------------
function Is_RACW_Stub_Type_Operation (Op : Entity_Id) return Boolean is
Typ : Entity_Id;
begin
case Ekind (Op) is
when E_Function
| E_Procedure
=>
Typ := Find_Dispatching_Type (Op);
return
Present (Typ)
and then Is_RACW_Stub_Type (Typ)
and then not Is_Internal (Op);
when others =>
return False;
end case;
end Is_RACW_Stub_Type_Operation;
---------------------------------
-- Is_Valid_Remote_Object_Type --
---------------------------------
function Is_Valid_Remote_Object_Type (E : Entity_Id) return Boolean is
P : constant Node_Id := Parent (E);
begin
pragma Assert (Is_Tagged_Type (E));
-- Simple case: a limited private type
if Nkind (P) = N_Private_Type_Declaration
and then Is_Limited_Record (E)
then
return True;
-- AI05-0060 (Binding Interpretation): A limited interface is a legal
-- ancestor for the designated type of an RACW type.
elsif Is_Limited_Record (E) and then Is_Limited_Interface (E) then
return True;
-- A generic tagged limited type is a valid candidate. Limitedness will
-- be checked again on the actual at instantiation point.
elsif Nkind (P) = N_Formal_Type_Declaration
and then Ekind (E) = E_Record_Type_With_Private
and then Is_Generic_Type (E)
and then Is_Limited_Record (E)
then
return True;
-- A private extension declaration is a valid candidate if its parent
-- type is.
elsif Nkind (P) = N_Private_Extension_Declaration then
return Is_Valid_Remote_Object_Type (Etype (E));
else
return False;
end if;
end Is_Valid_Remote_Object_Type;
------------------------------------
-- Package_Specification_Of_Scope --
------------------------------------
function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id is
N : Node_Id;
begin
N := Parent (E);
while Nkind (N) /= N_Package_Specification loop
N := Parent (N);
end loop;
return N;
end Package_Specification_Of_Scope;
--------------------------
-- Process_Partition_ID --
--------------------------
procedure Process_Partition_Id (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Ety : Entity_Id;
Get_Pt_Id : Node_Id;
Get_Pt_Id_Call : Node_Id;
Prefix_String : String_Id;
Typ : constant Entity_Id := Etype (N);
begin
-- In case prefix is not a library unit entity, get the entity
-- of library unit.
Ety := Entity (Prefix (N));
while (Present (Scope (Ety))
and then Scope (Ety) /= Standard_Standard)
and not Is_Child_Unit (Ety)
loop
Ety := Scope (Ety);
end loop;
-- Retrieve the proper function to call
if Is_Remote_Call_Interface (Ety) then
Get_Pt_Id := New_Occurrence_Of
(RTE (RE_Get_Active_Partition_Id), Loc);
elsif Is_Shared_Passive (Ety) then
Get_Pt_Id := New_Occurrence_Of
(RTE (RE_Get_Passive_Partition_Id), Loc);
else
Get_Pt_Id := New_Occurrence_Of
(RTE (RE_Get_Local_Partition_Id), Loc);
end if;
-- Get and store the String_Id corresponding to the name of the
-- library unit whose Partition_Id is needed.
Get_Library_Unit_Name_String (Unit_Declaration_Node (Ety));
Prefix_String := String_From_Name_Buffer;
-- Build the function call which will replace the attribute
if Is_Remote_Call_Interface (Ety) or else Is_Shared_Passive (Ety) then
Get_Pt_Id_Call :=
Make_Function_Call (Loc,
Name => Get_Pt_Id,
Parameter_Associations =>
New_List (Make_String_Literal (Loc, Prefix_String)));
else
Get_Pt_Id_Call := Make_Function_Call (Loc, Get_Pt_Id);
end if;
-- Replace the attribute node by a conversion of the function call
-- to the target type.
Rewrite (N, Convert_To (Typ, Get_Pt_Id_Call));
Analyze_And_Resolve (N, Typ);
end Process_Partition_Id;
----------------------------------
-- Process_Remote_AST_Attribute --
----------------------------------
procedure Process_Remote_AST_Attribute
(N : Node_Id;
New_Type : Entity_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Remote_Subp : Entity_Id;
Tick_Access_Conv_Call : Node_Id;
Remote_Subp_Decl : Node_Id;
RS_Pkg_Specif : Node_Id;
RS_Pkg_E : Entity_Id;
RAS_Type : Entity_Id := New_Type;
Async_E : Entity_Id;
All_Calls_Remote_E : Entity_Id;
Attribute_Subp : Entity_Id;
begin
-- Check if we have to expand the access attribute
Remote_Subp := Entity (Prefix (N));
if not Expander_Active or else Get_PCS_Name = Name_No_DSA then
return;
end if;
if Ekind (RAS_Type) /= E_Record_Type then
RAS_Type := Equivalent_Type (RAS_Type);
end if;
Attribute_Subp := TSS (RAS_Type, TSS_RAS_Access);
pragma Assert (Present (Attribute_Subp));
Remote_Subp_Decl := Unit_Declaration_Node (Remote_Subp);
if Nkind (Remote_Subp_Decl) = N_Subprogram_Body then
Remote_Subp := Corresponding_Spec (Remote_Subp_Decl);
Remote_Subp_Decl := Unit_Declaration_Node (Remote_Subp);
end if;
RS_Pkg_Specif := Parent (Remote_Subp_Decl);
RS_Pkg_E := Defining_Entity (RS_Pkg_Specif);
Async_E :=
Boolean_Literals (Ekind (Remote_Subp) = E_Procedure
and then Is_Asynchronous (Remote_Subp));
All_Calls_Remote_E :=
Boolean_Literals (Has_All_Calls_Remote (RS_Pkg_E));
Tick_Access_Conv_Call :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Attribute_Subp, Loc),
Parameter_Associations =>
New_List (
Make_String_Literal (Loc,
Strval => Full_Qualified_Name (RS_Pkg_E)),
Build_Subprogram_Id (Loc, Remote_Subp),
New_Occurrence_Of (Async_E, Loc),
New_Occurrence_Of (All_Calls_Remote_E, Loc)));
Rewrite (N, Tick_Access_Conv_Call);
Analyze_And_Resolve (N, RAS_Type);
end Process_Remote_AST_Attribute;
------------------------------------
-- Process_Remote_AST_Declaration --
------------------------------------
procedure Process_Remote_AST_Declaration (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
User_Type : constant Node_Id := Defining_Identifier (N);
Scop : constant Entity_Id := Scope (User_Type);
Is_RCI : constant Boolean := Is_Remote_Call_Interface (Scop);
Is_RT : constant Boolean := Is_Remote_Types (Scop);
Type_Def : constant Node_Id := Type_Definition (N);
Parameter : Node_Id;
Is_Degenerate : Boolean;
-- True iff this RAS has an access formal parameter (see
-- Exp_Dist.Add_RAS_Dereference_TSS for details).
Subpkg : constant Entity_Id := Make_Temporary (Loc, 'S');
Subpkg_Decl : Node_Id;
Subpkg_Body : Node_Id;
Vis_Decls : constant List_Id := New_List;
Priv_Decls : constant List_Id := New_List;
Obj_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc,
New_External_Name (Chars (User_Type), 'R'));
Full_Obj_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc, Chars (Obj_Type));
RACW_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc,
New_External_Name (Chars (User_Type), 'P'));
Fat_Type : constant Entity_Id :=
Make_Defining_Identifier (Loc, Chars (User_Type));
Fat_Type_Decl : Node_Id;
begin
Is_Degenerate := False;
Parameter := First (Parameter_Specifications (Type_Def));
while Present (Parameter) loop
if Nkind (Parameter_Type (Parameter)) = N_Access_Definition then
Error_Msg_N
("formal parameter& has anonymous access type??",
Defining_Identifier (Parameter));
Is_Degenerate := True;
exit;
end if;
Next (Parameter);
end loop;
if Is_Degenerate then
Error_Msg_NE
("remote access-to-subprogram type& can only be null??",
Defining_Identifier (Parameter), User_Type);
-- The only legal value for a RAS with a formal parameter of an
-- anonymous access type is null, because it cannot be subtype-
-- conformant with any legal remote subprogram declaration. In this
-- case, we cannot generate a corresponding primitive operation.
end if;
if Get_PCS_Name = Name_No_DSA then
return;
end if;
-- The tagged private type, primitive operation and RACW type associated
-- with a RAS need to all be declared in a subpackage of the one that
-- contains the RAS declaration, because the primitive of the object
-- type, and the associated primitive of the stub type, need to be
-- dispatching operations of these types, and the profile of the RAS
-- might contain tagged types declared in the same scope.
Append_To (Vis_Decls,
Make_Private_Type_Declaration (Loc,
Defining_Identifier => Obj_Type,
Abstract_Present => True,
Tagged_Present => True,
Limited_Present => True));
Append_To (Priv_Decls,
Make_Full_Type_Declaration (Loc,
Defining_Identifier => Full_Obj_Type,
Type_Definition =>
Make_Record_Definition (Loc,
Abstract_Present => True,
Tagged_Present => True,
Limited_Present => True,
Null_Present => True,
Component_List => Empty)));
-- Trick semantic analysis into swapping the public and full view when
-- freezing the public view.
Set_Comes_From_Source (Full_Obj_Type, True);
if not Is_Degenerate then
Append_To (Vis_Decls,
Make_Abstract_Subprogram_Declaration (Loc,
Specification => Build_RAS_Primitive_Specification (
Subp_Spec => Type_Def,
Remote_Object_Type => Obj_Type)));
end if;
Append_To (Vis_Decls,
Make_Full_Type_Declaration (Loc,
Defining_Identifier => RACW_Type,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
All_Present => True,
Subtype_Indication =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Obj_Type, Loc),
Attribute_Name => Name_Class))));
Set_Is_Remote_Call_Interface (RACW_Type, Is_RCI);
Set_Is_Remote_Types (RACW_Type, Is_RT);
Subpkg_Decl :=
Make_Package_Declaration (Loc,
Make_Package_Specification (Loc,
Defining_Unit_Name => Subpkg,
Visible_Declarations => Vis_Decls,
Private_Declarations => Priv_Decls,
End_Label => New_Occurrence_Of (Subpkg, Loc)));
Set_Is_Remote_Call_Interface (Subpkg, Is_RCI);
Set_Is_Remote_Types (Subpkg, Is_RT);
Insert_After_And_Analyze (N, Subpkg_Decl);
-- Generate package body to receive RACW calling stubs
-- Note: Analyze_Declarations has an absolute requirement that the
-- declaration list be non-empty, so provide dummy null statement here.
Subpkg_Body :=
Make_Package_Body (Loc,
Defining_Unit_Name => Make_Defining_Identifier (Loc, Chars (Subpkg)),
Declarations => New_List (Make_Null_Statement (Loc)));
Insert_After_And_Analyze (Subpkg_Decl, Subpkg_Body);
-- Many parts of the analyzer and expander expect
-- that the fat pointer type used to implement remote
-- access to subprogram types be a record.
-- Note: The structure of this type must be kept consistent
-- with the code generated by Remote_AST_Null_Value for the
-- corresponding 'null' expression.
Fat_Type_Decl := Make_Full_Type_Declaration (Loc,
Defining_Identifier => Fat_Type,
Type_Definition =>
Make_Record_Definition (Loc,
Component_List =>
Make_Component_List (Loc,
Component_Items => New_List (
Make_Component_Declaration (Loc,
Defining_Identifier =>
Make_Defining_Identifier (Loc, Name_Ras),
Component_Definition =>
Make_Component_Definition (Loc,
Aliased_Present => False,
Subtype_Indication =>
New_Occurrence_Of (RACW_Type, Loc)))))));
Set_Equivalent_Type (User_Type, Fat_Type);
-- Set Fat_Type's Etype early so that we can use its
-- Corresponding_Remote_Type attribute, whose presence indicates that
-- this is the record type used to implement a RAS.
Set_Ekind (Fat_Type, E_Record_Type);
Set_Corresponding_Remote_Type (Fat_Type, User_Type);
Insert_After_And_Analyze (Subpkg_Body, Fat_Type_Decl);
-- The reason we suppress the initialization procedure is that we know
-- that no initialization is required (even if Initialize_Scalars mode
-- is active), and there are order of elaboration problems if we do try
-- to generate an init proc for this created record type.
Set_Suppress_Initialization (Fat_Type);
if Expander_Active then
Add_RAST_Features (Parent (User_Type));
end if;
end Process_Remote_AST_Declaration;
-----------------------
-- RAS_E_Dereference --
-----------------------
procedure RAS_E_Dereference (Pref : Node_Id) is
Loc : constant Source_Ptr := Sloc (Pref);
Call_Node : Node_Id;
New_Type : constant Entity_Id := Etype (Pref);
Explicit_Deref : constant Node_Id := Parent (Pref);
Deref_Subp_Call : constant Node_Id := Parent (Explicit_Deref);
Deref_Proc : Entity_Id;
Params : List_Id;
begin
if Nkind (Deref_Subp_Call) = N_Procedure_Call_Statement then
Params := Parameter_Associations (Deref_Subp_Call);
if Present (Params) then
Prepend (Pref, Params);
else
Params := New_List (Pref);
end if;
elsif Nkind (Deref_Subp_Call) = N_Indexed_Component then
Params := Expressions (Deref_Subp_Call);
if Present (Params) then
Prepend (Pref, Params);
else
Params := New_List (Pref);
end if;
else
-- Context is not a call
return;
end if;
if not Expander_Active or else Get_PCS_Name = Name_No_DSA then
return;
end if;
Deref_Proc := TSS (New_Type, TSS_RAS_Dereference);
pragma Assert (Present (Deref_Proc));
if Ekind (Deref_Proc) = E_Function then
Call_Node :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Deref_Proc, Loc),
Parameter_Associations => Params);
else
Call_Node :=
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Deref_Proc, Loc),
Parameter_Associations => Params);
end if;
Rewrite (Deref_Subp_Call, Call_Node);
Analyze (Deref_Subp_Call);
end RAS_E_Dereference;
------------------------------
-- Remote_AST_E_Dereference --
------------------------------
function Remote_AST_E_Dereference (P : Node_Id) return Boolean is
ET : constant Entity_Id := Etype (P);
begin
-- Perform the changes only on original dereferences, and only if
-- we are generating code.
if Comes_From_Source (P)
and then Is_Record_Type (ET)
and then (Is_Remote_Call_Interface (ET)
or else Is_Remote_Types (ET))
and then Present (Corresponding_Remote_Type (ET))
and then Nkind_In (Parent (Parent (P)), N_Procedure_Call_Statement,
N_Indexed_Component)
and then Expander_Active
then
RAS_E_Dereference (P);
return True;
else
return False;
end if;
end Remote_AST_E_Dereference;
------------------------------
-- Remote_AST_I_Dereference --
------------------------------
function Remote_AST_I_Dereference (P : Node_Id) return Boolean is
ET : constant Entity_Id := Etype (P);
Deref : Node_Id;
begin
if Comes_From_Source (P)
and then (Is_Remote_Call_Interface (ET)
or else Is_Remote_Types (ET))
and then Present (Corresponding_Remote_Type (ET))
and then Ekind (Entity (P)) /= E_Function
then
Deref :=
Make_Explicit_Dereference (Sloc (P),
Prefix => Relocate_Node (P));
Rewrite (P, Deref);
Set_Etype (P, ET);
RAS_E_Dereference (Prefix (P));
return True;
end if;
return False;
end Remote_AST_I_Dereference;
---------------------------
-- Remote_AST_Null_Value --
---------------------------
function Remote_AST_Null_Value
(N : Node_Id;
Typ : Entity_Id) return Boolean
is
Loc : constant Source_Ptr := Sloc (N);
Target_Type : Entity_Id;
begin
if not Expander_Active or else Get_PCS_Name = Name_No_DSA then
return False;
elsif Ekind (Typ) = E_Access_Subprogram_Type
and then (Is_Remote_Call_Interface (Typ)
or else Is_Remote_Types (Typ))
and then Comes_From_Source (N)
and then Expander_Active
then
-- Any null that comes from source and is of the RAS type must
-- be expanded, except if expansion is not active (nothing
-- gets expanded into the equivalent record type).
Target_Type := Equivalent_Type (Typ);
elsif Ekind (Typ) = E_Record_Type
and then Present (Corresponding_Remote_Type (Typ))
then
-- This is a record type representing a RAS type, this must be
-- expanded.
Target_Type := Typ;
else
-- We do not have to handle this case
return False;
end if;
Rewrite (N,
Make_Aggregate (Loc,
Component_Associations => New_List (
Make_Component_Association (Loc,
Choices => New_List (Make_Identifier (Loc, Name_Ras)),
Expression => Make_Null (Loc)))));
Analyze_And_Resolve (N, Target_Type);
return True;
end Remote_AST_Null_Value;
end Sem_Dist;
|
package body Tc is
use Aunit;
function Name (Test : Test_Case) return AUnit.Message_String is
begin
return Format ("test");
end Name;
procedure Test_Routine (Tc : in out AUnit.Test_Cases.Test_Case'Class) is
begin
null;
end;
procedure Register_Tests (Test : in out Test_Case) is
begin
AUnit.Test_Cases.Registration.Register_Routine (Test, Test_Routine'Access, "Test_Routine");
end;
end Tc;
|
{"version_code":552023,"content":"
<p>.</p>
<li>.</li>
","url":""
}
|
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_bit_Reader.Binding is
function LLVMParseBitcode
(MemBuf : in llvm.LLVMMemoryBufferRef;
OutModule : access llvm.LLVMModuleRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMParseBitcodeInContext
(MemBuf : in llvm.LLVMMemoryBufferRef;
ContextRef : in llvm.LLVMContextRef;
OutModule : access llvm.LLVMModuleRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMGetBitcodeModuleProvider
(MemBuf : in llvm.LLVMMemoryBufferRef;
OutMP : access llvm.LLVMModuleProviderRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMGetBitcodeModuleProviderInContext
(MemBuf : in llvm.LLVMMemoryBufferRef;
ContextRef : in llvm.LLVMContextRef;
OutMP : access llvm.LLVMModuleProviderRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
private
pragma Import (C, LLVMParseBitcode, "Ada_LLVMParseBitcode");
pragma Import
(C,
LLVMParseBitcodeInContext,
"Ada_LLVMParseBitcodeInContext");
pragma Import
(C,
LLVMGetBitcodeModuleProvider,
"Ada_LLVMGetBitcodeModuleProvider");
pragma Import
(C,
LLVMGetBitcodeModuleProviderInContext,
"Ada_LLVMGetBitcodeModuleProviderInContext");
end LLVM_bit_Reader.Binding;
|
package Libtcod.Maps.FOV is
type Algorithm_Type is
(
-- Trace multiple Bresenham lines along the perimeter
-- Based on: http://www.roguebasin.com/index.php?title=Ray_casting
Fov_Basic,
-- Cast Bresenham line shadows on a per-tile basis
-- Based on: http://www.oocities.org/temerra/los_rays.html
Fov_Diamond,
-- Recursive Shadowcast
-- Based on: http://www.roguebasin.com/index.php?title=FOV_using_recursive_shadowcasting
Fov_Shadow,
-- Precise Permissive Field of View
-- Based on: http://www.roguebasin.com/index.php?title=Precise_Permissive_Field_of_View
Fov_Permissive_0,
Fov_Permissive_1,
Fov_Permissive_2,
Fov_Permissive_3,
Fov_Permissive_4,
Fov_Permissive_5,
Fov_Permissive_6,
Fov_Permissive_7,
Fov_Permissive_8,
-- Mingos' Restrictive Precise Angle Shadowcasting (contribution by Mingos)
-- Based on: http://www.roguebasin.com/index.php?title=Restrictive_Precise_Angle_Shadowcasting
Fov_Restrictive,
-- Symmetric Shadowcast
-- Based on: https://www.albertford.com/shadowcasting/
Fov_Symmetric_Shadowcast)
with Convention => C;
procedure compute_FOV(m : in out Map; x : X_Pos; y : Y_Pos; max_radius : Radius;
light_walls : Boolean := True; algo : Algorithm_Type := Fov_Basic)
with Inline;
function in_FOV(m : Map; x : X_Pos; y : Y_Pos) return Boolean with Inline;
procedure set_in_FOV(m : in out Map; x : X_Pos; y : Y_Pos; is_in : Boolean)
with Inline;
end Libtcod.Maps.FOV;
|
# Turns capslock off
ifj caps turn_off
goto off_done
:turn_off
toggle caps
:off_done
# Turn light on depending on caps state
:light_off
light off
goto loop
:light_on
light on
:loop
wait 100
ifj caps light_on
goto light_off
|
with Ada.Text_IO;
with Ada.Integer_Text_IO;
procedure Bubble_Sort is
type Int_Array is array (Positive range <>) of Integer;
procedure Do_Bubble_Sort(A: in out Int_Array) is
Did_Swap: Boolean;
Tmp: Positive;
begin
loop
Did_Swap := false;
for I in Integer range (A'First + 1) .. A'Last loop
if A(I) < A(I - 1) then
Tmp := A(I - 1);
A(I - 1) := A(I);
A(I) := Tmp;
Did_Swap := true;
end if;
end loop;
exit when not Did_Swap;
end loop;
end Do_Bubble_Sort;
A: Int_Array (1..10) := (7, 6, 3, 5, 9, 4, 8, 10, 1, 2);
-- A: Int_Array (1..10) := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
-- A: Int_Array (1..10) := (10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
-- A: Int_Array (1..1) := (others => 42);
-- A: Int_Array (1..0);
begin
Do_Bubble_Sort(A);
for I in A'Range loop
Ada.Integer_Text_IO.Put(A(I), 0);
if I /= A'Last then
Ada.Text_IO.Put(", ");
end if;
end loop;
Ada.Text_IO.New_Line;
end Bubble_Sort;
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
package SDL_SDL_keysym_h is
-- unsupported macro: KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
-- unsupported macro: KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
-- unsupported macro: KMOD_ALT (KMOD_LALT|KMOD_RALT)
-- unsupported macro: KMOD_META (KMOD_LMETA|KMOD_RMETA)
subtype SDLKey is unsigned;
SDLK_UNKNOWN : constant SDLKey := 0;
SDLK_FIRST : constant SDLKey := 0;
SDLK_BACKSPACE : constant SDLKey := 8;
SDLK_TAB : constant SDLKey := 9;
SDLK_CLEAR : constant SDLKey := 12;
SDLK_RETURN : constant SDLKey := 13;
SDLK_PAUSE : constant SDLKey := 19;
SDLK_ESCAPE : constant SDLKey := 27;
SDLK_SPACE : constant SDLKey := 32;
SDLK_EXCLAIM : constant SDLKey := 33;
SDLK_QUOTEDBL : constant SDLKey := 34;
SDLK_HASH : constant SDLKey := 35;
SDLK_DOLLAR : constant SDLKey := 36;
SDLK_AMPERSAND : constant SDLKey := 38;
SDLK_QUOTE : constant SDLKey := 39;
SDLK_LEFTPAREN : constant SDLKey := 40;
SDLK_RIGHTPAREN : constant SDLKey := 41;
SDLK_ASTERISK : constant SDLKey := 42;
SDLK_PLUS : constant SDLKey := 43;
SDLK_COMMA : constant SDLKey := 44;
SDLK_MINUS : constant SDLKey := 45;
SDLK_PERIOD : constant SDLKey := 46;
SDLK_SLASH : constant SDLKey := 47;
SDLK_0 : constant SDLKey := 48;
SDLK_1 : constant SDLKey := 49;
SDLK_2 : constant SDLKey := 50;
SDLK_3 : constant SDLKey := 51;
SDLK_4 : constant SDLKey := 52;
SDLK_5 : constant SDLKey := 53;
SDLK_6 : constant SDLKey := 54;
SDLK_7 : constant SDLKey := 55;
SDLK_8 : constant SDLKey := 56;
SDLK_9 : constant SDLKey := 57;
SDLK_COLON : constant SDLKey := 58;
SDLK_SEMICOLON : constant SDLKey := 59;
SDLK_LESS : constant SDLKey := 60;
SDLK_EQUALS : constant SDLKey := 61;
SDLK_GREATER : constant SDLKey := 62;
SDLK_QUESTION : constant SDLKey := 63;
SDLK_AT : constant SDLKey := 64;
SDLK_LEFTBRACKET : constant SDLKey := 91;
SDLK_BACKSLASH : constant SDLKey := 92;
SDLK_RIGHTBRACKET : constant SDLKey := 93;
SDLK_CARET : constant SDLKey := 94;
SDLK_UNDERSCORE : constant SDLKey := 95;
SDLK_BACKQUOTE : constant SDLKey := 96;
SDLK_a : constant SDLKey := 97;
SDLK_b : constant SDLKey := 98;
SDLK_c : constant SDLKey := 99;
SDLK_d : constant SDLKey := 100;
SDLK_e : constant SDLKey := 101;
SDLK_f : constant SDLKey := 102;
SDLK_g : constant SDLKey := 103;
SDLK_h : constant SDLKey := 104;
SDLK_i : constant SDLKey := 105;
SDLK_j : constant SDLKey := 106;
SDLK_k : constant SDLKey := 107;
SDLK_l : constant SDLKey := 108;
SDLK_m : constant SDLKey := 109;
SDLK_n : constant SDLKey := 110;
SDLK_o : constant SDLKey := 111;
SDLK_p : constant SDLKey := 112;
SDLK_q : constant SDLKey := 113;
SDLK_r : constant SDLKey := 114;
SDLK_s : constant SDLKey := 115;
SDLK_t : constant SDLKey := 116;
SDLK_u : constant SDLKey := 117;
SDLK_v : constant SDLKey := 118;
SDLK_w : constant SDLKey := 119;
SDLK_x : constant SDLKey := 120;
SDLK_y : constant SDLKey := 121;
SDLK_z : constant SDLKey := 122;
SDLK_DELETE : constant SDLKey := 127;
SDLK_WORLD_0 : constant SDLKey := 160;
SDLK_WORLD_1 : constant SDLKey := 161;
SDLK_WORLD_2 : constant SDLKey := 162;
SDLK_WORLD_3 : constant SDLKey := 163;
SDLK_WORLD_4 : constant SDLKey := 164;
SDLK_WORLD_5 : constant SDLKey := 165;
SDLK_WORLD_6 : constant SDLKey := 166;
SDLK_WORLD_7 : constant SDLKey := 167;
SDLK_WORLD_8 : constant SDLKey := 168;
SDLK_WORLD_9 : constant SDLKey := 169;
SDLK_WORLD_10 : constant SDLKey := 170;
SDLK_WORLD_11 : constant SDLKey := 171;
SDLK_WORLD_12 : constant SDLKey := 172;
SDLK_WORLD_13 : constant SDLKey := 173;
SDLK_WORLD_14 : constant SDLKey := 174;
SDLK_WORLD_15 : constant SDLKey := 175;
SDLK_WORLD_16 : constant SDLKey := 176;
SDLK_WORLD_17 : constant SDLKey := 177;
SDLK_WORLD_18 : constant SDLKey := 178;
SDLK_WORLD_19 : constant SDLKey := 179;
SDLK_WORLD_20 : constant SDLKey := 180;
SDLK_WORLD_21 : constant SDLKey := 181;
SDLK_WORLD_22 : constant SDLKey := 182;
SDLK_WORLD_23 : constant SDLKey := 183;
SDLK_WORLD_24 : constant SDLKey := 184;
SDLK_WORLD_25 : constant SDLKey := 185;
SDLK_WORLD_26 : constant SDLKey := 186;
SDLK_WORLD_27 : constant SDLKey := 187;
SDLK_WORLD_28 : constant SDLKey := 188;
SDLK_WORLD_29 : constant SDLKey := 189;
SDLK_WORLD_30 : constant SDLKey := 190;
SDLK_WORLD_31 : constant SDLKey := 191;
SDLK_WORLD_32 : constant SDLKey := 192;
SDLK_WORLD_33 : constant SDLKey := 193;
SDLK_WORLD_34 : constant SDLKey := 194;
SDLK_WORLD_35 : constant SDLKey := 195;
SDLK_WORLD_36 : constant SDLKey := 196;
SDLK_WORLD_37 : constant SDLKey := 197;
SDLK_WORLD_38 : constant SDLKey := 198;
SDLK_WORLD_39 : constant SDLKey := 199;
SDLK_WORLD_40 : constant SDLKey := 200;
SDLK_WORLD_41 : constant SDLKey := 201;
SDLK_WORLD_42 : constant SDLKey := 202;
SDLK_WORLD_43 : constant SDLKey := 203;
SDLK_WORLD_44 : constant SDLKey := 204;
SDLK_WORLD_45 : constant SDLKey := 205;
SDLK_WORLD_46 : constant SDLKey := 206;
SDLK_WORLD_47 : constant SDLKey := 207;
SDLK_WORLD_48 : constant SDLKey := 208;
SDLK_WORLD_49 : constant SDLKey := 209;
SDLK_WORLD_50 : constant SDLKey := 210;
SDLK_WORLD_51 : constant SDLKey := 211;
SDLK_WORLD_52 : constant SDLKey := 212;
SDLK_WORLD_53 : constant SDLKey := 213;
SDLK_WORLD_54 : constant SDLKey := 214;
SDLK_WORLD_55 : constant SDLKey := 215;
SDLK_WORLD_56 : constant SDLKey := 216;
SDLK_WORLD_57 : constant SDLKey := 217;
SDLK_WORLD_58 : constant SDLKey := 218;
SDLK_WORLD_59 : constant SDLKey := 219;
SDLK_WORLD_60 : constant SDLKey := 220;
SDLK_WORLD_61 : constant SDLKey := 221;
SDLK_WORLD_62 : constant SDLKey := 222;
SDLK_WORLD_63 : constant SDLKey := 223;
SDLK_WORLD_64 : constant SDLKey := 224;
SDLK_WORLD_65 : constant SDLKey := 225;
SDLK_WORLD_66 : constant SDLKey := 226;
SDLK_WORLD_67 : constant SDLKey := 227;
SDLK_WORLD_68 : constant SDLKey := 228;
SDLK_WORLD_69 : constant SDLKey := 229;
SDLK_WORLD_70 : constant SDLKey := 230;
SDLK_WORLD_71 : constant SDLKey := 231;
SDLK_WORLD_72 : constant SDLKey := 232;
SDLK_WORLD_73 : constant SDLKey := 233;
SDLK_WORLD_74 : constant SDLKey := 234;
SDLK_WORLD_75 : constant SDLKey := 235;
SDLK_WORLD_76 : constant SDLKey := 236;
SDLK_WORLD_77 : constant SDLKey := 237;
SDLK_WORLD_78 : constant SDLKey := 238;
SDLK_WORLD_79 : constant SDLKey := 239;
SDLK_WORLD_80 : constant SDLKey := 240;
SDLK_WORLD_81 : constant SDLKey := 241;
SDLK_WORLD_82 : constant SDLKey := 242;
SDLK_WORLD_83 : constant SDLKey := 243;
SDLK_WORLD_84 : constant SDLKey := 244;
SDLK_WORLD_85 : constant SDLKey := 245;
SDLK_WORLD_86 : constant SDLKey := 246;
SDLK_WORLD_87 : constant SDLKey := 247;
SDLK_WORLD_88 : constant SDLKey := 248;
SDLK_WORLD_89 : constant SDLKey := 249;
SDLK_WORLD_90 : constant SDLKey := 250;
SDLK_WORLD_91 : constant SDLKey := 251;
SDLK_WORLD_92 : constant SDLKey := 252;
SDLK_WORLD_93 : constant SDLKey := 253;
SDLK_WORLD_94 : constant SDLKey := 254;
SDLK_WORLD_95 : constant SDLKey := 255;
SDLK_KP0 : constant SDLKey := 256;
SDLK_KP1 : constant SDLKey := 257;
SDLK_KP2 : constant SDLKey := 258;
SDLK_KP3 : constant SDLKey := 259;
SDLK_KP4 : constant SDLKey := 260;
SDLK_KP5 : constant SDLKey := 261;
SDLK_KP6 : constant SDLKey := 262;
SDLK_KP7 : constant SDLKey := 263;
SDLK_KP8 : constant SDLKey := 264;
SDLK_KP9 : constant SDLKey := 265;
SDLK_KP_PERIOD : constant SDLKey := 266;
SDLK_KP_DIVIDE : constant SDLKey := 267;
SDLK_KP_MULTIPLY : constant SDLKey := 268;
SDLK_KP_MINUS : constant SDLKey := 269;
SDLK_KP_PLUS : constant SDLKey := 270;
SDLK_KP_ENTER : constant SDLKey := 271;
SDLK_KP_EQUALS : constant SDLKey := 272;
SDLK_UP : constant SDLKey := 273;
SDLK_DOWN : constant SDLKey := 274;
SDLK_RIGHT : constant SDLKey := 275;
SDLK_LEFT : constant SDLKey := 276;
SDLK_INSERT : constant SDLKey := 277;
SDLK_HOME : constant SDLKey := 278;
SDLK_END : constant SDLKey := 279;
SDLK_PAGEUP : constant SDLKey := 280;
SDLK_PAGEDOWN : constant SDLKey := 281;
SDLK_F1 : constant SDLKey := 282;
SDLK_F2 : constant SDLKey := 283;
SDLK_F3 : constant SDLKey := 284;
SDLK_F4 : constant SDLKey := 285;
SDLK_F5 : constant SDLKey := 286;
SDLK_F6 : constant SDLKey := 287;
SDLK_F7 : constant SDLKey := 288;
SDLK_F8 : constant SDLKey := 289;
SDLK_F9 : constant SDLKey := 290;
SDLK_F10 : constant SDLKey := 291;
SDLK_F11 : constant SDLKey := 292;
SDLK_F12 : constant SDLKey := 293;
SDLK_F13 : constant SDLKey := 294;
SDLK_F14 : constant SDLKey := 295;
SDLK_F15 : constant SDLKey := 296;
SDLK_NUMLOCK : constant SDLKey := 300;
SDLK_CAPSLOCK : constant SDLKey := 301;
SDLK_SCROLLOCK : constant SDLKey := 302;
SDLK_RSHIFT : constant SDLKey := 303;
SDLK_LSHIFT : constant SDLKey := 304;
SDLK_RCTRL : constant SDLKey := 305;
SDLK_LCTRL : constant SDLKey := 306;
SDLK_RALT : constant SDLKey := 307;
SDLK_LALT : constant SDLKey := 308;
SDLK_RMETA : constant SDLKey := 309;
SDLK_LMETA : constant SDLKey := 310;
SDLK_LSUPER : constant SDLKey := 311;
SDLK_RSUPER : constant SDLKey := 312;
SDLK_MODE : constant SDLKey := 313;
SDLK_COMPOSE : constant SDLKey := 314;
SDLK_HELP : constant SDLKey := 315;
SDLK_PRINT : constant SDLKey := 316;
SDLK_SYSREQ : constant SDLKey := 317;
SDLK_BREAK : constant SDLKey := 318;
SDLK_MENU : constant SDLKey := 319;
SDLK_POWER : constant SDLKey := 320;
SDLK_EURO : constant SDLKey := 321;
SDLK_UNDO : constant SDLKey := 322;
SDLK_LAST : constant SDLKey := 323; -- ../include/SDL/SDL_keysym.h:302
subtype SDLMod is unsigned;
KMOD_NONE : constant SDLMod := 0;
KMOD_LSHIFT : constant SDLMod := 1;
KMOD_RSHIFT : constant SDLMod := 2;
KMOD_LCTRL : constant SDLMod := 64;
KMOD_RCTRL : constant SDLMod := 128;
KMOD_LALT : constant SDLMod := 256;
KMOD_RALT : constant SDLMod := 512;
KMOD_LMETA : constant SDLMod := 1024;
KMOD_RMETA : constant SDLMod := 2048;
KMOD_NUM : constant SDLMod := 4096;
KMOD_CAPS : constant SDLMod := 8192;
KMOD_MODE : constant SDLMod := 16384;
KMOD_RESERVED : constant SDLMod := 32768; -- ../include/SDL/SDL_keysym.h:319
end SDL_SDL_keysym_h;
|
------------------------------------------------------------------------------
-- Copyright (c) 2014-2017, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Cron is a low-overhead, low-precision implementation of periodic --
-- callbacks, similar to UNIX cron daemon. --
-- Note that callbacks are executed sequentially in a single thread, and --
-- ticks may be skipped when computing resources lack. --
-- If you need more precision and/or more reliability, you might want to --
-- consider using Ada.Real_Time.Timing_Events instead. --
------------------------------------------------------------------------------
with Ada.Calendar;
private with Ada.Containers.Doubly_Linked_Lists;
private with Ada.Containers.Ordered_Maps;
private with Ada.Finalization;
private with Ada.Unchecked_Deallocation;
private with Natools.References;
private with Natools.Storage_Pools;
package Natools.Cron is
type Callback is interface;
procedure Run (Object : in out Callback) is abstract;
type Periodic_Time is record
Origin : Ada.Calendar.Time;
Period : Duration;
end record;
type Cron_Entry is tagged limited private;
pragma Preelaborable_Initialization (Cron_Entry);
function Create
(Time : in Periodic_Time;
Callback : in Cron.Callback'Class)
return Cron_Entry;
-- Create a new entry with the given parameters
function Create
(Origin : in Ada.Calendar.Time;
Callback : in Cron.Callback'Class)
return Cron_Entry;
-- Create a new entry that executes only once, at the given time
function Create
(Period : in Duration;
Callback : in Cron.Callback'Class)
return Cron_Entry;
-- Create a new entry starting within a period from now
procedure Set
(Self : in out Cron_Entry;
Time : in Periodic_Time;
Callback : in Cron.Callback'Class);
-- Reset an entry with the given parameters
procedure Set
(Self : in out Cron_Entry;
Origin : in Ada.Calendar.Time;
Callback : in Cron.Callback'Class);
-- Reset entry with the given parameters, running only once
procedure Set
(Self : in out Cron_Entry;
Period : in Duration;
Callback : in Cron.Callback'Class);
-- Reset entry with the given parameters, starting one period from now
procedure Reset (Self : in out Cron_Entry);
-- Clear internal state and remove associated entry from database.
-- Note that if the callback procedure is currently running, it will
-- continue until it returns, so the callback object may outlive
-- the call to Reset, plan concurrency accordingly.
private
package Callback_Refs is new References
(Callback'Class,
Storage_Pools.Access_In_Default_Pool'Storage_Pool,
Storage_Pools.Access_In_Default_Pool'Storage_Pool);
type Cron_Entry is new Ada.Finalization.Limited_Controlled with record
Callback : Callback_Refs.Reference;
end record;
overriding procedure Finalize (Object : in out Cron_Entry);
package Event_Lists is new Ada.Containers.Doubly_Linked_Lists
(Callback_Refs.Reference, Callback_Refs."=");
type Event_List is new Callback with record
List : Event_Lists.List;
end record;
overriding procedure Run (Self : in out Event_List);
-- Sequentially run the contained events
procedure Append
(Self : in out Event_List;
Ref : in Callback_Refs.Reference);
-- Append Ref at the end of Self.List
procedure Prepend
(Self : in out Event_List;
Ref : in Callback_Refs.Reference);
-- Prepend Ref at the beginning of Self.List
procedure Remove
(Self : in out Event_List;
Ref : in Callback_Refs.Reference;
Removed : out Boolean);
-- Remove Ref from Self.List, through a linear search
function Is_Empty (Self : Event_List) return Boolean;
-- Return whether Self contains any element
function "<" (Left, Right : Periodic_Time) return Boolean;
-- Comparison function for ordered map
package Entry_Maps is new Ada.Containers.Ordered_Maps
(Periodic_Time, Callback_Refs.Reference, "<", Callback_Refs."=");
protected Database is
procedure Insert
(Time : in Periodic_Time;
Callback : in Callback_Refs.Reference);
-- Insert Callback into the database, adjusting Time.Origin
-- to be in the future.
procedure Remove (Callback : in Callback_Refs.Reference);
-- Remove Callback from the database
procedure Update (Callback : in Callback_Refs.Reference);
-- Update Time.Origin associated with Callback so that
-- it is in the future.
procedure Get_First
(Time : out Periodic_Time;
Callback : out Callback_Refs.Reference);
-- Return the next active callback, or an empty reference when
-- the database is empty (to signal task termination).
procedure Get_Event_List
(Source : in Event_List;
List : out Event_Lists.List);
-- Initialize an event list from Source without
-- any concurrent tampering of the list.
entry Update_Notification;
-- Block as long as the next active item does not change
private
Map : Entry_Maps.Map;
First_Changed : Boolean := False;
end Database;
task type Worker is
end Worker;
type Worker_Access is access Worker;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Worker, Worker_Access);
Global_Worker : Worker_Access := null;
end Natools.Cron;
|
-----------------------------------------------------------------------
-- css -- Ada CSS Library
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Log.Loggers;
with CSS.Parser.Parser;
with CSS.Parser.Parser_Tokens;
package body CSS.Parser is
use Ada.Strings.Unbounded;
use Util.Concurrent.Counters;
use type CSS.Core.Styles.CSSStyleRule_Access;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("CSS.Parser");
Report_Handler : CSS.Core.Errors.Error_Handler_Access;
Current_Sheet : CSS.Core.Sheets.CSSStylesheet_Access;
procedure Load (Path : in String;
Sheet : in CSS.Core.Sheets.CSSStylesheet_Access;
Handler : in CSS.Core.Errors.Error_Handler_Access) is
Res : Integer;
begin
Report_Handler := Handler;
Current_Sheet := Sheet;
Res := CSS.Parser.Parser.Parse (Path, Sheet);
Report_Handler := null;
Current_Sheet := null;
exception
when Parser_Tokens.Syntax_Error =>
Log.Error ("Syntax error while parsing {0}", Path);
Report_Handler := null;
Current_Sheet := null;
end Load;
function To_String (Val : in Parser_Node_Access) return String is
begin
if Val = null then
return "null";
end if;
case Val.Kind is
when TYPE_STRING | TYPE_IDENT | TYPE_NUMBER =>
return Ada.Strings.Unbounded.To_String (Val.Str_Value);
when TYPE_STYLE =>
return "<style>";
when TYPE_PROPERTY =>
return To_String (Val.Name) & ": " & To_String (Val.Value);
when others =>
return "";
end case;
end To_String;
-- ------------------------------
-- Return a printable representation of the parse value.
-- ------------------------------
function To_String (Val : in YYstype) return String is
begin
case Val.Kind is
when TYPE_NULL =>
return "null";
when TYPE_STRING | TYPE_IDENT | TYPE_NUMBER =>
return To_String (Val.Node);
when TYPE_URI =>
return "url(" & To_String (Val.Node) & ")";
when TYPE_VALUE =>
return To_String (Val.Node);
when others =>
return "?";
end case;
end To_String;
procedure Set_Type (Into : in out YYstype;
Kind : in Node_Type;
Line : in Natural;
Column : in Natural) is
procedure Free is
new Ada.Unchecked_Deallocation (Parser_Node_Type, Parser_Node_Access);
Release : Boolean;
begin
if Into.Node /= null then
Util.Concurrent.Counters.Decrement (Into.Node.Ref_Counter, Release);
if Release then
Free (Into.Node);
else
Into.Node := null;
end if;
end if;
Into.Kind := Kind;
Into.Line := Line;
Into.Column := Column;
end Set_Type;
-- ------------------------------
-- Set the parser token with a string that represent an identifier.
-- The line and column number are recorded in the token.
-- ------------------------------
procedure Set_Ident (Into : in out YYstype;
Value : in String;
Line : in Natural;
Column : in Natural) is
begin
Set_Type (Into, TYPE_IDENT, Line, Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_IDENT,
Ref_Counter => ONE,
others => <>);
Ada.Strings.Unbounded.Set_Unbounded_String (Into.Node.Str_Value, Value);
end Set_Ident;
-- ------------------------------
-- Set the parser token with a string.
-- The line and column number are recorded in the token.
-- ------------------------------
procedure Set_String (Into : in out YYstype;
Value : in String;
Line : in Natural;
Column : in Natural) is
begin
Set_Type (Into, TYPE_STRING, Line, Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_STRING,
Ref_Counter => ONE,
others => <>);
Ada.Strings.Unbounded.Set_Unbounded_String (Into.Node.Str_Value, Value);
end Set_String;
-- ------------------------------
-- Set the parser token with a url string.
-- The line and column number are recorded in the token.
-- ------------------------------
procedure Set_Uri (Into : in out YYstype;
Value : in String;
Line : in Natural;
Column : in Natural) is
begin
Set_Type (Into, TYPE_URI, Line, Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_URI,
Ref_Counter => ONE,
others => <>);
Ada.Strings.Unbounded.Set_Unbounded_String (Into.Node.Str_Value, Value);
end Set_Uri;
-- ------------------------------
-- Set the parser token with an number value with an optional unit or dimension.
-- The line and column number are recorded in the token.
-- ------------------------------
procedure Set_Number (Into : in out YYstype;
Value : in String;
Unit : in CSS.Core.Values.Unit_Type;
Line : in Natural;
Column : in Natural) is
begin
Set_Type (Into, TYPE_VALUE, Line, Column);
Into.Unit := Unit;
Into.Kind := TYPE_NUMBER;
Into.Node := new Parser_Node_Type '(Kind => TYPE_NUMBER,
Ref_Counter => ONE,
others => <>);
if Value = "0.0" then
Ada.Strings.Unbounded.Set_Unbounded_String (Into.Node.Str_Value, "0");
elsif Value'Length > 2 and then Value (Value'First .. Value'First + 1) = "0." then
Ada.Strings.Unbounded.Set_Unbounded_String (Into.Node.Str_Value, Value (Value'First + 1 .. Value'Last));
else
Ada.Strings.Unbounded.Set_Unbounded_String (Into.Node.Str_Value, Value);
end if;
end Set_Number;
-- ------------------------------
-- Set the parser token with a color.
-- Report an error if the color is invalid.
-- ------------------------------
procedure Set_Color (Into : in out YYstype;
Value : in YYstype) is
begin
Set_Type (Into, TYPE_COLOR, Value.Line, Value.Column);
Into.Kind := TYPE_COLOR;
Into.Node := new Parser_Node_Type '(Kind => TYPE_COLOR,
Ref_Counter => ONE,
others => <>);
Into.Node.Str_Value := Value.Node.Str_Value;
end Set_Color;
-- ------------------------------
-- Set the parser token to represent a property identifier and its value expression.
-- The value may be a multi-value (ex: 1px 2em 3 4). The priority indicates whether
-- the !important keyword was present.
-- ------------------------------
procedure Set_Property (Into : in out YYstype;
Ident : in YYstype;
Value : in YYstype;
Prio : in Boolean) is
begin
Set_Type (Into, TYPE_PROPERTY, Ident.Line, Ident.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_PROPERTY,
Ref_Counter => ONE,
Name => Ident.Node,
Value => Value.Node,
Prio => Prio);
Util.Concurrent.Counters.Increment (Ident.Node.Ref_Counter);
if Value.Node /= null then
Util.Concurrent.Counters.Increment (Value.Node.Ref_Counter);
end if;
end Set_Property;
-- ------------------------------
-- Set the parser token to represent a list of properties held by a CSSStyleRule
-- declaration. The style rule is created and the first property inserted in it.
-- The stylesheet document is used for the property string allocation.
-- ------------------------------
procedure Set_Property_List (Into : in out YYstype;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Prop : in YYstype) is
begin
Set_Type (Into, TYPE_STYLE, Prop.Line, Prop.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_STYLE, Ref_Counter => ONE, Rule => null);
Into.Node.Rule := Document.Create_Rule;
Append_Property (Into.Node.Rule.Style, Document, Prop);
end Set_Property_List;
function Get_Property_Name (Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Prop : in YYstype) return CSS.Core.CSSProperty_Name is
begin
if Prop.Node = null then
return null;
else
return Document.Create_Property_Name (To_String (Prop.Node.Name));
end if;
end Get_Property_Name;
-- ------------------------------
-- Append to the CSSStyleRule the property held by the parser token.
-- ------------------------------
procedure Append_Property (Into : in out CSS.Core.Styles.CSSStyle_Declaration;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Prop : in YYstype) is
Name : CSS.Core.CSSProperty_Name := Get_Property_Name (Document, Prop);
begin
if Prop.Node = null then
Log.Debug ("Property has an invalid name and is dropped");
elsif Prop.Node.Value = null then
Log.Debug ("Property {0} was incorrect and is dropped", Name.all);
else
case Prop.Node.Value.Kind is
when TYPE_VALUE =>
Into.Append (Name, Prop.Node.Value.V, Prop.Line, Prop.Column);
when TYPE_PROPERTY_LIST =>
Into.Append (Name, Prop.Node.Value.Values, Prop.Line, Prop.Column);
when others =>
Log.Error ("Invalid property value");
end case;
end if;
end Append_Property;
procedure Append_Property (Into : in out CSS.Core.Styles.CSSStyleRule_Access;
Media : in CSS.Core.Medias.CSSMediaRule_Access;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Prop : in YYstype) is
begin
if Into = null then
Into := Document.Create_Rule;
Document.Append (Media, Into, Prop.Line, Prop.Column);
end if;
Append_Property (Into.Style, Document, Prop);
end Append_Property;
-- ------------------------------
-- Append the token as a string.
-- ------------------------------
procedure Append_String (Into : in out YYstype;
Value : in YYstype) is
begin
Ada.Strings.Unbounded.Append (Into.Node.Str_Value, To_String (Value));
end Append_String;
procedure Append_String (Into : in out YYstype;
Value : in String) is
begin
Ada.Strings.Unbounded.Append (Into.Node.Str_Value, Value);
end Append_String;
procedure Append_String (Into : in out YYstype;
Value1 : in YYstype;
Value2 : in YYstype) is
begin
Ada.Strings.Unbounded.Append (Into.Node.Str_Value, To_String (Value1));
Ada.Strings.Unbounded.Append (Into.Node.Str_Value, To_String (Value2));
end Append_String;
-- ------------------------------
-- Set the parser token to represent the CSS selector.
-- ------------------------------
procedure Append_Media (Into : in out CSS.Core.Medias.CSSMediaRule_Access;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
List : in YYstype) is
use type CSS.Core.Medias.CSSMediaRule_Access;
begin
if Into = null then
Into := Document.Create_Rule;
Document.Append (Into, List.Line, List.Column);
end if;
Into.Medias.Append (To_String (List));
end Append_Media;
-- ------------------------------
-- Set the parser token to represent the CSS selector list.
-- The first selector searched in the document, inserted in the document
-- CSS selector tree and then added to the selector list.
-- ------------------------------
procedure Set_Selector_List (Into : in out YYstype;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Selector : in YYstype) is
begin
Log.Error ("Selector '{0}'", CSS.Core.Selectors.To_String (Selector.Node.Selector));
end Set_Selector_List;
-- ------------------------------
-- Append to the CSS selector list the selector. The selector is first
-- searched in the document CSS selector tree and inserted in the tree.
-- It is then added to the list.
-- ------------------------------
procedure Add_Selector_List (Into : in out CSS.Core.Styles.CSSStyleRule_Access;
Media : in CSS.Core.Medias.CSSMediaRule_Access;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Selector : in YYstype) is
begin
if Into = null then
Into := Document.Create_Rule;
Document.Append (Media, Into, Selector.Line, Selector.Column);
end if;
CSS.Core.Selectors.Append (Into.Selectors, Selector.Node.Selector);
end Add_Selector_List;
-- ------------------------------
-- Set the parser token to represent the CSS selector.
-- ------------------------------
procedure Set_Selector (Into : in out YYstype;
Selector : in YYstype) is
begin
Set_Type (Into, TYPE_SELECTOR, Selector.Line, Selector.Column);
end Set_Selector;
-- ------------------------------
-- Set the parser token to represent the CSS selector.
-- ------------------------------
procedure Set_Selector (Into : in out YYstype;
Kind : in CSS.Core.Selectors.Selector_Type;
Selector : in YYstype) is
begin
Set_Type (Into, TYPE_SELECTOR, Selector.Line, Selector.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_SELECTOR,
Ref_Counter => ONE,
Selector => <>);
Into.Node.Selector := CSS.Core.Selectors.Create (Kind, To_String (Selector));
end Set_Selector;
-- ------------------------------
-- Set the parser token to represent the CSS selector.
-- ------------------------------
procedure Set_Selector (Into : in out YYstype;
Kind : in CSS.Core.Selectors.Selector_Type;
Param1 : in YYstype;
Param2 : in YYstype) is
begin
Set_Type (Into, TYPE_SELECTOR, Param1.Line, Param1.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_SELECTOR,
Ref_Counter => ONE,
Selector => <>);
Into.Node.Selector := CSS.Core.Selectors.Create (Kind, To_String (Param1),
To_String (Param2));
end Set_Selector;
-- ------------------------------
-- Add to the current parser token CSS selector the next CSS selector.
-- ------------------------------
procedure Add_Selector (Into : in out YYstype;
Selector : in YYstype) is
begin
CSS.Core.Selectors.Append (Into.Node.Selector, Selector.Node.Selector);
end Add_Selector;
-- ------------------------------
-- Add to the current parser token CSS selector the next CSS selector.
-- ------------------------------
procedure Add_Selector (Into : in out YYstype;
Combinator : in YYstype;
Selector : in YYstype) is
S : CSS.Core.Selectors.CSSSelector := CSS.Core.Selectors.Create (Combinator.Sel, "");
begin
CSS.Core.Selectors.Append (Into.Node.Selector, S);
CSS.Core.Selectors.Append (Into.Node.Selector, Selector.Node.Selector);
end Add_Selector;
-- ------------------------------
-- Add to the parser token CSS selector a filter represented either
-- by an attribute selection, a pseudo element, a pseudo class or
-- a function.
-- ------------------------------
procedure Add_Selector_Filter (Into : in out YYstype;
Filter : in YYstype) is
begin
CSS.Core.Selectors.Append_Child (Into.Node.Selector, Filter.Node.Selector);
end Add_Selector_Filter;
-- ------------------------------
-- Set the parser token to represent a CSS selector type.
-- Record the line and column where the selector type is found.
-- ------------------------------
procedure Set_Selector_Type (Into : in out YYstype;
Selector : in CSS.Core.Selectors.Selector_Type;
Line : in Natural;
Column : in Natural) is
begin
Set_Type (Into, TYPE_SELECTOR_TYPE, Line, Column);
Into.Sel := Selector;
end Set_Selector_Type;
function Create_Value (Document : in CSS.Core.Sheets.CSSStylesheet_Access;
From : in YYstype) return CSS.Core.Values.Value_Type is
begin
case From.Kind is
when TYPE_STRING =>
return Document.Values.Create_String (To_String (From.Node.Str_Value));
when TYPE_URI =>
return Document.Values.Create_URL (To_String (From.Node.Str_Value));
when TYPE_IDENT =>
return Document.Values.Create_Ident (To_String (From.Node.Str_Value));
when TYPE_COLOR =>
return Document.Values.Create_Color (To_String (From.Node.Str_Value));
when TYPE_NUMBER =>
return Document.Values.Create_Number (To_String (From.Node.Str_Value),
From.Unit);
when TYPE_VALUE =>
return From.Node.V;
when others =>
return CSS.Core.Values.EMPTY;
end case;
end Create_Value;
procedure Set_Value (Into : in out YYstype;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Value : in YYstype) is
begin
Set_Type (Into, TYPE_VALUE, Value.Line, Value.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_VALUE,
Ref_Counter => ONE,
V => <>);
Into.Node.V := Create_Value (Document, Value);
end Set_Value;
procedure Set_Expr (Into : in out YYstype;
Left : in YYstype;
Right : in YYstype) is
begin
if Left.Kind = TYPE_NULL then
Log.Debug ("Ignoring syntax error in expression");
Into := Left;
elsif Right.Kind = TYPE_NULL then
Log.Debug ("Ignoring syntax error in expression");
Into := Right;
elsif Left.Kind = TYPE_PROPERTY_LIST then
Left.Node.Values.Append (Create_Value (Current_Sheet, Right));
Into := Left;
else
Set_Type (Into, TYPE_PROPERTY_LIST, Left.Line, Left.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_PROPERTY_LIST,
Ref_Counter => ONE,
Values => <>);
Into.Node.Values.Append (Create_Value (Current_Sheet, Left));
Into.Node.Values.Append (Create_Value (Current_Sheet, Right));
end if;
end Set_Expr;
procedure Set_Expr (Into : in out YYstype;
Left : in YYstype;
Oper : in YYstype;
Right : in YYstype) is
begin
Log.Error (Natural'Image (Left.Line) & ":" & Natural'Image (Left.Column)
& "Expression {0} {1} {2}", To_String (Left), To_String (Oper),
To_String (Right));
end Set_Expr;
procedure Set_Function (Into : in out YYstype;
Document : in CSS.Core.Sheets.CSSStylesheet_Access;
Name : in YYstype;
Params : in YYstype) is
Func_Name : constant String := To_String (Name.Node.Str_Value);
begin
Log.Debug ("Set function {0}", Func_Name);
Set_Type (Into, TYPE_VALUE, Name.Line, Name.Column);
Into.Node := new Parser_Node_Type '(Kind => TYPE_VALUE,
Ref_Counter => ONE,
V => <>);
if Params.Kind = TYPE_VALUE then
Into.Node.V := Document.Values.Create_Function
(Func_Name (Func_Name'First .. Func_Name'Last - 1), Params.Node.V);
elsif Params.Kind /= TYPE_PROPERTY_LIST then
Into.Node.V := Document.Values.Create_Function
(Func_Name (Func_Name'First .. Func_Name'Last - 1), CSS.Core.Values.EMPTY_LIST);
else
Into.Node.V := Document.Values.Create_Function
(Func_Name (Func_Name'First .. Func_Name'Last - 1), Params.Node.Values);
end if;
end Set_Function;
procedure Error (Line : in Natural;
Column : in Natural;
Message : in String) is
Loc : constant Core.Location := Core.Create_Location (Current_Sheet.all'Access,
Line, Column);
begin
Report_Handler.Error (Loc, Message);
end Error;
procedure Warning (Line : in Natural;
Column : in Natural;
Message : in String) is
Loc : constant Core.Location := Core.Create_Location (Current_Sheet.all'Access,
Line, Column);
begin
Report_Handler.Warning (Loc, Message);
end Warning;
overriding
procedure Adjust (Object : in out YYstype) is
begin
if Object.Node /= null then
Util.Concurrent.Counters.Increment (Object.Node.Ref_Counter);
end if;
end Adjust;
overriding
procedure Finalize (Object : in out YYstype) is
begin
Set_Type (Object, TYPE_NULL, 0, 0);
end Finalize;
end CSS.Parser;
|
-- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
with Ada.Text_IO;
with GL.Buffers;
with GL.Files;
with GL.Fixed.Matrix;
with GL.Immediate;
with GL.Objects.Programs;
with GL.Objects.Shaders.Lists;
with GL.Types.Colors;
with GL_Test.Display_Backend;
procedure GL_Test.Shaders is
use GL.Buffers;
use GL.Types;
use GL.Fixed.Matrix;
use GL.Immediate;
Vertex_Shader : GL.Objects.Shaders.Shader
(Kind => GL.Objects.Shaders.Vertex_Shader);
Fragment_Shader : GL.Objects.Shaders.Shader
(Kind => GL.Objects.Shaders.Fragment_Shader);
Program : GL.Objects.Programs.Program;
begin
Display_Backend.Init;
Display_Backend.Open_Window (Width => 500, Height => 500);
Vertex_Shader.Initialize_Id;
Fragment_Shader.Initialize_Id;
Program.Initialize_Id;
-- load shader sources and compile shaders
GL.Files.Load_Shader_Source_From_File
(Vertex_Shader, "../src/gl/gl_test-shaders-vertex.glsl");
GL.Files.Load_Shader_Source_From_File
(Fragment_Shader, "../src/gl/gl_test-shaders-fragment.glsl");
Vertex_Shader.Compile;
Fragment_Shader.Compile;
if not Vertex_Shader.Compile_Status then
Ada.Text_IO.Put_Line ("Compilation of vertex shader failed. log:");
Ada.Text_IO.Put_Line (Vertex_Shader.Info_Log);
end if;
if not Fragment_Shader.Compile_Status then
Ada.Text_IO.Put_Line ("Compilation of fragment shader failed. log:");
Ada.Text_IO.Put_Line (Fragment_Shader.Info_Log);
end if;
-- set up program
Program.Attach (Vertex_Shader);
Program.Attach (Fragment_Shader);
Program.Link;
if not Program.Link_Status then
Ada.Text_IO.Put_Line ("Program linking failed. Log:");
Ada.Text_IO.Put_Line (Program.Info_Log);
return;
end if;
Program.Use_Program;
-- test iteration over program shaders
Ada.Text_IO.Put_Line ("Listing shaders attached to program...");
declare
use type GL.Objects.Shaders.Lists.Cursor;
List : constant GL.Objects.Shaders.Lists.List
:= Program.Attached_Shaders;
Cursor : GL.Objects.Shaders.Lists.Cursor := List.First;
begin
while Cursor /= GL.Objects.Shaders.Lists.No_Element loop
declare
Shader : constant GL.Objects.Shaders.Shader
:= GL.Objects.Shaders.Lists.Element (Cursor);
begin
Ada.Text_IO.Put_Line ("----------------------------");
Ada.Text_IO.Put_Line ("Kind: " & Shader.Kind'Img);
Ada.Text_IO.Put_Line ("Status: " & Shader.Compile_Status'Img);
end;
Cursor := GL.Objects.Shaders.Lists.Next (Cursor);
end loop;
end;
Ada.Text_IO.Put_Line ("-----------[Done.]----------");
-- set up matrices
Projection.Load_Identity;
Projection.Apply_Orthogonal (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
Modelview.Load_Identity;
while Display_Backend.Window_Opened loop
Clear (Buffer_Bits'(Color => True, others => False));
declare
Token : Input_Token := Start (Quads);
begin
Set_Color (Colors.Color'(1.0, 0.0, 0.0, 0.0));
Token.Add_Vertex (Doubles.Vector4'(0.7, 0.7, 0.0, 1.0));
Set_Color (Colors.Color'(0.0, 1.0, 0.0, 0.0));
Token.Add_Vertex (Doubles.Vector4'(0.7, -0.7, 0.0, 1.0));
Set_Color (Colors.Color'(0.0, 0.0, 1.0, 0.0));
Token.Add_Vertex (Doubles.Vector4'(-0.7, -0.7, 0.0, 1.0));
Set_Color (Colors.Color'(1.0, 0.0, 1.0, 0.0));
Token.Add_Vertex (Doubles.Vector4'(-0.7, 0.7, 0.0, 1.0));
end;
Modelview.Apply_Rotation (0.8, 0.0, 0.0, 1.0);
GL.Flush;
Display_Backend.Swap_Buffers;
Display_Backend.Poll_Events;
end loop;
Display_Backend.Shutdown;
end GL_Test.Shaders;
|
with agar.core.types;
with agar.gui.widget;
with agar.gui.rect;
package agar.gui.draw is
procedure box
(widget : agar.gui.widget.widget_access_t;
rect : agar.gui.rect.rect_t;
color : agar.core.types.uint32_t);
pragma import (c, box, "agar_draw_box");
procedure box_rounded
(widget : agar.gui.widget.widget_access_t;
rect : agar.gui.rect.rect_t;
z : natural;
radius : natural;
color : agar.core.types.uint32_t);
pragma inline (box_rounded);
procedure box_rounded_top
(widget : agar.gui.widget.widget_access_t;
rect : agar.gui.rect.rect_t;
z : natural;
radius : natural;
color : agar.core.types.uint32_t);
pragma inline (box_rounded_top);
procedure frame
(widget : agar.gui.widget.widget_access_t;
rect : agar.gui.rect.rect_t;
color : agar.core.types.uint32_t);
pragma import (c, frame, "agar_draw_frame");
procedure circle
(widget : agar.gui.widget.widget_access_t;
x : natural;
y : natural;
radius : natural;
color : agar.core.types.uint32_t);
pragma inline (circle);
procedure circle2
(widget : agar.gui.widget.widget_access_t;
x : natural;
y : natural;
radius : natural;
color : agar.core.types.uint32_t);
pragma inline (circle2);
procedure line
(widget : agar.gui.widget.widget_access_t;
x1 : natural;
y1 : natural;
x2 : natural;
y2 : natural;
color : agar.core.types.uint32_t);
pragma inline (line);
procedure line_horizontal
(widget : agar.gui.widget.widget_access_t;
x1 : natural;
x2 : natural;
y : natural;
color : agar.core.types.uint32_t);
pragma inline (line_horizontal);
procedure line_vertical
(widget : agar.gui.widget.widget_access_t;
x : natural;
y1 : natural;
y2 : natural;
color : agar.core.types.uint32_t);
pragma inline (line_vertical);
procedure rect_outline
(widget : agar.gui.widget.widget_access_t;
rect : agar.gui.rect.rect_t;
color : agar.core.types.uint32_t);
pragma import (c, rect_outline, "agar_draw_rect_outline");
procedure rect_filled
(widget : agar.gui.widget.widget_access_t;
rect : agar.gui.rect.rect_t;
color : agar.core.types.uint32_t);
pragma import (c, rect_filled, "agar_draw_rect_filled");
end agar.gui.draw;
|
package J_String_Pkg is
subtype J_Length is Natural range 0 .. 1024;
type J_String(size : J_Length := 20) is private;
-- functions
function Create(Str : String) return J_String;
function Value_Of(S : J_String) return String;
function Char_At(S : J_String; P : Positive) return Character;
function Compare_To(S_Left, S_Right : J_String) return Boolean;
function Concat(S_Left, S_Right : J_String) return J_String;
function Contains(S : J_String; Pattern : String) return Boolean;
function Ends_With(S : J_String; Ch : Character) return Boolean;
function Ends_With(S : J_String; Pattern : String) return Boolean;
function "="(S_Left, S_Right : J_String) return Boolean;
function Index_Of(S : J_String; Ch : Character) return Integer;
function Index_Of(S : J_String; Ch : Character; From_Index : Positive) return Integer;
function Index_Of(S : J_String; Pattern : String) return Integer;
function Is_Empty(S : J_String) return Boolean;
function Last_Index_Of(S : J_String; Ch : Character) return Integer;
function Last_Index_Of(S : J_String; Ch : Character; From_Index : Positive) return Integer;
function Length(S : J_String) return Natural;
function Replace(S : J_String; Old_Ch, New_Ch : Character) return J_String;
function Starts_With(S : J_String; Ch : Character) return Boolean;
function Starts_With(S : J_String; Pattern : String) return Boolean;
function Substring(S : J_String; Begin_Index : Positive) return J_String;
function Substring(S : J_String; Begin_Index, End_Index : Positive) return J_String;
-- private J_String type
private
type J_String(size : J_Length := 20) is record
value : String(1 .. size);
end record;
end J_String_Pkg;
|
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- The primary authors of ayacc were David Taback and Deepak Tolani.
-- Enhancements were made by Ronald J. Schmalz.
--
-- Send requests for ayacc information to ayacc-info@ics.uci.edu
-- Send bug reports for ayacc to ayacc-bugs@ics.uci.edu
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- Module : symbol_info_body.ada
-- Component of : ayacc
-- Version : 1.2
-- Date : 11/21/86 12:37:23
-- SCCS File : disk21~/rschm/hasee/sccs/ayacc/sccs/sxsymbol_info_body.ada
-- $Header: symbol_info_body.a,v 0.1 86/04/01 15:13:25 ada Exp $
-- $Log: symbol_info_body.a,v $
-- Revision 0.1 86/04/01 15:13:25 ada
-- This version fixes some minor bugs with empty grammars
-- and $$ expansion. It also uses vads5.1b enhancements
-- such as pragma inline.
--
--
-- Revision 0.0 86/02/19 18:46:56 ada
--
-- These files comprise the initial version of Ayacc
-- designed and implemented by David Taback and Deepak Tolani.
-- Ayacc has been compiled and tested under the Verdix Ada compiler
-- version 4.06 on a vax 11/750 running Unix 4.2BSD.
--
with Text_IO;
package body Symbol_Info is
SCCS_ID : constant String := "@(#) symbol_info_body.ada, Version 1.2";
Rcs_ID : constant String := "$Header: symbol_info_body.a,v 0.1 86/04/01 15:13:25 ada Exp $";
type Nullables_Array is array (Grammar_Symbol range <>) of Boolean;
type Nullables_Array_Pointer is access Nullables_Array;
Nullables : Nullables_Array_Pointer;
--
-- initializes the elements of the array pointed to by
-- NULLABLES to false if they cannot derive the empty
-- string and TRUE if they can derive the empty string.
--
procedure Find_Nullables is
Sym_Position : Natural;
Nonterminal_Sym : Grammar_Symbol;
RHS_Sym : Grammar_Symbol;
No_More_Added : Boolean;
Rule_Length : Natural;
begin
--& Verdix 4.06 bug
--& nullables.all := (nullables.all'range => false);
--& bug fix
for S in Nullables.all'range loop
Nullables(S) := False;
end loop;
--& end bug fix
-- First determine the symbols that are trivially nullable.
for R in First_Rule..Last_Rule loop
if Length_of(R) = 0 then
Nullables(Get_LHS(R)) := True;
end if;
end loop;
loop
No_More_Added := True;
for R in First_Rule..Last_Rule loop
Nonterminal_Sym := Get_LHS(R);
if not Nullables(Nonterminal_Sym) then
Sym_Position := 1;
Rule_Length := Length_of(R);
while Sym_Position <= Rule_Length loop
RHS_Sym := Get_RHS(R, Sym_Position);
exit when Is_Terminal(RHS_Sym) or else
not Nullables(RHS_Sym);
Sym_Position := Sym_Position + 1;
end loop;
if Sym_Position > Rule_Length then
Nullables(Nonterminal_Sym) := True;
No_More_Added := False;
end if;
end if;
end loop;
exit when No_More_Added;
end loop;
end Find_Nullables;
function Is_Nullable(Sym: Grammar_Symbol) return Boolean is
begin
return Nullables(Sym);
end Is_Nullable;
procedure Make_Rules_Null_Position is
Null_Position : Integer;
RHS_Sym : Grammar_Symbol;
begin
for R in First_Rule..Last_Rule loop
Null_Position := Length_of(R);
while Null_Position /= 0 loop
RHS_Sym := Get_RHS(R, Null_Position);
if Is_Terminal(RHS_Sym) or else not Nullables(RHS_Sym) then
exit;
end if;
Null_Position := Null_Position - 1;
end loop;
Set_Null_Pos(R, Null_Position);
end loop;
end Make_Rules_Null_Position;
procedure Find_Rule_Yields is
use Text_IO; -- To report undefined nonterminals
Found_Undefined_Nonterminal: Boolean := False;
Current_Index : Yield_Index;
begin
-- First initialize the arrays to the correct size --
Nonterminal_Yield := new Rule_Array
(Yield_Index(First_Rule)..Yield_Index(Last_Rule));
Nonterminal_Yield_Index := new Offset_Array
(First_Symbol(Nonterminal)..Last_Symbol(Nonterminal) + 1);
Current_Index := Yield_Index(First_Rule);
for Sym in First_Symbol(Nonterminal)..Last_Symbol(Nonterminal) loop
Nonterminal_Yield_Index(Sym) := Current_Index;
for R in First_Rule..Last_Rule loop
if Get_LHS(R) = Sym then
Nonterminal_Yield(Current_Index) := R;
Current_Index := Current_Index + 1;
end if;
end loop;
if Nonterminal_Yield_Index(Sym) = Current_Index then
Found_Undefined_Nonterminal := True;
Put_Line ("Ayacc: Nonterminal " & Get_Symbol_Name(Sym) &
" does not appear on the " &
"left hand side of any rule.");
end if;
end loop;
Nonterminal_Yield_Index(Last_Symbol(Nonterminal) + 1) := Current_Index;
-- So you can easily determine the end of the list in loops
-- bye comparing the index to the index of sym+1.
if Found_Undefined_Nonterminal then
raise Undefined_Nonterminal;
end if;
end Find_Rule_Yields;
-- First detect nonterminals that can't be derived from the start symbol.
-- Then detect nonterminals that don't derive any token string.
--
-- NOTE: We should use Digraph to do this stuff when we
-- have time to put it in.
procedure Check_Grammar is
use Text_IO; -- to report errors
type Nonterminal_Array is array (Grammar_Symbol range <>) of Boolean;
Ok : Nonterminal_Array
(First_Symbol(Nonterminal)..Last_Symbol(Nonterminal));
More : Boolean;
I : Natural;
Rule_Length : Natural;
Found_Error : Boolean := False;
RHS_Sym, LHS_Sym: Grammar_Symbol;
Bad_Grammar : exception; -- Move this somewhere else!!!
begin
-- check if each nonterminal is deriveable from the start symbol --
-- To be added! We should use digraph for this
-- check if each nonterminal can derive a terminal string. --
--& Verdix 4.06 bug
--& ok := (ok'range => false);
--& bug fix
for S in Ok'range loop
Ok(S) := False;
end loop;
--& end bug fix
More := True;
while More loop
More := False;
for R in First_Rule..Last_Rule loop
LHS_Sym := Get_LHS(R);
if not Ok(LHS_Sym) then
I := 1;
Rule_Length := Length_of(R);
while I <= Rule_Length loop
RHS_Sym := Get_RHS(R, I);
if Is_Nonterminal(RHS_Sym) and then
not Ok(RHS_Sym)
then
exit;
end if;
I := I + 1;
end loop;
if I > Rule_Length then -- nonterminal can derive terminals
Ok(LHS_Sym) := True;
More := True;
end if;
end if;
end loop;
end loop;
for J in Ok'range loop
if not Ok(J) then
Put_Line ("Ayacc: Nonterminal " & Get_Symbol_Name(J) &
" does not derive a terminal string");
Found_Error := True;
end if;
end loop;
if Found_Error then
raise Bad_Grammar;
end if;
end Check_Grammar;
procedure Initialize is
begin
Nullables := new Nullables_Array
(First_Symbol(Nonterminal) .. Last_Symbol(Nonterminal));
Find_Rule_Yields;
Check_Grammar;
Find_Nullables;
Make_Rules_Null_Position;
end Initialize;
end Symbol_Info;
|
-- Generated by a script from an "avr tools device file" (atdf)
with HAL; use HAL;
with System;
package body SAM.Main_Clock is
Base_Address : constant := 16#40000800#;
AHBMASK : UInt32
with Volatile,
Address => System'To_Address (Base_Address + 16#10#);
APBAMASK : UInt32
with Volatile,
Address => System'To_Address (Base_Address + 16#14#);
APBBMASK : UInt32
with Volatile,
Address => System'To_Address (Base_Address + 16#18#);
APBCMASK : UInt32
with Volatile,
Address => System'To_Address (Base_Address + 16#1C#);
APBDMASK : UInt32
with Volatile,
Address => System'To_Address (Base_Address + 16#20#);
-- HPB0 --
procedure HPB0_On is
begin
AHBMASK := AHBMASK or 16#1#;
end HPB0_On;
procedure HPB0_Off is
begin
AHBMASK := AHBMASK and not 16#1#;
end HPB0_Off;
-- HPB1 --
procedure HPB1_On is
begin
AHBMASK := AHBMASK or 16#2#;
end HPB1_On;
procedure HPB1_Off is
begin
AHBMASK := AHBMASK and not 16#2#;
end HPB1_Off;
-- HPB2 --
procedure HPB2_On is
begin
AHBMASK := AHBMASK or 16#4#;
end HPB2_On;
procedure HPB2_Off is
begin
AHBMASK := AHBMASK and not 16#4#;
end HPB2_Off;
-- HPB3 --
procedure HPB3_On is
begin
AHBMASK := AHBMASK or 16#8#;
end HPB3_On;
procedure HPB3_Off is
begin
AHBMASK := AHBMASK and not 16#8#;
end HPB3_Off;
-- DSU --
procedure DSU_On is
begin
AHBMASK := AHBMASK or 16#10#;
APBBMASK := APBBMASK or 16#2#;
end DSU_On;
procedure DSU_Off is
begin
AHBMASK := AHBMASK and not 16#10#;
APBBMASK := APBBMASK and not 16#2#;
end DSU_Off;
-- HMATRIX --
procedure HMATRIX_On is
begin
AHBMASK := AHBMASK or 16#20#;
APBBMASK := APBBMASK or 16#40#;
end HMATRIX_On;
procedure HMATRIX_Off is
begin
AHBMASK := AHBMASK and not 16#20#;
APBBMASK := APBBMASK and not 16#40#;
end HMATRIX_Off;
-- NVMCTRL --
procedure NVMCTRL_On is
begin
AHBMASK := AHBMASK or 16#40#;
APBBMASK := APBBMASK or 16#4#;
end NVMCTRL_On;
procedure NVMCTRL_Off is
begin
AHBMASK := AHBMASK and not 16#40#;
APBBMASK := APBBMASK and not 16#4#;
end NVMCTRL_Off;
-- HSRAM --
procedure HSRAM_On is
begin
AHBMASK := AHBMASK or 16#80#;
end HSRAM_On;
procedure HSRAM_Off is
begin
AHBMASK := AHBMASK and not 16#80#;
end HSRAM_Off;
-- CMCC --
procedure CMCC_On is
begin
AHBMASK := AHBMASK or 16#100#;
end CMCC_On;
procedure CMCC_Off is
begin
AHBMASK := AHBMASK and not 16#100#;
end CMCC_Off;
-- DMAC --
procedure DMAC_On is
begin
AHBMASK := AHBMASK or 16#200#;
end DMAC_On;
procedure DMAC_Off is
begin
AHBMASK := AHBMASK and not 16#200#;
end DMAC_Off;
-- USB --
procedure USB_On is
begin
AHBMASK := AHBMASK or 16#400#;
APBBMASK := APBBMASK or 16#1#;
end USB_On;
procedure USB_Off is
begin
AHBMASK := AHBMASK and not 16#400#;
APBBMASK := APBBMASK and not 16#1#;
end USB_Off;
-- BKUPRAM --
procedure BKUPRAM_On is
begin
AHBMASK := AHBMASK or 16#800#;
end BKUPRAM_On;
procedure BKUPRAM_Off is
begin
AHBMASK := AHBMASK and not 16#800#;
end BKUPRAM_Off;
-- PAC --
procedure PAC_On is
begin
AHBMASK := AHBMASK or 16#1000#;
APBAMASK := APBAMASK or 16#1#;
end PAC_On;
procedure PAC_Off is
begin
AHBMASK := AHBMASK and not 16#1000#;
APBAMASK := APBAMASK and not 16#1#;
end PAC_Off;
-- QSPI --
procedure QSPI_On is
begin
AHBMASK := AHBMASK or 16#2000#;
APBCMASK := APBCMASK or 16#2000#;
end QSPI_On;
procedure QSPI_Off is
begin
AHBMASK := AHBMASK and not 16#2000#;
APBCMASK := APBCMASK and not 16#2000#;
end QSPI_Off;
-- SDHC0 --
procedure SDHC0_On is
begin
AHBMASK := AHBMASK or 16#8000#;
end SDHC0_On;
procedure SDHC0_Off is
begin
AHBMASK := AHBMASK and not 16#8000#;
end SDHC0_Off;
-- ICM --
procedure ICM_On is
begin
AHBMASK := AHBMASK or 16#80000#;
APBCMASK := APBCMASK or 16#800#;
end ICM_On;
procedure ICM_Off is
begin
AHBMASK := AHBMASK and not 16#80000#;
APBCMASK := APBCMASK and not 16#800#;
end ICM_Off;
-- PUKCC --
procedure PUKCC_On is
begin
AHBMASK := AHBMASK or 16#100000#;
end PUKCC_On;
procedure PUKCC_Off is
begin
AHBMASK := AHBMASK and not 16#100000#;
end PUKCC_Off;
-- QSPI_2X --
procedure QSPI_2X_On is
begin
AHBMASK := AHBMASK or 16#200000#;
end QSPI_2X_On;
procedure QSPI_2X_Off is
begin
AHBMASK := AHBMASK and not 16#200000#;
end QSPI_2X_Off;
-- NVMCTRL_SMEEPROM --
procedure NVMCTRL_SMEEPROM_On is
begin
AHBMASK := AHBMASK or 16#400000#;
end NVMCTRL_SMEEPROM_On;
procedure NVMCTRL_SMEEPROM_Off is
begin
AHBMASK := AHBMASK and not 16#400000#;
end NVMCTRL_SMEEPROM_Off;
-- NVMCTRL_CACHE --
procedure NVMCTRL_CACHE_On is
begin
AHBMASK := AHBMASK or 16#800000#;
end NVMCTRL_CACHE_On;
procedure NVMCTRL_CACHE_Off is
begin
AHBMASK := AHBMASK and not 16#800000#;
end NVMCTRL_CACHE_Off;
-- PM --
procedure PM_On is
begin
APBAMASK := APBAMASK or 16#2#;
end PM_On;
procedure PM_Off is
begin
APBAMASK := APBAMASK and not 16#2#;
end PM_Off;
-- MCLK --
procedure MCLK_On is
begin
APBAMASK := APBAMASK or 16#4#;
end MCLK_On;
procedure MCLK_Off is
begin
APBAMASK := APBAMASK and not 16#4#;
end MCLK_Off;
-- RSTC --
procedure RSTC_On is
begin
APBAMASK := APBAMASK or 16#8#;
end RSTC_On;
procedure RSTC_Off is
begin
APBAMASK := APBAMASK and not 16#8#;
end RSTC_Off;
-- OSCCTRL --
procedure OSCCTRL_On is
begin
APBAMASK := APBAMASK or 16#10#;
end OSCCTRL_On;
procedure OSCCTRL_Off is
begin
APBAMASK := APBAMASK and not 16#10#;
end OSCCTRL_Off;
-- OSC32KCTRL --
procedure OSC32KCTRL_On is
begin
APBAMASK := APBAMASK or 16#20#;
end OSC32KCTRL_On;
procedure OSC32KCTRL_Off is
begin
APBAMASK := APBAMASK and not 16#20#;
end OSC32KCTRL_Off;
-- SUPC --
procedure SUPC_On is
begin
APBAMASK := APBAMASK or 16#40#;
end SUPC_On;
procedure SUPC_Off is
begin
APBAMASK := APBAMASK and not 16#40#;
end SUPC_Off;
-- GCLK --
procedure GCLK_On is
begin
APBAMASK := APBAMASK or 16#80#;
end GCLK_On;
procedure GCLK_Off is
begin
APBAMASK := APBAMASK and not 16#80#;
end GCLK_Off;
-- WDT --
procedure WDT_On is
begin
APBAMASK := APBAMASK or 16#100#;
end WDT_On;
procedure WDT_Off is
begin
APBAMASK := APBAMASK and not 16#100#;
end WDT_Off;
-- RTC --
procedure RTC_On is
begin
APBAMASK := APBAMASK or 16#200#;
end RTC_On;
procedure RTC_Off is
begin
APBAMASK := APBAMASK and not 16#200#;
end RTC_Off;
-- EIC --
procedure EIC_On is
begin
APBAMASK := APBAMASK or 16#400#;
end EIC_On;
procedure EIC_Off is
begin
APBAMASK := APBAMASK and not 16#400#;
end EIC_Off;
-- FREQM --
procedure FREQM_On is
begin
APBAMASK := APBAMASK or 16#800#;
end FREQM_On;
procedure FREQM_Off is
begin
APBAMASK := APBAMASK and not 16#800#;
end FREQM_Off;
-- SERCOM0 --
procedure SERCOM0_On is
begin
APBAMASK := APBAMASK or 16#1000#;
end SERCOM0_On;
procedure SERCOM0_Off is
begin
APBAMASK := APBAMASK and not 16#1000#;
end SERCOM0_Off;
-- SERCOM1 --
procedure SERCOM1_On is
begin
APBAMASK := APBAMASK or 16#2000#;
end SERCOM1_On;
procedure SERCOM1_Off is
begin
APBAMASK := APBAMASK and not 16#2000#;
end SERCOM1_Off;
-- TC0 --
procedure TC0_On is
begin
APBAMASK := APBAMASK or 16#4000#;
end TC0_On;
procedure TC0_Off is
begin
APBAMASK := APBAMASK and not 16#4000#;
end TC0_Off;
-- TC1 --
procedure TC1_On is
begin
APBAMASK := APBAMASK or 16#8000#;
end TC1_On;
procedure TC1_Off is
begin
APBAMASK := APBAMASK and not 16#8000#;
end TC1_Off;
-- PORT --
procedure PORT_On is
begin
APBBMASK := APBBMASK or 16#10#;
end PORT_On;
procedure PORT_Off is
begin
APBBMASK := APBBMASK and not 16#10#;
end PORT_Off;
-- EVSYS --
procedure EVSYS_On is
begin
APBBMASK := APBBMASK or 16#80#;
end EVSYS_On;
procedure EVSYS_Off is
begin
APBBMASK := APBBMASK and not 16#80#;
end EVSYS_Off;
-- SERCOM2 --
procedure SERCOM2_On is
begin
APBBMASK := APBBMASK or 16#200#;
end SERCOM2_On;
procedure SERCOM2_Off is
begin
APBBMASK := APBBMASK and not 16#200#;
end SERCOM2_Off;
-- SERCOM3 --
procedure SERCOM3_On is
begin
APBBMASK := APBBMASK or 16#400#;
end SERCOM3_On;
procedure SERCOM3_Off is
begin
APBBMASK := APBBMASK and not 16#400#;
end SERCOM3_Off;
-- TCC0 --
procedure TCC0_On is
begin
APBBMASK := APBBMASK or 16#800#;
end TCC0_On;
procedure TCC0_Off is
begin
APBBMASK := APBBMASK and not 16#800#;
end TCC0_Off;
-- TCC1 --
procedure TCC1_On is
begin
APBBMASK := APBBMASK or 16#1000#;
end TCC1_On;
procedure TCC1_Off is
begin
APBBMASK := APBBMASK and not 16#1000#;
end TCC1_Off;
-- TC2 --
procedure TC2_On is
begin
APBBMASK := APBBMASK or 16#2000#;
end TC2_On;
procedure TC2_Off is
begin
APBBMASK := APBBMASK and not 16#2000#;
end TC2_Off;
-- TC3 --
procedure TC3_On is
begin
APBBMASK := APBBMASK or 16#4000#;
end TC3_On;
procedure TC3_Off is
begin
APBBMASK := APBBMASK and not 16#4000#;
end TC3_Off;
-- RAMECC --
procedure RAMECC_On is
begin
APBBMASK := APBBMASK or 16#10000#;
end RAMECC_On;
procedure RAMECC_Off is
begin
APBBMASK := APBBMASK and not 16#10000#;
end RAMECC_Off;
-- TCC2 --
procedure TCC2_On is
begin
APBCMASK := APBCMASK or 16#8#;
end TCC2_On;
procedure TCC2_Off is
begin
APBCMASK := APBCMASK and not 16#8#;
end TCC2_Off;
-- TCC3 --
procedure TCC3_On is
begin
APBCMASK := APBCMASK or 16#10#;
end TCC3_On;
procedure TCC3_Off is
begin
APBCMASK := APBCMASK and not 16#10#;
end TCC3_Off;
-- TC4 --
procedure TC4_On is
begin
APBCMASK := APBCMASK or 16#20#;
end TC4_On;
procedure TC4_Off is
begin
APBCMASK := APBCMASK and not 16#20#;
end TC4_Off;
-- TC5 --
procedure TC5_On is
begin
APBCMASK := APBCMASK or 16#40#;
end TC5_On;
procedure TC5_Off is
begin
APBCMASK := APBCMASK and not 16#40#;
end TC5_Off;
-- PDEC --
procedure PDEC_On is
begin
APBCMASK := APBCMASK or 16#80#;
end PDEC_On;
procedure PDEC_Off is
begin
APBCMASK := APBCMASK and not 16#80#;
end PDEC_Off;
-- AC --
procedure AC_On is
begin
APBCMASK := APBCMASK or 16#100#;
end AC_On;
procedure AC_Off is
begin
APBCMASK := APBCMASK and not 16#100#;
end AC_Off;
-- AES --
procedure AES_On is
begin
APBCMASK := APBCMASK or 16#200#;
end AES_On;
procedure AES_Off is
begin
APBCMASK := APBCMASK and not 16#200#;
end AES_Off;
-- TRNG --
procedure TRNG_On is
begin
APBCMASK := APBCMASK or 16#400#;
end TRNG_On;
procedure TRNG_Off is
begin
APBCMASK := APBCMASK and not 16#400#;
end TRNG_Off;
-- CCL --
procedure CCL_On is
begin
APBCMASK := APBCMASK or 16#4000#;
end CCL_On;
procedure CCL_Off is
begin
APBCMASK := APBCMASK and not 16#4000#;
end CCL_Off;
-- SERCOM4 --
procedure SERCOM4_On is
begin
APBDMASK := APBDMASK or 16#1#;
end SERCOM4_On;
procedure SERCOM4_Off is
begin
APBDMASK := APBDMASK and not 16#1#;
end SERCOM4_Off;
-- SERCOM5 --
procedure SERCOM5_On is
begin
APBDMASK := APBDMASK or 16#2#;
end SERCOM5_On;
procedure SERCOM5_Off is
begin
APBDMASK := APBDMASK and not 16#2#;
end SERCOM5_Off;
-- TCC4 --
procedure TCC4_On is
begin
APBDMASK := APBDMASK or 16#10#;
end TCC4_On;
procedure TCC4_Off is
begin
APBDMASK := APBDMASK and not 16#10#;
end TCC4_Off;
-- ADC0 --
procedure ADC0_On is
begin
APBDMASK := APBDMASK or 16#80#;
end ADC0_On;
procedure ADC0_Off is
begin
APBDMASK := APBDMASK and not 16#80#;
end ADC0_Off;
-- ADC1 --
procedure ADC1_On is
begin
APBDMASK := APBDMASK or 16#100#;
end ADC1_On;
procedure ADC1_Off is
begin
APBDMASK := APBDMASK and not 16#100#;
end ADC1_Off;
-- DAC --
procedure DAC_On is
begin
APBDMASK := APBDMASK or 16#200#;
end DAC_On;
procedure DAC_Off is
begin
APBDMASK := APBDMASK and not 16#200#;
end DAC_Off;
-- I2S --
procedure I2S_On is
begin
APBDMASK := APBDMASK or 16#400#;
end I2S_On;
procedure I2S_Off is
begin
APBDMASK := APBDMASK and not 16#400#;
end I2S_Off;
-- PCC --
procedure PCC_On is
begin
APBDMASK := APBDMASK or 16#800#;
end PCC_On;
procedure PCC_Off is
begin
APBDMASK := APBDMASK and not 16#800#;
end PCC_Off;
end SAM.Main_Clock;
|
package body Logging is
task body Log is
Verbosity : Verbosity_Level := Log_Error;
begin
loop
select
accept Set_Verbosity (User_Verbosity : Verbosity_Level) do
Verbosity := User_Verbosity;
end Set_Verbosity;
or
accept Chat (Text : Wide_Wide_String; Suffix : Wide_Wide_Character := Characters.LF) do
if Verbosity >= Log_Chatty then
IO.Put (IO.Current_Error, Text & Suffix);
end if;
end Chat;
or
accept Info (Text : Wide_Wide_String; Suffix : Wide_Wide_Character := Characters.LF) do
if Verbosity >= Log_Info then
IO.Put (IO.Current_Error, Text & Suffix);
end if;
end Info;
or
accept Warning (Text : Wide_Wide_String; Suffix : Wide_Wide_Character := Characters.LF) do
if Verbosity >= Log_Warning then
IO.Put (IO.Current_Error, Text & Suffix);
end if;
end Warning;
or
accept Error (Text : Wide_Wide_String; Suffix : Wide_Wide_Character := Characters.LF) do
if Verbosity >= Log_Error then
IO.Put (IO.Current_Error, Text & Suffix);
end if;
end Error;
or
terminate;
end select;
end loop;
end Log;
protected body Logging_Termination_Handler is
-- Intentionally not using the logging task here because it
-- could very well be the logging task that terminates prematurely...
procedure Log_Termination_Cause
(C : Cause_Of_Termination; T : Task_Id; X : Exception_Occurrence) is
begin
case C is
when Normal =>
null;
when Abnormal =>
IO.Put_Line
(IO.Current_Error,
W ("Something caused termination in task " & Image (T)));
when Unhandled_Exception =>
IO.Put_Line
(IO.Current_Error,
W ("Uncaught exception terminated task " & Image (T) & ":"));
IO.Put_Line
(IO.Current_Error,
W (Exception_Information (X)));
end case;
end Log_Termination_Cause;
end Logging_Termination_Handler;
end Logging;
|
-------------------------------------------------------------------------------
-- --
-- Coffee Clock --
-- --
-- Copyright (C) 2016-2017 Fabien Chouteau --
-- --
-- Coffee Clock 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. --
-- --
-- Coffee Clock 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 We Noise Maker. If not, see <http://www.gnu.org/licenses/>. --
-- --
-------------------------------------------------------------------------------
with LCD_Graphic_Backend;
with Giza.GUI;
with Giza.Context;
with Giza.Bitmap_Fonts.FreeSerifItalic18pt7b;
with Ada.Synchronous_Task_Control;
with STM32.RNG.Polling;
with System;
with Giza.Events; use Giza.Events;
with Ada.Real_Time; use Ada.Real_Time;
with STM32.Board;
with HAL.Touch_Panel; use HAL.Touch_Panel;
with Clock_Window;
package body GUI is
Backend : aliased LCD_Graphic_Backend.Instance;
Context : aliased Giza.Context.Instance;
Main_W : aliased Clock_Window.Instance;
Sync : Ada.Synchronous_Task_Control.Suspension_Object;
type Touch_State is record
Touch_Detected : Boolean;
X : Natural;
Y : Natural;
end record;
function Current_Touch_State return Touch_State;
-------------------------
-- Current_Touch_State --
-------------------------
function Current_Touch_State return Touch_State is
TS : Touch_State;
ST_TS : constant HAL.Touch_Panel.TP_State :=
STM32.Board.Touch_Panel.Get_All_Touch_Points;
begin
TS.Touch_Detected := ST_TS'Length > 0;
if TS.Touch_Detected then
TS.X := ST_TS (1).X;
TS.Y := ST_TS (1).Y;
else
TS.X := 0;
TS.Y := 0;
end if;
return TS;
end Current_Touch_State;
task Touch_Screen is
pragma Priority (System.Default_Priority - 1);
end Touch_Screen;
task body Touch_Screen is
TS, Prev : Touch_State;
Click_Evt : constant Click_Event_Ref := new Click_Event;
Release_Evt : constant Click_Released_Event_Ref
:= new Click_Released_Event;
begin
Ada.Synchronous_Task_Control.Suspend_Until_True (Sync);
Prev.Touch_Detected := False;
loop
-- STM32F4.Touch_Panel.Wait_For_Touch_Detected;
TS := Current_Touch_State;
if TS.Touch_Detected /= Prev.Touch_Detected then
if TS.Touch_Detected then
Click_Evt.Pos.X := TS.X;
Click_Evt.Pos.Y := TS.Y;
Giza.GUI.Emit (Event_Not_Null_Ref (Click_Evt));
else
Giza.GUI.Emit (Event_Not_Null_Ref (Release_Evt));
end if;
end if;
Prev := TS;
delay until Clock + Milliseconds (10);
end loop;
end Touch_Screen;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
LCD_Graphic_Backend.Initialize;
Giza.GUI.Set_Backend (Backend'Access);
STM32.Board.Touch_Panel.Initialize;
Context.Set_Font (Giza.Bitmap_Fonts.FreeSerifItalic18pt7b.Font);
Giza.GUI.Set_Context (Context'Access);
end Initialize;
-----------
-- Start --
-----------
procedure Start is
begin
STM32.Board.Configure_User_Button_GPIO;
Giza.GUI.Push (Main_W'Access);
Ada.Synchronous_Task_Control.Set_True (Sync);
Giza.GUI.Event_Loop;
end Start;
------------
-- Random --
------------
function Random (Modulo : Unsigned_32) return Unsigned_32 is
Rand_Exess : constant Unsigned_32 := (Unsigned_32'Last mod Modulo) + 1;
Rand_Linit : constant Unsigned_32 := Unsigned_32'Last - Rand_Exess;
Ret : Unsigned_32;
begin
loop
Ret := STM32.RNG.Polling.Random;
exit when Ret <= Rand_Linit;
end loop;
return Ret mod Modulo;
end Random;
end GUI;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2017, Daniel King
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not be used to endorse or promote
-- Products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with Keccak.Types; use Keccak.Types;
with AUnit.Assertions; use AUnit.Assertions;
package body Parallel_Sponge_Tests
is
Suffix : constant Byte := 2#101#;
Suffix_Len : constant := 3;
procedure Set_Up (T : in out Test)
is
begin
Parallel_Sponge.Init (T.Ctx);
end Set_Up;
----------------------------------------------------------------------------
-- Test that the output of a parallel sponge with N parallel instances
-- produces the same output as N serial sponges.
--
-- Each parallel instance is fed different input data to detect problems
-- where the wrong data is fed into the wrong instance.
procedure Test_Same_Output_As_Serial (T : in out Test)
is
N : constant Positive := Parallel_Sponge.Num_Parallel_Instances;
Input_Len : constant := 64*1024;
Output_Len : constant := 2*1024;
Rate_Bytes : constant Positive := Parallel_Sponge.Rate_Of (T.Ctx) / 8;
Input : Byte_Array (0 .. (Input_Len * N) - 1);
Reference_Output : Byte_Array (0 .. (Output_Len * N) - 1) := (others => 0);
Actual_Output : Byte_Array (0 .. (Output_Len * N) - 1) := (others => 0);
Serial_Ctx : Serial_Sponge.Context;
begin
-- Set up each instance to receive different data.
-- Instance 0 has the repeating pattern 16#00#
-- Instance 1 has the repeating pattern 16#11#
-- Instance 2 has the repeating pattern 16#22#
-- and so on...
for I in 0 .. N - 1 loop
Input ((I * Input_Len) .. (I * Input_Len) + Input_Len - 1) := (others => Byte ((16#11# * I) mod 256));
end loop;
-- Use the serial algorithm to produce the reference output to compare
-- against.
for I in 0 .. N - 1 loop
Serial_Sponge.Init (Serial_Ctx, Capacity);
Serial_Sponge.Absorb_With_Suffix
(Ctx => Serial_Ctx,
Message => Input ((I * Input_Len) .. (I * Input_Len) + Input_Len - 1),
Bit_Length => Input_Len * 8,
Suffix => Suffix,
Suffix_Len => Suffix_Len);
Serial_Sponge.Squeeze
(Ctx => Serial_Ctx,
Digest => Reference_Output ((I * Output_Len) .. (I * Output_Len) + Output_Len - 1));
end loop;
-- Run the parallel sponge
Parallel_Sponge.Init (T.Ctx);
Parallel_Sponge.Absorb_Bytes_Separate_With_Suffix
(Ctx => T.Ctx,
Data => Input,
Suffix => Suffix,
Suffix_Len => Suffix_Len);
Parallel_Sponge.Squeeze_Bytes_Separate
(Ctx => T.Ctx,
Data => Actual_Output);
Assert (Actual_Output = Reference_Output,
"Output of parallel sponge does not match serial sponge");
end Test_Same_Output_As_Serial;
end Parallel_Sponge_Tests;
|
private with Ada.Numerics;
with GL.Types;
with Orka.Transforms.Doubles.Matrices;
with Orka.Transforms.Doubles.Quaternions;
with Orka.Transforms.Doubles.Vectors;
with Planets.Earth;
package Coordinates is
package Quaternions renames Orka.Transforms.Doubles.Quaternions;
package Vectors renames Orka.Transforms.Doubles.Vectors;
package Matrices renames Orka.Transforms.Doubles.Matrices;
GL_To_Geo : constant Quaternions.Quaternion;
Earth_Tilt : constant Quaternions.Quaternion;
Orientation_ECI : constant Quaternions.Quaternion;
Rotate_ECI : constant Matrices.Matrix4;
Inverse_Rotate_ECI : constant Matrices.Matrix4;
function Rotate_ECEF return Matrices.Matrix4;
Orientation_ECEF : Quaternions.Quaternion := Quaternions.Identity_Value;
private
use type GL.Types.Double;
GL_To_Geo : constant Quaternions.Quaternion :=
Quaternions.R (Vectors.Normalize ((1.0, 1.0, 1.0, 0.0)),
0.66667 * Ada.Numerics.Pi);
Earth_Tilt : constant Quaternions.Quaternion :=
Quaternions.R (Vectors.Normalize ((1.0, 0.0, 0.0, 0.0)),
Vectors.To_Radians (Planets.Earth.Planet.Axial_Tilt_Deg));
use type Quaternions.Quaternion;
Orientation_ECI : constant Quaternions.Quaternion := Earth_Tilt * GL_To_Geo;
Rotate_ECI : constant Matrices.Matrix4 :=
Matrices.R (Matrices.Vector4 (Orientation_ECI));
Inverse_Rotate_ECI : constant Matrices.Matrix4 :=
Matrices.R (Matrices.Vector4 (Quaternions.Conjugate (Orientation_ECI)));
function Rotate_ECEF return Matrices.Matrix4 is
(Matrices.R (Matrices.Vector4 (Orientation_ECEF * Orientation_ECI)));
-- type Geocentric_Coordinate is record
-- X, Y, Z : GL.Types.Double;
-- end record;
-- Geocentric coordinates or Earth-Centered Earth-Fixed (ECEF)
--
-- (0, 0, 0) is the center of mass of the Earth. The z-axis intersects
-- the true north (north pole), while the x-axis intersects the Earth
-- at 0 deg latitude and 0 deg longitude.
-- type Geodetic_Coordinate is record
-- Longitude, Latitude, Height : GL.Types.Double;
-- end record;
-- Subsolar point (point when sun is directly above a position (at zenith):
--
-- latitude = declination of the sun
-- longitude = -15 * (T_UTC - 12 + E_min / 60) [2]
--
-- T_UTC = time UTC
-- E_min = equation of time [1] in minutes
--
-- [1] https://en.wikipedia.org/wiki/Equation_of_time
-- [2] https://doi.org/10.1016/j.renene.2021.03.047
end Coordinates;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- Copyright (C) 2012-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Interfaces.STM32;
package System.STM32 is
pragma No_Elaboration_Code_All;
pragma Preelaborate (System.STM32);
subtype Frequency is Interfaces.STM32.UInt32;
-- See RM0433 rev. 7 pg. 334 chapter 8.5, and pg. 335 for clock tree
type RCC_System_Clocks is record
SYSCLK : Frequency;
HCLK1 : Frequency; -- CPU clock
HCLK2 : Frequency; -- AHBs peripheral clocks
PCLK1 : Frequency; -- APB1 peripheral clock (D2PPRE1)
PCLK2 : Frequency; -- APB2 peripheral clock (D2PPRE2)
PCLK3 : Frequency; -- APB3 peripheral clock (D1PPRE)
PCLK4 : Frequency; -- APB4 peripheral clock (D3PPRE)
TIMCLK1 : Frequency; -- APB1 timer clock for TIMs 2 .. 7, 12 .. 14
TIMCLK2 : Frequency; -- APB2 timer clock for TIMs 1, 8, 15 .. 17
TIMCLK3 : Frequency; -- APB1 timer clock for HRTIM1
end record;
function System_Clocks return RCC_System_Clocks;
-- MODER constants
subtype GPIO_MODER_Values is Interfaces.STM32.UInt2;
Mode_IN : constant GPIO_MODER_Values := 0;
Mode_OUT : constant GPIO_MODER_Values := 1;
Mode_AF : constant GPIO_MODER_Values := 2;
Mode_AN : constant GPIO_MODER_Values := 3;
-- OTYPER constants
subtype GPIO_OTYPER_Values is Interfaces.STM32.Bit;
Push_Pull : constant GPIO_OTYPER_Values := 0;
Open_Drain : constant GPIO_OTYPER_Values := 1;
-- OSPEEDR constants
subtype GPIO_OSPEEDR_Values is Interfaces.STM32.UInt2;
Speed_2MHz : constant GPIO_OSPEEDR_Values := 0; -- Low speed
Speed_25MHz : constant GPIO_OSPEEDR_Values := 1; -- Medium speed
Speed_50MHz : constant GPIO_OSPEEDR_Values := 2; -- Fast speed
Speed_100MHz : constant GPIO_OSPEEDR_Values := 3; -- High speed
-- PUPDR constants
subtype GPIO_PUPDR_Values is Interfaces.STM32.UInt2;
No_Pull : constant GPIO_PUPDR_Values := 0;
Pull_Up : constant GPIO_PUPDR_Values := 1;
Pull_Down : constant GPIO_PUPDR_Values := 2;
-- AFL constants
AF_USART1 : constant Interfaces.STM32.UInt4 := 7;
AF_USART3 : constant Interfaces.STM32.UInt4 := 7;
type MCU_ID_Register is record
DEV_ID : Interfaces.STM32.UInt12;
Reserved : Interfaces.STM32.UInt4;
REV_ID : Interfaces.STM32.UInt16;
end record with Pack, Size => 32;
-- RCC constants
type PLL_Source is
(PLL_SRC_HSI,
PLL_SRC_CSI,
PLL_SRC_HSE)
with Size => 2;
for PLL_Source use
(PLL_SRC_HSI => 2#00#,
PLL_SRC_CSI => 2#01#,
PLL_SRC_HSE => 2#10#);
type SYSCLK_Source is
(SYSCLK_SRC_HSI,
SYSCLK_SRC_CSI,
SYSCLK_SRC_HSE,
SYSCLK_SRC_PLL)
with Size => 3;
for SYSCLK_Source use
(SYSCLK_SRC_HSI => 2#000#,
SYSCLK_SRC_CSI => 2#001#,
SYSCLK_SRC_HSE => 2#010#,
SYSCLK_SRC_PLL => 2#011#);
type AHB_Prescaler_Enum is
(DIV2, DIV4, DIV8, DIV16,
DIV64, DIV128, DIV256, DIV512)
with Size => 3;
type AHB_Prescaler is record
Enabled : Boolean := False;
Value : AHB_Prescaler_Enum := AHB_Prescaler_Enum'First;
end record with Size => 4;
for AHB_Prescaler use record
Enabled at 0 range 3 .. 3;
Value at 0 range 0 .. 2;
end record;
type APB_Prescaler_Enum is
(DIV2, DIV4, DIV8, DIV16)
with Size => 2;
type APB_Prescaler is record
Enabled : Boolean;
Value : APB_Prescaler_Enum := APB_Prescaler_Enum'First;
end record with Size => 3;
for APB_Prescaler use record
Enabled at 0 range 2 .. 2;
Value at 0 range 0 .. 1;
end record;
type MCO1_Clock_Selection is
(MCOSEL_HSI,
MCOSEL_LSE,
MCOSEL_HSE,
MCOSEL_PLL1,
MCOSEL_HSI48)
with Size => 3;
type MCO2_Clock_Selection is
(MCOSEL_SYSCLK,
MCOSEL_PLL2,
MCOSEL_HSE,
MCOSEL_PLL1,
MCOSEL_CSI,
MCOSEL_LSI)
with Size => 3;
type MCO_Prescaler is
(MCOPRE_Disabled,
MCOPRE_DIV1, -- Bypass
MCOPRE_DIV2,
MCOPRE_DIV3,
MCOPRE_DIV4,
MCOPRE_DIV5,
MCOPRE_DIV6,
MCOPRE_DIV7,
MCOPRE_DIV8,
MCOPRE_DIV9,
MCOPRE_DIV10,
MCOPRE_DIV11,
MCOPRE_DIV12,
MCOPRE_DIV13,
MCOPRE_DIV14,
MCOPRE_DIV15)
with Size => 4;
type HSI_Divisor is
(HSI_DIV1,
HSI_DIV2,
HSI_DIV4,
HSI_DIV8)
with Size => 2;
type PER_Source is
(PER_SRC_HSI,
PER_SRC_CSI,
PER_SRC_HSE)
with Size => 2;
-- Constants for RCC CR register
subtype PLLM_Range is Integer range 1 .. 63;
subtype PLLN_Range is Integer range 4 .. 512;
subtype PLL1P_Range is Integer range 2 .. 128; -- Only even numbers
subtype PLL23P_Range is Integer range 1 .. 128;
subtype PLLQ_Range is Integer range 1 .. 128;
subtype PLLR_Range is Integer range 1 .. 128;
subtype HSECLK_Range is Integer range 4_000_000 .. 50_000_000;
subtype PLLM_OUT_Range is Integer range 1_000_000 .. 16_000_000;
subtype PLLN_OUT_Range is Integer range 150_000_000 .. 960_000_000;
subtype PLL1P_OUT_Range is Integer range 1_500_000 .. 480_000_000;
subtype PLL2P_OUT_Range is Integer range 1_500_000 .. 300_000_000;
subtype PLL3P_OUT_Range is Integer range 1_500_000 .. 200_000_000;
subtype PLL1Q_OUT_Range is Integer range 1_500_000 .. 400_000_000;
subtype PLL2Q_OUT_Range is Integer range 1_500_000 .. 300_000_000;
subtype PLL3Q_OUT_Range is Integer range 1_500_000 .. 200_000_000;
subtype PLLCLK_Range is Integer range 192_000_000 .. 836_000_000;
subtype SYSCLK_Range is Integer range 1 .. 480_000_000;
subtype HCLK1_Range is Integer range 1 .. 480_000_000;
subtype HCLK2_Range is Integer range 1 .. 240_000_000;
subtype PCLK1_Range is Integer range 1 .. 120_000_000;
subtype PCLK2_Range is Integer range 1 .. 120_000_000;
subtype PCLK3_Range is Integer range 1 .. 120_000_000;
subtype PCLK4_Range is Integer range 1 .. 120_000_000;
-- Constants for Flash read latency with VCORE Range in relation to
-- AXI Interface clock frequency (MHz) (AXI clock is HCLK2):
-- RM0433 STM32H743 pg. 159 table 17 chapter 4.3.8.
-- VCORE range VOS3 | VOS2 | VOS1 | VOS0
-- 000: Zero wait state 0 - 45 | 0 - 55 | 0 - 70 | 0 - 70
-- 001: One wait state 45 - 90 | 55 - 110 | 70 - 140 | 70 - 140
-- 010: Two wait sates 90 - 135 | 110 - 165 | 140 - 210 | 140 - 210
-- 011: Three wait sates 135 - 180 | 165 - 225 | 210 - 225 | 210 - 225
-- 100: Four wait sates 180 - 225 | 225 | | 225 - 240
subtype FLASH_Latency_0 is Integer range 1 .. 70_000_000;
subtype FLASH_Latency_1 is Integer range 71_000_000 .. 140_000_000;
subtype FLASH_Latency_2 is Integer range 141_000_000 .. 210_000_000;
subtype FLASH_Latency_3 is Integer range 211_000_000 .. 225_000_000;
subtype FLASH_Latency_4 is Integer range 226_000_000 .. 240_000_000;
-- Flash wait states
type FLASH_WS is (FWS0, FWS1, FWS2, FWS3, FWS4)
with Size => 4;
FLASH_Latency : Interfaces.STM32.UInt4 := FLASH_WS'Enum_Rep (FWS4);
type VCORE_Scaling_Selection is
(Scale_3,
Scale_2,
Scale_1);
for VCORE_Scaling_Selection use
(Scale_3 => 2#01#,
Scale_2 => 2#10#,
Scale_1 => 2#11#);
MCU_ID : MCU_ID_Register
with Volatile, Address => System'To_Address (16#E00E_1000#);
-- DBGMCU_IDC Identity code register, also at CPU address 16#5C00_1000#.
-- RM0433 rev 7 pg. 3189 chapter 60.5.8.
DEV_ID_STM32F40xxx : constant := 16#413#; -- STM32F40xxx/41xxx
DEV_ID_STM32F42xxx : constant := 16#419#; -- STM32F42xxx/43xxx
DEV_ID_STM32F46xxx : constant := 16#434#; -- STM32F469xx/479xx
DEV_ID_STM32F74xxx : constant := 16#449#; -- STM32F74xxx/75xxx
DEV_ID_STM32F76xxx : constant := 16#451#; -- STM32F76xxx/77xxx
DEV_ID_STM32F334xx : constant := 16#438#; -- STM32F334xx
DEV_ID_STM32G474x2 : constant := 16#468#; -- STM32G474xx category 2
DEV_ID_STM32G474x3 : constant := 16#469#; -- STM32G474xx category 3
DEV_ID_STM32G474x4 : constant := 16#479#; -- STM32G474xx category 4
DEV_ID_STM32H743 : constant := 16#450#; -- STM32H742/743/753/750
end System.STM32;
|
with Ada.Strings.Fixed;
package body tracker is
procedure Percentage (Object : in out Collection) is
begin
for I in Fixed_Collection'First .. Fixed_Collection'First + Object.Items_Count - 1 loop
Object.Counter (Object.Items(I).state) := Object.Counter(Object.Items(I).state) + 1;
end loop;
end Percentage;
procedure Set_Name (Object : in out Collection; Name : String) is
begin
Ada.Strings.Fixed.Move (Name, Object.Name);
end Set_Name;
procedure Add_Item (Object : in out Collection ; Name : String ; S : Item_Status := UNSTARTED) is
New_Item : Item;
begin
New_Item.state := S;
Ada.Strings.Fixed.Move (Name, New_Item.name);
New_Item.name_length := Integer'Min (Name'Length, New_Item.name'Length);
Object.Items (Object.Items'First + Object.Items_Count) := New_Item;
Object.Items_Count := Object.Items_Count + 1;
end Add_Item;
procedure Move_Up (Object : in out Collection ; Item : Integer) is
begin
null;
end Move_Up;
procedure Move_Down (Object : in out Collection ; Item : Integer) is
begin
null;
end Move_Down;
procedure Add_Collection (Object : in out Board; Col : Collection) is
begin
Object.Collections (Object.Collections'First + Object.Collection_Count) := Col;
Object.Collection_Count := Object.Collection_Count + 1;
end Add_Collection;
end tracker;
|
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A S I S . S E T _ G E T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1995-2011, 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.adaccore.com). --
-- --
------------------------------------------------------------------------------
with Ada.Characters.Handling; use Ada.Characters.Handling;
with A4G.A_Sem; use A4G.A_Sem;
with A4G.Contt; use A4G.Contt;
with A4G.Contt.UT; use A4G.Contt.UT;
with A4G.Contt.TT; use A4G.Contt.TT;
with A4G.GNAT_Int; use A4G.GNAT_Int;
with A4G.Knd_Conv; use A4G.Knd_Conv;
with Atree; use Atree;
with Sinfo; use Sinfo;
with Stand; use Stand;
with Uintp; use Uintp;
package body Asis.Set_Get is
-----------------------
-- Local Subprograms --
-----------------------
function Element_In_Current_Tree (E : Element) return Boolean;
-- Checks if the currently accessed tree is the tree from which the
-- argument has been obtained.
---------------------
-- To_Program_Text --
---------------------
function To_Program_Text (S : String) return Program_Text is
Result : Wide_String (1 .. S'Length);
Result_Len : Natural := 0;
Next_Char : Natural := S'First;
Tmp : Natural;
function To_Wide_Char (S : String) return Wide_Character;
-- Converts ["hh"] and ["hhhh"] notation into Wide_Character
function To_Wide_Char (S : String) return Wide_Character is
Numerical : Natural := 0;
type Xlate is array (Character range '0' .. 'F') of Natural;
Xlation : constant Xlate :=
('0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4,
'5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9,
'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14,
'F' => 15, others => 0);
begin
for I in S'Range loop
Numerical := Numerical * 16 + Xlation (S (I));
end loop;
return Wide_Character'Val (Numerical);
end To_Wide_Char;
begin
while Next_Char <= S'Last loop
Result_Len := Result_Len + 1;
if S (Next_Char) = '[' then
Next_Char := Next_Char + 2;
Tmp := Next_Char;
while S (Tmp + 1) /= '"' loop
Tmp := Tmp + 1;
end loop;
Result (Result_Len) :=
To_Wide_Char (S (Next_Char .. Tmp));
Next_Char := Tmp + 3;
else
Result (Result_Len) :=
To_Wide_Character (S (Next_Char));
Next_Char := Next_Char + 1;
end if;
end loop;
return Result (1 .. Result_Len);
end To_Program_Text;
-------------
-- CONTEXT --
-------------
-------------------------------------
-- Id <-> ASIS Context conversions --
-------------------------------------
function Get_Cont_Id (C : Context) return Context_Id is
begin
return C.Id;
end Get_Cont_Id;
function Get_Cont (Id : Context_Id) return Context is
begin
return (Id => Id);
end Get_Cont;
procedure Set_Cont (C : out Context; Id : Context_Id) is
begin
C.Id := Id;
end Set_Cont;
function Valid (C : Context) return Boolean is
begin
return Is_Opened (C.Id);
end Valid;
----------------------
-- COMPILATION_UNIT --
----------------------
----------------------------------------------
-- Id <-> ASIS Compilation Unit conversions --
----------------------------------------------
function Get_Unit_Id (C_U : Compilation_Unit) return Unit_Id is
begin
return C_U.Id;
end Get_Unit_Id;
function Get_Comp_Unit
(U : Unit_Id;
C : Context_Id)
return Compilation_Unit
is
Result_Unit : Compilation_Unit;
begin
if U = Nil_Unit then
return Nil_Compilation_Unit;
end if;
Result_Unit := (Cont_Id => C, Id => U, Obtained => A_OS_Time);
return Result_Unit;
end Get_Comp_Unit;
------------------------
-- Get_Comp_Unit_List --
------------------------
function Get_Comp_Unit_List
(U_List : Unit_Id_List;
C : Context_Id)
return Compilation_Unit_List
is
Result_Len : constant Natural := U_List'Length;
Result_List : Compilation_Unit_List (1 .. Result_Len);
U_L_First : constant Natural := U_List'First;
begin
for I in 1 .. Result_Len loop
Result_List (I) := Get_Comp_Unit (U_List (U_L_First + I - 1), C);
end loop;
return Result_List;
end Get_Comp_Unit_List;
-----------------------------------------
-- Getting Compilation Unit Attributes --
-----------------------------------------
function Not_Nil (C_U : Compilation_Unit) return Boolean is
begin
return Get_Unit_Id (C_U) /= Nil_Unit;
end Not_Nil;
function Nil (C_U : Compilation_Unit) return Boolean is
begin
return Get_Unit_Id (C_U) = Nil_Unit;
end Nil;
function Is_Standard (C_U : Compilation_Unit) return Boolean is
begin
return Get_Unit_Id (C_U) = Standard_Id;
end Is_Standard;
function Kind (C_U : Compilation_Unit) return Asis.Unit_Kinds is
begin
if C_U.Id = Nil_Unit then
return Not_A_Unit;
else
return Kind (C_U.Cont_Id, C_U.Id);
end if;
end Kind;
function Class (C_U : Compilation_Unit) return Unit_Classes is
begin
if C_U.Id = Nil_Unit then
return Not_A_Class;
else
return Class (C_U.Cont_Id, C_U.Id);
end if;
end Class;
function Origin (C_U : Compilation_Unit) return Unit_Origins is
begin
if C_U.Id = Nil_Unit then
return Not_An_Origin;
else
return Origin (C_U.Cont_Id, C_U.Id);
end if;
end Origin;
function Is_Main_Unit (C_U : Compilation_Unit) return Boolean is
begin
return Is_Main_Unit (C_U.Cont_Id, C_U.Id);
end Is_Main_Unit;
function Top (C_U : Compilation_Unit) return Node_Id is
begin
if not Unit_In_Current_Tree (C_U.Cont_Id, C_U.Id) then
Reset_Tree_For_Unit (C_U.Cont_Id, C_U.Id);
end if;
return Top (C_U.Id);
end Top;
function Is_Body_Required (C_U : Compilation_Unit) return Boolean is
begin
return Is_Body_Required (C_U.Cont_Id, C_U.Id);
end Is_Body_Required;
function Encl_Cont (C_U : Compilation_Unit) return Context is
begin
return Get_Cont (C_U.Cont_Id);
end Encl_Cont;
function Unit_Name (C_U : Compilation_Unit) return String is
begin
Get_Name_String (C_U.Id, Ada_Name);
return A4G.Contt.A_Name_Buffer (1 .. A4G.Contt.A_Name_Len);
end Unit_Name;
function Encl_Cont_Id (C_U : Compilation_Unit) return Context_Id is
begin
return C_U.Cont_Id;
end Encl_Cont_Id;
function Source_File (C_U : Compilation_Unit) return String
is
begin
if Length_Of_Name (C_U.Id, Source_File_Name) = 0 then
return Nil_Asis_String;
else
Get_Name_String (C_U.Id, Source_File_Name);
return A4G.Contt.A_Name_Buffer (1 .. A4G.Contt.A_Name_Len);
end if;
end Source_File;
function Ref_File (C_U : Compilation_Unit) return String
is
begin
if Length_Of_Name (C_U.Id, Ref_File_Name) = 0 then
return Nil_Asis_String;
else
Get_Name_String (C_U.Id, Ref_File_Name);
return A4G.Contt.A_Name_Buffer (1 .. A4G.Contt.A_Name_Len);
end if;
end Ref_File;
function Context_Info (C_U : Compilation_Unit) return String
is
begin
return Context_Info (C_U.Cont_Id);
end Context_Info;
function Time_Stamp (C_U : Compilation_Unit) return Time
is
begin
return A_Time (Time_Stamp (C_U.Cont_Id, C_U.Id));
end Time_Stamp;
function Source_Status (C_U : Compilation_Unit)
return Source_File_Statuses
is
begin
if C_U.Id = Nil_Unit then
return No_File_Status;
else
return Source_Status (C_U.Cont_Id, C_U.Id);
end if;
end Source_Status;
function Main_Tree (C_U : Compilation_Unit) return Tree_Id is
begin
return Main_Tree (C_U.Cont_Id, C_U.Id);
end Main_Tree;
-------------------
-- Miscellaneous --
-------------------
function "=" (Left, Right : Compilation_Unit) return Boolean is
Result : Boolean;
begin
Result :=
Left.Id = Right.Id and then
Left.Cont_Id = Right.Cont_Id and then
Left.Obtained = Right.Obtained;
return Result;
end "=";
--------------------------
-- Get_Configuration_CU --
--------------------------
function Get_Configuration_CU
(C_U : Compilation_Unit)
return Compilation_Unit
is
begin
return Get_Comp_Unit (Config_Comp_Id, Encl_Cont_Id (C_U));
end Get_Configuration_CU;
-------------------
-- Set_Main_Tree --
-------------------
procedure Reset_Main_Tree (C_U : Compilation_Unit) is
Main_Tree_Id : constant Tree_Id := Main_Tree (C_U);
begin
if Main_Tree_Id /= Nil_Tree then
Reset_Tree (C_U.Cont_Id, Main_Tree_Id);
end if;
end Reset_Main_Tree;
-----------
-- Valid --
-----------
function Valid (C_U : Compilation_Unit) return Boolean is
begin
return Is_Opened (C_U.Cont_Id) and then
Later (Opened_At (C_U.Cont_Id), C_U.Obtained);
end Valid;
-------------
-- ELEMENT --
-------------
function "=" (Left, Right : Element) return Boolean is
Result : Boolean;
begin
-- just literal field-by-field comparison
Result :=
Left.Node = Right.Node and then
Left.R_Node = Right.R_Node and then
Left.Node_Field_1 = Right.Node_Field_1 and then
Left.Node_Field_2 = Right.Node_Field_2 and then
Left.Enclosing_Unit = Right.Enclosing_Unit and then
Left.Enclosing_Context = Right.Enclosing_Context and then
Left.Internal_Kind = Right.Internal_Kind and then
Left.Is_Part_Of_Implicit = Right.Is_Part_Of_Implicit and then
Left.Is_Part_Of_Inherited = Right.Is_Part_Of_Inherited and then
Left.Is_Part_Of_Instance = Right.Is_Part_Of_Instance and then
Left.Special_Case = Right.Special_Case and then
Left.Enclosing_Tree = Right.Enclosing_Tree and then
Left.Rel_Sloc = Right.Rel_Sloc and then
Left.Character_Code = Right.Character_Code and then
Left.Obtained = Right.Obtained;
return Result;
end "=";
---------
-- Get --
---------
function Node (E : Element) return Node_Id is
begin
if E.Internal_Kind /= Not_An_Element and then
not Element_In_Current_Tree (E)
then
Reset_Tree (E.Enclosing_Context, E.Enclosing_Tree);
end if;
return E.Node;
end Node;
function R_Node (E : Element) return Node_Id is
begin
if E.Internal_Kind /= Not_An_Element and then
not Element_In_Current_Tree (E)
then
Reset_Tree (E.Enclosing_Context, E.Enclosing_Tree);
end if;
return E.R_Node;
end R_Node;
function Node_Field_1 (E : Element) return Node_Id is
begin
if E.Internal_Kind /= Not_An_Element and then
not Element_In_Current_Tree (E)
then
Reset_Tree (E.Enclosing_Context, E.Enclosing_Tree);
end if;
return E.Node_Field_1;
end Node_Field_1;
function Node_Field_2 (E : Element) return Node_Id is
begin
if E.Internal_Kind /= Not_An_Element and then
not Element_In_Current_Tree (E)
then
Reset_Tree (E.Enclosing_Context, E.Enclosing_Tree);
end if;
return E.Node_Field_2;
end Node_Field_2;
function Node_Value (E : Element) return Node_Id is
begin
return E.Node;
end Node_Value;
function R_Node_Value (E : Element) return Node_Id is
begin
return E.R_Node;
end R_Node_Value;
function Node_Field_1_Value (E : Element) return Node_Id is
begin
return E.Node_Field_1;
end Node_Field_1_Value;
function Node_Field_2_Value (E : Element) return Node_Id is
begin
return E.Node_Field_2;
end Node_Field_2_Value;
function Encl_Unit (E : Element) return Compilation_Unit is
begin
return Get_Comp_Unit (E.Enclosing_Unit, E.Enclosing_Context);
end Encl_Unit;
function Encl_Unit_Id (E : Element) return Unit_Id is
begin
return E.Enclosing_Unit;
end Encl_Unit_Id;
function Encl_Cont (E : Element) return Context is
begin
return Get_Cont (E.Enclosing_Context);
end Encl_Cont;
function Encl_Cont_Id (E : Element) return Context_Id is
begin
return E.Enclosing_Context;
end Encl_Cont_Id;
function Kind (E : Element) return Asis.Element_Kinds is
begin
return Asis_From_Internal_Kind (E.Internal_Kind);
end Kind;
function Int_Kind (E : Element) return Internal_Element_Kinds is
begin
return E.Internal_Kind;
end Int_Kind;
function Is_From_Implicit (E : Element) return Boolean is
begin
return E.Is_Part_Of_Implicit;
end Is_From_Implicit;
function Is_From_Inherited (E : Element) return Boolean is
begin
return E.Is_Part_Of_Inherited;
end Is_From_Inherited;
function Is_From_Instance (E : Element) return Boolean is
begin
return E.Is_Part_Of_Instance;
end Is_From_Instance;
function Special_Case (E : Element) return Special_Cases is
begin
return E.Special_Case;
end Special_Case;
function Normalization_Case (E : Element) return Normalization_Cases is
begin
return E.Normalization_Case;
end Normalization_Case;
function Parenth_Count (E : Element) return Nat is
begin
return E.Parenth_Count;
end Parenth_Count;
function Encl_Tree (E : Element) return Tree_Id is
begin
return E.Enclosing_Tree;
end Encl_Tree;
function Rel_Sloc (E : Element) return Source_Ptr is
begin
return E.Rel_Sloc;
end Rel_Sloc;
function Character_Code (E : Element) return Char_Code is
begin
return E.Character_Code;
end Character_Code;
function Obtained (E : Element) return ASIS_OS_Time is
begin
return E.Obtained;
end Obtained;
function Location (E : Element) return Source_Ptr is
begin
return Sloc (Node (E));
end Location;
function Valid (E : Element) return Boolean is
begin
return Is_Opened (E.Enclosing_Context) and then
Later (Opened_At (E.Enclosing_Context), E.Obtained);
end Valid;
---------
-- Set --
---------
procedure Set_Node (E : in out Element; N : Node_Id) is
Rel_Sloc : Source_Ptr;
begin
E.Node := N;
-- If we reset the node, we have to recompute Sloc as well:
Rel_Sloc := Sloc (N);
if Rel_Sloc > Standard_Location then
Rel_Sloc := Rel_Sloc - Sloc (Top (E.Enclosing_Unit));
E.Rel_Sloc := Rel_Sloc;
end if;
end Set_Node;
procedure Set_R_Node
(E : in out Element; N : Node_Id) is
begin
E.R_Node := N;
end Set_R_Node;
procedure Set_Node_Field_1
(E : in out Element; N : Node_Id) is
begin
E.Node_Field_1 := N;
end Set_Node_Field_1;
procedure Set_Node_Field_2
(E : in out Element; N : Node_Id) is
begin
E.Node_Field_2 := N;
end Set_Node_Field_2;
procedure Set_Encl_Unit_Id
(E : in out Element; U : Unit_Id) is
begin
E.Enclosing_Unit := U;
end Set_Encl_Unit_Id;
procedure Set_Enclosing_Context
(E : in out Element; C : Context_Id) is
begin
E.Enclosing_Context := C;
end Set_Enclosing_Context;
procedure Set_Obtained
(E : in out Element; T : ASIS_OS_Time) is
begin
E.Obtained := T;
end Set_Obtained;
procedure Set_Int_Kind
(E : in out Element; K : Internal_Element_Kinds) is
begin
E.Internal_Kind := K;
end Set_Int_Kind;
procedure Set_From_Implicit
(E : in out Element; I : Boolean := True) is
begin
E.Is_Part_Of_Implicit := I;
end Set_From_Implicit;
procedure Set_From_Inherited
(E : in out Element; I : Boolean := True) is
begin
E.Is_Part_Of_Inherited := I;
end Set_From_Inherited;
procedure Set_From_Instance
(E : in out Element; I : Boolean := True) is
begin
E.Is_Part_Of_Instance := I;
end Set_From_Instance;
procedure Set_Special_Case
(E : in out Element; S : Special_Cases) is
begin
E.Special_Case := S;
end Set_Special_Case;
procedure Set_Normalization_Case
(E : in out Element; N : Normalization_Cases) is
begin
E.Normalization_Case := N;
end Set_Normalization_Case;
procedure Set_Parenth_Count (E : in out Element; Val : Nat) is
begin
E.Parenth_Count := Val;
end Set_Parenth_Count;
procedure Set_Rel_Sloc
(E : in out Element; S : Source_Ptr) is
begin
E.Rel_Sloc := S;
end Set_Rel_Sloc;
procedure Set_Character_Code
(E : in out Element; C : Char_Code) is
begin
E.Character_Code := C;
end Set_Character_Code;
procedure Set_Encl_Tree
(E : in out Element; T : Tree_Id) is
begin
E.Enclosing_Tree := T;
end Set_Encl_Tree;
-----------------
-- Set_Element --
-----------------
function Set_Element
(Node : Node_Id;
R_Node : Node_Id;
Node_Field_1 : Node_Id;
Node_Field_2 : Node_Id;
Encl_Unit : Compilation_Unit;
-- contains Ids for both Enclosing Compilation Unit and Enclosing
-- Context
Int_Kind : Internal_Element_Kinds;
Implicit : Boolean;
Inherited : Boolean;
Instance : Boolean;
Spec_Case : Special_Cases;
Norm_Case : Normalization_Cases;
Par_Count : Nat;
Character_Code : Char_Code)
return Element
is
Cont_Id : constant Context_Id := Encl_Unit.Cont_Id;
Un_Id : constant Unit_Id := Encl_Unit.Id;
Arg_N_Kind : Node_Kind;
Rel_Sloc : Source_Ptr := No_Location;
Ch_Code : Char_Code := 0;
-- Character_Code is set "by hand" for defining character literals
-- from Standard, when the corresponding element is created
-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --
-- ??????????????????????????????????????????????????????????????? --
-- --
-- Temporary solution for the problem with generics: --
-- --
-- The problem consists in following: GNAT rewrites all the --
-- structures related to generics: generic specifications, --
-- generic bodies and generic instantiations, and the --
-- corresponding original tree structures ARE NOT fully --
-- decorated by semantic information. --
-- --
-- The rough fix suggested here is to use the original tree --
-- structures for everything except the cases mentioned above, --
-- and to use the rewritten structures for these cases --
-- when original structures are not fully decorated. --
-- --
-- This fix should definitely be revised when the new model --
-- for generics are implemented! --
-- --
-- ??????????????????????????????????????????????????????????????? --
-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --
-- start of the patch code for generics -----------------------------
Element_Node : Node_Id := Node;
function Is_Generic (Node : Node_Id) return Boolean;
-- This function checks is its argument represents a generic unit in
-- a source code
function Is_Generic (Node : Node_Id) return Boolean is
Kind : constant Node_Kind := Nkind (Node);
Or_Kind : constant Node_Kind := Nkind (Original_Node (Node));
Result : Boolean := False;
begin
-- first, general condition:
Result := Is_Rewrite_Substitution (Node) and then
(Kind = N_Generic_Subprogram_Declaration or else
Kind = N_Generic_Package_Declaration or else
Kind = N_Subprogram_Body or else
Kind = N_Package_Body);
-- and now - some special exceptions (fixes in fixes -
-- this makes me crazy!!!!
if Result and then
Kind = N_Generic_Package_Declaration and then
Or_Kind = N_Formal_Package_Declaration
then
-- this is the case of a formal package declaration with the
-- box rewritten into N_Generic_Package_Declaration
Result := False;
elsif Result and then
(Or_Kind = N_Subprogram_Renaming_Declaration)
-- this is the case of renaming a subprogram-attribute
-- or else SCz
-- Or_Kind = N_Expression_Function)
then
Result := False;
elsif Result and then
Or_Kind in N_Generic_Instantiation and then
Nkind (Parent (Node)) = N_Compilation_Unit
then
-- Library-level instantiation
Result := False;
end if;
return Result;
end Is_Generic;
-- end of the patch code for generics -------------------------------
begin
-- start of the patch code for generics -----------------------------
if Is_Generic (R_Node) then
Element_Node := R_Node;
end if;
-- end of the patch code for generics -------------------------------
Arg_N_Kind := Nkind (Node);
if Spec_Case in Predefined then
Rel_Sloc := Standard_Location;
-- does it really make any sense???
-- elsif???
else
if Arg_N_Kind = N_Object_Declaration or else
Arg_N_Kind = N_Number_Declaration or else
Arg_N_Kind = N_Discriminant_Specification or else
Arg_N_Kind = N_Component_Declaration or else
Arg_N_Kind = N_Parameter_Specification or else
Arg_N_Kind = N_Exception_Declaration or else
Arg_N_Kind = N_Formal_Object_Declaration
then
-- GNAT normalizes these multi-identifier declarations in the
-- equivalent sets of one-identifier declarations, so we have to
-- use the defining identifier node for setting Rel_Sloc
Rel_Sloc := Sloc (Defining_Identifier (Node));
elsif Arg_N_Kind = N_With_Clause then
-- the same story for with clauses, but here we have to use
-- the Name field
Rel_Sloc := Sloc (Sinfo.Name (Node));
else
Rel_Sloc := Sloc (Node);
end if;
if Spec_Case /= Configuration_File_Pragma then
Rel_Sloc := Rel_Sloc - Sloc (Top (Un_Id));
end if;
end if;
if Arg_N_Kind = N_Character_Literal then
Ch_Code := UI_To_CC (Char_Literal_Value (Node));
elsif Nkind (R_Node) = N_Character_Literal then -- ???
Ch_Code := UI_To_CC (Char_Literal_Value (R_Node));
else
Ch_Code := Character_Code;
end if;
return Element'(
-- start of the patch code for generics -----------------------------
Node => Element_Node, --
-- Node => Node, -- the original code --
-- end of the patch code for generics -------------------------------
R_Node => R_Node,
Node_Field_1 => Node_Field_1,
Node_Field_2 => Node_Field_2,
Enclosing_Unit => Un_Id,
Enclosing_Context => Cont_Id,
Internal_Kind => Int_Kind,
Is_Part_Of_Implicit => Implicit,
Is_Part_Of_Inherited => Inherited,
Is_Part_Of_Instance => Instance,
Special_Case => Spec_Case,
Normalization_Case => Norm_Case,
Parenth_Count => Par_Count,
Enclosing_Tree => Get_Current_Tree,
Rel_Sloc => Rel_Sloc,
Character_Code => Ch_Code,
Obtained => A_OS_Time);
end Set_Element;
-----------------------------
-- Convert_To_Limited_View --
-----------------------------
procedure Convert_To_Limited_View (El : in out Asis.Element) is
begin
Set_From_Implicit (El, True);
Set_Special_Case (El, From_Limited_View);
Set_Int_Kind (El, Limited_View_Kind (El));
end Convert_To_Limited_View;
-----------------
-- Set_In_List --
-----------------
function Set_In_List
(EL : Element_List;
Node_Field_1 : Node_Id := Empty;
Implicit : Boolean := False;
Inherited : Boolean := False)
return Element_List
is
Result : Element_List := EL;
begin
for J in Result'Range loop
Set_Node_Field_1 (Result (J), Node_Field_1);
Set_From_Implicit (Result (J), Implicit);
Set_From_Inherited (Result (J), Inherited);
end loop;
return Result;
end Set_In_List;
-----------------------------
-- Element_In_Current_Tree --
-----------------------------
function Element_In_Current_Tree (E : Element) return Boolean is
begin
return (E.Enclosing_Unit = Standard_Id)
or else
(E.Enclosing_Context = Get_Current_Cont and then
E.Enclosing_Tree = Get_Current_Tree);
end Element_In_Current_Tree;
-----------------------------------------------------------
-- Special processing for Elements representing root and --
-- universal numeric types in ASIS --
-----------------------------------------------------------
----------------------
-- Is_Root_Num_Type --
----------------------
function Is_Root_Num_Type
(Declaration : Asis.Declaration)
return Boolean
is
begin
return
(Declaration.Node = Empty and then
Declaration.R_Node = Empty and then
Declaration.Enclosing_Unit = Standard_Id and then
Declaration.Internal_Kind = An_Ordinary_Type_Declaration and then
Declaration.Is_Part_Of_Implicit and then
Declaration.Special_Case = Implicit_From_Standard);
-- several conditions are checked in this test - just in case
end Is_Root_Num_Type;
--------------------------
-- Root_Type_Definition --
--------------------------
function Root_Type_Definition
(Declaration : Asis.Declaration)
return Asis.Definition
is
Result : Asis.Definition := Declaration;
begin
-- only two fields should be corrected:
Result.Internal_Kind := Internal_Element_Kinds'Val (Result.Rel_Sloc);
Result.Obtained := A_OS_Time;
return Result;
end Root_Type_Definition;
-------------------------------
-- Set_Root_Type_Declaration --
-------------------------------
Root_Type_Declaration_Template : constant Element :=
Element'(Node => Empty,
R_Node => Empty,
Node_Field_1 => Empty,
Node_Field_2 => Empty,
Enclosing_Unit => Standard_Id,
Enclosing_Context => Nil_Context_Id, -- should be set
Internal_Kind => An_Ordinary_Type_Declaration,
Is_Part_Of_Implicit => True,
Is_Part_Of_Inherited => False,
Is_Part_Of_Instance => False,
Special_Case => Implicit_From_Standard,
Normalization_Case => Is_Not_Normalized,
Parenth_Count => 0,
Enclosing_Tree => Nil_Tree,
Rel_Sloc => -1, -- should be set
Character_Code => 0,
Obtained => Nil_ASIS_OS_Time);
function Set_Root_Type_Declaration
(Int_Kind : Internal_Element_Kinds;
Cont : Context_Id)
return Element
is
Result : Element := Root_Type_Declaration_Template;
begin
if Int_Kind in Internal_Root_Type_Kinds then
Result.Enclosing_Context := Cont;
Result.Rel_Sloc := Internal_Element_Kinds'Pos (Int_Kind);
-- we use Rel_Sloc field to keep the ("encoded") kind of
-- the type definition. Bad style, I see... Let me know if
-- you have a better idea for these crazy Root_Type_Kinds!...
Result.Obtained := A_OS_Time;
return Result;
else
return Nil_Element;
end if;
end Set_Root_Type_Declaration;
begin
Char_Literal_Spec_Template :=
Element'(Node => Empty, -- should be set
R_Node => Empty, -- should be set
Node_Field_1 => Empty,
Node_Field_2 => Empty,
Enclosing_Unit => Standard_Id,
Enclosing_Context => Nil_Context_Id, -- should be set
Internal_Kind => An_Enumeration_Literal_Specification,
Is_Part_Of_Implicit => False,
Is_Part_Of_Inherited => False,
Is_Part_Of_Instance => False,
Special_Case => Stand_Char_Literal,
Normalization_Case => Is_Not_Normalized,
Parenth_Count => 0,
Enclosing_Tree => No_Tree_Name,
Rel_Sloc => -2,
Character_Code => 0, -- should be set
Obtained => Nil_ASIS_OS_Time); -- should be set
Numeric_Error_Template :=
Element'(Node => Standard_Package_Node,
R_Node => Standard_Package_Node,
Node_Field_1 => Empty,
Node_Field_2 => Empty,
Enclosing_Unit => Standard_Id,
Enclosing_Context => Nil_Context_Id,
Internal_Kind => An_Exception_Renaming_Declaration,
Is_Part_Of_Implicit => False,
Is_Part_Of_Inherited => False,
Is_Part_Of_Instance => False,
Special_Case => Numeric_Error_Renaming,
Normalization_Case => Is_Not_Normalized,
Parenth_Count => 0,
Enclosing_Tree => No_Tree_Name,
Rel_Sloc => -2,
Character_Code => 0,
Obtained => Nil_ASIS_OS_Time);
end Asis.Set_Get;
|
package body Activity is
procedure Printf (String : in Interfaces.C.char_array);
pragma Import (C, Printf, "printf");
procedure Thr1_Job is
Ret : Return_Code_Type;
begin
loop
Printf ("beep ");
Timed_Wait (1000, Ret);
end loop;
end Thr1_Job;
end Activity;
|
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with CUPS.bits_stat_h;
with System;
with Interfaces.C.Strings;
private package CUPS.cups_dir_h is
-- * "$Id: dir.h 10996 2013-05-29 11:51:34Z msweet $"
-- *
-- * Public directory definitions for CUPS.
-- *
-- * This set of APIs abstracts enumeration of directory entries.
-- *
-- * Copyright 2007-2011 by Apple Inc.
-- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
-- *
-- * These coded instructions, statements, and computer programs are the
-- * property of Apple Inc. and are protected by Federal copyright
-- * law. Distribution and use rights are outlined in the file "LICENSE.txt"
-- * which should have been included with this file. If this file is
-- * file is missing or damaged, see the license at "http://www.cups.org/".
--
-- * Include necessary headers...
--
-- * C++ magic...
--
-- * Data types...
--
--*** Directory type ***
-- skipped empty struct u_cups_dir_s
-- skipped empty struct cups_dir_t
--*** Directory entry type ***
-- File name
subtype cups_dentry_s_filename_array is Interfaces.C.char_array (0 .. 259);
type cups_dentry_s is record
filename : aliased cups_dentry_s_filename_array; -- cups/dir.h:47
fileinfo : aliased CUPS.bits_stat_h.stat; -- cups/dir.h:48
end record;
pragma Convention (C_Pass_By_Copy, cups_dentry_s); -- cups/dir.h:45
-- File information
subtype cups_dentry_t is cups_dentry_s;
-- * Prototypes...
--
procedure cupsDirClose (dp : System.Address); -- cups/dir.h:56
pragma Import (C, cupsDirClose, "cupsDirClose");
function cupsDirOpen (directory : Interfaces.C.Strings.chars_ptr) return System.Address; -- cups/dir.h:57
pragma Import (C, cupsDirOpen, "cupsDirOpen");
function cupsDirRead (dp : System.Address) return access cups_dentry_t; -- cups/dir.h:58
pragma Import (C, cupsDirRead, "cupsDirRead");
procedure cupsDirRewind (dp : System.Address); -- cups/dir.h:59
pragma Import (C, cupsDirRewind, "cupsDirRewind");
-- * End of "$Id: dir.h 10996 2013-05-29 11:51:34Z msweet $".
--
end CUPS.cups_dir_h;
|
package body Memory.Option is
function Create_Option return Option_Pointer is
result : constant Option_Pointer := new Option_Type;
begin
return result;
end Create_Option;
function Clone(mem : Option_Type) return Memory_Pointer is
result : constant Option_Pointer := new Option_Type'(mem);
begin
return Memory_Pointer(result);
end Clone;
procedure Permute(mem : in out Option_Type;
generator : in Distribution_Type;
max_cost : in Cost_Type) is
begin
mem.index := Random(generator) mod (mem.memories.Last_Index + 1);
end Permute;
procedure Add_Memory(mem : in out Option_Type;
other : access Memory_Type'Class) is
begin
mem.memories.Append(Memory_Pointer(other));
end Add_Memory;
function Done(mem : Option_Type) return Boolean is
begin
return Done(mem.memories.Element(mem.index).all);
end Done;
procedure Reset(mem : in out Option_Type;
context : in Natural) is
begin
for i in mem.memories.First_Index .. mem.memories.Last_Index loop
Reset(mem.memories.Element(i).all, context);
end loop;
end Reset;
procedure Set_Port(mem : in out Option_Type;
port : in Natural;
ready : out Boolean) is
begin
Set_Port(mem.memories.Element(mem.index).all, port, ready);
end Set_Port;
procedure Read(mem : in out Option_Type;
address : in Address_Type;
size : in Positive) is
begin
Read(mem.memories.Element(mem.index).all, address, size);
end Read;
procedure Write(mem : in out Option_Type;
address : in Address_Type;
size : in Positive) is
begin
Write(mem.memories.Element(mem.index).all, address, size);
end Write;
procedure Idle(mem : in out Option_Type;
cycles : in Time_Type) is
begin
Idle(mem.memories.Element(mem.index).all, cycles);
end Idle;
function Get_Time(mem : Option_Type) return Time_Type is
begin
return Get_Time(mem.memories.Element(mem.index).all);
end Get_Time;
function Get_Writes(mem : Option_Type) return Long_Integer is
begin
return Get_Writes(mem.memories.Element(mem.index).all);
end Get_Writes;
function To_String(mem : Option_Type) return Unbounded_String is
begin
return To_String(mem.memories.Element(mem.index).all);
end To_String;
function Get_Cost(mem : Option_Type) return Cost_Type is
begin
return Get_Cost(mem.memories.Element(mem.index).all);
end Get_Cost;
function Get_Word_Size(mem : Option_Type) return Positive is
begin
return Get_Word_Size(mem.memories.Element(mem.index).all);
end Get_Word_Size;
procedure Generate(mem : in Option_Type;
sigs : in out Unbounded_String;
code : in out Unbounded_String) is
begin
Generate(mem.memories.Element(mem.index).all, sigs, code);
end Generate;
function Get_Ports(mem : Option_Type) return Port_Vector_Type is
begin
return Get_Ports(mem.memories.Element(mem.index).all);
end Get_Ports;
procedure Adjust(mem : in out Option_Type) is
begin
for i in mem.memories.First_Index .. mem.memories.Last_Index loop
declare
ptr : constant Memory_Pointer := mem.memories.Element(i);
begin
mem.memories.Replace_Element(i, Clone(ptr.all));
end;
end loop;
end Adjust;
procedure Finalize(mem : in out Option_Type) is
begin
for i in mem.memories.First_Index .. mem.memories.Last_Index loop
declare
ptr : Memory_Pointer := mem.memories.Element(i);
begin
Destroy(ptr);
end;
end loop;
end Finalize;
end Memory.Option;
|
with System.Storage_Elements;
package TLSF.Allocator is
package SSE renames System.Storage_Elements;
type Pool is limited private;
function Init_Pool (Addr : System.Address;
Len : SSE.Storage_Count)
return Pool;
function Memory_Allocate (Sz : SSE.Storage_Count;
P : Pool)
return System.Address;
procedure Memory_Free (Addr : System.Address;
P : Pool);
private
pragma SPARK_Mode (Off);
type Pool_Header;
type Pool is access all Pool_Header;
end TLSF.Allocator;
|
-- part of AdaYaml, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "copying.txt"
with Text.Pool;
with Yaml.Events.Store;
private with Yaml.Events.Context;
private with Yaml.Transformator.Annotation;
package Yaml.Transformator.Annotation_Processor is
type Instance (<>) is limited new Transformator.Instance with private;
function New_Processor
(Pool : Text.Pool.Reference;
Externals : Events.Store.Reference := Events.Store.New_Store)
return Pointer;
overriding procedure Put (Object : in out Instance; E : Event)
with Pre => not Object.Has_Next;
function Has_Next (Object : Instance) return Boolean;
function Next (Object : in out Instance) return Event;
private
procedure Append (Object : in out Instance; E : Event);
type Annotated_Node is record
Swallows_Next : Boolean;
Impl : Transformator.Pointer;
Depth : Natural;
end record;
type Node_Array is array (Positive range <>) of Annotated_Node;
type Node_Array_Pointer is access Node_Array;
type Level_Array is array (Positive range <>) of
Annotation.Node_Context_Type;
type Level_Array_Pointer is access Level_Array;
type Current_State_Type is (Existing, Event_Held_Back, Releasing_Held_Back,
Swallowing_Document_End, Localizing_Alias,
Absent);
type Next_Event_Storage_Type is (No, Searching, Finishing, Yes);
type Instance is limited new Transformator.Instance with record
Context : Events.Context.Reference;
Pool : Text.Pool.Reference;
Annotation_Count, Level_Count, Stream_Depth : Natural := 0;
Current, Held_Back : Event;
Current_State : Current_State_Type := Absent;
Current_Stream : Events.Store.Optional_Stream_Reference;
Annotations : not null Node_Array_Pointer := new Node_Array (1 .. 16);
Levels : not null Level_Array_Pointer := new Level_Array (1 .. 64);
May_Finish_Transformation : Boolean := False;
Next_Event_Storage : Next_Event_Storage_Type := No;
end record;
overriding procedure Finalize (Object : in out Instance);
end Yaml.Transformator.Annotation_Processor;
|
------------------------------------------------------------------------------
-- Copyright (c) 2015-2019, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
with Natools.Cron;
package body Natools.Web.Sites.Holders is
type Cron_Callback is new Natools.Cron.Callback with record
Target : Site_Refs.Reference;
end record;
function Create (Target : Site_Refs.Reference)
return Natools.Cron.Callback'Class;
overriding procedure Run (Object : in out Cron_Callback);
------------------------------
-- Local Helper Subprograms --
------------------------------
function Create (Target : Site_Refs.Reference)
return Natools.Cron.Callback'Class is
begin
return Cron_Callback'(Target => Target);
end Create;
procedure Run (Object : in out Cron_Callback) is
begin
Updates.Reload (Object.Target.Query);
end Run;
-----------------------------
-- Holder Public Interface --
-----------------------------
overriding procedure Queue
(Self : in out Holder;
Update : in Updates.Site_Update'Class) is
begin
Self.Queue.Append (Update_Holders.To_Holder (Update));
end Queue;
not overriding procedure Load
(Self : in out Holder;
File_Name : in String)
is
New_Site : constant Site_Refs.Data_Access := new Site;
New_Ref : constant Site_Refs.Reference
:= Site_Refs.Create (New_Site);
begin
New_Site.Constructors := Self.Constructors;
New_Site.Filters := Self.Filters;
New_Site.Updater := Self'Unchecked_Access;
New_Site.Reset (File_Name);
Self.Ref := New_Ref;
Self.Queue.Append (Update_Holders.Empty_Holder);
end Load;
not overriding procedure Register
(Self : in out Holder;
Name : in String;
Constructor : in Filters.Stores.Constructor) is
begin
Self.Filters.Register (S_Expressions.To_Atom (Name), Constructor);
end Register;
not overriding procedure Register
(Self : in out Holder;
Name : in String;
Constructor : in Page_Constructor) is
begin
Self.Constructors.Page.Insert
(S_Expressions.To_Atom (Name), Constructor);
end Register;
not overriding procedure Register
(Self : in out Holder;
Name : in String;
Constructor : in Backend_Constructor) is
begin
Self.Constructors.Backend.Insert
(S_Expressions.To_Atom (Name), Constructor);
end Register;
not overriding procedure Register
(Self : in out Holder;
Name : in String;
Constructor : in ACL_Constructor) is
begin
Self.Constructors.ACL.Insert
(S_Expressions.To_Atom (Name), Constructor);
end Register;
not overriding procedure Register
(Self : in out Holder;
Key : in Character;
Filter : in not null Comment_Cookies.Decoder) is
begin
Comment_Cookies.Register (Self.Constructors.Codec_DB, Key, Filter);
end Register;
not overriding procedure Respond
(Self : in Holder;
Exchange : aliased in out Exchanges.Exchange) is
begin
Self.Ref.Update.Respond (Exchange);
end Respond;
not overriding procedure Set_Cookie_Encoder
(Self : in out Holder;
Filter : in not null Comment_Cookies.Encoder;
Serialization : in Comment_Cookies.Serialization_Kind) is
begin
Comment_Cookies.Set_Encoder
(Self.Constructors.Codec_DB, Filter, Serialization);
end Set_Cookie_Encoder;
------------------
-- Update Queue --
------------------
protected body Update_Queue is
entry Append (Update : in Update_Holders.Holder) when True is
begin
if Task_Waiting then
Task_Waiting := False;
requeue Parent.Worker.Run;
else
List.Append (Update);
end if;
end Append;
procedure Next
(Update : out Update_Holders.Holder;
Has_Update : out Boolean) is
begin
if List.Is_Empty then
Task_Waiting := True;
Update := Update_Holders.Empty_Holder;
Has_Update := False;
else
pragma Assert (not Task_Waiting);
Update := List.First_Element;
Has_Update := True;
List.Delete_First;
end if;
end Next;
end Update_Queue;
-------------------
-- Update Worker --
-------------------
task body Worker_Task is
Container : Update_Holders.Holder;
Cron_Entry : Natools.Cron.Cron_Entry;
Has_Update : Boolean;
begin
loop
Parent.Queue.Next (Container, Has_Update);
if not Has_Update then
select
accept Run (Update : in Update_Holders.Holder) do
Container := Update;
end Run;
or
terminate;
end select;
end if;
Cron_Entry.Reset;
if not Container.Is_Empty then
declare
Old_Site : constant Site_Refs.Accessor := Parent.Ref.Query;
New_Site : constant Site_Refs.Data_Access := new Site'
(Load_Date => Old_Site.Load_Date,
ACL => Old_Site.ACL,
Backends => Old_Site.Backends,
Constructors => Old_Site.Constructors,
Default_Template => Old_Site.Default_Template,
Expire => Old_Site.Expire,
File_Name => Old_Site.File_Name,
Filters => Old_Site.Filters,
Loaders => Old_Site.Loaders,
Named_Elements => Old_Site.Named_Elements,
Pages => Old_Site.Pages,
Printer_Parameters => Old_Site.Printer_Parameters,
Static => Old_Site.Static,
Tags => Old_Site.Tags,
Templates => Old_Site.Templates,
Updater => Old_Site.Updater);
New_Ref : constant Site_Refs.Reference
:= Site_Refs.Create (New_Site);
use type Ada.Calendar.Time;
begin
Updates.Update (Container.Element, New_Site.all);
Parent.Ref := New_Ref;
if New_Site.Expire.Present then
Cron_Entry.Set
(New_Site.Expire.Time + 1.0, Create (New_Ref));
end if;
end;
elsif not Parent.Ref.Is_Empty then
declare
Ref : constant Site_Refs.Reference := Parent.Ref;
Current_Site : constant Site_Refs.Accessor := Ref.Query;
use type Ada.Calendar.Time;
begin
if Current_Site.Expire.Present then
Cron_Entry.Set
(Current_Site.Expire.Time + 1.0, Create (Ref));
end if;
end;
end if;
end loop;
end Worker_Task;
end Natools.Web.Sites.Holders;
|
with Menus; use Menus;
package AdaPhysics2DDemo is
procedure Start(This : in out Menu);
end AdaPhysics2DDemo;
|
-----------------------------------------------------------------------
-- awa-storages-modules -- Storage management module
-- Copyright (C) 2012, 2018, 2020 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Applications;
with AWA.Modules;
with AWA.Storages.Services;
with AWA.Storages.Servlets;
-- == Integration ==
-- To be able to use the `storages` module, you will need to add the following
-- line in your GNAT project file:
--
-- with "awa_storages";
--
-- The `Storage_Module` type represents the storage module. An instance
-- of the storage module must be declared and registered when the application
-- is created and initialized. The storage module is associated with
-- the storage service which provides and implements the storage management
-- operations. An instance of the `Storage_Module` must be declared and
-- registered in the AWA application. The module instance can be defined
-- as follows:
--
-- with AWA.Storages.Modules;
-- ...
-- type Application is new AWA.Applications.Application with record
-- Storage_Module : aliased AWA.Storages.Modules.Storage_Module;
-- end record;
--
-- And registered in the `Initialize_Modules` procedure by using:
--
-- Register (App => App.Self.all'Access,
-- Name => AWA.Storages.Modules.NAME,
-- Module => App.Storage_Module'Access);
--
-- == Permissions ==
-- @include-permission storages.xml
--
-- == Configuration ==
-- The `storages` module defines the following configuration parameters:
--
-- @include-config storages.xml
package AWA.Storages.Modules is
NAME : constant String := "storages";
type Storage_Module is new AWA.Modules.Module with private;
type Storage_Module_Access is access all Storage_Module'Class;
-- Initialize the storage module.
overriding
procedure Initialize (Plugin : in out Storage_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config);
-- Configures the module after its initialization and after having
-- read its XML configuration.
overriding
procedure Configure (Plugin : in out Storage_Module;
Props : in ASF.Applications.Config);
-- Get the storage manager.
function Get_Storage_Manager (Plugin : in Storage_Module)
return Services.Storage_Service_Access;
-- Create a storage manager. This operation can be overridden to provide
-- another storage service implementation.
function Create_Storage_Manager (Plugin : in Storage_Module)
return Services.Storage_Service_Access;
-- Get the storage module instance associated with the current application.
function Get_Storage_Module return Storage_Module_Access;
-- Get the storage manager instance associated with the current application.
function Get_Storage_Manager return Services.Storage_Service_Access;
private
type Storage_Module is new AWA.Modules.Module with record
Manager : Services.Storage_Service_Access := null;
Storage_Servlet : aliased AWA.Storages.Servlets.Storage_Servlet;
end record;
end AWA.Storages.Modules;
|
-----------------------------------------------------------------------
-- util-dates-formats -- Date Format ala strftime
-- Copyright (C) 2011, 2018 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Util.Properties;
-- == Localized date formatting ==
-- The `Util.Dates.Formats` provides a date formatting and parsing operation similar to the
-- Unix `strftime`, `strptime` or the `GNAT.Calendar.Time_IO`. The localization of month
-- and day labels is however handled through `Util.Properties.Bundle` (similar to
-- the Java world). Unlike `strftime` and `strptime`, this allows to have a multi-threaded
-- application that reports dates in several languages. The `GNAT.Calendar.Time_IO` only
-- supports English and this is the reason why it is not used here.
--
-- The date pattern recognizes the following formats:
--
-- | Format | Description |
-- | --- | ---------- |
-- | %a | The abbreviated weekday name according to the current locale.
-- | %A | The full weekday name according to the current locale.
-- | %b | The abbreviated month name according to the current locale.
-- | %h | Equivalent to %b. (SU)
-- | %B | The full month name according to the current locale.
-- | %c | The preferred date and time representation for the current locale.
-- | %C | The century number (year/100) as a 2-digit integer. (SU)
-- | %d | The day of the month as a decimal number (range 01 to 31).
-- | %D | Equivalent to %m/%d/%y
-- | %e | Like %d, the day of the month as a decimal number,
-- | | but a leading zero is replaced by a space. (SU)
-- | %F | Equivalent to %Y\-%m\-%d (the ISO 8601 date format). (C99)
-- | %G | The ISO 8601 week-based year
-- | %H | The hour as a decimal number using a 24-hour clock (range 00 to 23).
-- | %I | The hour as a decimal number using a 12-hour clock (range 01 to 12).
-- | %j | The day of the year as a decimal number (range 001 to 366).
-- | %k | The hour (24 hour clock) as a decimal number (range 0 to 23);
-- | %l | The hour (12 hour clock) as a decimal number (range 1 to 12);
-- | %m | The month as a decimal number (range 01 to 12).
-- | %M | The minute as a decimal number (range 00 to 59).
-- | %n | A newline character. (SU)
-- | %p | Either "AM" or "PM"
-- | %P | Like %p but in lowercase: "am" or "pm"
-- | %r | The time in a.m. or p.m. notation.
-- | | In the POSIX locale this is equivalent to %I:%M:%S %p. (SU)
-- | %R | The time in 24 hour notation (%H:%M).
-- | %s | The number of seconds since the Epoch, that is,
-- | | since 1970\-01\-01 00:00:00 UTC. (TZ)
-- | %S | The second as a decimal number (range 00 to 60).
-- | %t | A tab character. (SU)
-- | %T | The time in 24 hour notation (%H:%M:%S). (SU)
-- | %u | The day of the week as a decimal, range 1 to 7,
-- | | Monday being 1. See also %w. (SU)
-- | %U | The week number of the current year as a decimal
-- | | number, range 00 to 53
-- | %V | The ISO 8601 week number
-- | %w | The day of the week as a decimal, range 0 to 6,
-- | | Sunday being 0. See also %u.
-- | %W | The week number of the current year as a decimal number,
-- | | range 00 to 53
-- | %x | The preferred date representation for the current locale
-- | | without the time.
-- | %X | The preferred time representation for the current locale
-- | | without the date.
-- | %y | The year as a decimal number without a century (range 00 to 99).
-- | %Y | The year as a decimal number including the century.
-- | %z | The timezone as hour offset from GMT.
-- | %Z | The timezone or name or abbreviation.
--
-- The following strftime flags are ignored:
--
-- | Format | Description |
-- | --- | ---------- |
-- | %E | Modifier: use alternative format, see below. (SU)
-- | %O | Modifier: use alternative format, see below. (SU)
--
-- SU: Single Unix Specification
-- C99: C99 standard, POSIX.1-2001
--
-- See strftime (3) and strptime (3) manual page
--
-- To format and use the localize date, it is first necessary to get a bundle
-- for the `dates` so that date elements are translated into the given locale.
--
-- Factory : Util.Properties.Bundles.Loader;
-- Bundle : Util.Properties.Bundles.Manager;
-- ...
-- Load_Bundle (Factory, "dates", "fr", Bundle);
--
-- The date is formatted according to the pattern string described above.
-- The bundle is used by the formatter to use the day and month names in the
-- expected locale.
--
-- Date : String := Util.Dates.Formats.Format (Pattern => Pattern,
-- Date => Ada.Calendar.Clock,
-- Bundle => Bundle);
--
-- To parse a date according to a pattern and a localization, the same pattern string
-- and bundle can be used and the `Parse` function will return the date in split format.
--
-- Result : Date_Record := Util.Dates.Formats.Parse (Date => Date,
-- Pattern => Pattern,
-- Bundle => Bundle);
--
package Util.Dates.Formats is
-- Month labels.
MONTH_NAME_PREFIX : constant String := "util.month";
-- Day labels.
DAY_NAME_PREFIX : constant String := "util.day";
-- Short month/day suffix.
SHORT_SUFFIX : constant String := ".short";
-- Long month/day suffix.
LONG_SUFFIX : constant String := ".long";
-- The date time pattern name to be used for the %x representation.
-- This property name is searched in the bundle to find the localized date time pattern.
DATE_TIME_LOCALE_NAME : constant String := "util.datetime.pattern";
-- The default date pattern for %c (English).
DATE_TIME_DEFAULT_PATTERN : constant String := "%a %b %_d %T %Y";
-- The date pattern to be used for the %x representation.
-- This property name is searched in the bundle to find the localized date pattern.
DATE_LOCALE_NAME : constant String := "util.date.pattern";
-- The default date pattern for %x (English).
DATE_DEFAULT_PATTERN : constant String := "%m/%d/%y";
-- The time pattern to be used for the %X representation.
-- This property name is searched in the bundle to find the localized time pattern.
TIME_LOCALE_NAME : constant String := "util.time.pattern";
-- The default time pattern for %X (English).
TIME_DEFAULT_PATTERN : constant String := "%T %Y";
AM_NAME : constant String := "util.date.am";
PM_NAME : constant String := "util.date.pm";
AM_DEFAULT : constant String := "AM";
PM_DEFAULT : constant String := "PM";
-- Format the date passed in <b>Date</b> using the date pattern specified in <b>Pattern</b>.
-- The date pattern is similar to the Unix <b>strftime</b> operation.
--
-- For month and day of week strings, use the resource bundle passed in <b>Bundle</b>.
-- Append the formatted date in the <b>Into</b> string.
procedure Format (Into : in out Ada.Strings.Unbounded.Unbounded_String;
Pattern : in String;
Date : in Date_Record;
Bundle : in Util.Properties.Manager'Class);
-- Format the date passed in <b>Date</b> using the date pattern specified in <b>Pattern</b>.
-- For month and day of week strings, use the resource bundle passed in <b>Bundle</b>.
-- Append the formatted date in the <b>Into</b> string.
procedure Format (Into : in out Ada.Strings.Unbounded.Unbounded_String;
Pattern : in String;
Date : in Ada.Calendar.Time;
Bundle : in Util.Properties.Manager'Class);
function Format (Pattern : in String;
Date : in Ada.Calendar.Time;
Bundle : in Util.Properties.Manager'Class) return String;
-- Append the localized month string in the <b>Into</b> string.
-- The month string is found in the resource bundle under the name:
-- util.month<month number>.short
-- util.month<month number>.long
-- If the month string is not found, the month is displayed as a number.
procedure Append_Month (Into : in out Ada.Strings.Unbounded.Unbounded_String;
Month : in Ada.Calendar.Month_Number;
Bundle : in Util.Properties.Manager'Class;
Short : in Boolean := True);
-- Append the localized month string in the <b>Into</b> string.
-- The month string is found in the resource bundle under the name:
-- util.month<month number>.short
-- util.month<month number>.long
-- If the month string is not found, the month is displayed as a number.
procedure Append_Day (Into : in out Ada.Strings.Unbounded.Unbounded_String;
Day : in Ada.Calendar.Formatting.Day_Name;
Bundle : in Util.Properties.Manager'Class;
Short : in Boolean := True);
-- Append a number with padding if necessary
procedure Append_Number (Into : in out Ada.Strings.Unbounded.Unbounded_String;
Value : in Natural;
Padding : in Character;
Length : in Natural := 2);
-- Append the timezone offset
procedure Append_Time_Offset (Into : in out Ada.Strings.Unbounded.Unbounded_String;
Offset : in Ada.Calendar.Time_Zones.Time_Offset);
-- Parse the date according to the pattern and the given locale bundle and
-- return the data split record.
-- A `Constraint_Error` exception is raised if the date string is not in the correct format.
function Parse (Date : in String;
Pattern : in String;
Bundle : in Util.Properties.Manager'Class) return Date_Record;
end Util.Dates.Formats;
|
with Extraction.Node_Edge_Types;
with Ada.Text_IO;
package body Extraction.File_System is
use type VFS.File_Array_Access;
use type VFS.Filesystem_String;
function All_Relevant_Files (Directory : VFS.Virtual_File) return VFS.File_Array_Access
with Pre => Directory.Is_Directory
-- Only analyse relevant files
-- I.e. remove irrelevant files and directories
-- (e.g. version management related directories and files)
is
Result : VFS.File_Array_Access;
function Is_Hidden (File : VFS.Virtual_File) return Boolean
-- Linux-style hidden files and directories start with a '.'
is
Base_Name : constant String := + File.Base_Name;
begin
return Base_Name (Base_Name'First) = '.';
end Is_Hidden;
procedure Internal (Directory : VFS.Virtual_File) is
Files : VFS.File_Array_Access := Directory.Read_Dir;
begin
for File of Files.all loop
if Is_Hidden (File) then
Ada.Text_IO.Put_Line ("Skipping " & (+File.Full_Name));
else
VFS.Append (Result, File);
if File.Is_Directory then
Internal (File);
end if;
end if;
end loop;
VFS.Unchecked_Free(Files);
end Internal;
begin
Internal (Directory);
return Result;
end All_Relevant_Files;
procedure Extract_Nodes
(Directory : VFS.Virtual_File;
Graph : Graph_Operations.Graph_Context)
-- Add all relevant files in the file system.
-- This enables the finding of "dead files":
-- Files in the archive but no longer compiled / used by any project.
is
Files : VFS.File_Array_Access := All_Relevant_Files (Directory);
begin
Graph.Write_Node(Directory);
if Files /= null then
for File of Files.all loop
Graph.Write_Node (File);
end loop;
end if;
VFS.Unchecked_Free(Files);
end Extract_Nodes;
procedure Extract_Edges
(Directory : VFS.Virtual_File;
Graph : Graph_Operations.Graph_Context)
is
Files : VFS.File_Array_Access := All_Relevant_Files (Directory);
begin
if Files /= null then
for File of Files.all loop
Graph.Write_Edge(File.Get_Parent, File, Node_Edge_Types.Edge_Type_Contains);
end loop;
end if;
VFS.Unchecked_Free(Files);
end Extract_Edges;
end Extraction.File_System;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.