repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
zhmu/ananas | Ada | 383 | adb | -- { dg-do compile }
package body Overload is
function Get (I : Integer) return Ptr1 is
P : Ptr1 := null;
begin
return P;
end;
function Get (I : Integer) return Ptr2 is
P : Ptr2 := null;
begin
return P;
end;
function F (I : Integer) return Ptr1 is
P : Ptr1 := Get (I).Data'Access;
begin
return P;
end;
end Overload;
|
persan/advent-of-code-2020 | Ada | 4,026 | ads | -- --- Day 9: Encoding Error ---
--
-- With your neighbor happily enjoying their video game, you turn your attention to an open data port on the little screen in the seat in front of you.
--
-- Though the port is non-standard, you manage to connect it to your computer through the clever use of several paperclips.
-- Upon connection, the port outputs a series of numbers (your puzzle input).
--
-- The data appears to be encrypted with the eXchange-Masking Addition System (XMAS) which,
-- conveniently for you, is an old cypher with an important weakness.
--
-- XMAS starts by transmitting a preamble of 25 numbers.
-- After that, each number you receive should be the sum of any two of the 25 immediately previous numbers.
-- The two numbers will have different values, and there might be more than one such pair.
--
-- For example, suppose your preamble consists of the numbers 1 through 25 in a random order.
-- To be valid, the next number must be the sum of two of those numbers:
--
-- 26 would be a valid next number, as it could be 1 plus 25 (or many other pairs, like 2 and 24).
-- 49 would be a valid next number, as it is the sum of 24 and 25.
-- 100 would not be valid; no two of the previous 25 numbers sum to 100.
-- 50 would also not be valid; although 25 appears in the previous 25 numbers, the two numbers in the pair must be different.
--
-- Suppose the 26th number is 45, and the first number (no longer an option, as it is more than 25 numbers ago) was 20.
-- Now, for the next number to be valid, there needs to be some pair of numbers among 1-19, 21-25, or 45 that add up to it:
--
-- 26 would still be a valid next number, as 1 and 25 are still within the previous 25 numbers.
-- 65 would not be valid, as no two of the available numbers sum to it.
-- 64 and 66 would both be valid, as they are the result of 19+45 and 21+45 respectively.
--
-- Here is a larger example which only considers the previous 5 numbers (and has a preamble of length 5):
-- <File:input.test>
-- In this example, after the 5-number preamble, almost every number is the sum of two of the previous 5 numbers;
-- the only number that does not follow this rule is 127.
--
-- The first step of attacking the weakness in the XMAS data is to find the first number in the list (after the preamble)
-- which is not the sum of two of the 25 numbers before it.
-- What is the first number that does not have this property?
-- ===========================================================================================================================
--- Part Two ---
--
-- The final step in breaking the XMAS encryption relies on the invalid number you just found:
-- you must find a contiguous set of at least two numbers in your list which sum to the invalid number from step 1.
--
-- Again consider the above example :
-- <file:input.test.2>
-- In this list, adding up all of the numbers from 15 through 40 produces the invalid number from step 1, 127.
-- (Of course, the contiguous set of numbers in your actual list might be much longer.)
--
-- To find the encryption weakness, add together the smallest and largest number in this contiguous range;
-- in this example, these are 15 and 47, producing 62.
--
-- What is the encryption weakness in your XMAS-encrypted list of numbers?
package Adventofcode.Day_9 is
type Decoder (Memory_Size : Natural) is tagged private;
procedure Read (Self : in out Decoder; From_Path : String);
procedure Scan (Self : in out Decoder;
Premble_Size : Natural := 25;
Result : out Long_Integer);
procedure Scan2 (Self : in out Decoder;
Key : Long_Integer;
Result : out Long_Integer);
private
type Data_Array is array (Natural range <>) of Long_Integer;
type Decoder (Memory_Size : Natural) is tagged record
Data : Data_Array (1 .. Memory_Size);
Last : Natural := 0;
end record;
end Adventofcode.Day_9;
|
zhmu/ananas | Ada | 420 | ads | package Discr29 is
type Rec1 is record
I1 : Integer;
I2 : Integer;
I3 : Integer;
end record;
type Rec2 is tagged record
I1 : Integer;
I2 : Integer;
end record;
type Rec3 (D : Boolean) is record
case D is
when True => A : Rec1;
when False => B : Rec2;
end case;
end record;
procedure Proc (R : out Rec3);
Tmp : Rec2;
end Discr29;
|
rveenker/sdlada | Ada | 5,753 | ads | --------------------------------------------------------------------------------------------------------------------
-- 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.
--------------------------------------------------------------------------------------------------------------------
-- SDL.TTFs
--
-- Root package implementing the binding to SDL2_ttf.
--------------------------------------------------------------------------------------------------------------------
with Ada.Finalization;
with Ada.Strings.UTF_Encoding;
with Interfaces.C;
with SDL.Video.Palettes;
with SDL.Video.Surfaces;
package SDL.TTFs is
package UTF_Strings renames Ada.Strings.UTF_Encoding;
package C renames Interfaces.C;
TTF_Error : exception;
function Initialise return Boolean with
Inline_Always => True;
procedure Finalise with
Import => True,
Convention => C,
External_Name => "TTF_Quit";
-- Fonts.
type Point_Sizes is new C.int;
type Font_Faces is range 0 .. C.long'Last with
Size => C.long'Size,
Convention => C;
type Font_Styles is mod 2 ** 32 with
Convention => C;
Style_Normal : constant Font_Styles := 16#0000_0000#;
Style_Bold : constant Font_Styles := 16#0000_0001#;
Style_Italic : constant Font_Styles := 16#0000_0002#;
Style_Underline : constant Font_Styles := 16#0000_0004#;
Style_Strike_Through : constant Font_Styles := 16#0000_0008#;
type Font_Outlines is range 0 .. C.int'Last with
Size => C.int'Size,
Convention => C;
Outlines_Off : constant Font_Outlines := Font_Outlines'First;
type Font_Hints is (Normal, Light, Mono, None) with
Convention => C;
type Font_Measurements is range 0 .. C.int'Last with
Size => C.int'Size,
Convention => C;
type Fonts is new Ada.Finalization.Controlled with private;
Null_Font : constant Fonts;
overriding
procedure Finalize (Self : in out Fonts);
function Style (Self : in Fonts) return Font_Styles with
Inline => True;
procedure Set_Style (Self : in out Fonts; Now : in Font_Styles) with
Inline => True;
function Outline (Self : in Fonts) return Font_Outlines with
Inline => True;
procedure Set_Outline (Self : in out Fonts; Now : in Font_Outlines := Outlines_Off) with
Inline => True;
function Hinting (Self : in Fonts) return Font_Hints with
Inline => True;
procedure Set_Hinting (Self : in out Fonts; Now : in Font_Hints := Normal) with
Inline => True;
function Kerning (Self : in Fonts) return Boolean with
Inline => True;
procedure Set_Kerning (Self : in out Fonts; Now : in Boolean) with
Inline => True;
function Height (Self : in Fonts) return Font_Measurements with
Inline => True;
function Ascent (Self : in Fonts) return Font_Measurements with
Inline => True;
function Descent (Self : in Fonts) return Font_Measurements with
Inline => True;
function Line_Skip (Self : in Fonts) return Font_Measurements with
Inline => True;
function Faces (Self : in Fonts) return Font_Faces with
Inline => True;
function Is_Face_Fixed_Width (Self : in Fonts) return Boolean with
Inline => True;
function Face_Family_Name (Self : in Fonts) return String with
Inline => True;
function Face_Style_Name (Self : in Fonts) return String with
Inline => True;
function Size_Latin_1 (Self : in Fonts; Text : in String) return SDL.Sizes with
Inline => True;
function Size_UTF_8 (Self : in Fonts; Text : in UTF_Strings.UTF_8_String) return SDL.Sizes with
Inline => True;
function Render_Solid (Self : in Fonts;
Text : in String;
Colour : in SDL.Video.Palettes.Colour) return SDL.Video.Surfaces.Surface;
function Render_Shaded (Self : in Fonts;
Text : in String;
Colour : in SDL.Video.Palettes.Colour;
Background_Colour : in SDL.Video.Palettes.Colour) return SDL.Video.Surfaces.Surface;
function Render_Blended (Self : in Fonts;
Text : in String;
Colour : in SDL.Video.Palettes.Colour) return SDL.Video.Surfaces.Surface;
private
type Internal_Fonts is null record;
type Fonts_Pointer is access all Internal_Fonts with
Convention => C;
subtype Fonts_Ref is not null Fonts_Pointer;
type Fonts is new Ada.Finalization.Controlled with
record
Internal : Fonts_Pointer := null;
Source_Freed : Boolean := False; -- Whether the Makers.* subprogram has already closed the font.
end record;
Null_Font : constant Fonts := (Ada.Finalization.Controlled with others => <>);
end SDL.TTFs;
|
jamiepg1/sdlada | Ada | 2,550 | ads | --------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2014 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.
--------------------------------------------------------------------------------------------------------------------
-- SDL.Versions
--
-- Library version information.
--------------------------------------------------------------------------------------------------------------------
package SDL.Versions is
type Version_Level is mod 2 ** 8 with
Size => 8,
Convention => C;
-- TODO: Check this against the library, as they use an int.
type Revision_Level is mod 2 ** 32;
type Version is
record
Major : Version_Level;
Minor : Version_Level;
Patch : Version_Level;
end record with
Convention => C;
-- These allow the user to determine which version of SDLAda they compiled with.
Compiled_Major : constant Version_Level with
Import => True,
Convention => C,
External_Name => "SDL_Ada_Major_Version";
Compiled_Minor : constant Version_Level with
Import => True,
Convention => C,
External_Name => "SDL_Ada_Minor_Version";
Compiled_Patch : constant Version_Level with
Import => True,
Convention => C,
External_Name => "SDL_Ada_Patch_Version";
Compiled : constant Version := (Major => Compiled_Major, Minor => Compiled_Minor, Patch => Compiled_Patch);
function Revision return String with
Inline => True;
function Revision return Revision_Level;
procedure Linked_With (Info : in out Version);
end SDL.Versions;
|
zhmu/ananas | Ada | 17,889 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . G E N E R I C _ A U X --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System.File_IO;
with System.File_Control_Block;
package body Ada.Wide_Text_IO.Generic_Aux is
package FIO renames System.File_IO;
package FCB renames System.File_Control_Block;
subtype AP is FCB.AFCB_Ptr;
------------------------
-- Check_End_Of_Field --
------------------------
procedure Check_End_Of_Field
(Buf : String;
Stop : Integer;
Ptr : Integer;
Width : Field)
is
begin
if Ptr > Stop then
return;
elsif Width = 0 then
raise Data_Error;
else
for J in Ptr .. Stop loop
if not Is_Blank (Buf (J)) then
raise Data_Error;
end if;
end loop;
end if;
end Check_End_Of_Field;
-----------------------
-- Check_On_One_Line --
-----------------------
procedure Check_On_One_Line
(File : File_Type;
Length : Integer)
is
begin
FIO.Check_Write_Status (AP (File));
if File.Line_Length /= 0 then
if Count (Length) > File.Line_Length then
raise Layout_Error;
elsif File.Col + Count (Length) > File.Line_Length + 1 then
New_Line (File);
end if;
end if;
end Check_On_One_Line;
--------------
-- Is_Blank --
--------------
function Is_Blank (C : Character) return Boolean is
begin
return C = ' ' or else C = ASCII.HT;
end Is_Blank;
----------
-- Load --
----------
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char : Character;
Loaded : out Boolean)
is
ch : int;
begin
if File.Before_Wide_Character then
Loaded := False;
return;
else
ch := Getc (File);
if ch = Character'Pos (Char) then
Store_Char (File, ch, Buf, Ptr);
Loaded := True;
else
Ungetc (ch, File);
Loaded := False;
end if;
end if;
end Load;
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char : Character)
is
ch : int;
begin
if File.Before_Wide_Character then
null;
else
ch := Getc (File);
if ch = Character'Pos (Char) then
Store_Char (File, ch, Buf, Ptr);
else
Ungetc (ch, File);
end if;
end if;
end Load;
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char1 : Character;
Char2 : Character;
Loaded : out Boolean)
is
ch : int;
begin
if File.Before_Wide_Character then
Loaded := False;
return;
else
ch := Getc (File);
if ch = Character'Pos (Char1)
or else ch = Character'Pos (Char2)
then
Store_Char (File, ch, Buf, Ptr);
Loaded := True;
else
Ungetc (ch, File);
Loaded := False;
end if;
end if;
end Load;
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char1 : Character;
Char2 : Character)
is
ch : int;
begin
if File.Before_Wide_Character then
null;
else
ch := Getc (File);
if ch = Character'Pos (Char1)
or else ch = Character'Pos (Char2)
then
Store_Char (File, ch, Buf, Ptr);
else
Ungetc (ch, File);
end if;
end if;
end Load;
-----------------
-- Load_Digits --
-----------------
procedure Load_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Loaded : out Boolean)
is
ch : int;
After_Digit : Boolean;
begin
if File.Before_Wide_Character then
Loaded := False;
return;
else
ch := Getc (File);
if ch not in Character'Pos ('0') .. Character'Pos ('9') then
Loaded := False;
else
Loaded := True;
After_Digit := True;
loop
Store_Char (File, ch, Buf, Ptr);
ch := Getc (File);
if ch in Character'Pos ('0') .. Character'Pos ('9') then
After_Digit := True;
elsif ch = Character'Pos ('_') and then After_Digit then
After_Digit := False;
else
exit;
end if;
end loop;
end if;
Ungetc (ch, File);
end if;
end Load_Digits;
procedure Load_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer)
is
ch : int;
After_Digit : Boolean;
begin
if File.Before_Wide_Character then
return;
else
ch := Getc (File);
if ch in Character'Pos ('0') .. Character'Pos ('9') then
After_Digit := True;
loop
Store_Char (File, ch, Buf, Ptr);
ch := Getc (File);
if ch in Character'Pos ('0') .. Character'Pos ('9') then
After_Digit := True;
elsif ch = Character'Pos ('_') and then After_Digit then
After_Digit := False;
else
exit;
end if;
end loop;
end if;
Ungetc (ch, File);
end if;
end Load_Digits;
--------------------------
-- Load_Extended_Digits --
--------------------------
procedure Load_Extended_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Loaded : out Boolean)
is
ch : int;
After_Digit : Boolean := False;
begin
if File.Before_Wide_Character then
Loaded := False;
return;
else
Loaded := False;
loop
ch := Getc (File);
if ch in Character'Pos ('0') .. Character'Pos ('9')
or else
ch in Character'Pos ('a') .. Character'Pos ('f')
or else
ch in Character'Pos ('A') .. Character'Pos ('F')
then
After_Digit := True;
elsif ch = Character'Pos ('_') and then After_Digit then
After_Digit := False;
else
exit;
end if;
Store_Char (File, ch, Buf, Ptr);
Loaded := True;
end loop;
Ungetc (ch, File);
end if;
end Load_Extended_Digits;
procedure Load_Extended_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer)
is
Junk : Boolean;
begin
Load_Extended_Digits (File, Buf, Ptr, Junk);
end Load_Extended_Digits;
------------------
-- Load_Integer --
------------------
procedure Load_Integer
(File : File_Type;
Buf : out String;
Ptr : in out Natural)
is
Hash_Loc : Natural;
Loaded : Boolean;
begin
Load_Skip (File);
-- Note: it is a bit strange to allow a minus sign here, but it seems
-- consistent with the general behavior expected by the ACVC tests
-- which is to scan past junk and then signal data error, see ACVC
-- test CE3704F, case (6), which is for signed integer exponents,
-- which seems a similar case.
Load (File, Buf, Ptr, '+', '-');
Load_Digits (File, Buf, Ptr, Loaded);
if Loaded then
-- Deal with based literal. We recognize either the standard '#' or
-- the allowed alternative replacement ':' (see RM J.2(3)).
Load (File, Buf, Ptr, '#', ':', Loaded);
if Loaded then
Hash_Loc := Ptr;
Load_Extended_Digits (File, Buf, Ptr);
Load (File, Buf, Ptr, Buf (Hash_Loc));
end if;
-- Deal with exponent
Load (File, Buf, Ptr, 'E', 'e', Loaded);
if Loaded then
-- Note: it is strange to allow a minus sign, since the syntax
-- does not, but that is what ACVC test CE3704F, case (6) wants
-- for the signed case, and there seems no good reason to treat
-- exponents differently for the signed and unsigned cases.
Load (File, Buf, Ptr, '+', '-');
Load_Digits (File, Buf, Ptr);
end if;
end if;
end Load_Integer;
---------------
-- Load_Real --
---------------
procedure Load_Real
(File : File_Type;
Buf : out String;
Ptr : in out Natural)
is
Loaded : Boolean;
begin
-- Skip initial blanks and load possible sign
Load_Skip (File);
Load (File, Buf, Ptr, '+', '-');
-- Case of .nnnn
Load (File, Buf, Ptr, '.', Loaded);
if Loaded then
Load_Digits (File, Buf, Ptr, Loaded);
-- Hopeless junk if no digits loaded
if not Loaded then
return;
end if;
-- Otherwise must have digits to start
else
Load_Digits (File, Buf, Ptr, Loaded);
-- Hopeless junk if no digits loaded
if not Loaded then
return;
end if;
-- Deal with based case. We recognize either the standard '#' or the
-- allowed alternative replacement ':' (see RM J.2(3)).
Load (File, Buf, Ptr, '#', ':', Loaded);
if Loaded then
-- Case of nnn#.xxx#
Load (File, Buf, Ptr, '.', Loaded);
if Loaded then
Load_Extended_Digits (File, Buf, Ptr);
Load (File, Buf, Ptr, '#', ':');
-- Case of nnn#xxx.[xxx]# or nnn#xxx#
else
Load_Extended_Digits (File, Buf, Ptr);
Load (File, Buf, Ptr, '.', Loaded);
if Loaded then
Load_Extended_Digits (File, Buf, Ptr);
end if;
-- As usual, it seems strange to allow mixed base characters,
-- but that is what ACVC tests expect, see CE3804M, case (3).
Load (File, Buf, Ptr, '#', ':');
end if;
-- Case of nnn.[nnn] or nnn
else
-- Prevent the potential processing of '.' in cases where the
-- initial digits have a trailing underscore.
if Buf (Ptr) = '_' then
return;
end if;
Load (File, Buf, Ptr, '.', Loaded);
if Loaded then
Load_Digits (File, Buf, Ptr);
end if;
end if;
end if;
-- Deal with exponent
Load (File, Buf, Ptr, 'E', 'e', Loaded);
if Loaded then
Load (File, Buf, Ptr, '+', '-');
Load_Digits (File, Buf, Ptr);
end if;
end Load_Real;
---------------
-- Load_Skip --
---------------
procedure Load_Skip (File : File_Type) is
C : Character;
begin
FIO.Check_Read_Status (AP (File));
-- We need to explicitly test for the case of being before a wide
-- character (greater than 16#7F#). Since no such character can
-- ever legitimately be a valid numeric character, we can
-- immediately signal Data_Error.
if File.Before_Wide_Character then
raise Data_Error;
end if;
-- Otherwise loop till we find a non-blank character (note that as
-- usual in Wide_Text_IO, blank includes horizontal tab). Note that
-- Get_Character deals with Before_LM/Before_LM_PM flags appropriately.
loop
Get_Character (File, C);
exit when not Is_Blank (C);
end loop;
Ungetc (Character'Pos (C), File);
File.Col := File.Col - 1;
end Load_Skip;
----------------
-- Load_Width --
----------------
procedure Load_Width
(File : File_Type;
Width : Field;
Buf : out String;
Ptr : in out Integer)
is
ch : int;
WC : Wide_Character;
Bad_Wide_C : Boolean := False;
-- Set True if one of the characters read is not in range of type
-- Character. This is always a Data_Error, but we do not signal it
-- right away, since we have to read the full number of characters.
begin
FIO.Check_Read_Status (AP (File));
-- If we are immediately before a line mark, then we have no characters.
-- This is always a data error, so we may as well raise it right away.
if File.Before_LM then
raise Data_Error;
else
for J in 1 .. Width loop
if File.Before_Wide_Character then
Bad_Wide_C := True;
Store_Char (File, 0, Buf, Ptr);
File.Before_Wide_Character := False;
else
ch := Getc (File);
if ch = EOF then
exit;
elsif ch = LM then
Ungetc (ch, File);
exit;
else
WC := Get_Wide_Char (Character'Val (ch), File);
ch := Wide_Character'Pos (WC);
if ch > 255 then
Bad_Wide_C := True;
ch := 0;
end if;
Store_Char (File, ch, Buf, Ptr);
end if;
end if;
end loop;
if Bad_Wide_C then
raise Data_Error;
end if;
end if;
end Load_Width;
--------------
-- Put_Item --
--------------
procedure Put_Item (File : File_Type; Str : String) is
begin
Check_On_One_Line (File, Str'Length);
for J in Str'Range loop
Put (File, Wide_Character'Val (Character'Pos (Str (J))));
end loop;
end Put_Item;
----------------
-- Store_Char --
----------------
procedure Store_Char
(File : File_Type;
ch : Integer;
Buf : out String;
Ptr : in out Integer)
is
begin
File.Col := File.Col + 1;
if Ptr = Buf'Last then
raise Data_Error;
else
Ptr := Ptr + 1;
Buf (Ptr) := Character'Val (ch);
end if;
end Store_Char;
-----------------
-- String_Skip --
-----------------
procedure String_Skip (Str : String; Ptr : out Integer) is
begin
-- Routines calling String_Skip malfunction if Str'Last = Positive'Last.
-- It's too much trouble to make this silly case work, so we just raise
-- Program_Error with an appropriate message. We raise Program_Error
-- rather than Constraint_Error because we don't want this case to be
-- converted to Data_Error.
if Str'Last = Positive'Last then
raise Program_Error with
"string upper bound is Positive'Last, not supported";
end if;
-- Normal case where Str'Last < Positive'Last
Ptr := Str'First;
loop
if Ptr > Str'Last then
raise End_Error;
elsif not Is_Blank (Str (Ptr)) then
return;
else
Ptr := Ptr + 1;
end if;
end loop;
end String_Skip;
------------
-- Ungetc --
------------
procedure Ungetc (ch : int; File : File_Type) is
begin
if ch /= EOF then
if ungetc (ch, File.Stream) = EOF then
raise Device_Error;
end if;
end if;
end Ungetc;
end Ada.Wide_Text_IO.Generic_Aux;
|
BrickBot/Bound-T-H8-300 | Ada | 24,411 | adb | -- Assertions.Source_Marks (body)
--
-- A component of the Bound-T Worst-Case Execution Time Tool.
--
-------------------------------------------------------------------------------
-- Copyright (c) 1999 .. 2015 Tidorum Ltd
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- 1. Redistributions of source code must retain the above copyright notice, this
-- list of conditions and the following disclaimer.
-- 2. Redistributions in binary form must reproduce the above copyright notice,
-- this list of conditions and the following disclaimer in the documentation
-- and/or other materials provided with the distribution.
--
-- This software is provided by the copyright holders and contributors "as is" and
-- any express or implied warranties, including, but not limited to, the implied
-- warranties of merchantability and fitness for a particular purpose are
-- disclaimed. In no event shall the copyright owner or contributors be liable for
-- any direct, indirect, incidental, special, exemplary, or consequential damages
-- (including, but not limited to, procurement of substitute goods or services;
-- loss of use, data, or profits; or business interruption) however caused and
-- on any theory of liability, whether in contract, strict liability, or tort
-- (including negligence or otherwise) arising in any way out of the use of this
-- software, even if advised of the possibility of such damage.
--
-- Other modules (files) of this software composition should contain their
-- own copyright statements, which may have different copyright and usage
-- conditions. The above conditions apply to this file.
-------------------------------------------------------------------------------
--
-- $Revision: 1.4 $
-- $Date: 2015/10/24 20:05:45 $
--
-- $Log: assertions-source_marks.adb,v $
-- Revision 1.4 2015/10/24 20:05:45 niklas
-- Moved to free licence.
--
-- Revision 1.3 2010-01-30 21:13:29 niklas
-- BT-CH-0216: Subprograms have a Return_Method_T attribute.
--
-- Revision 1.2 2009-04-10 08:43:29 niklas
-- Improved error detection and error messages in mark-line parsing.
--
-- Revision 1.1 2009/03/27 13:57:12 niklas
-- BT-CH-0167: Assertion context identified by source-code markers.
--
with Ada.Characters.Handling;
with Ada.Text_IO;
with Assertions.Opt;
with Bags; -- MW_Components
with Bags.Bounded_Operations; -- MW_Components
with File_System;
with Output;
with Symbols;
package body Assertions.Source_Marks is
use type Source_File_Name_T;
use type Line_Number_T;
--
--- Marks in source files
--
function Image (Item : Mark_T) return String
is
begin
return
To_String (Item.Marker)
& Output.Field_Separator
& Symbols.Image (Item.File)
& Output.Field_Separator
& Output.Image (Item.Line)
& Output.Field_Separator
& Marked_Part_T'Image (Item.Part)
& Output.Field_Separator
& Marker_Relation_T'Image (Item.Relation);
end Image;
--
--- The mark set
--
-- The mark set is organized as a three-level keyed data structure:
--
-- The first key is the (canonized) source-file name, which leads
-- to the subset of all marks in that source file (or all those
-- source files with matching names).
--
-- The second key is the marker name, which leads to the subset of
-- all marks with this marker, in the given source file.
--
-- The third key is the source line number. On this key we can perform
-- range queries, which leads to all marks with the given marker name
-- in the given line-number range of the given source file.
--
-- The corresponding container types are defined in the reverse order,
-- from the third key to the first key.
-- Using a Line number (or range) to find marks at that number (or
-- within that range) from the set of all markers with a given
-- Marker name in a given source File.
function Line_Number_Of (Item : Mark_T) return Line_Number_T
is
begin
return Item.Line;
end Line_Number_Of;
package Marks_By_Line is new Bags (
Key_Type => Line_Number_T,
Item_Type => Mark_T,
Key_Of => Line_Number_Of,
Count => Natural);
type Marks_By_Line_T is record
Marker : Marker_Name_T;
File : Source_File_Name_T;
Marks : Marks_By_Line.Bag (Duplicate_Keys_Allowed => True);
end record;
--
-- All the marks with the given Marker name, in the given source File,
-- sorted by Line number.
--
-- Duplicate keys are allowed TBC for TBD reasons.
type Marks_By_Line_Ref is access Marks_By_Line_T;
--
-- A reference to a Marks_By_Line_T object on the heap.
-- We need a non-limited type for the next level of the structure.
-- Using a Marker name to find all its marks, at any Line in
-- a given (known) file:
function Marker_Name_Of (Item : Marks_By_Line_Ref)
return Marker_Name_T
is
begin
return Item.Marker;
end Marker_Name_Of;
package Marks_By_Marker is new Bags (
Key_Type => Marker_Name_T,
Item_Type => Marks_By_Line_Ref,
Key_Of => Marker_Name_Of,
Count => Natural);
type Marks_By_Marker_T is record
File : Source_File_Name_T;
Marks : Marks_By_Marker.Bag (Duplicate_Keys_Allowed => False);
end record;
--
-- All the marks in the file source File, sorted by Marker name first
-- and Line number second.
--
-- Duplicate keys are not allowed because we want to collect all
-- marks with the same Marker name into a single Marks set.
type Marks_By_Marker_Ref is access Marks_By_Marker_T;
--
-- A reference to a Marks_By_Marker_T object on the heap.
-- We need a non-limited type for the next level of the structure.
-- Using a source File name to find all the marks in this file,
-- of whatever Marker name and Line number:
function Source_File_Name_Of (Item : Marks_By_Marker_Ref)
return Source_File_Name_T
is
begin
return Item.File;
end Source_File_Name_Of;
package Marks_By_File is new Bags (
Key_Type => Source_File_Name_T,
Item_Type => Marks_By_Marker_Ref,
Key_Of => Source_File_Name_Of,
Count => Natural);
-- The set of all marks:
Mark_Set : Marks_By_File.Bag (Duplicate_Keys_Allowed => False);
--
-- The set of all known (loaded) marks, in any source-code File,
-- with any Marker name, and at any Line number; sorted by File
-- name first, Marker name second, and Line number last.
--
-- Duplicate keys are not allowed because we want to collect all
-- markers from a given source file into the same subset (of type
-- Marks_By_Marker_T).
--
--- Loading mark definition files
--
procedure Load (
Mark : in Mark_T;
Into : in out Marks_By_Marker.Bag)
--
-- Enters the given Mark Into the set of all markers in
-- the source file named Into.File.
--
is
By_Line : Marks_By_Line_Ref;
-- The set of all marks of this Mark.Marker name, within
-- the source code file Marker.File.
begin
-- Find the set of marks for this Marker name:
begin
By_Line := Marks_By_Marker.Search (
Key => Mark.Marker,
Within => Into);
exception
when Marks_By_Marker.Nonexistent_Key =>
-- The first appearance of this Marker name.
By_Line := new Marks_By_Line_T;
By_Line.Marker := Mark.Marker;
By_Line.File := Mark.File;
Marks_By_Marker.Insert (Item => By_Line, Into => Into);
end;
-- Insert the Mark at this Line:
Marks_By_Line.Insert (Item => Mark, Into => By_Line.Marks);
end Load;
procedure Load (
Mark : in Mark_T;
Success : in out Boolean)
--
-- Enters the given Mark into the Mark_Set.
-- If there is an error of some sort, sets Success to False,
-- otherwise leaves Success unchanged.
--
is
By_Marker : Marks_By_Marker_Ref;
-- The set of all marks in the source code file Mark.File.
begin
if Opt.Trace_Marks then
Output.Trace (
"Mark"
& Output.Field_Separator
& Image (Mark));
end if;
-- Find the set of all marks in this File:
begin
By_Marker := Marks_By_File.Search (
Key => Mark.File,
Within => Mark_Set);
exception
when Marks_By_File.Nonexistent_Key =>
-- The first appearance of this File name.
By_Marker := new Marks_By_Marker_T;
By_Marker.File := Mark.File;
Marks_By_File.Insert (Item => By_Marker, Into => Mark_Set);
end;
-- Then insert the Mark there:
Load (Mark => Mark, Into => By_Marker.Marks);
end Load;
--
--- Mark-definition file syntax
--
--
-- Mark-definition files are comma-separated text files.
-- Each line defines one mark using five fields:
--
-- 1. The marker name.
-- 2. The source-file name.
-- 3. The source-line number.
-- 4. The kind of marked part: "any", "loop", ...
-- 5. The positional relation: "above", "below", ...
--
-- If the marker-name or the source-file name contain commas
-- the whole name must enclosed in double quotes: "...".
-- If the marker-name or the source-file name contain double
-- quote characters (") the whole name must be enclosed in double
-- quotes and the internal quotes must must be written as two
-- double quotes in succession. Examples:
--
-- Name Representation in file
-- ---- ----------------------
-- foo foo or "foo"
-- foo,bar "foo,bar"
-- foo"x "foo""x"
-- foo",bar "foo"",bar"
Mark_Syntax_Error : exception;
--
-- Signals a syntax error in a mark definition file.
Comma : constant Character := ',';
-- The field separator.
procedure Scan_Field (
From : in String;
Start : in out Positive;
Value : in out String;
Length : out Natural)
--
-- Extracts the comma-separated field starting at From(Start),
-- updates Start to indicate the start of the next field, and
-- returns the extracted field as Value(1 .. Length), with
-- enclosing quotes removed and internal repeated quotes
-- replaced by a single quote.
--
-- Propagates Mark_Syntax_Error in case of syntax error.
--
-- Updates Start to point to the comma character in From after
-- the extracted field, or to From'Last + 1 if the field is
-- terminated by the end of From.
--
is
Quote : constant Character := '"';
-- The quotation mark.
Enclosed : Boolean;
-- Whether the value is enclosed in quotes
-- and the closing quote is not yet scanned.
Scan : Positive := Start;
-- The current scanned position.
begin
Length := 0;
-- Check for and skip an initial enclosing quote:
Enclosed := Scan <= From'Last and then From(Scan) = Quote;
if Enclosed then
Scan := Scan + 1;
end if;
-- Scan the rest of the field:
loop
exit when Scan > From'Last
or else ((not Enclosed) and From(Scan) = Comma);
if From(Scan) /= Quote then
-- The simple case.
Length := Length + 1;
Value(Length) := From(Scan);
Scan := Scan + 1;
elsif not Enclosed then
-- Quotes are allowed only in enclosed values.
Output.Error (
"Mark lines must use '""' around fields that contain '""'.");
raise Mark_Syntax_Error;
elsif Scan < From'Last and then From(Scan + 1) = Quote then
-- A doubled quote mark.
Length := Length + 1;
Value(Length) := Quote;
Scan := Scan + 2;
elsif Scan = From'Last or else From(Scan + 1) = Comma then
-- The end of the quote-enclosed field.
Enclosed := False;
Scan := Scan + 1;
exit;
else
-- A single quote in an enclosed field. Tch tch.
Output.Error ("Mark lines must use '""""' for '""'.");
raise Mark_Syntax_Error;
end if;
end loop;
if Enclosed then
-- There was an opening quote but no closing quote.
Output.Error ("Mark field lacks closing '""'.");
raise Mark_Syntax_Error;
end if;
if Length = 0 then
-- A field cannot be null.
Output.Error ("Mark line cannot have empty fields.");
raise Mark_Syntax_Error;
end if;
Start := Scan;
end Scan_Field;
procedure Skip_Comma (
From : in String;
Start : in out Positive)
--
-- Checks that From(Start) = ',' and increments Start.
-- Propagates Mark_Syntax_Error in case of errors.
--
is
begin
if Start > From'Last then
Output.Error ("Mark line has too few fields.");
raise Mark_Syntax_Error;
elsif From(Start) /= Comma then
Output.Fault (
Location => "Assertions.Source_Marks.Skip_Comma",
Text => "No comma between fields.");
raise Mark_Syntax_Error;
else
Start := Start + 1;
end if;
end Skip_Comma;
function To_Line_Number (Item : String)
return Line_Number_T
--
-- Interprets the Item as the source-line number of a mark.
-- Propagates Mark_Syntax_Error in case of problems.
--
is
begin
return Line_Number_T'Value (Item);
exception
when Constraint_Error =>
Output.Error (
"Marked source-line number is wrong"
& Output.Field_Separator
& Item);
raise Mark_Syntax_Error;
end To_Line_Number;
function To_Marked_Part (Item : String) return Marked_Part_T
--
-- Decodes the mnemonics for the kind of part that is marked.
-- Propagates Mark_Syntax_Error in case of problems.
--
is
begin
if Item = "any" then return Any;
elsif Item = "subprogram" then return Subprogram;
elsif Item = "loop" then return Luup;
elsif Item = "call" then return Call;
else
Output.Error (
"Marked part kind unknown"
& Item);
raise Mark_Syntax_Error;
end if;
end To_Marked_Part;
function To_Marker_Relation (Item : String) return Marker_Relation_T
--
-- Decodes the mnemonics for the positional relation between
-- the mark line and the marked part.
--
is
begin
if Item = "any" then return Any;
elsif Item = "here" then return Here;
elsif Item = "above" then return Above;
elsif Item = "below" then return Below;
elsif Item = "contain" then return Contain;
elsif Item = "span" then return Span;
else
Output.Error (
"Marker relation unknown"
& Item);
raise Mark_Syntax_Error;
end if;
end To_Marker_Relation;
function Canonical_Name (Name : String)
return Symbols.Source_File_Name_T
--
-- The Source_File_Name_T that corresponds to the given
-- source-file Name, optionally "canonized" by omitting
-- directory paths and/or converting to lower case.
--
is
use Ada.Characters.Handling;
use File_System;
use Symbols;
begin
case Opt.File_Matching is
when Base_Name =>
case Opt.File_Casing is
when Case_Sensitive =>
return To_Source_File_Name (File_Name (Name));
when Case_Oblivious =>
return To_Source_File_Name (To_Lower (File_Name (Name)));
end case;
when Full_Path =>
case Opt.File_Casing is
when Case_Sensitive =>
return To_Source_File_Name (Name);
when Case_Oblivious =>
return To_Source_File_Name (To_Lower (Name));
end case;
end case;
end Canonical_Name;
function Canonical_Name (Name : Symbols.Source_File_Name_T)
return Symbols.Source_File_Name_T
--
-- The possibly "canonized" Name, assuming that the given Name
-- is the full and case-correct name.
--
is
begin
if Opt.File_Matching = Full_Path
and Opt.File_Casing = Case_Sensitive
then
-- No changed.
return Name;
else
-- Canonize the string:
return Canonical_Name (Symbols.Image (Name));
end if;
end Canonical_Name;
procedure Parse_And_Load_Mark (
Line : in String;
Valid : in out Boolean)
--
-- Parses the mark-definition Line and, if Valid,
-- loads the mark definition into the mark set.
-- Sets Valid to False if any error is detected.
--
is
Start : Positive := Line'First;
-- The start of the next field.
Field : String (1 .. Line'Length);
-- One of the fields on the Line.
Length : Natural;
-- The length of the Field.
Mark : Mark_T;
-- The mark defined by the Line.
procedure Scan
is
begin
Scan_Field (
From => Line , Start => Start,
Value => Field, Length => Length);
end Scan;
procedure Skip_Comma
is
begin
Skip_Comma (From => Line, Start => Start);
end Skip_Comma;
begin -- Parse_And_Load_Mark
-- 1. The marker name.
Scan;
Mark.Marker := To_Item (Field(1 .. Length));
-- 2. The source-file name.
Skip_Comma; Scan;
Mark.File := Canonical_Name (Field(1 .. Length));
-- 3. The source-line number.
Skip_Comma; Scan;
Mark.Line := To_Line_Number (Field(1 .. Length));
-- 4. The kind of marked part: "any", "loop", ...
Skip_Comma; Scan;
Mark.Part := To_Marked_Part (Field(1 .. Length));
-- 5. The positional relation: "above", "below", ...
Skip_Comma; Scan;
Mark.Relation := To_Marker_Relation (Field(1 .. Length));
-- And no more:
if Start <= Line'Last then
-- There is something more on the Line.
Output.Error (
"Mark line has excess text"
& Output.Field_Separator
& '"' & Line(Start .. Line'Last) & '"');
raise Mark_Syntax_Error;
end if;
-- The definition is valid, so we load it:
Load (Mark => Mark, Success => Valid);
exception
when Mark_Syntax_Error =>
Output.Error (
"Mark syntax"
& Output.Field_Separator
& Line);
Valid := False;
when X : others =>
Output.Exception_Info (
Text => "Exception in Parse_And_Load_Mark",
Occurrence => X);
end Parse_And_Load_Mark;
Max_Line_Length : constant := 1_000;
--
-- The maximum length of a mark-definition file line.
procedure Load_File (
File_Name : in String;
Valid : out Boolean)
is
use type Ada.Text_IO.Count;
File : Ada.Text_IO.File_Type;
-- The file named File_Name.
Text : String (1 .. Max_Line_Length);
Last : Natural;
-- An input line.
Number : Output.Line_Number_T;
-- The number of the current line (Text) in the File.
Mark : Output.Nest_Mark_T;
-- Marks the locus File:Number.
begin
Valid := True;
-- We know nothing to the contrary as yet.
Output.Note (
"Reading marks from "
& File_Name
& ".");
Ada.Text_IO.Open (
File => File,
Name => File_Name,
Mode => Ada.Text_IO.In_File);
while not Ada.Text_IO.End_Of_File (File) loop
Number := Output.Line_Number_T (Ada.Text_IO.Line (File));
Mark := Output.Nest (Output.Locus (
Statements => Output."+" (Output.Locus (
Source_File => File_Name,
Line_Number => Number))));
Ada.Text_IO.Get_Line (File, Text, Last);
if Ada.Text_IO.Col (File) = 1 then
-- Good, we read all of a line.
Parse_And_Load_Mark (
Line => Text(1 .. Last),
Valid => Valid);
else
Output.Error (
"Mark line is too long (over"
& Natural'Image (Text'Length)
& " characters).");
Valid := False;
end if;
Output.Unnest (Mark);
end loop;
Ada.Text_IO.Close (File);
Output.Note (
"Finished marks from "
& File_Name
& ".");
exception
when Ada.Text_IO.Name_Error =>
Output.Error (
"Could not open the mark file """
& File_Name
& """.");
if Ada.Text_IO.Is_Open (File) then
Ada.Text_IO.Close (File);
end if;
Valid := False;
end Load_File;
--
--- Picking marks from the mark set
--
package Marks_By_Line_Ranges is new Marks_By_Line.Bounded_Operations;
--
-- Operations to pick and traverse marks in certain ranges
-- of line number, within a set of all marks for a given marker
-- name, in a given source-code file.
No_Marks : Mark_List_T (1 .. 0);
--
-- An empty set of marks.
function Marks (
Marker : Marker_Name_T;
From : Source_File_Name_T;
Min : Line_Number_T;
Max : Line_Number_T)
return Mark_List_T
is
From_Marks : Marks_By_Marker_Ref;
-- The marks in the file From, sorted by marker name.
From_Marker_Marks : Marks_By_Line_Ref;
-- The marks in From with this Marker name, sorted by line number.
begin
-- Find the marks From this source-code file:
From_Marks := Marks_By_File.Search (
Key => Canonical_Name (From),
Within => Mark_Set);
-- May raise Nonexistent_Key.
-- From them, find the marks with this Marker name:
From_Marker_Marks := Marks_By_Marker.Search (
Key => Marker,
Within => From_Marks.Marks);
-- May raise Nonexistent_Key.
-- From them, find the marks that mark lines in the range Min .. Max:
declare
List : Mark_List_T (1 .. Marks_By_Line.Card (From_Marker_Marks.Marks));
Num : Natural := 0;
-- The marks found will be in List(1 .. Num).
procedure Add_To_List (Item : Mark_T)
is
begin
Num := Num + 1;
List(Num) := Item;
end Add_To_List;
procedure List_Marks_In_Range is new
Marks_By_Line_Ranges.Bounded_Traversal (Action => Add_To_List);
begin
List_Marks_In_Range (
On_Bag => From_Marker_Marks.Marks,
First => Min,
Last => Max);
if Opt.Trace_Marks then
Output.Trace (
"Number of """
& To_String (Marker)
& """ marks in file """
& Symbols.Image (From)
& """ on lines "
& Output.Image (Min)
& ".."
& Output.Image (Max)
& Output.Field_Separator
& Output.Image (Num));
for L in 1 .. Num loop
Output.Trace (
"Mark #"
& Output.Image (L)
& Output.Field_Separator
& Image (List(L)));
end loop;
end if;
return List(1 .. Num);
end;
exception
when Marks_By_File.Nonexistent_Key =>
-- No marks in the file, From.
if Opt.Trace_Marks then
Output.Trace (
"No marks in file """
& Symbols.Image (From)
& """.");
end if;
return No_Marks;
when Marks_By_Marker.Nonexistent_Key =>
-- Some marks in this file, From, but none with this Marker name.
if Opt.Trace_Marks then
Output.Trace (
"No """
& To_String (Marker)
& """ marks in file """
& Symbols.Image (From)
& """.");
end if;
return No_Marks;
end Marks;
end Assertions.Source_Marks;
|
Tim-Tom/project-euler | Ada | 1,997 | adb | with Ada.Text_IO;
package body Problem_43 is
package IO renames Ada.Text_IO;
procedure Solve is
subtype Digit is Natural range 0 .. 9;
type Pandigital_Index is new Positive range 1 .. 10;
Type Pandigital_Number is Array (Pandigital_Index) of Digit;
sum : Long_Long_Integer := 0;
number : Pandigital_Number;
chosen : Array (Digit) of Boolean := (others => False);
Primes : constant Array(Pandigital_Index) of Positive := (1,1,1,2,3,5,7,11,13,17);
function Make_Number return Long_Long_Integer is
result : Long_Long_Integer := 0;
begin
for index in number'Range loop
result := result*10 + Long_Long_Integer(number(index));
end loop;
return result;
end;
procedure Permute(index : Pandigital_Index) is
begin
if index <= 3 then
for d in Digit'Range loop
if not chosen(d) then
number(index) := d;
chosen(d) := True;
Permute(Pandigital_Index'Succ(index));
chosen(d) := False;
end if;
end loop;
else
declare
so_far : constant Positive := number(index - 2)*100 + number(index - 1)*10;
begin
for d in Digit'Range loop
if not chosen(d) and (so_far + d) mod Primes(index) = 0 then
number(index) := d;
if index = Pandigital_Index'Last then
sum := sum + Make_Number;
else
chosen(d) := True;
Permute(Pandigital_Index'Succ(index));
chosen(d) := False;
end if;
end if;
end loop;
end;
end if;
end Permute;
begin
Permute(Pandigital_Index'First);
IO.Put_Line(Long_Long_Integer'Image(sum));
end Solve;
end Problem_43;
|
stcarrez/ada-awa | Ada | 5,305 | adb | -----------------------------------------------------------------------
-- awa-events -- AWA Events
-- Copyright (C) 2012, 2015, 2020, 2022 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ADO.Sessions.Entities;
package body AWA.Events is
-- ------------------------------
-- Set the event type which identifies the event.
-- ------------------------------
procedure Set_Event_Kind (Event : in out Module_Event;
Kind : in Event_Index) is
begin
Event.Kind := Kind;
end Set_Event_Kind;
-- ------------------------------
-- Get the event type which identifies the event.
-- ------------------------------
function Get_Event_Kind (Event : in Module_Event) return Event_Index is
begin
return Event.Kind;
end Get_Event_Kind;
-- ------------------------------
-- Set a parameter on the message.
-- ------------------------------
procedure Set_Parameter (Event : in out Module_Event;
Name : in String;
Value : in String) is
begin
Event.Props.Include (Name, Util.Beans.Objects.To_Object (Value));
end Set_Parameter;
procedure Set_Parameter (Event : in out Module_Event;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
Event.Props.Include (Name, Value);
end Set_Parameter;
-- ------------------------------
-- Get the parameter with the given name.
-- ------------------------------
function Get_Parameter (Event : in Module_Event;
Name : in String) return String is
Pos : constant Util.Beans.Objects.Maps.Cursor := Event.Props.Find (Name);
begin
if Util.Beans.Objects.Maps.Has_Element (Pos) then
return Util.Beans.Objects.To_String (Util.Beans.Objects.Maps.Element (Pos));
else
return "";
end if;
end Get_Parameter;
-- ------------------------------
-- Set the parameters of the message.
-- ------------------------------
procedure Set_Parameters (Event : in out Module_Event;
Parameters : in Util.Beans.Objects.Maps.Map) is
begin
Event.Props := Parameters;
end Set_Parameters;
-- ------------------------------
-- Get the value that corresponds to the parameter with the given name.
-- ------------------------------
overriding
function Get_Value (Event : in Module_Event;
Name : in String) return Util.Beans.Objects.Object is
begin
if Event.Props.Contains (Name) then
return Event.Props.Element (Name);
else
return Util.Beans.Objects.Null_Object;
end if;
end Get_Value;
-- ------------------------------
-- Get the entity identifier associated with the event.
-- ------------------------------
function Get_Entity_Identifier (Event : in Module_Event) return ADO.Identifier is
begin
return Event.Entity;
end Get_Entity_Identifier;
-- ------------------------------
-- Set the entity identifier associated with the event.
-- ------------------------------
procedure Set_Entity_Identifier (Event : in out Module_Event;
Id : in ADO.Identifier) is
begin
Event.Entity := Id;
end Set_Entity_Identifier;
-- ------------------------------
-- Set the database entity associated with the event.
-- ------------------------------
procedure Set_Entity (Event : in out Module_Event;
Entity : in ADO.Objects.Object_Ref'Class;
Session : in ADO.Sessions.Session'Class) is
Key : constant ADO.Objects.Object_Key := Entity.Get_Key;
begin
Event.Entity := ADO.Objects.Get_Value (Key);
Event.Entity_Type := ADO.Sessions.Entities.Find_Entity_Type (Session, Key);
end Set_Entity;
-- ------------------------------
-- Copy the event properties to the map passed in <tt>Into</tt>.
-- ------------------------------
procedure Copy (Event : in Module_Event;
Into : in out Util.Beans.Objects.Maps.Map) is
begin
Into := Event.Props;
end Copy;
-- ------------------------------
-- Make and return a copy of the event.
-- ------------------------------
function Copy (Event : in Module_Event) return Module_Event_Access is
Result : constant Module_Event_Access := new Module_Event;
begin
Result.Kind := Event.Kind;
Result.Props := Event.Props;
return Result;
end Copy;
end AWA.Events;
|
Fabien-Chouteau/shoot-n-loot | Ada | 12,155 | adb | -- Shoot'n'loot
-- Copyright (c) 2020 Fabien Chouteau
with HAL; use HAL;
with GESTE;
with GESTE.Tile_Bank;
with GESTE.Sprite.Animated;
with GESTE_Config;
with GESTE.Maths_Types; use GESTE.Maths_Types;
with GESTE.Physics;
with Game_Assets;
with Game_Assets.Tileset;
with Game_Assets.Misc_Objects;
with PyGamer.Screen;
with Projectile;
with Monsters;
with Sound;
package body Player is
package Item renames Game_Assets.Misc_Objects.Item;
Fire_Animation : aliased constant GESTE.Sprite.Animated.Animation_Array :=
((Item.P2.Tile_Id, 1),
(Item.P3.Tile_Id, 1),
(Item.P4.Tile_Id, 1),
(Item.P5.Tile_Id, 1),
(Item.P6.Tile_Id, 2),
(Item.P7.Tile_Id, 2),
(Item.P8.Tile_Id, 2),
(Item.P9.Tile_Id, 2),
(Item.P10.Tile_Id, 2),
(Item.P11.Tile_Id, 2),
(Item.P12.Tile_Id, 2),
(Item.P13.Tile_Id, 2));
type Player_Type (Bank : not null GESTE.Tile_Bank.Const_Ref;
Init_Frame : GESTE_Config.Tile_Index)
is limited new GESTE.Physics.Object with record
Sprite : aliased GESTE.Sprite.Animated.Instance (Bank, Init_Frame);
Alive : Boolean := True;
end record;
Tile_Bank : aliased GESTE.Tile_Bank.Instance
(Game_Assets.Tileset.Tiles'Access,
GESTE.No_Collisions,
Game_Assets.Palette'Access);
P : aliased Player_Type (Tile_Bank'Access, Item.P1.Tile_Id);
Max_Jump_Frame : constant := 1;
Jumping : Boolean := False;
Do_Jump : Boolean := False;
Jump_Cnt : Natural := 0;
Going_Left : Boolean := False;
Going_Right : Boolean := False;
Firing : Boolean := False;
Grabing_Wall : Boolean := False;
Facing_Left : Boolean := False;
type Collision_Points is array (Natural range <>) of GESTE.Pix_Point;
-- Bounding Box points
BB_Top : constant Collision_Points :=
((-1, -4), (1, -4));
BB_Bottom : constant Collision_Points :=
((-1, 3), (1, 3));
BB_Left : constant Collision_Points :=
((-3, 1), (-3, -1));
BB_Right : constant Collision_Points :=
((2, 1), (2, -1));
Bounding_Box : constant Collision_Points :=
BB_Top & BB_Bottom & BB_Right & BB_Left;
Left_Wall : constant Collision_Points :=
(0 => (-4, 1));
Right_Wall : constant Collision_Points :=
(0 => (4, 1));
Grounded : Boolean := False;
Projs : array (1 .. 5) of Projectile.Instance
(Tile_Bank'Access, Item.Bullet.Tile_Id);
Show_Collision_Points : constant Boolean := False;
function Collides (Points : Collision_Points) return Boolean;
function Check_Monster_Collision return Boolean;
--------------
-- Collides --
--------------
function Collides (Points : Collision_Points) return Boolean is
X : constant Integer := Integer (P.Position.X);
Y : constant Integer := Integer (P.Position.Y);
begin
for Pt of Points loop
if Show_Collision_Points then
declare
Data : aliased HAL.UInt16_Array := (0 => 0);
begin
PyGamer.Screen.Set_Address (UInt16 (X + Pt.X),
UInt16 (X + Pt.X),
UInt16 (Y + Pt.Y),
UInt16 (Y + Pt.Y));
PyGamer.Screen.Start_Pixel_TX;
PyGamer.Screen.Push_Pixels (Data'Address, Data'Length);
PyGamer.Screen.End_Pixel_TX;
end;
end if;
if
X + Pt.X not in 0 .. PyGamer.Screen.Width - 1
or else
Y + Pt.Y not in 0 .. PyGamer.Screen.Height - 1
or else
GESTE.Collides ((X + Pt.X, Y + Pt.Y))
then
return True;
end if;
end loop;
return False;
end Collides;
-----------------------------
-- Check_Monster_Collision --
-----------------------------
function Check_Monster_Collision return Boolean is
X : constant Integer := Integer (P.Position.X);
Y : constant Integer := Integer (P.Position.Y);
begin
for Pt of Bounding_Box loop
if Monsters.Check_Hit ((X + Pt.X,
Y + Pt.Y),
Lethal => False)
then
return True;
end if;
end loop;
return False;
end Check_Monster_Collision;
-----------
-- Spawn --
-----------
procedure Spawn is
begin
P.Alive := True;
P.Set_Mass (Value (90.0));
P.Sprite.Flip_Vertical (False);
P.Set_Speed ((0.0, 0.0));
GESTE.Add (P.Sprite'Access, 3);
P.Sprite.Flip_Horizontal (True);
for Prj of Projs loop
Prj.Init;
end loop;
end Spawn;
----------
-- Move --
----------
procedure Move (Pt : GESTE.Pix_Point) is
begin
P.Set_Position (GESTE.Maths_Types.Point'(Value (Pt.X), Value (Pt.Y)));
P.Sprite.Move ((Integer (P.Position.X) - 4,
Integer (P.Position.Y) - 4));
end Move;
--------------
-- Position --
--------------
function Position return GESTE.Pix_Point
is ((Integer (P.Position.X), Integer (P.Position.Y)));
--------------
-- Is_Alive --
--------------
function Is_Alive return Boolean
is (P.Alive);
------------
-- Update --
------------
procedure Update is
Old : constant Point := P.Position;
Elapsed : constant Value := Value (1.0 / 60.0);
Collision_To_Fix : Boolean;
begin
-- Check collision with monsters
if Check_Monster_Collision then
P.Sprite.Flip_Vertical (True);
P.Alive := False;
end if;
if Going_Right then
Facing_Left := False;
P.Sprite.Flip_Horizontal (True);
elsif Going_Left then
Facing_Left := True;
P.Sprite.Flip_Horizontal (False);
end if;
-- Lateral movements
if Grounded then
if Going_Right then
P.Apply_Force ((14_000.0, 0.0));
elsif Going_Left then
P.Apply_Force ((-14_000.0, 0.0));
else
-- Friction on the floor
P.Apply_Force (
(Value (Value (-2000.0) * P.Speed.X),
0.0));
end if;
else
if Going_Right then
P.Apply_Force ((7_000.0, 0.0));
elsif Going_Left then
P.Apply_Force ((-7_000.0, 0.0));
end if;
end if;
-- Gavity
if not Grounded then
P.Apply_Gravity (Value (-500.0));
end if;
-- Wall grab
if not Grounded
and then
P.Speed.Y > 0.0 -- Going down
and then
-- Pushing against a wall
((Collides (Right_Wall))
or else
(Collides (Left_Wall)))
then
-- Friction against the wall
P.Apply_Force ((0.0, -4_0000.0));
Grabing_Wall := True;
else
Grabing_Wall := False;
end if;
-- Jump
if Do_Jump then
declare
Jmp_X : Value := 0.0;
begin
if Grabing_Wall then
-- Wall jump
Jmp_X := 215_000.0;
if Collides (Right_Wall) then
Jmp_X := -Jmp_X;
end if;
end if;
P.Apply_Force ((Jmp_X, -900_000.0));
Grounded := False;
Jumping := True;
Sound.Play_Jump;
end;
end if;
P.Step (Elapsed);
Grounded := False;
Collision_To_Fix := False;
if P.Speed.Y < 0.0 then
-- Going up
if Collides (BB_Top) then
Collision_To_Fix := True;
-- Cannot jump after touching a roof
Jump_Cnt := Max_Jump_Frame + 1;
-- Touching a roof, kill vertical speed
P.Set_Speed ((P.Speed.X, Value (0.0)));
-- Going back to previous Y coord
P.Set_Position ((P.Position.X, Old.Y));
end if;
elsif P.Speed.Y > 0.0 then
-- Going down
if Collides (BB_Bottom) then
Collision_To_Fix := True;
Grounded := True;
-- Can start jumping
Jump_Cnt := 0;
-- Touching a roof, kill vertical speed
P.Set_Speed ((P.Speed.X, Value (0.0)));
-- Going back to previous Y coord
P.Set_Position ((P.Position.X, Old.Y));
end if;
end if;
if P.Speed.X > 0.0 then
-- Going right
if Collides (BB_Right) then
Collision_To_Fix := True;
-- Touching a wall, kill horizontal speed
P.Set_Speed ((Value (0.0), P.Speed.Y));
-- Going back to previos X coord
P.Set_Position ((Old.X, P.Position.Y));
end if;
elsif P.Speed.X < 0.0 then
-- Going left
if Collides (BB_Left) then
Collision_To_Fix := True;
-- Touching a wall, kill horizontal speed
P.Set_Speed ((Value (0.0), P.Speed.Y));
-- Going back to previous X coord
P.Set_Position ((Old.X, P.Position.Y));
end if;
end if;
-- Fix the collisions, one pixel at a time
while Collision_To_Fix loop
Collision_To_Fix := False;
if Collides (BB_Top) then
Collision_To_Fix := True;
-- Try a new Y coord that do not collides
P.Set_Position ((P.Position.X, P.Position.Y + 1.0));
elsif Collides (BB_Bottom) then
Collision_To_Fix := True;
-- Try a new Y coord that do not collides
P.Set_Position ((P.Position.X, P.Position.Y - 1.0));
end if;
if Collides (BB_Right) then
Collision_To_Fix := True;
-- Try to find X coord that do not collides
P.Set_Position ((P.Position.X - 1.0, P.Position.Y));
elsif Collides (BB_Left) then
Collision_To_Fix := True;
-- Try to find X coord that do not collides
P.Set_Position ((P.Position.X + 1.0, P.Position.Y));
end if;
end loop;
Jumping := Jumping and not Grounded;
P.Sprite.Signal_Frame;
P.Sprite.Move ((Integer (P.Position.X) - 4,
Integer (P.Position.Y) - 4));
if Firing then
Fire_Projectile :
for Proj of Projs loop
if not Proj.Alive then
if Facing_Left then
Proj.Set_Speed ((-120.0 + P.Speed.X, 0.0));
else
Proj.Set_Speed ((120.0 + P.Speed.X, 0.0));
end if;
Proj.Spawn (Pos => P.Position,
Time_To_Live => 2.0,
Priority => 2);
P.Sprite.Set_Animation (Fire_Animation'Access,
Looping => False);
Sound.Play_Gun;
exit Fire_Projectile;
end if;
end loop Fire_Projectile;
end if;
for Proj of Projs loop
Proj.Update (Elapsed);
if Proj.Alive
and then
(Monsters.Check_Hit (Proj.Position, Lethal => True)
or else
GESTE.Collides (Proj.Position)
)
then
Proj.Remove;
end if;
end loop;
Do_Jump := False;
Going_Left := False;
Going_Right := False;
Firing := False;
end Update;
----------
-- Jump --
----------
procedure Jump is
begin
if Grounded
or else
Grabing_Wall
or else
(Jump_Cnt < Max_Jump_Frame)
then
Do_Jump := True;
Jump_Cnt := Jump_Cnt + 1;
end if;
end Jump;
----------
-- Fire --
----------
procedure Fire is
begin
Firing := True;
end Fire;
---------------
-- Move_Left --
---------------
procedure Move_Left is
begin
Going_Left := True;
end Move_Left;
----------------
-- Move_Right --
----------------
procedure Move_Right is
begin
Going_Right := True;
end Move_Right;
end Player;
|
reznikmm/matreshka | Ada | 4,648 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Style.Min_Row_Height_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Style_Min_Row_Height_Attribute_Node is
begin
return Self : Style_Min_Row_Height_Attribute_Node do
Matreshka.ODF_Style.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Style_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Style_Min_Row_Height_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Min_Row_Height_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Style_URI,
Matreshka.ODF_String_Constants.Min_Row_Height_Attribute,
Style_Min_Row_Height_Attribute_Node'Tag);
end Matreshka.ODF_Style.Min_Row_Height_Attributes;
|
optikos/oasis | Ada | 3,853 | ads | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Element_Vectors;
with Program.Elements.Select_Paths;
with Program.Element_Visitors;
package Program.Nodes.Select_Paths is
pragma Preelaborate;
type Select_Path is
new Program.Nodes.Node and Program.Elements.Select_Paths.Select_Path
and Program.Elements.Select_Paths.Select_Path_Text
with private;
function Create
(When_Token : Program.Lexical_Elements.Lexical_Element_Access;
Guard : Program.Elements.Expressions.Expression_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Statements : not null Program.Element_Vectors.Element_Vector_Access)
return Select_Path;
type Implicit_Select_Path is
new Program.Nodes.Node and Program.Elements.Select_Paths.Select_Path
with private;
function Create
(Guard : Program.Elements.Expressions.Expression_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Select_Path
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Select_Path is
abstract new Program.Nodes.Node
and Program.Elements.Select_Paths.Select_Path
with record
Guard : Program.Elements.Expressions.Expression_Access;
Statements : not null Program.Element_Vectors.Element_Vector_Access;
end record;
procedure Initialize (Self : aliased in out Base_Select_Path'Class);
overriding procedure Visit
(Self : not null access Base_Select_Path;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Guard
(Self : Base_Select_Path)
return Program.Elements.Expressions.Expression_Access;
overriding function Statements
(Self : Base_Select_Path)
return not null Program.Element_Vectors.Element_Vector_Access;
overriding function Is_Select_Path_Element
(Self : Base_Select_Path)
return Boolean;
overriding function Is_Path_Element
(Self : Base_Select_Path)
return Boolean;
type Select_Path is
new Base_Select_Path and Program.Elements.Select_Paths.Select_Path_Text
with record
When_Token : Program.Lexical_Elements.Lexical_Element_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
end record;
overriding function To_Select_Path_Text
(Self : aliased in out Select_Path)
return Program.Elements.Select_Paths.Select_Path_Text_Access;
overriding function When_Token
(Self : Select_Path)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Arrow_Token
(Self : Select_Path)
return Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Select_Path is
new Base_Select_Path
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Select_Path_Text
(Self : aliased in out Implicit_Select_Path)
return Program.Elements.Select_Paths.Select_Path_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Select_Path)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Select_Path)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Select_Path)
return Boolean;
end Program.Nodes.Select_Paths;
|
sungyeon/drake | Ada | 8,213 | ads | pragma License (Unrestricted);
-- extended unit
with Ada.Command_Line;
with Ada.IO_Exceptions;
with Ada.Streams.Stream_IO.Standard_Files;
private with Ada.Finalization;
private with System.Native_Processes;
package Ada.Processes is
-- Spawning child processes.
type Command_Type is limited private;
function Image (Command : Command_Type) return String;
function Value (Command_Line : String) return Command_Type;
procedure Append (Command : in out Command_Type; New_Item : String);
procedure Append (
Command : in out Command_Type;
New_Item :
Ada.Command_Line.Iterator_Interfaces.Reversible_Iterator'Class);
-- Copy arguments from (subsequence of) Ada.Command_Line.
procedure Append_Argument (
Command_Line : in out String;
Last : in out Natural;
Argument : String);
pragma Inline (Append_Argument); -- renamed
type Process is limited private;
-- subtype Open_Process is Process
-- with
-- Dynamic_Predicate => Is_Open (Open_Process),
-- Predicate_Failure => raise Status_Error;
-- Child process management
function Is_Open (Child : Process) return Boolean;
pragma Inline (Is_Open);
procedure Create (
Child : in out Process;
Command : Command_Type;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all);
procedure Create (
Child : in out Process;
Command_Line : String;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all);
function Create (
Command : Command_Type;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all)
return Process;
function Create (
Command_Line : String;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all)
return Process;
pragma Inline (Create); -- renamed
procedure Wait (
Child : in out Process; -- Open_Process
Status : out Ada.Command_Line.Exit_Status);
procedure Wait (
Child : in out Process); -- Open_Process
pragma Inline (Wait);
procedure Wait_Immediate (
Child : in out Process; -- Open_Process
Terminated : out Boolean;
Status : out Ada.Command_Line.Exit_Status);
procedure Wait_Immediate (
Child : in out Process; -- Open_Process
Terminated : out Boolean);
pragma Inline (Wait_Immediate);
procedure Abort_Process (Child : in out Process); -- Open_Process
procedure Forced_Abort_Process (Child : in out Process); -- Open_Process
pragma Inline (Abort_Process);
pragma Inline (Forced_Abort_Process);
-- Pass a command to the shell
procedure Shell (
Command : Command_Type;
Status : out Ada.Command_Line.Exit_Status);
procedure Shell (
Command_Line : String;
Status : out Ada.Command_Line.Exit_Status);
procedure Shell (Command : Command_Type);
procedure Shell (Command_Line : String);
pragma Inline (Shell); -- for shorthand
-- Exceptions
Status_Error : exception
renames IO_Exceptions.Status_Error;
Name_Error : exception
renames IO_Exceptions.Name_Error;
Use_Error : exception
renames IO_Exceptions.Use_Error;
Device_Error : exception
renames IO_Exceptions.Device_Error;
private
package Controlled_Commands is
type Command_Type is limited private;
function Reference (Object : Processes.Command_Type)
return not null access System.Native_Processes.Command_Type;
pragma Inline (Reference);
private
type Command_Type is
limited new Finalization.Limited_Controlled
with record
Native_Command : aliased System.Native_Processes.Command_Type := null;
end record;
overriding procedure Finalize (Object : in out Command_Type);
end Controlled_Commands;
type Command_Type is new Controlled_Commands.Command_Type;
procedure Append_Argument (
Command_Line : in out String;
Last : in out Natural;
Argument : String)
renames System.Native_Processes.Append_Argument;
package Controlled_Processes is
type Process is limited private;
function Reference (Object : Processes.Process)
return not null access System.Native_Processes.Process;
pragma Inline (Reference);
function Create (
Command : Command_Type;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all)
return Processes.Process;
function Create (
Command_Line : String;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all)
return Processes.Process;
-- [gcc-7] strange error if this function is placed outside of
-- the package Controlled, and Disable_Controlled => True
private
type Process is limited new Finalization.Limited_Controlled with record
Data : aliased System.Native_Processes.Process :=
System.Native_Processes.Null_Process;
end record
with
Disable_Controlled =>
System.Native_Processes.Process_Disable_Controlled;
overriding procedure Finalize (Object : in out Process);
end Controlled_Processes;
type Process is new Controlled_Processes.Process;
function Create (
Command : Command_Type;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all)
return Process
renames Controlled_Processes.Create;
function Create (
Command_Line : String;
Directory : String := "";
Search_Path : Boolean := False;
Input : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Input.all;
Output : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Output.all;
Error : Streams.Stream_IO.File_Type :=
Streams.Stream_IO.Standard_Files.Standard_Error.all)
return Process
renames Controlled_Processes.Create;
end Ada.Processes;
|
AdaCore/libadalang | Ada | 213 | adb | procedure Test is
package T is
type TT is tagged null record;
procedure Foo (Self : TT) is null;
end T;
Inst : T.TT;
begin
Inst.Foo; -- Dot call
T.Foo (Inst); -- Not dot call
end Test;
|
iyan22/AprendeAda | Ada | 696 | adb | with datos;
use datos;
with intercambiar;
procedure Ordenar_Por_Burbuja (L : in out Lista_Enteros) is
-- pre:
-- post: L contiene los valores iniciales en orden ascendente
I : Integer;
J: Integer;
Cuenta : Integer;
begin
I := L.Numeros'First;
if L.Cont > 1 then
loop
Cuenta := 0;
J := 1;
loop exit when J > L.Cont-1;
if L.Numeros(J) > L.Numeros(J+1) then
Intercambiar(J, J+1, L);
Cuenta := Cuenta+1;
end if;
J:= J+1;
end loop;
I := I+1;
exit when I > L.Cont-1 or Cuenta = 0; -- Usamos esto como Boolean para comprobar si hay cambios
end loop;
end if;
end Ordenar_Por_Burbuja;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 4,423 | adb | package body STM32GD.I2C.Peripheral is
Default_Timeout : constant Natural := 10000;
Count_Down : Natural;
procedure Start (Duration : Natural := Default_Timeout) is
begin
Count_Down := Duration;
end Start;
function Timed_Out return Boolean is
begin
return (Count_Down = 0);
end Timed_Out;
procedure Pause is
begin
if not Timed_Out then Count_Down := Count_Down - 1; end if;
end Pause;
procedure Init is
begin
I2C.CR1.PE := 0;
I2C.TIMINGR.SCLH := 15;
I2C.TIMINGR.SCLL := 19;
I2C.TIMINGR.SDADEL := 2;
I2C.TIMINGR.SCLDEL := 4;
I2C.TIMINGR.PRESC := 1;
I2C.CR1.PE := 1;
end Init;
function Received_Ack return Boolean is
begin
Start;
while I2C.ISR.TXIS = 0 and I2C.ISR.NACKF = 0 and not Timed_Out
loop
Pause;
end loop;
return (I2C.ISR.TXIS = 1 and I2C.ISR.NACKF = 0);
end Received_Ack;
function Wait_For_TXDR_Empty return Boolean is
begin
Start;
while I2C.ISR.TXIS = 0 and not Timed_Out loop
Pause;
end loop;
return (I2C.ISR.TXIS = 1);
end Wait_For_TXDR_Empty;
function Wait_For_TX_Complete return Boolean is
begin
Start;
while I2C.ISR.TC = 0 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_TX_Complete;
function Wait_For_RX_Not_Empty return Boolean is
begin
Start;
while I2C.ISR.RXNE = 0 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_RX_Not_Empty;
function Wait_For_Idle return Boolean is
begin
Start;
while I2C.ISR.BUSY = 1 and not Timed_Out loop
Pause;
end loop;
return not Timed_Out;
end Wait_For_Idle;
function Master_Transmit (Address : I2C_Address; Data : Byte;
Restart : Boolean := False) return Boolean is
begin
if not Wait_For_Idle then return False; end if;
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD0 := 0;
I2C.CR2.SADD1 := Address;
I2C.CR2.RD_WRN := 0;
I2C.CR2.START := 1;
I2C.CR2.AUTOEND := (if not Restart then 1 else 0);
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Data;
return Wait_For_TX_Complete;
end Master_Transmit;
function Master_Receive (Address : I2C_Address; Data : out Byte)
return Boolean is
begin
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD0 := 0;
I2C.CR2.SADD1 := Address;
I2C.CR2.START := 1;
I2C.CR2.RD_WRN := 1;
if not Wait_For_TXDR_Empty then return False; end if;
if not Wait_For_RX_Not_Empty then return False; end if;
Data := I2C.RXDR.RXDATA;
I2C.CR2.STOP := 1;
return True;
end Master_Receive;
function Master_Receive (Address : I2C_Address; Data : out I2C_Data)
return Boolean
is
begin
I2C.CR2.NBYTES := Data'Length;
I2C.CR2.SADD0 := 0;
I2C.CR2.SADD1 := Address;
I2C.CR2.RD_WRN := 1;
I2C.CR2.START := 1;
I2C.CR2.AUTOEND := 1;
for D of Data loop
if Wait_For_RX_Not_Empty then
D := I2C.RXDR.RXDATA;
end if;
end loop;
return True;
end Master_Receive;
function Write_Register (Address : I2C_Address; Register : Byte;
Data : Byte) return Boolean is
begin
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD0 := 0;
I2C.CR2.SADD1 := Address;
I2C.CR2.START := 1;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Register;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Data;
if not Wait_For_TX_Complete then return False; end if;
I2C.CR2.STOP := 1;
return True;
end Write_Register;
function Read_Register (Address : I2C_Address; Register : Byte;
Data : out Byte) return Boolean is
begin
I2C.CR2.NBYTES := 1;
I2C.CR2.SADD0 := 0;
I2C.CR2.SADD1 := Address;
I2C.CR2.START := 1;
if not Wait_For_TXDR_Empty then return False; end if;
I2C.TXDR.TXDATA := Register;
if not Wait_For_TX_Complete then return False; end if;
I2C.CR2.AUTOEND := 1;
I2C.CR2.RD_WRN := 1;
I2C.CR2.START := 1;
if not Wait_For_RX_Not_Empty then return False; end if;
Data := I2C.RXDR.RXDATA;
I2C.CR2.STOP := 1;
return True;
end Read_Register;
end STM32GD.I2C.Peripheral;
|
nerilex/ada-util | Ada | 17,616 | adb | -----------------------------------------------------------------------
-- properties -- Generic name/value property management
-- Copyright (C) 2001, 2002, 2003, 2006, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Ada.Unchecked_Conversion;
with Ada.Directories;
with Ada.Containers.Vectors;
with Ada.Strings.Fixed;
with Util.Log.Loggers;
with Util.Files;
package body Util.Properties.Bundles is
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Util.Properties.Bundles");
procedure Free is
new Ada.Unchecked_Deallocation (Manager'Class,
Bundle_Manager_Access);
-- Implementation of the Bundle
-- (this allows to decouples the implementation from the API)
package Interface_P is
type Manager is new Util.Properties.Interface_P.Manager with private;
type Manager_Object_Access is access all Manager;
-- Returns TRUE if the property exists.
function Exists (Self : in Manager; Name : in Value)
return Boolean;
-- Returns the property value. Raises an exception if not found.
function Get (Self : in Manager; Name : in Value)
return Value;
procedure Insert (Self : in out Manager; Name : in Value;
Item : in Value);
-- Set the value of the property. The property is created if it
-- does not exists.
procedure Set (Self : in out Manager; Name : in Value;
Item : in Value);
-- Remove the property given its name.
procedure Remove (Self : in out Manager; Name : in Value);
-- Iterate over the properties and execute the given procedure passing the
-- property name and its value.
procedure Iterate (Self : in Manager;
Process : access procedure (Name, Item : Value));
procedure Load_Properties (Self : in out Manager;
File : in String);
-- Deep copy of properties stored in 'From' to 'To'.
function Create_Copy (Self : in Manager)
return Util.Properties.Interface_P.Manager_Access;
procedure Delete (Self : in Manager;
Obj : in out Util.Properties.Interface_P.Manager_Access);
function Get_Names (Self : in Manager;
Prefix : in String) return Name_Array;
procedure Add_Bundle (Self : in out Manager;
Props : in Util.Properties.Manager_Access);
private
use type Util.Properties.Manager_Access;
package PropertyList is new Ada.Containers.Vectors
(Element_Type => Util.Properties.Manager_Access,
Index_Type => Natural,
"=" => "=");
type Manager is new Util.Properties.Interface_P.Manager with record
List : PropertyList.Vector;
Props : aliased Util.Properties.Manager;
end record;
procedure Free is
new Ada.Unchecked_Deallocation (Manager,
Manager_Object_Access);
end Interface_P;
procedure Add_Bundle (Self : in out Manager;
Props : in Manager_Access) is
use type Util.Properties.Interface_P.Manager_Access;
begin
Interface_P.Manager'Class (Self.Impl.all).Add_Bundle (Props);
end Add_Bundle;
procedure Initialize (Object : in out Manager) is
use Util.Properties.Interface_P;
begin
Object.Impl := new Util.Properties.Bundles.Interface_P.Manager;
Util.Concurrent.Counters.Increment (Object.Impl.Count);
end Initialize;
procedure Adjust (Object : in out Manager) is
use Util.Properties.Interface_P;
begin
if Object.Impl = null then
Object.Impl := new Util.Properties.Bundles.Interface_P.Manager;
end if;
Util.Concurrent.Counters.Increment (Object.Impl.Count);
end Adjust;
-- ------------------------------
-- Initialize the bundle factory and specify where the property files are stored.
-- ------------------------------
procedure Initialize (Factory : in out Loader;
Path : in String) is
begin
Log.Info ("Initialize bundle factory to load from {0}", Path);
Factory.Path := To_Unbounded_String (Path);
end Initialize;
-- ------------------------------
-- Load the bundle with the given name and for the given locale name.
-- ------------------------------
procedure Load_Bundle (Factory : in out Loader;
Name : in String;
Locale : in String;
Bundle : out Manager'Class) is
Found : Boolean := False;
begin
Log.Info ("Load bundle {0} for language {1}", Name, Locale);
Find_Bundle (Factory, Name, Locale, Bundle, Found);
if not Found then
Load_Bundle (Factory, Name, Found);
if not Found then
Log.Error ("Bundle {0} not found", Name);
raise NO_BUNDLE with "No bundle '" & Name & "'";
end if;
Find_Bundle (Factory, Name, Locale, Bundle, Found);
if not Found then
Log.Error ("Bundle {0} not found", Name);
raise NO_BUNDLE with "No bundle '" & Name & "'";
end if;
end if;
end Load_Bundle;
-- ------------------------------
-- Find the bundle with the given name and for the given locale name.
-- ------------------------------
procedure Find_Bundle (Factory : in out Loader;
Name : in String;
Locale : in String;
Bundle : out Manager'Class;
Found : out Boolean) is
use Ada.Strings;
use type Util.Properties.Manager_Access;
Loc_Name : constant String := '_' & Locale;
Last_Pos : Integer := Loc_Name'Last;
begin
Log.Info ("Looking for bundle {0} and language {1}", Name, Locale);
Found := False;
Factory.Lock.Read;
declare
Pos : Bundle_Map.Cursor;
begin
while Last_Pos + 1 >= Loc_Name'First loop
declare
Bundle_Name : aliased constant String
:= Name & Loc_Name (Loc_Name'First .. Last_Pos);
begin
Log.Debug ("Searching for {0}", Bundle_Name);
Pos := Factory.Bundles.Find (Bundle_Name'Unrestricted_Access);
if Bundle_Map.Has_Element (Pos) then
Bundle.Finalize;
Bundle.Impl := Bundle_Map.Element (Pos).Impl;
Util.Concurrent.Counters.Increment (Bundle.Impl.Count);
Found := True;
exit;
end if;
end;
if Last_Pos > Loc_Name'First then
Last_Pos := Fixed.Index (Loc_Name, "_", Last_Pos - 1, Backward) - 1;
else
Last_Pos := Last_Pos - 1;
end if;
end loop;
exception
when others =>
Factory.Lock.Release_Read;
raise;
end;
Factory.Lock.Release_Read;
end Find_Bundle;
-- ------------------------------
-- Load the bundle with the given name and for the given locale name.
-- ------------------------------
procedure Load_Bundle (Factory : in out Loader;
Name : in String;
Found : out Boolean) is
use Ada.Directories;
use Ada.Strings;
use Util.Strings;
use Ada.Containers;
use Util.Strings.String_Set;
use Bundle_Map;
procedure Process_File (Name : in String;
File_Path : in String;
Done : out Boolean);
Path : constant String := To_String (Factory.Path);
Pattern : constant String := Name & "*.properties";
Names : Util.Strings.String_Set.Set;
procedure Process_File (Name : in String;
File_Path : in String;
Done : out Boolean) is
subtype Cursor is Bundle_Map.Cursor;
Base_Name : aliased constant String := Name (Name'First .. Name'Last - 11);
Pos : constant Cursor := Factory.Bundles.Find (Base_Name'Unchecked_Access);
Bundle_Name : Name_Access;
Bundle : Bundle_Manager_Access;
begin
Log.Debug ("Loading file {0}", File_Path);
if Bundle_Map.Has_Element (Pos) then
Bundle := Bundle_Map.Element (Pos);
else
Bundle := new Manager;
Bundle_Name := new String '(Base_Name);
Factory.Bundles.Include (Key => Bundle_Name, New_Item => Bundle);
Names.Insert (Bundle_Name);
end if;
Interface_P.Manager'Class (Bundle.Impl.all).Load_Properties (File_Path);
Found := True;
Done := False;
end Process_File;
begin
Log.Info ("Reading bundle {1} in directory {0}", Path, Name);
Found := False;
Factory.Lock.Write;
begin
Util.Files.Iterate_Files_Path (Pattern => Pattern,
Path => Path,
Process => Process_File'Access,
Going => Ada.Strings.Backward);
-- Link the property files to implement the localization default rules.
while Names.Length > 0 loop
declare
Name_Pos : String_Set.Cursor := Names.First;
Bundle_Name : constant Name_Access := String_Set.Element (Name_Pos);
Idx : Natural := Fixed.Index (Bundle_Name.all, "_", Backward);
Bundle_Pos : constant Bundle_Map.Cursor := Factory.Bundles.Find (Bundle_Name);
Bundle : constant Bundle_Manager_Access := Element (Bundle_Pos);
begin
Names.Delete (Name_Pos);
-- Associate the property bundle to the first existing parent
-- Ex: message_fr_CA -> message_fr
-- message_fr_CA -> message
while Idx > 0 loop
declare
Name : aliased constant String
:= Bundle_Name (Bundle_Name'First .. Idx - 1);
Pos : constant Bundle_Map.Cursor
:= Factory.Bundles.Find (Name'Unchecked_Access);
begin
if Bundle_Map.Has_Element (Pos) then
Bundle.Add_Bundle (Bundle_Map.Element (Pos).all'Access);
Idx := 0;
else
Idx := Fixed.Index (Bundle_Name.all, "_", Idx - 1, Backward);
end if;
end;
end loop;
end;
end loop;
exception
when others =>
Factory.Lock.Release_Write;
raise;
end;
Factory.Lock.Release_Write;
exception
when Name_Error =>
Log.Error ("Cannot read directory: {0}", Path);
end Load_Bundle;
-- Implementation of the Bundle
-- (this allows to decouples the implementation from the API)
package body Interface_P is
use PropertyList;
-- ------------------------------
-- Returns TRUE if the property exists.
-- ------------------------------
function Exists (Self : in Manager; Name : in Value)
return Boolean is
Iter : Cursor := Self.List.First;
begin
if Self.Props.Exists (Name) then
return True;
end if;
while Has_Element (Iter) loop
if Element (Iter).Exists (Name) then
return True;
end if;
Iter := Next (Iter);
end loop;
return False;
end Exists;
-- ------------------------------
-- Returns the property value. Raises an exception if not found.
-- ------------------------------
function Get (Self : in Manager; Name : in Value)
return Value is
begin
return Self.Props.Get (Name);
exception
when NO_PROPERTY =>
declare
Iter : Cursor := Self.List.First;
begin
while Has_Element (Iter) loop
begin
return Element (Iter).all.Get (Name);
exception
when NO_PROPERTY =>
Iter := Next (Iter);
end;
end loop;
end;
raise;
end Get;
procedure Load_Properties (Self : in out Manager;
File : in String) is
begin
Self.Props.Load_Properties (File);
end Load_Properties;
procedure Insert (Self : in out Manager;
Name : in Value;
Item : in Value) is
pragma Unreferenced (Self);
pragma Unreferenced (Name);
pragma Unreferenced (Item);
begin
raise NOT_WRITEABLE with "Bundle is readonly";
end Insert;
-- ------------------------------
-- Set the value of the property. The property is created if it
-- does not exists.
-- ------------------------------
procedure Set (Self : in out Manager;
Name : in Value;
Item : in Value) is
begin
raise NOT_WRITEABLE with "Bundle is readonly";
end Set;
-- ------------------------------
-- Remove the property given its name.
-- ------------------------------
procedure Remove (Self : in out Manager; Name : in Value) is
begin
raise NOT_WRITEABLE with "Bundle is readonly";
end Remove;
-- Iterate over the properties and execute the given procedure passing the
-- property name and its value.
procedure Iterate (Self : in Manager;
Process : access procedure (Name, Item : Value)) is
begin
raise Program_Error with "Iterate is not implemented on Bundle";
end Iterate;
-- ------------------------------
-- Deep copy of properties stored in 'From' to 'To'.
-- ------------------------------
function Create_Copy (Self : in Manager)
return Util.Properties.Interface_P.Manager_Access is
pragma Unreferenced (Self);
begin
return null;
end Create_Copy;
procedure Delete (Self : in Manager;
Obj : in out Util.Properties.Interface_P.Manager_Access) is
pragma Unreferenced (Self);
Item : Manager_Object_Access := Manager (Obj.all)'Access;
begin
Free (Item);
end Delete;
function Get_Names (Self : in Manager;
Prefix : in String) return Name_Array is
Result : Name_Array (1 .. 2);
Iter : constant Cursor := Self.List.First;
begin
while Has_Element (Iter) loop
declare
M : constant Util.Properties.Manager_Access := Element (Iter);
N : constant Name_Array := M.Get_Names (Prefix);
begin
return N;
end;
end loop;
return Result;
end Get_Names;
procedure Add_Bundle (Self : in out Manager;
Props : in Util.Properties.Manager_Access) is
begin
Self.List.Append (Props);
end Add_Bundle;
end Interface_P;
-- ------------------------------
-- Clear the bundle cache
-- ------------------------------
procedure Clear_Cache (Factory : in out Loader) is
use Util.Strings;
use Bundle_Map;
function To_String_Access is
new Ada.Unchecked_Conversion (Source => Util.Strings.Name_Access,
Target => Ada.Strings.Unbounded.String_Access);
begin
Log.Info ("Clearing bundle cache");
Factory.Lock.Write;
loop
declare
Pos : Bundle_Map.Cursor := Factory.Bundles.First;
Name : Ada.Strings.Unbounded.String_Access;
Node : Bundle_Manager_Access;
begin
exit when not Has_Element (Pos);
Node := Element (Pos);
Name := To_String_Access (Key (Pos));
Factory.Bundles.Delete (Pos);
Free (Node);
Free (Name);
end;
end loop;
Factory.Lock.Release_Write;
end Clear_Cache;
-- ------------------------------
-- Finalize the bundle loader and clear the cache
-- ------------------------------
procedure Finalize (Factory : in out Loader) is
begin
Clear_Cache (Factory);
end Finalize;
end Util.Properties.Bundles;
|
reznikmm/matreshka | Ada | 4,519 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Examples Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Signals;
with League.Strings;
with AWF.Layouts;
package body Demo.Main_Windows is
------------
-- Create --
------------
function Create return not null Main_Window_Access is
L : AWF.Layouts.AWF_Layout_Access;
package Slot is new League.Signals.Generic_Slot (Main_Window, On_Click);
begin
return Self : not null Main_Window_Access := new Main_Window do
AWF.Internals.AWF_Widgets.Constructors.Initialize (Self);
L := AWF.Layouts.Create;
Self.Set_Layout (L);
Self.Button := AWF.Push_Buttons.Create (Self);
Self.Button.Set_Text
(League.Strings.To_Universal_String ("Click me!"));
Slot.Connect (Self.Button.Clicked, Self);
end return;
end Create;
--------------
-- On_Click --
--------------
not overriding procedure On_Click (Self : not null access Main_Window) is
begin
Self.Counter := Self.Counter + 1;
Self.Button.Set_Text
(League.Strings.To_Universal_String
("Was clicked"
& Integer'Wide_Wide_Image (Self.Counter)
& " times. Click again!"));
end On_Click;
end Demo.Main_Windows;
|
houey/Amass | Ada | 2,724 | ads | -- Copyright 2017-2021 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
name = "Brute Forcing"
type = "brute"
probes = {"www", "online", "webserver", "ns", "ns1", "mail", "smtp", "webmail", "shop", "dev",
"prod", "test", "vpn", "ftp", "ssh", "secure", "whm", "admin", "webdisk", "mobile",
"remote", "server", "cpanel", "cloud", "autodiscover", "api", "m", "blog"}
function start()
setratelimit(1)
end
function vertical(ctx, domain)
local cfg = config(ctx)
if cfg.mode == "passive" then
return
end
if cfg['brute_forcing'].active then
makenames(ctx, domain)
end
end
function resolved(ctx, name, domain, records)
local nparts = split(name, ".")
local dparts = split(domain, ".")
-- Do not process resolved root domain names
if #nparts == #dparts then
return
end
-- Do not generate names from CNAMEs or names without A/AAAA records
if (#records == 0 or (has_cname(records) or not has_addr(records))) then
return
end
local cfg = config(ctx)
if cfg.mode == "passive" then
return
end
local bf = cfg['brute_forcing']
if (bf.active and bf.recursive and (bf['min_for_recursive'] == 0)) then
makenames(ctx, name)
end
end
function subdomain(ctx, name, domain, times)
local cfg = config(ctx)
if cfg.mode == "passive" then
return
end
local bf = cfg['brute_forcing']
if (bf.active and bf.recursive and (bf['min_for_recursive'] == times)) then
makenames(ctx, name)
end
end
function makenames(ctx, base)
local wordlist = brute_wordlist(ctx)
for i, word in pairs(wordlist) do
local expired = newname(ctx, word .. "." .. base)
if expired then
return
end
if i % 1000 == 0 then
checkratelimit()
end
end
end
function has_cname(records)
if #records == 0 then
return false
end
for _, rec in pairs(records) do
if rec.rrtype == 5 then
return true
end
end
return false
end
function has_addr(records)
if #records == 0 then
return false
end
for _, rec in pairs(records) do
if (rec.rrtype == 1 or rec.rrtype == 28) then
return true
end
end
return false
end
function split(str, delim)
local result = {}
local pattern = "[^%" .. delim .. "]+"
local matches = find(str, pattern)
if (matches == nil or #matches == 0) then
return result
end
for _, match in pairs(matches) do
table.insert(result, match)
end
return result
end
|
reznikmm/matreshka | Ada | 4,121 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Presentation_Use_Header_Name_Attributes;
package Matreshka.ODF_Presentation.Use_Header_Name_Attributes is
type Presentation_Use_Header_Name_Attribute_Node is
new Matreshka.ODF_Presentation.Abstract_Presentation_Attribute_Node
and ODF.DOM.Presentation_Use_Header_Name_Attributes.ODF_Presentation_Use_Header_Name_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Presentation_Use_Header_Name_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Presentation_Use_Header_Name_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Presentation.Use_Header_Name_Attributes;
|
reznikmm/matreshka | Ada | 45,819 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Use_Cases is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Use_Case_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Use_Case
(AMF.UML.Use_Cases.UML_Use_Case_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Use_Case_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Use_Case
(AMF.UML.Use_Cases.UML_Use_Case_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Use_Case_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Use_Case
(Visitor,
AMF.UML.Use_Cases.UML_Use_Case_Access (Self),
Control);
end if;
end Visit_Element;
----------------
-- Get_Extend --
----------------
overriding function Get_Extend
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Extends.Collections.Set_Of_UML_Extend is
begin
return
AMF.UML.Extends.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Extend
(Self.Element)));
end Get_Extend;
-------------------------
-- Get_Extension_Point --
-------------------------
overriding function Get_Extension_Point
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Extension_Points.Collections.Set_Of_UML_Extension_Point is
begin
return
AMF.UML.Extension_Points.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Extension_Point
(Self.Element)));
end Get_Extension_Point;
-----------------
-- Get_Include --
-----------------
overriding function Get_Include
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Includes.Collections.Set_Of_UML_Include is
begin
return
AMF.UML.Includes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Include
(Self.Element)));
end Get_Include;
-----------------
-- Get_Subject --
-----------------
overriding function Get_Subject
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Subject
(Self.Element)));
end Get_Subject;
-----------------------------
-- Get_Classifier_Behavior --
-----------------------------
overriding function Get_Classifier_Behavior
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access is
begin
return
AMF.UML.Behaviors.UML_Behavior_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Classifier_Behavior
(Self.Element)));
end Get_Classifier_Behavior;
-----------------------------
-- Set_Classifier_Behavior --
-----------------------------
overriding procedure Set_Classifier_Behavior
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Classifier_Behavior
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Classifier_Behavior;
-------------------------------
-- Get_Interface_Realization --
-------------------------------
overriding function Get_Interface_Realization
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Interface_Realizations.Collections.Set_Of_UML_Interface_Realization is
begin
return
AMF.UML.Interface_Realizations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Interface_Realization
(Self.Element)));
end Get_Interface_Realization;
------------------------
-- Get_Owned_Behavior --
------------------------
overriding function Get_Owned_Behavior
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Behaviors.Collections.Set_Of_UML_Behavior is
begin
return
AMF.UML.Behaviors.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Behavior
(Self.Element)));
end Get_Owned_Behavior;
-------------------
-- Get_Attribute --
-------------------
overriding function Get_Attribute
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is
begin
return
AMF.UML.Properties.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Attribute
(Self.Element)));
end Get_Attribute;
---------------------------
-- Get_Collaboration_Use --
---------------------------
overriding function Get_Collaboration_Use
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Collaboration_Uses.Collections.Set_Of_UML_Collaboration_Use is
begin
return
AMF.UML.Collaboration_Uses.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Collaboration_Use
(Self.Element)));
end Get_Collaboration_Use;
-----------------
-- Get_Feature --
-----------------
overriding function Get_Feature
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature is
begin
return
AMF.UML.Features.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Feature
(Self.Element)));
end Get_Feature;
-----------------
-- Get_General --
-----------------
overriding function Get_General
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_General
(Self.Element)));
end Get_General;
------------------------
-- Get_Generalization --
------------------------
overriding function Get_Generalization
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Generalizations.Collections.Set_Of_UML_Generalization is
begin
return
AMF.UML.Generalizations.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Generalization
(Self.Element)));
end Get_Generalization;
--------------------------
-- Get_Inherited_Member --
--------------------------
overriding function Get_Inherited_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Inherited_Member
(Self.Element)));
end Get_Inherited_Member;
---------------------
-- Get_Is_Abstract --
---------------------
overriding function Get_Is_Abstract
(Self : not null access constant UML_Use_Case_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Abstract
(Self.Element);
end Get_Is_Abstract;
---------------------------------
-- Get_Is_Final_Specialization --
---------------------------------
overriding function Get_Is_Final_Specialization
(Self : not null access constant UML_Use_Case_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Final_Specialization
(Self.Element);
end Get_Is_Final_Specialization;
---------------------------------
-- Set_Is_Final_Specialization --
---------------------------------
overriding procedure Set_Is_Final_Specialization
(Self : not null access UML_Use_Case_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Final_Specialization
(Self.Element, To);
end Set_Is_Final_Specialization;
----------------------------------
-- Get_Owned_Template_Signature --
----------------------------------
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access is
begin
return
AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
(Self.Element)));
end Get_Owned_Template_Signature;
----------------------------------
-- Set_Owned_Template_Signature --
----------------------------------
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owned_Template_Signature;
------------------------
-- Get_Owned_Use_Case --
------------------------
overriding function Get_Owned_Use_Case
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
return
AMF.UML.Use_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Use_Case
(Self.Element)));
end Get_Owned_Use_Case;
--------------------------
-- Get_Powertype_Extent --
--------------------------
overriding function Get_Powertype_Extent
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Generalization_Sets.Collections.Set_Of_UML_Generalization_Set is
begin
return
AMF.UML.Generalization_Sets.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Powertype_Extent
(Self.Element)));
end Get_Powertype_Extent;
------------------------------
-- Get_Redefined_Classifier --
------------------------------
overriding function Get_Redefined_Classifier
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Classifier
(Self.Element)));
end Get_Redefined_Classifier;
------------------------
-- Get_Representation --
------------------------
overriding function Get_Representation
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access is
begin
return
AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Representation
(Self.Element)));
end Get_Representation;
------------------------
-- Set_Representation --
------------------------
overriding procedure Set_Representation
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Representation
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Representation;
----------------------
-- Get_Substitution --
----------------------
overriding function Get_Substitution
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Substitutions.Collections.Set_Of_UML_Substitution is
begin
return
AMF.UML.Substitutions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Substitution
(Self.Element)));
end Get_Substitution;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access is
begin
return
AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
------------------
-- Get_Use_Case --
------------------
overriding function Get_Use_Case
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
return
AMF.UML.Use_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Use_Case
(Self.Element)));
end Get_Use_Case;
------------------------
-- Get_Element_Import --
------------------------
overriding function Get_Element_Import
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Element_Imports.Collections.Set_Of_UML_Element_Import is
begin
return
AMF.UML.Element_Imports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Element_Import
(Self.Element)));
end Get_Element_Import;
-------------------------
-- Get_Imported_Member --
-------------------------
overriding function Get_Imported_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
return
AMF.UML.Packageable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Imported_Member
(Self.Element)));
end Get_Imported_Member;
----------------
-- Get_Member --
----------------
overriding function Get_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Member
(Self.Element)));
end Get_Member;
----------------------
-- Get_Owned_Member --
----------------------
overriding function Get_Owned_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
return
AMF.UML.Named_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Member
(Self.Element)));
end Get_Owned_Member;
--------------------
-- Get_Owned_Rule --
--------------------
overriding function Get_Owned_Rule
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Rule
(Self.Element)));
end Get_Owned_Rule;
------------------------
-- Get_Package_Import --
------------------------
overriding function Get_Package_Import
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Package_Imports.Collections.Set_Of_UML_Package_Import is
begin
return
AMF.UML.Package_Imports.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Package_Import
(Self.Element)));
end Get_Package_Import;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------
-- Get_Package --
-----------------
overriding function Get_Package
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Packages.UML_Package_Access is
begin
return
AMF.UML.Packages.UML_Package_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Package
(Self.Element)));
end Get_Package;
-----------------
-- Set_Package --
-----------------
overriding procedure Set_Package
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Packages.UML_Package_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Package
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Package;
-----------------------------------
-- Get_Owning_Template_Parameter --
-----------------------------------
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter
(Self.Element)));
end Get_Owning_Template_Parameter;
-----------------------------------
-- Set_Owning_Template_Parameter --
-----------------------------------
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owning_Template_Parameter;
----------------------------
-- Get_Template_Parameter --
----------------------------
overriding function Get_Template_Parameter
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is
begin
return
AMF.UML.Template_Parameters.UML_Template_Parameter_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter
(Self.Element)));
end Get_Template_Parameter;
----------------------------
-- Set_Template_Parameter --
----------------------------
overriding procedure Set_Template_Parameter
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template_Parameter;
----------------------------------
-- Get_Owned_Template_Signature --
----------------------------------
overriding function Get_Owned_Template_Signature
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Template_Signatures.UML_Template_Signature_Access is
begin
return
AMF.UML.Template_Signatures.UML_Template_Signature_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Template_Signature
(Self.Element)));
end Get_Owned_Template_Signature;
----------------------------------
-- Set_Owned_Template_Signature --
----------------------------------
overriding procedure Set_Owned_Template_Signature
(Self : not null access UML_Use_Case_Proxy;
To : AMF.UML.Template_Signatures.UML_Template_Signature_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Owned_Template_Signature
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Owned_Template_Signature;
--------------------------
-- Get_Template_Binding --
--------------------------
overriding function Get_Template_Binding
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Template_Bindings.Collections.Set_Of_UML_Template_Binding is
begin
return
AMF.UML.Template_Bindings.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Binding
(Self.Element)));
end Get_Template_Binding;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Use_Case_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Use_Case_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
----------------------------
-- All_Included_Use_Cases --
----------------------------
overriding function All_Included_Use_Cases
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Use_Cases.Collections.Set_Of_UML_Use_Case is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Included_Use_Cases unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.All_Included_Use_Cases";
return All_Included_Use_Cases (Self);
end All_Included_Use_Cases;
------------------
-- All_Features --
------------------
overriding function All_Features
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Features.Collections.Set_Of_UML_Feature is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Features unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.All_Features";
return All_Features (Self);
end All_Features;
-----------------
-- Conforms_To --
-----------------
overriding function Conforms_To
(Self : not null access constant UML_Use_Case_Proxy;
Other : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Conforms_To";
return Conforms_To (Self, Other);
end Conforms_To;
-------------
-- General --
-------------
overriding function General
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "General unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.General";
return General (Self);
end General;
-----------------------
-- Has_Visibility_Of --
-----------------------
overriding function Has_Visibility_Of
(Self : not null access constant UML_Use_Case_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Has_Visibility_Of unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Has_Visibility_Of";
return Has_Visibility_Of (Self, N);
end Has_Visibility_Of;
-------------
-- Inherit --
-------------
overriding function Inherit
(Self : not null access constant UML_Use_Case_Proxy;
Inhs : AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherit unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Inherit";
return Inherit (Self, Inhs);
end Inherit;
-------------------------
-- Inheritable_Members --
-------------------------
overriding function Inheritable_Members
(Self : not null access constant UML_Use_Case_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inheritable_Members unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Inheritable_Members";
return Inheritable_Members (Self, C);
end Inheritable_Members;
----------------------
-- Inherited_Member --
----------------------
overriding function Inherited_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherited_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Inherited_Member";
return Inherited_Member (Self);
end Inherited_Member;
-----------------
-- Is_Template --
-----------------
overriding function Is_Template
(Self : not null access constant UML_Use_Case_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Is_Template";
return Is_Template (Self);
end Is_Template;
-------------------------
-- May_Specialize_Type --
-------------------------
overriding function May_Specialize_Type
(Self : not null access constant UML_Use_Case_Proxy;
C : AMF.UML.Classifiers.UML_Classifier_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "May_Specialize_Type unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.May_Specialize_Type";
return May_Specialize_Type (Self, C);
end May_Specialize_Type;
------------------------
-- Exclude_Collisions --
------------------------
overriding function Exclude_Collisions
(Self : not null access constant UML_Use_Case_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Exclude_Collisions unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Exclude_Collisions";
return Exclude_Collisions (Self, Imps);
end Exclude_Collisions;
-------------------------
-- Get_Names_Of_Member --
-------------------------
overriding function Get_Names_Of_Member
(Self : not null access constant UML_Use_Case_Proxy;
Element : AMF.UML.Named_Elements.UML_Named_Element_Access)
return AMF.String_Collections.Set_Of_String is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Get_Names_Of_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Get_Names_Of_Member";
return Get_Names_Of_Member (Self, Element);
end Get_Names_Of_Member;
--------------------
-- Import_Members --
--------------------
overriding function Import_Members
(Self : not null access constant UML_Use_Case_Proxy;
Imps : AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Import_Members unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Import_Members";
return Import_Members (Self, Imps);
end Import_Members;
---------------------
-- Imported_Member --
---------------------
overriding function Imported_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Imported_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Imported_Member";
return Imported_Member (Self);
end Imported_Member;
---------------------------------
-- Members_Are_Distinguishable --
---------------------------------
overriding function Members_Are_Distinguishable
(Self : not null access constant UML_Use_Case_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Members_Are_Distinguishable unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Members_Are_Distinguishable";
return Members_Are_Distinguishable (Self);
end Members_Are_Distinguishable;
------------------
-- Owned_Member --
------------------
overriding function Owned_Member
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Named_Elements.Collections.Set_Of_UML_Named_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Owned_Member unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Owned_Member";
return Owned_Member (Self);
end Owned_Member;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Use_Case_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Namespace";
return Namespace (Self);
end Namespace;
-----------------
-- Conforms_To --
-----------------
overriding function Conforms_To
(Self : not null access constant UML_Use_Case_Proxy;
Other : AMF.UML.Types.UML_Type_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Conforms_To unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Conforms_To";
return Conforms_To (Self, Other);
end Conforms_To;
------------------------
-- Is_Compatible_With --
------------------------
overriding function Is_Compatible_With
(Self : not null access constant UML_Use_Case_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Is_Compatible_With";
return Is_Compatible_With (Self, P);
end Is_Compatible_With;
---------------------------
-- Is_Template_Parameter --
---------------------------
overriding function Is_Template_Parameter
(Self : not null access constant UML_Use_Case_Proxy)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Is_Template_Parameter";
return Is_Template_Parameter (Self);
end Is_Template_Parameter;
----------------------------
-- Parameterable_Elements --
----------------------------
overriding function Parameterable_Elements
(Self : not null access constant UML_Use_Case_Proxy)
return AMF.UML.Parameterable_Elements.Collections.Set_Of_UML_Parameterable_Element is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Parameterable_Elements unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Parameterable_Elements";
return Parameterable_Elements (Self);
end Parameterable_Elements;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Use_Case_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Use_Case_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Use_Case_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
end AMF.Internals.UML_Use_Cases;
|
msrLi/portingSources | Ada | 4,077 | adb | -- Copyright 2009-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- This program declares a bunch of unconstrained objects and
-- discrinimated records; the goal is to check that GDB does not crash
-- when printing them even if they are not initialized.
with Parse_Controlled;
procedure Parse is -- START
A : aliased Integer := 1;
type Access_Type is access all Integer;
type String_Access is access String;
type My_Record is record
Field1 : Access_Type;
Field2 : String (1 .. 2);
end record;
type Discriminants_Record (A : Integer; B : Boolean) is record
C : Float;
end record;
Z : Discriminants_Record := (A => 1, B => False, C => 2.0);
type Variable_Record (A : Boolean := True) is record
case A is
when True =>
B : Integer;
when False =>
C : Float;
D : Integer;
end case;
end record;
Y : Variable_Record := (A => True, B => 1);
Y2 : Variable_Record := (A => False, C => 1.0, D => 2);
Nv : Parse_Controlled.Null_Variant;
type Union_Type (A : Boolean := False) is record
case A is
when True => B : Integer;
when False => C : Float;
end case;
end record;
pragma Unchecked_Union (Union_Type);
Ut : Union_Type := (A => True, B => 3);
type Tagged_Type is tagged record
A : Integer;
B : Character;
end record;
Tt : Tagged_Type := (A => 2, B => 'C');
type Child_Tagged_Type is new Tagged_Type with record
C : Float;
end record;
Ctt : Child_Tagged_Type := (Tt with C => 4.5);
type Child_Tagged_Type2 is new Tagged_Type with null record;
Ctt2 : Child_Tagged_Type2 := (Tt with null record);
type My_Record_Array is array (Natural range <>) of My_Record;
W : My_Record_Array := ((Field1 => A'Access, Field2 => "ab"),
(Field1 => A'Access, Field2 => "rt"));
type Discriminant_Record (Num1, Num2,
Num3, Num4 : Natural) is record
Field1 : My_Record_Array (1 .. Num2);
Field2 : My_Record_Array (Num1 .. 10);
Field3 : My_Record_Array (Num1 .. Num2);
Field4 : My_Record_Array (Num3 .. Num2);
Field5 : My_Record_Array (Num4 .. Num2);
end record;
Dire : Discriminant_Record (1, 7, 3, 0);
type Null_Variant_Part (Discr : Integer) is record
case Discr is
when 1 => Var_1 : Integer;
when 2 => Var_2 : Boolean;
when others => null;
end case;
end record;
Nvp : Null_Variant_Part (3);
type T_Type is array (Positive range <>) of Integer;
type T_Ptr_Type is access T_Type;
T_Ptr : T_Ptr_Type := new T_Type' (13, 17);
T_Ptr2 : T_Ptr_Type := new T_Type' (2 => 13, 3 => 17);
function Foos return String is
begin
return "string";
end Foos;
My_Str : String := Foos;
type Value_Var_Type is ( V_Null, V_Boolean, V_Integer );
type Value_Type( Var : Value_Var_Type := V_Null ) is
record
case Var is
when V_Null =>
null;
when V_Boolean =>
Boolean_Value : Boolean;
when V_Integer =>
Integer_Value : Integer;
end case;
end record;
NBI_N : Value_Type := (Var => V_Null);
NBI_I : Value_Type := (Var => V_Integer, Integer_Value => 18);
NBI_B : Value_Type := (Var => V_Boolean, Boolean_Value => True);
begin
null;
end Parse;
|
charlie5/lace | Ada | 3,099 | ads | generic
package any_Math.any_Algebra.any_linear
is
pragma Pure;
----------
-- Vector
--
function Norm_squared (Self : in Vector) return Real; -- Length squared.
function Normalised (Self : in Vector) return Vector;
procedure Normalise (Self : in out Vector);
function Normalised (Self : in Vector_2) return Vector_2;
procedure Normalise (Self : in out Vector_2);
function Normalised (Self : in Vector_3) return Vector_3;
procedure Normalise (Self : in out Vector_3);
function Min (Left, Right : in Vector) return Vector;
function Max (Left, Right : in Vector) return Vector;
function Scaled (Self : in Vector; By : in Vector) return Vector;
----------
-- Matrix
--
function to_Matrix (Row_1,
Row_2,
Row_3 : in Vector_3) return Matrix_3x3;
function Identity (Size : in Index := 3) return Matrix;
function Min (Self : in Matrix) return Real;
function Max (Self : in Matrix) return Real;
function Image (Self : in Matrix) return String;
procedure invert (Self : in out Matrix);
function is_Square (Self : in Matrix) return Boolean;
function sub_Matrix (Self : in Matrix;
start_Row, end_Row : in Index;
start_Col, end_Col : in Index) return Matrix;
---------------
-- Quaternion
--
function to_Quaternion (axis_X,
axis_Y,
axis_Z : in Real;
Angle : in Real) return Quaternion;
--
-- Returns a quaternion defined by a rotation about an axis.
-- (TODO: rid this and use Vector_3 version instead.)
function to_Quaternion (Axis : in Vector_3;
Angle : in Real) return Quaternion;
--
-- Returns a quaternion defined by a rotation about an axis.
function to_Quaternion (Self : in Matrix_3x3) return Quaternion;
function "*" (Self : in Quaternion; By : in Quaternion) return Quaternion;
--
-- Grassmann product.
function Unit (Self : in Quaternion) return Quaternion;
function Conjugate (Self : in Quaternion) return Quaternion;
--
-- (TODO: only for unit quaternions.)
function euler_Angles (Self : in Quaternion) return Vector_3;
function infinitesimal_Rotation_from
(Self : in Quaternion; angular_Velocity : in Vector_3) return Quaternion;
--
-- An infinitesimal rotation may be multiplied by a duration and then added to the original attitude
-- to produce the attitude at the given time.
function Normalised (Self : in Quaternion) return Quaternion;
procedure normalise (Self : in out Quaternion);
private
pragma Inline ("*");
pragma Inline_Always (Norm_squared);
pragma Inline_Always (Normalise);
end any_Math.any_Algebra.any_linear;
|
reznikmm/matreshka | Ada | 4,075 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Style_Font_Style_Complex_Attributes;
package Matreshka.ODF_Style.Font_Style_Complex_Attributes is
type Style_Font_Style_Complex_Attribute_Node is
new Matreshka.ODF_Style.Abstract_Style_Attribute_Node
and ODF.DOM.Style_Font_Style_Complex_Attributes.ODF_Style_Font_Style_Complex_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Style_Font_Style_Complex_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Style_Font_Style_Complex_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Style.Font_Style_Complex_Attributes;
|
reznikmm/matreshka | Ada | 3,883 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.ODF_Attributes.Style.Vertical_Align;
package ODF.DOM.Attributes.Style.Vertical_Align.Internals is
function Create
(Node : Matreshka.ODF_Attributes.Style.Vertical_Align.Style_Vertical_Align_Access)
return ODF.DOM.Attributes.Style.Vertical_Align.ODF_Style_Vertical_Align;
function Wrap
(Node : Matreshka.ODF_Attributes.Style.Vertical_Align.Style_Vertical_Align_Access)
return ODF.DOM.Attributes.Style.Vertical_Align.ODF_Style_Vertical_Align;
end ODF.DOM.Attributes.Style.Vertical_Align.Internals;
|
oysteinlondal/Inverted-Pendulum | Ada | 17,997 | adb | with Exceptions; use Exceptions;
package body Task_Implementations is
procedure Acceptance_Test(Max : float;
Min : float;
value : float;
Computation_time : ada.Real_Time.Time_Span;
Max_Computation_time : Ada.Real_Time.Time_Span;
Count : Integer)is
begin
if Count > 4 then
raise Recovery_Block_Overload;
elsif Value > Max then
raise Value_Exceed_Max;
elsif Value < Min then
raise Value_Exceed_Max;
elsif Computation_Time > Max_Computation_Time then
raise Excecution_Time_Overun;
end if;
end acceptance_Test;
task body Gyroscope_Reader is
-- Timing Constraints
Next_Period : Ada.Real_Time.Time;
Start_Point : Ada.Real_Time.Time;
Offset : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
Period : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(20);
-- Worst-Case Computation Time Analysis
Execution_Start : Ada.Real_Time.Time;
Execution_End : Ada.Real_Time.Time;
Total_Computation_Time : Ada.Real_Time.Time_Span;
Total_Computation_Time_Limit: Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(5);
Worst_Case_Computation_Time : Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
-- Task Specific Variable Declarations
Velocity : Float;
--Exception variables
Velocity_Max : float := 6.0;
Velocity_Min : float := -6.0;
Recoveryblock_count : integer := 0;
Recoveryblock_count_limit : integer := 4;
-------ALL EXECUTION GATHERED IN A FUNCTION
procedure excecute is
begin
-- START OF EXECUTION
Execution_Start := Ada.Real_Time.Clock;
Meassure_Velocity.Retrieve_Velocity(Velocity);
Velocity := To_Radians(Velocity);
Gyroscope_SR.Set(Velocity);
-- Define next time to run
Next_Period := Next_Period + Period;
-- END OF EXECUTION
Execution_End := Ada.Real_Time.Clock;
-- Calculation of Total Computation Time
Total_Computation_Time := Execution_End - Execution_Start;
-- Set a new worst-case if current execution time is the largest
if Total_Computation_Time > Worst_Case_Computation_Time then
Worst_Case_Computation_Time := Total_Computation_Time;
end if;
Ada.Text_IO.Put_Line("A" & Duration'Image(To_Duration(Worst_Case_Computation_Time)));
end excecute;
begin
Epoch.Get_Start_Time(Start_Point);
-- Define next time to run
Next_Period := Start_Point + Offset;
loop
declare
begin
-- Wait for new period
delay until Next_Period;
excecute; ---EXCECUTE PERIOD CALCULATIONS
Acceptance_Test(Velocity_Max, Velocity_Min, Velocity, Total_Computation_Time, Total_Computation_Time_Limit, Recoveryblock_count);
exception -- Containing Recovery Blocks
when Value_Exceed_Max =>
Recoveryblock_count := Recoveryblock_count + 1;
Velocity := 3.0;
Gyroscope_SR.Set(Velocity);
Acceptance_Test(Velocity_Max, Velocity_Min, Velocity, Total_Computation_Time, Total_Computation_Time_Limit, Recoveryblock_count);
when Value_Exceed_Min =>
Recoveryblock_count := Recoveryblock_count + 1;
Velocity := -3.0;
Gyroscope_SR.Set(Velocity);
Acceptance_Test(Velocity_Max, Velocity_Min, Velocity, Total_Computation_Time, Total_Computation_Time_Limit, Recoveryblock_count);
When Excecution_Time_Overun =>
ada.Text_IO.Put_Line("Gyroscope read: Execturion time error");
when Recovery_Block_Overload =>
ada.Text_IO.Put_Line("Gyroscope read: Recovery Block Overload");
when Unknown_Error =>
Ada.Text_IO.Put_Line("Gyroscope read: Unknown error!!!");
end;
end loop;
end Gyroscope_Reader;
task body Accelerometer_Reader is
-- Timing Constraints
Offset : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
Period : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(20);
Next_Period : Ada.Real_Time.Time;
Start_Point : Ada.Real_Time.Time;
-- I/O Jitter Constraints Of Accelorometer
Next_Reading : Ada.Real_Time.Time;
Read_Period : Ada.Real_Time.Time_Span := Ada.Real_Time.Microseconds(100);
-- Worst-Case Computation Time Analysis
Execution_Start : Ada.Real_Time.Time;
Execution_End : Ada.Real_Time.Time;
Total_Computation_Time : Ada.Real_Time.Time_Span;
Total_Computation_Time_Limit: Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(5);
Worst_Case_Computation_Time : Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
-- Task Specific Variable Declarations
Angle : Float;
-- Summation Of Meassured Coordinates
Sum_Accelerometer_Xvalues : Float := 0.0;
Sum_Accelerometer_Yvalues : Float := 0.0;
-- Average Meassured Value For Each Coordinate
Avg_Accelerometer_Xvalue : Float := 0.0;
Avg_Accelerometer_Yvalue : Float := 0.0;
-- New Meassurement For Each Coordinate
Acceleration_X : Float;
Acceleration_Y : Float;
-- Current Number Of Meassurements And Maximum Number Of Meassurements
Count_Accelerometer_Reads : Natural := 0;
Max_Accelerometer_Reads : Natural := 5;
-- Indicates When Meassuring Is Done According To The Max Counts
Done : Boolean;
-- Exception variables
Angle_Max : float := 6.0;
Angle_Min : float := -6.0;
Recoveryblock_count : integer := 0;
Recoveryblock_count_limit : integer := 4;
procedure excecute is
begin
Execution_Start := Ada.Real_Time.Clock;
-- START OF EXECUTION
Done := False;
-- Define next time to read from sensor (jitter)
Next_Reading := Next_Period;
-- Loop over number of meassurements needed to find the average
loop
delay until Next_Reading;
-- Count is zero when number of readings is equal to the value of max count
Count_Accelerometer_Reads := (Count_Accelerometer_Reads + 1) mod Max_Accelerometer_Reads;
-- Read from sensor
Meassure_Acceleration.Retrieve_Acceleration(Acceleration_X, Acceleration_Y);
-- Adde reading to the sum
Sum_Accelerometer_Xvalues := Sum_Accelerometer_Xvalues + Acceleration_X;
Sum_Accelerometer_Yvalues := Sum_Accelerometer_Yvalues + Acceleration_Y;
-- Check when number of readings is sufficient
if Count_Accelerometer_Reads = 0 then
Done := True;
-- Calculate the average values
Avg_Accelerometer_Xvalue := Sum_Accelerometer_Xvalues / Float(Max_Accelerometer_Reads);
Avg_Accelerometer_Yvalue := Sum_Accelerometer_Yvalues / Float(Max_Accelerometer_Reads);
-- Calculate the angle
Angle := Find_Angle(Avg_Accelerometer_Xvalue, Avg_Accelerometer_Yvalue);
-- Store the angle in a shared protected object
Accelerometer_SR.Set(Angle);
-- Reset
Sum_Accelerometer_Xvalues := 0.0;
Sum_Accelerometer_Yvalues := 0.0;
end if;
-- Exit when we have found an average sensor value
exit when Done;
-- Define the next time to run (Period T)
Next_Reading := Next_Reading + Read_Period;
end loop;
Next_Period := Next_Period + Period;
-- END OF EXECUTION
Execution_End := Ada.Real_Time.Clock;
-- Calculation of Total Computation Time
Total_Computation_Time := Execution_End - Execution_Start;
-- Set a new worst-case if current execution time is the largest
if Total_Computation_Time > Worst_Case_Computation_Time then
Worst_Case_Computation_Time := Total_Computation_Time;
end if;
Ada.Text_IO.Put_Line("B" & Duration'Image(To_Duration(Worst_Case_Computation_Time)));
end excecute;
begin
Epoch.Get_Start_Time(Start_Point);
-- Define next time to run
Next_Period := Start_Point + Offset;
loop
declare
begin
-- Wait for new period
delay until Next_Period;
Excecute;
Acceptance_Test(Angle_Max,
Angle_Min, Angle,
Total_Computation_Time,
Total_Computation_Time_Limit,
Recoveryblock_count);
exception
when Value_Exceed_Max =>
Recoveryblock_count := Recoveryblock_count + 1;
Angle := 0.01;
Accelerometer_SR.Set(Angle);
Acceptance_Test(Angle_Max,
Angle_Min,
Angle,
Total_Computation_Time,
Total_Computation_Time_Limit,
Recoveryblock_count);
when Value_Exceed_Min =>
Recoveryblock_count := Recoveryblock_count + 1;
Angle := -0.01;
Accelerometer_SR.Set(Angle);
Acceptance_Test(Angle_Max,
Angle_Min,
Angle,
Total_Computation_Time,
Total_Computation_Time_Limit,
Recoveryblock_count);
When Excecution_Time_Overun =>
ada.Text_IO.Put_Line("Accelerometer read: Execturion time error");
when Recovery_Block_Overload =>
ada.Text_IO.Put_Line("Accelerometer read: Recovery Block Overload");
when Unknown_Error =>
Ada.Text_IO.Put_Line("Accelerometer read: Unknown error!!!");
end;
end loop;
end Accelerometer_Reader;
task body Cascade_Controller is
-- Timing Constraints
Offset : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
Period : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(20);
Next_Period : Ada.Real_Time.Time;
Start_Point : Ada.Real_Time.Time;
-- Worst-Case Computation Time Analysis
Execution_Start : Ada.Real_Time.Time;
Execution_End : Ada.Real_Time.Time;
Total_Computation_Time : Ada.Real_Time.Time_Span;
Total_Computation_Time_Limit: Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(5);
Worst_Case_Computation_Time : Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
-- Task Specific Variable Declarations
Angle : Float;
Velocity : Float;
Actuator_Value : Natural := 1500;
Actuator_Value_Max : Float := 2000.0;
Actuator_Value_Min : Float := 1000.0;
Recoveryblock_count : integer := 0;
Recoveryblock_count_limit : integer := 4;
procedure Excecute is
begin
-- START OF EXECUTION
Execution_Start := Ada.Real_Time.Clock;
Accelerometer_SR.Get(Angle);
Gyroscope_SR.Get(Velocity);
Motor_AW.Set(Actuator_Value);
-- Define next time to run
Next_Period := Next_Period + Period;
-- END OF EXECUTION
Execution_End := Ada.Real_Time.Clock;
-- Calculation of Total Computation Time
Total_Computation_Time := Execution_End - Execution_Start;
-- Set a new worst-case if current execution time is the largest
if Total_Computation_Time > Worst_Case_Computation_Time then
Worst_Case_Computation_Time := Total_Computation_Time;
end if;
Ada.Text_IO.Put_Line("C" & Duration'Image(To_Duration(Worst_Case_Computation_Time)));
end Excecute;
begin
Epoch.Get_Start_Time(Start_Point);
-- Define next time to run
Next_Period := Start_Point + Offset;
loop
declare
begin
delay until Next_Period; -- Wait for new period
Excecute;
Acceptance_Test(Actuator_Value_Max,
Actuator_Value_Min,
Float(Actuator_Value),
Total_Computation_Time,
Total_Computation_Time_Limit,
Recoveryblock_count);
exception
when Value_Exceed_Max =>
Recoveryblock_count := Recoveryblock_count + 1;
Actuator_Value := 2000;
Motor_AW.Set(Actuator_Value);
Acceptance_Test(Actuator_Value_Max,
Actuator_Value_Min,
Float(Actuator_Value),
Total_Computation_Time,
Total_Computation_Time_Limit,
Recoveryblock_count);
when Value_Exceed_Min =>
Recoveryblock_count := Recoveryblock_count + 1;
Actuator_Value := 1000;
Motor_AW.Set(Actuator_Value);
Acceptance_Test(Actuator_Value_Max,
Actuator_Value_Min,
Float(Actuator_Value),
Total_Computation_Time,
Total_Computation_Time_Limit,
Recoveryblock_count);
When Excecution_Time_Overun =>
ada.Text_IO.Put_Line("Cascade controller: Execturion time error");
when Recovery_Block_Overload =>
ada.Text_IO.Put_Line("Cascade controller: Recovery Block Overload");
when Unknown_Error =>
Ada.Text_IO.Put_Line("Cascade controller: Unknown error!!!");
end;
end loop;
end Cascade_Controller;
task body Actuator_Writer is
-- Timing Constraints
Offset : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
Period : constant Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(20);
Next_Period : Ada.Real_Time.Time;
Start_Point : Ada.Real_Time.Time;
-- We do not wish to write to the motor to early
Min_Start_Time : Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(15);
-- Worst-Case Computation Time Analysis
Execution_Start : Ada.Real_Time.Time;
Execution_End : Ada.Real_Time.Time;
Total_Computation_Time : Ada.Real_Time.Time_Span;
Worst_Case_Computation_Time : Ada.Real_Time.Time_Span := Ada.Real_Time.Milliseconds(0);
-- Task Specific Variable Declarations
Actuator_Value : Natural;
begin
Epoch.Get_Start_Time(Start_Point);
-- Define next time to run
Next_Period := Start_Point + Offset;
loop
-- Wait for new period
delay until Next_Period + Min_Start_Time;
-- START OF EXECUTION
Execution_Start := Ada.Real_Time.Clock;
Motor_AW.Get(Actuator_Value);
Next_Period := Next_Period + Period;
-- END OF EXECUTION
Execution_End := Ada.Real_Time.Clock;
-- Calculation of Total Computation Time
Total_Computation_Time := Execution_End - Execution_Start;
-- Set a new worst-case if current execution time is the largest
if Total_Computation_Time > Worst_Case_Computation_Time then
Worst_Case_Computation_Time := Total_Computation_Time;
end if;
Ada.Text_IO.Put_Line("D" & Duration'Image(To_Duration(Worst_Case_Computation_Time)));
end loop;
end Actuator_Writer;
end Task_Implementations;
|
DavJo-dotdotdot/Ada_Drivers_Library | Ada | 1,261 | adb | --with Ada.Real_Time; use Ada.Real_Time;
with MicroBit.Console;
package body Brain is
task body Sense is
--Time_Now : Ada.Real_Time.Time;
begin
--loop
for Index in 1..4 loop
MicroBit.Console.Put_Line("Sensing, pass number ");
MicroBit.Console.Put_Line(Integer'Image(Index));
MicroBit.Console.New_Line;
end loop;
-- delay until Time_Now + Ada.Real_Time.Milliseconds (500);
--end loop;
end Sense;
task body Think is
--Time_Now : Ada.Real_Time.Time;
begin
--loop
for Index in 1..7 loop
MicroBit.Console.Put_Line("Thinking, pass number ");
MicroBit.Console.Put_Line(Integer'Image(Index));
MicroBit.Console.New_Line;
end loop;
-- delay until Time_Now + Ada.Real_Time.Milliseconds (500);
--end loop;
end Think;
task body Act is
--Time_Now : Ada.Real_Time.Time;
begin
--loop
for Index in 1..5 loop
MicroBit.Console.Put_Line("Acting, pass number ");
MicroBit.Console.Put_Line(Integer'Image(Index));
MicroBit.Console.New_Line;
end loop;
-- delay until Time_Now + Ada.Real_Time.Milliseconds (500);
--end loop;
end Act;
end Brain;
|
optikos/oasis | Ada | 3,335 | ads | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Known_Discriminant_Parts;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Expressions;
with Program.Elements.Protected_Definitions;
package Program.Elements.Protected_Type_Declarations is
pragma Pure (Program.Elements.Protected_Type_Declarations);
type Protected_Type_Declaration is
limited interface and Program.Elements.Declarations.Declaration;
type Protected_Type_Declaration_Access is
access all Protected_Type_Declaration'Class with Storage_Size => 0;
not overriding function Name
(Self : Protected_Type_Declaration)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is abstract;
not overriding function Discriminant_Part
(Self : Protected_Type_Declaration)
return Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access is abstract;
not overriding function Aspects
(Self : Protected_Type_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
not overriding function Progenitors
(Self : Protected_Type_Declaration)
return Program.Elements.Expressions.Expression_Vector_Access is abstract;
not overriding function Definition
(Self : Protected_Type_Declaration)
return not null Program.Elements.Protected_Definitions
.Protected_Definition_Access is abstract;
type Protected_Type_Declaration_Text is limited interface;
type Protected_Type_Declaration_Text_Access is
access all Protected_Type_Declaration_Text'Class with Storage_Size => 0;
not overriding function To_Protected_Type_Declaration_Text
(Self : aliased in out Protected_Type_Declaration)
return Protected_Type_Declaration_Text_Access is abstract;
not overriding function Protected_Token
(Self : Protected_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Type_Token
(Self : Protected_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function With_Token
(Self : Protected_Type_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Is_Token
(Self : Protected_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function New_Token
(Self : Protected_Type_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function With_Token_2
(Self : Protected_Type_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Protected_Type_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Protected_Type_Declarations;
|
tum-ei-rcs/StratoX | Ada | 1,769 | ads | -- Project: StratoX
-- Authors: Emanuel Regnath ([email protected])
-- Martin Becker ([email protected])
--
-- Description:
-- allows logging of structured messages at several logging levels.
--
-- Usage:
-- Logger.init -- initializes the Logger
-- Logger.log_console (Logger.INFO, "Program started.") -- writes log on info level to console
-- Logger.log_sd (Logger.INFO, gps_msg) -- writes GPS record to SD card
with ULog;
-- @summary Simultaneously writes to UART, and SD card.
-- Write to SD card is done via a queue and a background task,
-- becauuse it can be slow.
package Logger with SPARK_Mode,
Abstract_State => (LogState with External)
-- we need a state here because log() needs Global aspect
-- since protected object is part of the state, and p.o. is
-- by definition synchronous and synchronous objects are
-- by definition external, we need to mark it as such
is
type Log_Level is (SENSOR, ERROR, WARN, INFO, DEBUG, TRACE);
type Init_Error_Code is (SUCCESS, ERROR);
subtype Message_Type is String;
procedure Init (status : out Init_Error_Code);
procedure log_console (msg_level : Log_Level; message : Message_Type);
-- write a new text log message (shown on console, logged to SD)
procedure log_sd (msg_level : Log_Level; message : ULog.Message);
-- write a new ulog message (not shown on console, logged to SD)
procedure Set_Log_Level (level : Log_Level);
procedure Start_SDLog;
-- start a new logfile on the SD card
LOG_QUEUE_LENGTH : constant := 20;
private
-- FIXME: documentation required
package Adapter is
procedure init (status : out Init_Error_Code);
procedure write (message : Message_Type);
end Adapter;
end Logger;
|
reznikmm/matreshka | Ada | 4,672 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Chart.Error_Lower_Range_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Chart_Error_Lower_Range_Attribute_Node is
begin
return Self : Chart_Error_Lower_Range_Attribute_Node do
Matreshka.ODF_Chart.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Chart_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Chart_Error_Lower_Range_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Error_Lower_Range_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Chart_URI,
Matreshka.ODF_String_Constants.Error_Lower_Range_Attribute,
Chart_Error_Lower_Range_Attribute_Node'Tag);
end Matreshka.ODF_Chart.Error_Lower_Range_Attributes;
|
onox/orka | Ada | 3,224 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2023 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Orka.Behaviors;
with Orka.Cameras;
with Orka.Features.Atmosphere;
with Orka.Resources.Locations;
with Orka.Timers;
with Orka.Types;
with Orka.Rendering.Buffers;
with Orka.Rendering.Programs.Modules;
with Orka.Features.Atmosphere.Cache;
with Orka.Features.Atmosphere.Rendering;
with GL.Objects.Textures;
private with GL.Low_Level.Enums;
package Orka.Features.Terrain.Helpers is
type Terrain_Planet is tagged limited private;
function Height_Map (Object : Terrain_Planet) return GL.Objects.Textures.Texture;
function Slope_Map (Object : Terrain_Planet) return GL.Objects.Textures.Texture;
function Render_Modules (Object : Terrain_Planet)
return Rendering.Programs.Modules.Module_Array;
function Create_Terrain_Planet
(Data : aliased Orka.Features.Atmosphere.Model_Data;
Parameters : Features.Atmosphere.Rendering.Model_Parameters;
Atmosphere : Features.Atmosphere.Cache.Cached_Atmosphere;
Location_Data : Resources.Locations.Location_Ptr;
Location_Shaders : Resources.Locations.Location_Ptr) return Terrain_Planet;
procedure Render
(Object : in out Terrain_Planet;
Terrain : in out Features.Terrain.Terrain;
Parameters : Features.Terrain.Subdivision_Parameters;
Visible_Tiles : out Natural;
Camera : Cameras.Camera_Ptr;
Planet, Star : Behaviors.Behavior_Ptr;
Rotation : Types.Singles.Matrix4;
Center : Cameras.Transforms.Matrix4;
Freeze : Boolean;
Wires : Boolean;
Timer_Update : in out Timers.Timer;
Timer_Render : in out Timers.Timer);
private
use Orka.Cameras;
package LE renames GL.Low_Level.Enums;
type Terrain_Planet is tagged limited record
Terrain_Transforms : Rendering.Buffers.Buffer (Orka.Types.Single_Matrix_Type);
Terrain_Sphere_Params : Rendering.Buffers.Buffer (Orka.Types.Single_Type);
Terrain_Spheroid_Parameters : Features.Terrain.Spheroid_Parameters;
Modules_Terrain_Render : Rendering.Programs.Modules.Module_Array (1 .. 2);
Rotate_90 : Transforms.Matrix4;
Rotate_180 : Transforms.Matrix4;
Rotate_270 : Transforms.Matrix4;
Rotate_90_Up : Transforms.Matrix4;
Rotate_90_Down : Transforms.Matrix4;
Planet_Radius : Float_64;
Planet_Unit_Length : Float_64;
DMap : GL.Objects.Textures.Texture (LE.Texture_2D);
SMap : GL.Objects.Textures.Texture (LE.Texture_2D);
end record;
end Orka.Features.Terrain.Helpers;
|
reznikmm/matreshka | Ada | 3,694 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Attributes;
package ODF.DOM.Table_End_X_Attributes is
pragma Preelaborate;
type ODF_Table_End_X_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Table_End_X_Attribute_Access is
access all ODF_Table_End_X_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Table_End_X_Attributes;
|
reznikmm/matreshka | Ada | 4,199 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Nodes;
with XML.DOM.Attributes.Internals;
package body ODF.DOM.Attributes.FO.Padding.Internals is
------------
-- Create --
------------
function Create
(Node : Matreshka.ODF_Attributes.FO.Padding.FO_Padding_Access)
return ODF.DOM.Attributes.FO.Padding.ODF_FO_Padding is
begin
return
(XML.DOM.Attributes.Internals.Create
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Create;
----------
-- Wrap --
----------
function Wrap
(Node : Matreshka.ODF_Attributes.FO.Padding.FO_Padding_Access)
return ODF.DOM.Attributes.FO.Padding.ODF_FO_Padding is
begin
return
(XML.DOM.Attributes.Internals.Wrap
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Wrap;
end ODF.DOM.Attributes.FO.Padding.Internals;
|
stcarrez/dynamo | Ada | 6,172 | ads | ------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT IMPLEMENTATION COMPONENTS --
-- --
-- A 4 G . A _ D E B U G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2012, Free Software Foundation, Inc. --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 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). --
-- --
------------------------------------------------------------------------------
package A4G.A_Debug is
-- This package contains global flags used to control the inclusion
-- of debugging code in various phases of the ASIS-for-GNAT. It is
-- an almost complete analog of the GNAT Debug package
-------------------------
-- Dynamic Debug Flags --
-------------------------
-- Thirty six flags that can be used to activate various specialized
-- debugging output information. The flags are preset to False, which
-- corresponds to the given output being suppressed. The individual
-- flags can be turned on using the undocumented switch /dxxx where
-- xxx is a string of letters for flags to be turned on. Documentation
-- on the current usage of these flags is contained in the body of Debug
-- rather than the spec, so that we don't have to recompile the world
-- when a new debug flag is added
Debug_Flag_A : Boolean := False;
Debug_Flag_B : Boolean := False;
Debug_Flag_C : Boolean := False;
Debug_Flag_D : Boolean := False;
Debug_Flag_E : Boolean := False;
Debug_Flag_F : Boolean := False;
Debug_Flag_G : Boolean := False;
Debug_Flag_H : Boolean := False;
Debug_Flag_I : Boolean := False;
Debug_Flag_J : Boolean := False;
Debug_Flag_K : Boolean := False;
Debug_Flag_L : Boolean := False;
Debug_Flag_M : Boolean := False;
Debug_Flag_N : Boolean := False;
Debug_Flag_O : Boolean := False;
Debug_Flag_P : Boolean := False;
Debug_Flag_Q : Boolean := False;
Debug_Flag_R : Boolean := False;
Debug_Flag_S : Boolean := False;
Debug_Flag_T : Boolean := False;
Debug_Flag_U : Boolean := False;
Debug_Flag_V : Boolean := False;
Debug_Flag_W : Boolean := False;
Debug_Flag_X : Boolean := False;
Debug_Flag_Y : Boolean := False;
Debug_Flag_Z : Boolean := False;
Debug_Flag_1 : Boolean := False;
Debug_Flag_2 : Boolean := False;
Debug_Flag_3 : Boolean := False;
Debug_Flag_4 : Boolean := False;
Debug_Flag_5 : Boolean := False;
Debug_Flag_6 : Boolean := False;
Debug_Flag_7 : Boolean := False;
Debug_Flag_8 : Boolean := False;
Debug_Flag_9 : Boolean := False;
procedure Set_Debug_Flag (C : Character; Val : Boolean := True);
-- Where C is 0-9 or a-z, sets the corresponding debug flag to the
-- given value. In the checks off version of debug, the call to
-- Set_Debug_Flag is always a null operation.
procedure Set_Off;
-- Sets all the debug flags OFF (except Debug_Lib_Model for now),
-- is to be called by Asis_Environment.Finalize
procedure Set_On; -- TEMPORARY SOLUTION!!!
-- Sets all the debug flags ON.
------------------------
-- TEMPORARY SOLUTION --
------------------------
Debug_Mode : Boolean := False;
-- Flag indicating if the debugging information should be output by the
-- routines from the A4G.A_Output package
Debug_Lib_Model : Boolean := False;
-- Flag forcing the debug output of the tables implementing the ASIS
-- Context Model to be performed when finalizing the ASIS Environment.
-- Currently should be set by hand. The debug output is produced only if
-- Debug_Mode is set ON.
end A4G.A_Debug;
|
reznikmm/matreshka | Ada | 6,813 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.DI.Diagram_Elements.Collections;
with AMF.DI.Styles;
with AMF.Elements;
with AMF.Internals.UML_Elements;
with AMF.UMLDI.UML_Diagram_Elements.Collections;
with AMF.UMLDI.UML_Styles;
generic
type Element_Proxy is
abstract new AMF.Internals.UML_Elements.UML_Element_Base with private;
package AMF.Internals.UMLDI_UML_Diagram_Elements is
type UMLDI_UML_Diagram_Element_Proxy is
abstract limited new Element_Proxy
and AMF.UMLDI.UML_Diagram_Elements.UMLDI_UML_Diagram_Element with null record;
overriding function Container
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.Elements.Element_Access;
overriding function Get_Owned_Element
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.UMLDI.UML_Diagram_Elements.Collections.Ordered_Set_Of_UMLDI_UML_Diagram_Element;
-- Getter of UMLDiagramElement::ownedElement.
--
-- Restricts UMLDiagramElements to own only UMLDiagramElements.
overriding function Get_Owning_Element
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.UMLDI.UML_Diagram_Elements.UMLDI_UML_Diagram_Element_Access;
-- Getter of UMLDiagramElement::owningElement.
--
-- Restricts UMLDiagramElements to be owned by only UMLDiagramElements.
overriding procedure Set_Owning_Element
(Self : not null access UMLDI_UML_Diagram_Element_Proxy;
To : AMF.UMLDI.UML_Diagram_Elements.UMLDI_UML_Diagram_Element_Access);
-- Setter of UMLDiagramElement::owningElement.
--
-- Restricts UMLDiagramElements to be owned by only UMLDiagramElements.
overriding function Get_Owning_Element
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.DI.Diagram_Elements.DI_Diagram_Element_Access;
-- Getter of DiagramElement::owningElement.
--
-- a reference to the diagram element that directly owns this diagram
-- element.
overriding function Get_Owned_Element
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.DI.Diagram_Elements.Collections.Set_Of_DI_Diagram_Element;
-- Getter of DiagramElement::ownedElement.
--
-- a collection of diagram elements that are directly owned by this
-- diagram element.
overriding function Get_Shared_Style
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access;
-- Getter of UMLDiagramElement::sharedStyle.
--
-- Restricts shared styles to UMLStyles.
overriding procedure Set_Shared_Style
(Self : not null access UMLDI_UML_Diagram_Element_Proxy;
To : AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access);
-- Setter of UMLDiagramElement::sharedStyle.
--
-- Restricts shared styles to UMLStyles.
overriding function Get_Shared_Style
(Self : not null access constant UMLDI_UML_Diagram_Element_Proxy)
return AMF.DI.Styles.DI_Style_Access;
-- Getter of DiagramElement::sharedStyle.
--
-- a reference to an optional shared style element for this diagram
-- element.
overriding procedure Set_Shared_Style
(Self : not null access UMLDI_UML_Diagram_Element_Proxy;
To : AMF.DI.Styles.DI_Style_Access);
-- Setter of DiagramElement::sharedStyle.
--
-- a reference to an optional shared style element for this diagram
-- element.
end AMF.Internals.UMLDI_UML_Diagram_Elements;
|
AdaCore/libadalang | Ada | 149 | adb | separate (a.b)
procedure pb is
begin
null;
end pb;
--% node.parent.f_name.p_referenced_decl()
--% node.parent.f_name.f_prefix.p_referenced_decl()
|
leonhxx/pok | Ada | 3,257 | ads | -- POK header
--
-- The following file is a part of the POK project. Any modification should
-- be made according to the POK licence. You CANNOT use this file or a part
-- of a file for your own project.
--
-- For more information on the POK licence, please see our LICENCE FILE
--
-- Please follow the coding guidelines described in doc/CODING_GUIDELINES
--
-- Copyright (c) 2007-2021 POK team
-- ---------------------------------------------------------------------------
-- --
-- SAMPLING PORT constant and type definitions and management services --
-- --
-- ---------------------------------------------------------------------------
package APEX.Sampling_Ports is
Max_Number_Of_Sampling_Ports : constant :=
System_Limit_Number_Of_Sampling_Ports;
subtype Sampling_Port_Name_Type is Name_Type;
type Sampling_Port_Id_Type is private;
Null_Sampling_Port_Id : constant Sampling_Port_Id_Type;
type Validity_Type is (Invalid, Valid);
type Sampling_Port_Status_Type is record
Refresh_Period : System_Time_Type;
Max_Message_Size : Message_Size_Type;
Port_Direction : Port_Direction_Type;
Last_Msg_Validity : Validity_Type;
end record;
procedure Create_Sampling_Port
(Sampling_Port_Name : in Sampling_Port_Name_Type;
Max_Message_Size : in Message_Size_Type;
Port_Direction : in Port_Direction_Type;
Refresh_Period : in System_Time_Type;
Sampling_Port_Id : out Sampling_Port_Id_Type;
Return_Code : out Return_Code_Type);
procedure Write_Sampling_Message
(Sampling_Port_Id : in Sampling_Port_Id_Type;
Message_Addr : in Message_Addr_Type;
Length : in Message_Size_Type;
Return_Code : out Return_Code_Type);
procedure Read_Sampling_Message
(Sampling_Port_Id : in Sampling_Port_Id_Type;
Message_Addr : in Message_Addr_Type;
-- The message address is passed IN, although the respective message is
-- passed OUT
Length : out Message_Size_Type;
Validity : out Validity_Type;
Return_Code : out Return_Code_Type);
procedure Get_Sampling_Port_Id
(Sampling_Port_Name : in Sampling_Port_Name_Type;
Sampling_Port_Id : out Sampling_Port_Id_Type;
Return_Code : out Return_Code_Type);
procedure Get_Sampling_Port_Status
(Sampling_Port_Id : in Sampling_Port_Id_Type;
Sampling_Port_Status : out Sampling_Port_Status_Type;
Return_Code : out Return_Code_Type);
private
type Sampling_Port_Id_Type is new APEX_Integer;
Null_Sampling_Port_Id : constant Sampling_Port_Id_Type := 0;
pragma Convention (C, Validity_Type);
pragma Convention (C, Sampling_Port_Status_Type);
-- POK BINDINGS
pragma Import (C, Create_Sampling_Port, "CREATE_SAMPLING_PORT");
pragma Import (C, Write_Sampling_Message, "WRITE_SAMPLING_MESSAGE");
pragma Import (C, Read_Sampling_Message, "READ_SAMPLING_MESSAGE");
pragma Import (C, Get_Sampling_Port_Id, "GET_SAMPLING_PORT_ID");
pragma Import (C, Get_Sampling_Port_Status, "GET_SAMPLING_PORT_STATUS");
-- END OF POK BINDINGS
end APEX.Sampling_Ports;
|
charlie5/cBound | Ada | 1,692 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with swig;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_get_modifier_mapping_reply_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
keycodes_per_modifier : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
length : aliased Interfaces.Unsigned_32;
pad0 : aliased swig.int8_t_Array (0 .. 23);
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_get_modifier_mapping_reply_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_get_modifier_mapping_reply_t.Item,
Element_Array => xcb.xcb_get_modifier_mapping_reply_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_get_modifier_mapping_reply_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_get_modifier_mapping_reply_t.Pointer,
Element_Array => xcb.xcb_get_modifier_mapping_reply_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_get_modifier_mapping_reply_t;
|
jwarwick/aoc_2020 | Ada | 1,299 | adb | with AUnit.Assertions; use AUnit.Assertions;
with Ada.Containers; use Ada.Containers;
package body Day.Test is
procedure Test_Part1 (T : in out AUnit.Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
passwords : constant Password_Vector.Vector := load_passwords("test1.txt");
count : constant Count_Type := count_valid(passwords);
begin
Assert(count = 2, "Wrong valid password count, expected 2, got " & Count_Type'IMAGE(count));
end Test_Part1;
procedure Test_Part2 (T : in out AUnit.Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
passwords : constant Password_Vector.Vector := load_passwords("test1.txt");
count : constant Count_Type := count_valid_positions(passwords);
begin
Assert(count = 1, "Wrong valid password position count, expected 1, got " & Count_Type'IMAGE(count));
end Test_Part2;
function Name (T : Test) return AUnit.Message_String is
pragma Unreferenced (T);
begin
return AUnit.Format ("Test Day package");
end Name;
procedure Register_Tests (T : in out Test) is
use AUnit.Test_Cases.Registration;
begin
Register_Routine (T, Test_Part1'Access, "Test Part 1");
Register_Routine (T, Test_Part2'Access, "Test Part 2");
end Register_Tests;
end Day.Test;
|
reznikmm/matreshka | Ada | 8,133 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.DC;
with AMF.DG.Canvases;
with AMF.DG.Graphical_Elements;
with AMF.Elements;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.DD_Attributes;
with AMF.Visitors.DG_Iterators;
with AMF.Visitors.DG_Visitors;
package body AMF.Internals.DG_Patterns is
----------------
-- Get_Bounds --
----------------
overriding function Get_Bounds
(Self : not null access constant DG_Pattern_Proxy)
return AMF.DC.DC_Bounds is
begin
return
AMF.Internals.Tables.DD_Attributes.Internal_Get_Bounds
(Self.Element);
end Get_Bounds;
----------------
-- Set_Bounds --
----------------
overriding procedure Set_Bounds
(Self : not null access DG_Pattern_Proxy;
To : AMF.DC.DC_Bounds) is
begin
AMF.Internals.Tables.DD_Attributes.Internal_Set_Bounds
(Self.Element, To);
end Set_Bounds;
--------------
-- Get_Tile --
--------------
overriding function Get_Tile
(Self : not null access constant DG_Pattern_Proxy)
return AMF.DG.Graphical_Elements.DG_Graphical_Element_Access is
begin
return
AMF.DG.Graphical_Elements.DG_Graphical_Element_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.DD_Attributes.Internal_Get_Tile
(Self.Element)));
end Get_Tile;
--------------
-- Set_Tile --
--------------
overriding procedure Set_Tile
(Self : not null access DG_Pattern_Proxy;
To : AMF.DG.Graphical_Elements.DG_Graphical_Element_Access) is
begin
AMF.Internals.Tables.DD_Attributes.Internal_Set_Tile
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Tile;
----------------
-- Get_Canvas --
----------------
overriding function Get_Canvas
(Self : not null access constant DG_Pattern_Proxy)
return AMF.DG.Canvases.DG_Canvas_Access is
begin
return
AMF.DG.Canvases.DG_Canvas_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.DD_Attributes.Internal_Get_Canvas
(Self.Element)));
end Get_Canvas;
----------------
-- Set_Canvas --
----------------
overriding procedure Set_Canvas
(Self : not null access DG_Pattern_Proxy;
To : AMF.DG.Canvases.DG_Canvas_Access) is
begin
AMF.Internals.Tables.DD_Attributes.Internal_Set_Canvas
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Canvas;
-------------------
-- Get_Transform --
-------------------
overriding function Get_Transform
(Self : not null access constant DG_Pattern_Proxy)
return AMF.DG.Sequence_Of_DG_Transform is
begin
return
AMF.Internals.Tables.DD_Attributes.Internal_Get_Transform
(Self.Element);
end Get_Transform;
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant DG_Pattern_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.DG_Visitors.DG_Visitor'Class then
AMF.Visitors.DG_Visitors.DG_Visitor'Class
(Visitor).Enter_Pattern
(AMF.DG.Patterns.DG_Pattern_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant DG_Pattern_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.DG_Visitors.DG_Visitor'Class then
AMF.Visitors.DG_Visitors.DG_Visitor'Class
(Visitor).Leave_Pattern
(AMF.DG.Patterns.DG_Pattern_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant DG_Pattern_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.DG_Iterators.DG_Iterator'Class then
AMF.Visitors.DG_Iterators.DG_Iterator'Class
(Iterator).Visit_Pattern
(Visitor,
AMF.DG.Patterns.DG_Pattern_Access (Self),
Control);
end if;
end Visit_Element;
end AMF.Internals.DG_Patterns;
|
charlie5/lace | Ada | 564 | ads | with
openGL;
package gel.Conversions
is
function to_GL (Self : in math.Real) return opengl.Real;
function to_GL (Self : in math.Vector_3) return opengl.Vector_3;
function to_GL (Self : in math.Matrix_3x3) return opengl.Matrix_3x3;
function to_GL (Self : in math.Matrix_4x4) return opengl.Matrix_4x4;
function to_GL (Self : in geometry_3d.bounding_Box) return opengl.Bounds;
function to_Math (Self : in opengl.Vector_3) return math.Vector_3;
end gel.Conversions;
|
AdaCore/libadalang | Ada | 288 | adb | procedure Test is
type T is delta 0.1 range 0.0 .. 10.0;
A : constant := T'Delta;
pragma Test_Statement;
B : constant T := T'Fixed_Value (3);
pragma Test_Statement;
C : constant Integer := Integer'Integer_Value (B);
pragma Test_Statement;
begin
null;
end Test;
|
godunko/adawebpack | Ada | 9,675 | adb | ------------------------------------------------------------------------------
-- --
-- AdaWebPack --
-- --
------------------------------------------------------------------------------
-- Copyright © 2020, Vadim Godunko --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
------------------------------------------------------------------------------
with System;
with Web.Strings.WASM_Helpers;
with Web.DOM.Nodes;
pragma Unreferenced (Web.DOM.Nodes);
package body Web.Sockets is
------------------------
-- Add_Event_Listener --
------------------------
overriding procedure Add_Event_Listener
(Self : in out Web_Socket;
Name : Web.Strings.Web_String;
Callback : not null Web.DOM.Event_Listeners.Event_Listener_Access;
Capture : Boolean := False)
is
procedure Imported
(Identifier : WASM.Objects.Object_Identifier;
Name_Address : System.Address;
Name_Size : Interfaces.Unsigned_32;
Callback : System.Address;
Capture : Interfaces.Unsigned_32)
with Import => True,
Convention => C,
Link_Name => "__adawebpack__dom__Node__addEventListener";
A : System.Address;
S : Interfaces.Unsigned_32;
begin
Web.Strings.WASM_Helpers.To_JS (Name, A, S);
Imported
(Self.Identifier, A, S, Callback.all'Address,
(if Capture then 1 else 0));
end Add_Event_Listener;
-----------
-- Close --
-----------
procedure Close (Self : in out Web_Socket'Class) is
procedure Imported
(Identifier : WASM.Objects.Object_Identifier)
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__close";
begin
Imported (Self.Identifier);
end Close;
------------
-- Create --
------------
function Create (URL : Web.Strings.Web_String) return Web_Socket is
function Internal
(Address : System.Address;
Length : Interfaces.Unsigned_32)
return WASM.Objects.Object_Identifier
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__create";
A : System.Address;
S : Interfaces.Unsigned_32;
begin
Web.Strings.WASM_Helpers.To_JS (URL, A, S);
return Web.Sockets.Instantiate (Internal (A, S));
end Create;
---------------------
-- Get_Binary_Type --
---------------------
function Get_Binary_Type (Self : Web_Socket'Class) return Binary_Type is
function Imported
(Identifier : WASM.Objects.Object_Identifier)
return Interfaces.Unsigned_32
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__get_bin_type";
begin
return (if Imported (Self.Identifier) in 0 then blob else arraybuffer);
end Get_Binary_Type;
-------------------------
-- Get_Buffered_Amount --
-------------------------
function Get_Buffered_Amount
(Self : Web_Socket'Class) return Ada.Streams.Stream_Element_Count
is
function Imported
(Identifier : WASM.Objects.Object_Identifier)
return Ada.Streams.Stream_Element_Count
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__buf_amount";
begin
return Imported (Self.Identifier);
end Get_Buffered_Amount;
--------------------
-- Get_Extensions --
--------------------
function Get_Extensions
(Self : Web_Socket'Class) return Web.Strings.Web_String
is
function Imported
(Identifier : WASM.Objects.Object_Identifier)
return System.Address
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__get_ext";
begin
return Web.Strings.WASM_Helpers.To_Ada (Imported (Self.Identifier));
end Get_Extensions;
------------------
-- Get_Protocol --
------------------
function Get_Protocol
(Self : Web_Socket'Class) return Web.Strings.Web_String
is
function Imported
(Identifier : WASM.Objects.Object_Identifier)
return System.Address
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__get_proto";
begin
return Web.Strings.WASM_Helpers.To_Ada (Imported (Self.Identifier));
end Get_Protocol;
---------------------
-- Get_Ready_State --
---------------------
function Get_Ready_State (Self : Web_Socket'Class) return State is
function Imported
(Identifier : WASM.Objects.Object_Identifier)
return state
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__get_state";
begin
return Imported (Self.Identifier);
end Get_Ready_State;
-------------
-- Get_URL --
-------------
function Get_URL (Self : Web_Socket'Class) return Web.Strings.Web_String is
function Imported
(Identifier : WASM.Objects.Object_Identifier)
return System.Address
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__get_url";
begin
return Web.Strings.WASM_Helpers.To_Ada (Imported (Self.Identifier));
end Get_URL;
----------
-- Send --
----------
procedure Send
(Self : in out Web_Socket'Class;
Data : Web.Strings.Web_String)
is
procedure Imported
(Identifier : WASM.Objects.Object_Identifier;
Text_Address : System.Address;
Text_Size : Interfaces.Unsigned_32)
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__send_str";
A : System.Address;
S : Interfaces.Unsigned_32;
begin
Web.Strings.WASM_Helpers.To_JS (Data, A, S);
Imported (Self.Identifier, A, S);
end Send;
----------
-- Send --
----------
procedure Send
(Self : in out Web_Socket'Class;
Data : Ada.Streams.Stream_Element_Array)
is
procedure Imported
(Identifier : WASM.Objects.Object_Identifier;
Data_Address : System.Address;
Data_Size : Interfaces.Unsigned_32)
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__send_bin";
begin
Imported (Self.Identifier, Data'Address, Data'Length);
end Send;
---------------------
-- Set_Binary_Type --
---------------------
procedure Set_Binary_Type
(Self : in out Web_Socket'Class;
Value : Binary_Type)
is
procedure Imported
(Identifier : WASM.Objects.Object_Identifier;
Value : Interfaces.Unsigned_32)
with Import => True,
Convention => C,
Link_Name => "__adawebpack__sockets__WebSocket__set_bin_type";
begin
Imported (Self.Identifier, Binary_Type'Pos (Value));
end Set_Binary_Type;
end Web.Sockets;
|
psyomn/ash | Ada | 3,304 | ads | -- Copyright 2019 Simon Symeonidis (psyomn)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package HTTP_Status is
type Code is new Positive;
type Code_Range is range 100 .. 599;
Bad_Code_Error : exception;
-- Info
CONTINUE : constant Code := 100;
SWITCHING_PROTOCOLS : constant Code := 101;
-- Success
OK : constant Code := 200;
CREATED : constant Code := 201;
ACCEPTED : constant Code := 202;
NON_AUTHORITATIVE_INFORMATION : constant Code := 203;
NO_CONTENT : constant Code := 204;
RESET_CONTENT : constant Code := 205;
PARTIAL_CONTENT : constant Code := 206;
-- Redirections
MULTIPLE_CHOICES : constant Code := 300;
MOVED_PERMANENTLY : constant Code := 301;
FOUND : constant Code := 302;
SEE_OTHER : constant Code := 303;
NOT_MODIFIED : constant Code := 304;
USE_PROXY : constant Code := 305;
UNUSED : constant Code := 306;
TEMPORARY_REDIRECT : constant Code := 307;
-- PEBKAC
BAD_REQUEST : constant Code := 400;
UNAUTHORIZED : constant Code := 401;
PAYMENT_REQUIRED : constant Code := 402;
FORBIDDEN : constant Code := 403;
NOT_FOUND : constant Code := 404;
METHOD_NOT_ALLOWED : constant Code := 405;
NOT_ACCEPTABLE : constant Code := 406;
PROXY_AUTH_REQUIRED : constant Code := 407;
REQUEST_TIMEOUT : constant Code := 408;
CONFLICT : constant Code := 409;
GONE : constant Code := 410;
LENGTH_REQUIRED : constant Code := 411;
PRECONDITION_FAILED : constant Code := 412;
REQUEST_ENTITY_TOO_LARGE : constant Code := 413;
REQUEST_URI_TOO_LONG : constant Code := 414;
UNSUPPORTED_MEDIA_TYPE : constant Code := 415;
REQUESTED_RANGE_NOT_SATISFIABLE : constant Code := 416;
EXPECTATION_FAILED : constant Code := 417;
-- BOOM
INTERNAL_ERROR : constant Code := 500;
NOT_IMPLEMENTED : constant Code := 501;
BAD_GATEWAY : constant Code := 502;
SERVICE_UNAVAILABLE : constant Code := 503;
GATEWAY_TIMEOUT : constant Code := 504;
HTTP_VERSION_NOT_SUPPORTED : constant Code := 505;
function Message_Of_Code (C : Code) return String;
end HTTP_Status;
|
OneWingedShark/Byron | Ada | 455 | ads | Pragma Ada_2012;
Pragma Assertion_Policy( Check );
Package Debug with Pure, SPARK_Mode => On is
Procedure Put ( String : Wide_Wide_String )
with Import, Convention => Ada, External_Name => "DEBUG_PUT",
Global => Null, Depends => (Null => String);
Procedure Put_Line ( String : Wide_Wide_String )
with Import, Convention => Ada, External_Name => "DEBUG_PUT_LINE",
Global => Null, Depends => (Null => String);
End Debug;
|
reznikmm/matreshka | Ada | 3,664 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Elements;
package ODF.DOM.Draw_Polyline_Elements is
pragma Preelaborate;
type ODF_Draw_Polyline is limited interface
and XML.DOM.Elements.DOM_Element;
type ODF_Draw_Polyline_Access is
access all ODF_Draw_Polyline'Class
with Storage_Size => 0;
end ODF.DOM.Draw_Polyline_Elements;
|
reznikmm/ada-pretty | Ada | 12,364 | adb | -- Copyright (c) 2017 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Ada_Pretty.Statements is
--------------
-- Document --
--------------
overriding function Document
(Self : Block_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
pragma Unreferenced (Pad);
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
if Self.Declarations /= null then
Result.New_Line;
Result.Put ("declare");
Result.Append (Self.Declarations.Document (Printer, 0).Nest (3));
end if;
Result.New_Line;
Result.Put ("begin");
if Self.Statements = null then
declare
Nil : League.Pretty_Printers.Document := Printer.New_Document;
begin
Nil.New_Line;
Nil.Put ("null;");
Nil.Nest (3);
Result.Append (Nil);
end;
else
Result.Append (Self.Statements.Document (Printer, 0).Nest (3));
end if;
if Self.Exceptions /= null then
Result.New_Line;
Result.Put ("exception");
Result.Append (Self.Exceptions.Document (Printer, 0).Nest (3));
end if;
Result.New_Line;
Result.Put ("end;");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Case_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Put ("case ");
Result.Append (Self.Expression.Document (Printer, Pad));
Result.Put (" is");
Result.Append (Self.List.Document (Printer, Pad).Nest (3));
Result.New_Line;
Result.Put ("end case;");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Case_Path;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Put ("when ");
Result.Append (Self.Choice.Document (Printer, Pad));
Result.Put (" =>");
Result.Append (Self.List.Document (Printer, Pad).Nest (3));
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Elsif_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.New_Line;
Result.Put ("elsif ");
Result.Append (Self.Condition.Document (Printer, Pad));
Result.Put (" then");
Result.Append (Self.List.Document (Printer, Pad).Nest (3));
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Extended_Return_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Put ("return ");
Result.Append (Self.Name.Document (Printer, Pad));
Result.Put (" : ");
Result.Append (Self.Type_Definition.Document (Printer, Pad).Nest (2));
if Self.Initialization /= null then
declare
Init : League.Pretty_Printers.Document := Printer.New_Document;
begin
Init.New_Line;
Init.Append (Self.Initialization.Document (Printer, 0));
Init.Nest (2);
Init.Group;
Result.Put (" :=");
Result.Append (Init);
end;
end if;
Result.New_Line;
Result.Put ("do");
Result.Append (Self.Statements.Document (Printer, 0).Nest (3));
Result.New_Line;
Result.Put ("end return;");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : For_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Put ("for ");
Result.Append (Self.Name.Document (Printer, Pad));
declare
Init : League.Pretty_Printers.Document := Printer.New_Document;
begin
Init.Put (" in ");
Init.Append (Self.Iterator.Document (Printer, 0).Nest (2));
Init.New_Line;
Init.Put ("loop");
Init.Group;
Result.Append (Init);
end;
Result.Append (Self.Statements.Document (Printer, 0).Nest (3));
Result.New_Line;
Result.Put ("end loop;");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Loop_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
Init : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
if Self.Condition = null then
Result.Put ("loop");
else
Init.Put ("while ");
Init.Append (Self.Condition.Document (Printer, Pad).Nest (2));
Init.New_Line;
Init.Put ("loop");
Init.Group;
Result.Append (Init);
end if;
Result.Append (Self.Statements.Document (Printer, 0).Nest (3));
Result.New_Line;
Result.Put ("end loop;");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : If_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Put ("if ");
Result.Append (Self.Condition.Document (Printer, Pad));
Result.Put (" then");
Result.Append (Self.Then_Path.Document (Printer, Pad).Nest (3));
if Self.Elsif_List /= null then
Result.Append (Self.Elsif_List.Document (Printer, Pad));
end if;
if Self.Else_Path /= null then
Result.Append (Self.Else_Path.Document (Printer, Pad).Nest (3));
end if;
Result.New_Line;
Result.Put ("end if;");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Return_Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Put ("return");
if Self.Expression /= null then
Result.Put (" ");
Result.Append (Self.Expression.Document (Printer, Pad));
end if;
Result.Put (";");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Statement;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
if Self.Expression = null then
Result.Put ("null");
else
Result.Append (Self.Expression.Document (Printer, Pad));
end if;
Result.Put (";");
return Result;
end Document;
--------------
-- Document --
--------------
overriding function Document
(Self : Assignment;
Printer : not null access League.Pretty_Printers.Printer'Class;
Pad : Natural)
return League.Pretty_Printers.Document
is
Result : League.Pretty_Printers.Document := Printer.New_Document;
Right : League.Pretty_Printers.Document := Printer.New_Document;
begin
Result.New_Line;
Result.Append (Self.Left.Document (Printer, Pad));
Result.Put (" :=");
Right.New_Line;
Right.Append (Self.Right.Document (Printer, Pad));
Right.Nest (2);
Right.Group;
Result.Append (Right);
Result.Put (";");
return Result;
end Document;
--------------------
-- New_Assignment --
--------------------
function New_Assignment
(Left : not null Node_Access;
Right : not null Node_Access) return Node'Class is
begin
return Assignment'(Left, Right);
end New_Assignment;
-------------------------
-- New_Block_Statement --
-------------------------
function New_Block_Statement
(Declarations : Node_Access;
Statements : Node_Access;
Exceptions : Node_Access) return Node'Class is
begin
return Block_Statement'(Declarations, Statements, Exceptions);
end New_Block_Statement;
--------------
-- New_Case --
--------------
function New_Case
(Expression : not null Node_Access;
List : not null Node_Access) return Node'Class is
begin
return Case_Statement'(Expression, List);
end New_Case;
-------------------
-- New_Case_Path --
-------------------
function New_Case_Path
(Choice : not null Node_Access;
List : not null Node_Access) return Node'Class is
begin
return Case_Path'(Choice, List);
end New_Case_Path;
---------------
-- New_Elsif --
---------------
function New_Elsif
(Condition : not null Node_Access;
List : not null Node_Access) return Node'Class is
begin
return Elsif_Statement'(Condition, List);
end New_Elsif;
-------------------------
-- New_Extended_Return --
-------------------------
function New_Extended_Return
(Name : not null Node_Access;
Type_Definition : not null Node_Access;
Initialization : Node_Access;
Statements : not null Node_Access) return Node'Class is
begin
return Extended_Return_Statement'
(Name, Type_Definition, Initialization, Statements);
end New_Extended_Return;
-------------
-- New_For --
-------------
function New_For
(Name : not null Node_Access;
Iterator : not null Node_Access;
Statements : not null Node_Access) return Node'Class is
begin
return For_Statement'(Name, Iterator, Statements);
end New_For;
------------
-- New_If --
------------
function New_If
(Condition : not null Node_Access;
Then_Path : not null Node_Access;
Elsif_List : Node_Access;
Else_Path : Node_Access) return Node'Class is
begin
return If_Statement'(Condition, Then_Path, Elsif_List, Else_Path);
end New_If;
--------------
-- New_Loop --
--------------
function New_Loop
(Condition : Node_Access;
Statements : not null Node_Access) return Node'Class is
begin
return Loop_Statement'(Condition, Statements);
end New_Loop;
----------------
-- New_Return --
----------------
function New_Return
(Expression : Node_Access) return Node'Class is
begin
return Return_Statement'(Expression => Expression);
end New_Return;
-------------------
-- New_Statement --
-------------------
function New_Statement (Expression : Node_Access) return Node'Class is
begin
return Statement'(Expression => Expression);
end New_Statement;
end Ada_Pretty.Statements;
|
AdaCore/training_material | Ada | 26,895 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . L I B M --
-- --
-- B o d y --
-- --
-- Copyright (C) 2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the Ada Cert Math specific version of s-libm.adb
-- When Cody and Waite implementation is cited, it refers to the
-- Software Manual for the Elementary Functions by William J. Cody, Jr.
-- and William Waite, published by Prentice-Hall Series in Computational
-- Mathematics. Version??? ISBN???
-- When Hart implementation is cited, it refers to
-- "The Computer Approximation" by John F. Hart, published by Krieger.
-- Version??? ISBN???
with Numerics; use Numerics;
package body Libm is
type Unsigned_64 is mod 2**64;
generic
type T is private;
with function Multiply_Add (X, Y, Z : T) return T is <>;
-- The Multiply_Add function returns the value of X * Y + Z, ideally
-- (but not necessarily) using a wider intermediate type, or a fused
-- multiply-add operation with only a single rounding. They are used
-- for evaluating polynomials.
package Generic_Polynomials is
type Polynomial is array (Natural range <>) of T;
-- A value P of type PolynomialRepresents the polynomial
-- P (X) = P_0 + P_1 * X + ... + P_(n-1) * X**(n-1) + P_n * X**n,
--
-- where n = P'Length - 1, P_0 is P (P'First) and P_n is P (P'Last)
-- P (X) = P_0 + X * (P_1 + X * (P_2 + X * (... + X * P_n)))
function Compute_Horner (P : Polynomial; X : T) return T with Inline;
-- Computes the polynomial P using the Horner scheme:
-- P (X) = P_0 + X * (P_1 + X * (P_2 + X * (... + X * P_n)))
end Generic_Polynomials;
------------------------
-- Generic_Polynomial --
------------------------
package body Generic_Polynomials is
--------------------
-- Compute_Horner --
---------------------
function Compute_Horner (P : Polynomial; X : T) return T is
Result : T := P (P'Last);
begin
for P_j of reverse P (P'First .. P'Last - 1) loop
Result := Multiply_Add (Result, X, P_j);
end loop;
return Result;
end Compute_Horner;
end Generic_Polynomials;
----------------------------------
-- Generic_Float_Approximations --
----------------------------------
package body Generic_Approximations is
function Multiply_Add (X, Y, Z : T) return T is (X * Y + Z);
package Float_Polynomials is new Generic_Polynomials (T);
use Float_Polynomials;
-----------------
-- Approx_Asin --
-----------------
function Approx_Asin (X : T) return T is
P : T;
Q : T;
begin
if Mantissa <= 24 then
declare
-- Approximation MRE = 6.0128E-9
P1 : constant T := Exact (0.93393_5835);
P2 : constant T := Exact (-0.50440_0557);
Q0 : constant T := Exact (5.6036_3004);
Q1 : constant T := Exact (-5.5484_6723);
begin
P := Compute_Horner ((P1, P2), X);
Q := Compute_Horner ((Q0, Q1 + X), X);
end;
else
declare
-- Approximation MRE = 2.0975E-18
P1 : constant T := Exact (-0.27368_49452_41642_55994E+2);
P2 : constant T := Exact (+0.57208_22787_78917_31407E+2);
P3 : constant T := Exact (-0.39688_86299_75048_77339E+2);
P4 : constant T := Exact (+0.10152_52223_38064_63645E+2);
P5 : constant T := Exact (-0.69674_57344_73506_46411);
Q0 : constant T := Exact (-0.16421_09671_44985_60795E+3);
Q1 : constant T := Exact (+0.41714_43024_82604_12556E+3);
Q2 : constant T := Exact (-0.38186_30336_17501_49284E+3);
Q3 : constant T := Exact (+0.15095_27084_10306_04719E+3);
Q4 : constant T := Exact (-0.23823_85915_36702_38830E+2);
begin
P := Compute_Horner ((P1, P2, P3, P4, P5), X);
Q := Compute_Horner ((Q0, Q1, Q2, Q3, Q4 + X), X);
end;
end if;
return X * P / Q;
end Approx_Asin;
-----------------
-- Approx_Atan --
-----------------
function Approx_Atan (X : T) return T is
G : constant T := X * X;
P, Q : T;
begin
if Mantissa <= 24 then
declare
-- Approximation MRE = 3.2002E-9
P0 : constant T := Exact (-0.47083_25141);
P1 : constant T := Exact (-0.50909_58253E-1);
Q0 : constant T := Exact (0.14125_00740E1);
begin
P := Compute_Horner ((P0, P1), G);
Q := Q0 + G;
end;
else
declare
-- Approximation MRE = 1.8154E-18
P0 : constant T := Exact (-0.13688_76889_41919_26929E2);
P1 : constant T := Exact (-0.20505_85519_58616_51981E2);
P2 : constant T := Exact (-0.84946_24035_13206_83534E1);
P3 : constant T := Exact (-0.83758_29936_81500_59274);
Q0 : constant T := Exact (0.41066_30668_25757_81263E2);
Q1 : constant T := Exact (0.86157_34959_71302_42515E2);
Q2 : constant T := Exact (0.59578_43614_25973_44465E2);
Q3 : constant T := Exact (0.15024_00116_00285_76121E2);
begin
P := Compute_Horner ((P0, P1, P2, P3), G);
Q := Compute_Horner ((Q0, Q1, Q2, Q3 + G), G);
end;
end if;
return Multiply_Add (X, (G * P / Q), X);
end Approx_Atan;
function Approx_Cos (X : T) return T is
Cos_P : constant Polynomial :=
(if Mantissa <= 24
then
-- Hart's constants : #COS 3822# (p. 209)
-- Approximation MRE = 8.1948E-9
(0 => Exact (1.0),
1 => Exact (-0.49999_99404),
2 => Exact (0.41666_66046E-1),
3 => Exact (-0.13888_87875E-2),
4 => Exact (0.24827_63739E-4))
else
-- Hart's constants : #COS 3824# (p. 209)
-- Approximation MRE = 1.2548E-18
(0 => Exact (1.0),
1 => Exact (-0.5),
2 => Exact (+0.04166_66666_66666_43537),
3 => Exact (-0.13888_88888_88589_63271E-2),
4 => Exact (+0.24801_58728_28994_71149E-4),
5 => Exact (-0.27557_31286_56960_91429E-6),
6 => Exact (+0.20875_55514_56778_91895E-8),
7 => Exact (-0.11352_12320_57839_46664E-10)));
begin
return Compute_Horner (Cos_P, X * X);
end Approx_Cos;
----------------
-- Approx_Exp --
----------------
function Approx_Exp (X : T) return T is
Exp_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approximation MRE = 8.1529E-10
(0 => Exact (0.24999_99995_0),
1 => Exact (0.41602_88626_0E-2))
else -- Approximation MRE = 1.0259E-17
(0 => Exact (0.24999_99999_99999_993),
1 => Exact (0.69436_00015_11792_852E-2),
2 => Exact (0.16520_33002_68279_130E-4)));
Exp_Q : constant Polynomial :=
(if Mantissa <= 24
then
(0 => Exact (0.5),
1 => Exact (0.49987_17877_8E-1))
else
(0 => Exact (0.5),
1 => Exact (0.55553_86669_69001_188E-1),
2 => Exact (0.49586_28849_05441_294E-3)));
G : constant T := X * X;
P : T;
Q : T;
begin
P := Compute_Horner (Exp_P, G);
Q := Compute_Horner (Exp_Q, G);
return Exact (2.0) * Multiply_Add (X, P / (Multiply_Add (-X, P, Q)),
Exact (0.5));
end Approx_Exp;
----------------
-- Approx_Log --
----------------
function Approx_Log (X : T) return T is
Log_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approximation MRE = 1.0368E-10
(0 => Exact (-0.46490_62303_464),
1 => Exact (0.013600_95468_621))
else -- Approximation MRE = 4.7849E-19
(0 => Exact (-0.64124_94342_37455_81147E+2),
1 => Exact (0.16383_94356_30215_34222E+2),
2 => Exact (-0.78956_11288_74912_57267)));
Log_Q : constant Polynomial :=
(if Mantissa <= 24
then
(0 => Exact (-5.5788_73750_242),
1 => Exact (1.0))
else
(0 => Exact (-0.76949_93210_84948_79777E+3),
1 => Exact (0.31203_22209_19245_32844E+3),
2 => Exact (-0.35667_97773_90346_46171E+2),
3 => Exact (1.0)));
G : T;
P : T;
Q : T;
ZNum, ZDen, Z : T;
begin
ZNum := (X + Exact (-0.5)) + Exact (-0.5);
ZDen := X * Exact (0.5) + Exact (0.5);
Z := ZNum / ZDen;
G := Z * Z;
P := Compute_Horner (Log_P, G);
Q := Compute_Horner (Log_Q, G);
return Multiply_Add (Z, G * (P / Q), Z);
end Approx_Log;
----------------------
-- Approx_Power Log --
----------------------
function Approx_Power_Log (X : T) return T is
Power_Log_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approximation MRE = 7.9529E-4
(1 => Exact (0.83357_541E-1))
else -- Approximation MRE = 8.7973E-8
(1 => Exact (0.83333_33333_33332_11405E-1),
2 => Exact (0.12500_00000_05037_99174E-1),
3 => Exact (0.22321_42128_59242_58967E-2),
4 => Exact (0.43445_77567_21631_19635E-3)));
K : constant T := Exact (0.44269_50408_88963_40736);
G : constant T := X * X;
P : T;
begin
P := Compute_Horner (Power_Log_P, G);
P := (P * G) * X;
P := Multiply_Add (P, K, P);
return Multiply_Add (X, K, P) + X;
end Approx_Power_Log;
-----------------
-- Approx_Exp2 --
-----------------
function Approx_Exp2 (X : T) return T is
Exp2_P : constant Polynomial :=
(if Mantissa > 24
then -- Approximation MRE = 1.7418E-17
(1 => Exact (0.69314_71805_59945_29629),
2 => Exact (0.24022_65069_59095_37056),
3 => Exact (0.55504_10866_40855_95326E-1),
4 => Exact (0.96181_29059_51724_16964E-2),
5 => Exact (0.13333_54131_35857_84703E-2),
6 => Exact (0.15400_29044_09897_64601E-3),
7 => Exact (0.14928_85268_05956_08186E-4))
else -- Approximation MRE = 3.3642E-9
(1 => Exact (0.69314_675),
2 => Exact (0.24018_510),
3 => Exact (0.54360_383E-1)));
begin
return Exact (1.0) + Compute_Horner (Exp2_P, X) * X;
end Approx_Exp2;
----------------
-- Approx_Sin --
----------------
function Approx_Sin (X : T) return T is
Sin_P : constant Polynomial :=
(if Mantissa <= 24
then -- Hart's constants: #SIN 3040# (p. 199)
(1 => Exact (-0.16666_66567),
2 => Exact (0.83320_15015E-2),
3 => Exact (-0.19501_81031E-3))
else -- Hart's constants: #SIN 3044# (p. 199)
-- Approximation MRE = 2.4262E-18
(1 => Exact (-0.16666_66666_66666_71293),
2 => Exact (0.83333_33333_33332_28093E-2),
3 => Exact (-0.19841_26984_12531_12013E-3),
4 => Exact (0.27557_31921_33901_79497E-5),
5 => Exact (-0.25052_10473_82673_44045E-7),
6 => Exact (0.16058_34762_32246_14953E-9),
7 => Exact (-0.75778_67884_01271_54819E-12)));
G : constant T := X * X;
Sqrt_Epsilon_LF : constant Long_Float :=
Sqrt_2 ** (1 - Long_Float'Machine_Mantissa);
begin
if abs X <= Exact (Sqrt_Epsilon_LF) then
return X;
end if;
return Multiply_Add (X, Compute_Horner (Sin_P, G) * G, X);
end Approx_Sin;
-----------------
-- Approx_Sinh --
-----------------
function Approx_Sinh (X : T) return T is
Sinh_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approximation MRE = 2.6841E-8
(0 => Exact (-0.71379_3159E1),
1 => Exact (-0.19033_3300))
else -- Approximation MRE = 4.6429E-18
(0 => Exact (-0.35181_28343_01771_17881E6),
1 => Exact (-0.11563_52119_68517_68270E5),
2 => Exact (-0.16375_79820_26307_51372E3),
3 => Exact (-0.78966_12741_73570_99479)));
Sinh_Q : constant Polynomial :=
(if Mantissa <= 24
then
(0 => Exact (-0.42827_7109E2),
1 => Exact (1.0))
else
(0 => Exact (-0.21108_77005_81062_71242E7),
1 => Exact (0.36162_72310_94218_36460E5),
2 => Exact (-0.27773_52311_96507_01667E3),
3 => Exact (1.0)));
G : constant T := X * X;
P : T;
Q : T;
begin
P := Compute_Horner (Sinh_P, G);
Q := Compute_Horner (Sinh_Q, G);
return Multiply_Add (X, (G * P / Q), X);
end Approx_Sinh;
----------------
-- Approx_Tan --
----------------
function Approx_Tan (X : T) return T is
Tan_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approximation MRE = 2.7824E-8
(1 => Exact (-0.95801_7723E-1))
else -- Approximation MRE = 3.5167E-18
(1 => Exact (-0.13338_35000_64219_60681),
2 => Exact (0.34248_87823_58905_89960E-2),
3 => Exact (-0.17861_70734_22544_26711E-4)));
Tan_Q : constant Polynomial :=
(if Mantissa <= 24
then
(0 => Exact (1.0),
1 => Exact (-0.42913_5777),
2 => Exact (0.97168_5835E-2))
else
(0 => Exact (1.0),
1 => Exact (-0.46671_68333_97552_94240),
2 => Exact (0.25663_83228_94401_12864E-1),
3 => Exact (-0.31181_53190_70100_27307E-3),
4 => Exact (0.49819_43399_37865_12270E-6)));
G : constant T := X * X;
P : constant T := Multiply_Add (X, G * Compute_Horner (Tan_P, G), X);
Q : constant T := Compute_Horner (Tan_Q, G);
begin
return P / Q;
end Approx_Tan;
----------------
-- Approx_Cot --
----------------
function Approx_Cot (X : T) return T is
Tan_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approxmiation MRE = 1.5113E-17
(1 => Exact (-0.95801_7723E-1))
else
(1 => Exact (-0.13338_35000_64219_60681),
2 => Exact (0.34248_87823_58905_89960E-2),
3 => Exact (-0.17861_70734_22544_26711E-4)));
Tan_Q : constant Polynomial :=
(if Mantissa <= 24
then
(0 => Exact (1.0),
1 => Exact (-0.42913_5777),
2 => Exact (0.97168_5835E-2))
else
(0 => Exact (1.0),
1 => Exact (-0.46671_68333_97552_94240),
2 => Exact (0.25663_83228_94401_12864E-1),
3 => Exact (-0.31181_53190_70100_27307E-3),
4 => Exact (0.49819_43399_37865_12270E-6)));
G : constant T := X * X;
P : constant T := Multiply_Add (X, G * Compute_Horner (Tan_P, G), X);
Q : constant T := Compute_Horner (Tan_Q, G);
begin
return -Q / P;
end Approx_Cot;
-----------------
-- Approx_Tanh --
-----------------
function Approx_Tanh (X : T) return T is
Tanh_P : constant Polynomial :=
(if Mantissa <= 24
then -- Approximation MRE = 2.7166E-9
(0 => Exact (-0.82377_28127),
1 => Exact (-0.38310_10665E-2))
else -- Approximation MRE = 3.2436E-18
(0 => Exact (-0.16134_11902_39962_28053E4),
1 => Exact (-0.99225_92967_22360_83313E2),
2 => Exact (-0.96437_49277_72254_69787)));
Tanh_Q : constant Polynomial :=
(if Mantissa <= 24
then
(0 => Exact (2.4713_19654),
1 => Exact (1.0))
else
(0 => Exact (0.48402_35707_19886_88686E4),
1 => Exact (0.22337_72071_89623_12926E4),
2 => Exact (0.11274_47438_05349_49335E3),
3 => Exact (1.0)));
G : constant T := X * X;
P, Q : T;
begin
P := Compute_Horner (Tanh_P, G);
Q := Compute_Horner (Tanh_Q, G);
return Multiply_Add (X, G * P / Q, X);
end Approx_Tanh;
----------
-- Asin --
----------
function Asin (X : T) return T is
-- Cody and Waite implementation (page 174)
Y : T := abs X;
G : T;
Result : T;
begin
if Y <= Exact (0.5) then
Result := X + X * Approx_Asin (X * X);
else
G := (Exact (1.0) + (-Y)) * Exact (0.5);
Y := Sqrt (G);
Result :=
Exact (Pi / 2.0) - Exact (2.0) * (Y + Y * Approx_Asin (G));
if not (Exact (0.0) <= X) then
Result := -Result;
end if;
end if;
return Result;
end Asin;
end Generic_Approximations;
------------------
-- Generic_Acos --
------------------
function Generic_Acos (X : T) return T is
-- Cody and Waite implementation (page 174)
Y : T := abs (X);
G : T;
Result : T;
begin
if Y <= 0.5 then
-- No reduction needed
G := Y * Y;
Result := T'Copy_Sign (Y + Y * Approx_Asin (G), X);
return 0.5 * Pi - Result;
end if;
-- In the reduction step that follows, it is not Y, but rather G that
-- is reduced. The reduced G is in 0.0 .. 0.25.
G := (1.0 - Y) / 2.0;
Y := -2.0 * Sqrt (G);
Result := Y + Y * Approx_Asin (G);
return (if X < 0.0 then Pi + Result else -Result);
end Generic_Acos;
-------------------
-- Generic_Atan2 --
-------------------
function Generic_Atan2 (Y, X : T) return T is
-- Cody and Waite implementation (page 194)
F : T;
N : Integer := -1;
-- Default value for N is -1 so that if X=0 or over/underflow
-- tests on N are all false.
Result : T;
begin
if Y = 0.0 then
if T'Copy_Sign (1.0, X) < 0.0 then
return T'Copy_Sign (Pi, Y);
else
return T'Copy_Sign (0.0, Y);
end if;
elsif X = 0.0 then
return T'Copy_Sign (Half_Pi, Y);
elsif abs (Y) > T'Last * abs (X) then -- overflow
Result := T (Half_Pi);
elsif abs (X) > T'Last * abs (Y) then -- underflow
Result := 0.0;
elsif abs (X) > T'Last and then abs (Y) > T'Last then
-- NaN
if X < 0.0 then
return T'Copy_Sign (3.0 * Pi / 4.0, Y);
else
return T'Copy_Sign (Pi / 4.0, Y);
end if;
else
F := abs (Y / X);
if F > 1.0 then
F := 1.0 / F;
N := 2;
else
N := 0;
end if;
if F > 2.0 - Sqrt_3 then
F := (((Sqrt_3 - 1.0) * F - 1.0) + F) / (Sqrt_3 + F);
N := N + 1;
end if;
Result := Approx_Atan (F);
end if;
if N > 1 then
Result := -Result;
end if;
case N is
when 1 => Result := Result + Sixth_Pi;
when 2 => Result := Result + Half_Pi;
when 3 => Result := Result + Third_Pi;
when others => null;
end case;
if T'Copy_Sign (1.0, X) < 0.0 then
Result := Pi - Result;
end if;
return T'Copy_Sign (Result, Y);
end Generic_Atan2;
procedure Generic_Pow_Special_Cases
(Left : T;
Right : T;
Is_Special : out Boolean;
Result : out T)
is
------------
-- Is_Even --
------------
function Is_Even (X : T) return Boolean is
(abs X >= 2.0**T'Machine_Mantissa
or else Unsigned_64 (abs X) mod 2 = 0);
pragma Assert (T'Machine_Mantissa <= 64);
-- If X is large enough, then X is a multiple of 2. Otherwise,
-- conversion to Unsigned_64 is safe, assuming a mantissa of at
-- most 64 bits.
begin
Is_Special := True;
Result := 0.0;
-- value 'Result' is not used if the input is
-- not a couple of special values
if Right = 0.0 or else not (Left /= 1.0) then
Result := (if Right = 0.0 then 1.0 else Left);
elsif Left = 0.0 then
if Right < 0.0 then
if Right = T'Rounding (Right) and then not Is_Even (Right) then
Result := 1.0 / Left; -- Infinity with sign of Left
else
Result := 1.0 / abs Left; -- +Infinity
end if;
else
if Right = T'Rounding (Right)
and then not Is_Even (Right)
then
Result := Left;
else
Result := +0.0;
end if;
end if;
elsif abs (Right) > T'Last and then Left = -1.0 then
Result := 1.0;
elsif Left < 0.0
and then Left >= T'First
and then abs (Right) <= T'Last
and then Right /= T'Rounding (Right)
then
Result := 0.0 / (Left - Left); -- NaN
elsif Right < T'First then
if abs (Left) < 1.0 then
Result := -Right; -- Infinity
else
Result := 0.0; -- Cases where Left=+-1 are dealt with above
end if;
elsif Right > T'Last then
if abs (Left) < 1.0 then
Result := 0.0;
else
Result := Right;
end if;
elsif Left > T'Last then
if Right < 0.0 then
Result := 0.0;
else
Result := Left;
end if;
elsif Left < T'First then
if Right > 0.0 then
if Right = T'Rounding (Right)
and then not Is_Even (Right)
then
Result := Left;
else
Result := -Left; -- -Left = +INF
end if;
else
if Right = T'Rounding (Right)
and then not Is_Even (Right)
then
Result := -0.0;
else
Result := +0.0;
end if;
end if;
else
Is_Special := False;
end if;
end Generic_Pow_Special_Cases;
end Libm;
|
AaronC98/PlaneSystem | Ada | 9,118 | ads | ------------------------------------------------------------------------------
-- Ada Web Server --
-- --
-- Copyright (C) 2000-2014, AdaCore --
-- --
-- This library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU General Public License as published by the --
-- Free Software Foundation; either version 3, or (at your option) any --
-- later version. This library is distributed in the hope that it will be --
-- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
------------------------------------------------------------------------------
package AWS.MIME is
-- Some content type constants. All of them will be defined into this
-- package and associated with the right extensions. It is possible to
-- add new MIME types with the routines below or by placing a file named
-- aws.mime into the startup directory.
--
-- A MIME type is written in two parts: type/format
----------
-- Text --
----------
Text_CSS : constant String := "text/css";
Text_Javascript : constant String := "text/javascript";
Text_HTML : constant String := "text/html";
Text_Plain : constant String := "text/plain";
Text_XML : constant String := "text/xml";
Text_X_SGML : constant String := "text/x-sgml";
-----------
-- Image --
-----------
Image_Gif : constant String := "image/gif";
Image_Jpeg : constant String := "image/jpeg";
Image_Png : constant String := "image/png";
Image_SVG : constant String := "image/svg+xml";
Image_Tiff : constant String := "image/tiff";
Image_Icon : constant String := "image/x-icon";
Image_X_Portable_Anymap : constant String := "image/x-portable-anymap";
Image_X_Portable_Bitmap : constant String := "image/x-portable-bitmap";
Image_X_Portable_Graymap : constant String := "image/x-portable-graymap";
Image_X_Portable_Pixmap : constant String := "image/x-portable-pixmap";
Image_X_RGB : constant String := "image/x-rgb";
Image_X_Xbitmap : constant String := "image/x-xbitmap";
Image_X_Xpixmap : constant String := "image/x-xpixmap";
Image_X_Xwindowdump : constant String := "image/x-xwindowdump";
-----------------
-- Application --
-----------------
Application_Postscript : constant String := "application/postscript";
Application_Pdf : constant String := "application/pdf";
Application_Zip : constant String := "application/zip";
Application_Octet_Stream : constant String := "application/octet-stream";
Application_Form_Data : constant String :=
"application/x-www-form-urlencoded";
Application_Mac_Binhex40 : constant String := "application/mac-binhex40";
Application_Msword : constant String := "application/msword";
Application_Powerpoint : constant String := "application/powerpoint";
Application_Rtf : constant String := "application/rtf";
Application_XML : constant String := "application/xml";
Application_JSON : constant String := "application/json";
Application_SOAP : constant String := "application/soap";
Application_X_Compress : constant String := "application/x-compress";
Application_X_GTar : constant String := "application/x-gtar";
Application_X_GZip : constant String := "application/x-gzip";
Application_X_Latex : constant String := "application/x-latex";
Application_X_Sh : constant String := "application/x-sh";
Application_X_Shar : constant String := "application/x-shar";
Application_X_Tar : constant String := "application/x-tar";
Application_X_Tcl : constant String := "application/x-tcl";
Application_X_Tex : constant String := "application/x-tex";
Application_X_Texinfo : constant String := "application/x-texinfo";
Application_X_Troff : constant String := "application/x-troff";
Application_X_Troff_Man : constant String := "application/x-troff-man";
-----------
-- Audio --
-----------
Audio_Basic : constant String := "audio/basic";
Audio_Mpeg : constant String := "audio/mpeg";
Audio_X_Wav : constant String := "audio/x-wav";
Audio_X_Pn_Realaudio : constant String := "audio/x-pn-realaudio";
Audio_X_Pn_Realaudio_Plugin : constant String :=
"audio/x-pn-realaudio-plugin";
Audio_X_Realaudio : constant String := "audio/x-realaudio";
-----------
-- Video --
-----------
Video_Mpeg : constant String := "video/mpeg";
Video_Quicktime : constant String := "video/quicktime";
Video_X_Msvideo : constant String := "video/x-msvideo";
---------------
-- Multipart --
---------------
Multipart_Form_Data : constant String := "multipart/form-data";
Multipart_Byteranges : constant String := "multipart/byteranges";
Multipart_Related : constant String := "multipart/related";
Multipart_X_Mixed_Replace : constant String :=
"multipart/x-mixed-replace";
-------------
-- Setting --
-------------
procedure Add_Extension (Ext : String; MIME_Type : String);
-- Add extension Ext (file extension without the dot, e.g. "txt") to the
-- set of MIME type extension handled by this API. Ext will be mapped to
-- the MIME_Type string.
procedure Add_Regexp (Filename : String; MIME_Type : String);
-- Add a specific rule to the MIME type table. Filename is a regular
-- expression and will be mapped to the MIME_Type string.
---------------
-- MIME Type --
---------------
function Content_Type
(Filename : String;
Default : String := Application_Octet_Stream) return String;
-- Returns the MIME Content Type based on filename's extension or if not
-- found the MIME Content type where Filename matches one of the specific
-- rules set by Add_Regexp (see below).
-- Returns Default if the file type is unknown (i.e. no extension and
-- no regular expression match filename).
function Extension (Content_Type : String) return String;
-- Returns the best guess of the extension to use for the Content Type.
-- Note that extensions added indirectly by Add_Regexp are not searched.
function Is_Text (MIME_Type : String) return Boolean;
-- Returns True if the MIME_Type is a text data
function Is_Audio (MIME_Type : String) return Boolean;
-- Returns True if the MIME_Type is an audio data
function Is_Image (MIME_Type : String) return Boolean;
-- Returns True if the MIME_Type is an image data
function Is_Video (MIME_Type : String) return Boolean;
-- Returns True if the MIME_Type is a video data
function Is_Application (MIME_Type : String) return Boolean;
-- Returns True if the MIME_Type is an application data
procedure Load (MIME_File : String);
-- Load MIME_File, record every MIME type. Note that the format of this
-- file follows the common standard format used by Apache mime.types.
end AWS.MIME;
|
reznikmm/matreshka | Ada | 6,980 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Text.Editing_Duration_Elements is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Text_Editing_Duration_Element_Node is
begin
return Self : Text_Editing_Duration_Element_Node do
Matreshka.ODF_Text.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Text_Prefix);
end return;
end Create;
----------------
-- Enter_Node --
----------------
overriding procedure Enter_Node
(Self : not null access Text_Editing_Duration_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then
ODF.DOM.Visitors.Abstract_ODF_Visitor'Class
(Visitor).Enter_Text_Editing_Duration
(ODF.DOM.Text_Editing_Duration_Elements.ODF_Text_Editing_Duration_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Enter_Node (Visitor, Control);
end if;
end Enter_Node;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Text_Editing_Duration_Element_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Editing_Duration_Element;
end Get_Local_Name;
----------------
-- Leave_Node --
----------------
overriding procedure Leave_Node
(Self : not null access Text_Editing_Duration_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then
ODF.DOM.Visitors.Abstract_ODF_Visitor'Class
(Visitor).Leave_Text_Editing_Duration
(ODF.DOM.Text_Editing_Duration_Elements.ODF_Text_Editing_Duration_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Leave_Node (Visitor, Control);
end if;
end Leave_Node;
----------------
-- Visit_Node --
----------------
overriding procedure Visit_Node
(Self : not null access Text_Editing_Duration_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control) is
begin
if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then
ODF.DOM.Iterators.Abstract_ODF_Iterator'Class
(Iterator).Visit_Text_Editing_Duration
(Visitor,
ODF.DOM.Text_Editing_Duration_Elements.ODF_Text_Editing_Duration_Access
(Self),
Control);
else
Matreshka.DOM_Elements.Abstract_Element_Node
(Self.all).Visit_Node (Iterator, Visitor, Control);
end if;
end Visit_Node;
begin
Matreshka.DOM_Documents.Register_Element
(Matreshka.ODF_String_Constants.Text_URI,
Matreshka.ODF_String_Constants.Editing_Duration_Element,
Text_Editing_Duration_Element_Node'Tag);
end Matreshka.ODF_Text.Editing_Duration_Elements;
|
zhmu/ananas | Ada | 2,511 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ C H 1 1 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. 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 Types; use Types;
package Sem_Ch11 is
procedure Analyze_Exception_Declaration (N : Node_Id);
procedure Analyze_Handled_Statements (N : Node_Id);
procedure Analyze_Raise_Expression (N : Node_Id);
procedure Analyze_Raise_Statement (N : Node_Id);
procedure Analyze_Raise_When_Statement (N : Node_Id);
procedure Analyze_Raise_xxx_Error (N : Node_Id);
procedure Analyze_Exception_Handlers (L : List_Id);
-- Analyze list of exception handlers of a handled statement sequence
end Sem_Ch11;
|
johnperry-math/hac | Ada | 3,698 | adb | with HAC_Sys.Compiler.PCode_Emit,
HAC_Sys.Parser.Enter_Def,
HAC_Sys.Parser.Helpers,
HAC_Sys.PCode,
HAC_Sys.Scanner,
HAC_Sys.UErrors;
package body HAC_Sys.Parser.Tasking is
use Compiler, Compiler.PCode_Emit, Defs, Enter_Def, Helpers, PCode, UErrors;
------------------------------------------------------------------
-------------------------------------------------Task_Declaration-
-- Hathorn
procedure Task_Declaration (
CD : in out Compiler_Data;
FSys : Defs.Symset;
Initial_Level : Nesting_level
)
is
Level : Nesting_level := Initial_Level;
saveLineCount : constant Integer := CD.Line_Count; -- Source line where Task appeared
procedure InSymbol is begin Scanner.InSymbol (CD); end InSymbol;
I, T0 : Integer;
TaskID : Alfa;
begin
InSymbol;
if CD.Sy = BODY_Symbol then -- Task Body
InSymbol;
I := Locate_Identifier (CD, CD.Id, Level);
TaskID := CD.IdTab (I).Name;
CD.Blocks_Table (CD.IdTab (I).Block_Ref).SrcFrom := saveLineCount; -- (* Manuel *)
InSymbol;
Block (CD, FSys, False, False, Level + 1, I, TaskID, TaskID); -- !! up/low case
Emit_1 (CD, k_Exit_Call, Normal_Procedure_Call);
else -- Task Specification
if CD.Sy = IDent then
TaskID := CD.Id;
else
Error (CD, err_identifier_missing);
CD.Id := Empty_Alfa;
end if;
CD.Tasks_Definitions_Count := CD.Tasks_Definitions_Count + 1;
if CD.Tasks_Definitions_Count > TaskMax then
Fatal (TASKS); -- Exception is raised there.
end if;
Enter (CD, Level, TaskID, TaskID, aTask); -- !! casing
CD.Tasks_Definitions_Table (CD.Tasks_Definitions_Count) := CD.Id_Count;
Enter_Block (CD, CD.Id_Count);
CD.IdTab (CD.Id_Count).Block_Ref := CD.Blocks_Count;
InSymbol;
if CD.Sy = Semicolon then
InSymbol; -- Task with no entries
else -- Parsing the Entry specs
Need (CD, IS_Symbol, err_IS_missing);
if Level = Nesting_Level_Max then
Fatal (LEVELS); -- Exception is raised there.
end if;
Level := Level + 1;
CD.Display (Level) := CD.Blocks_Count;
while CD.Sy = ENTRY_Symbol loop
InSymbol;
if CD.Sy /= IDent then
Error (CD, err_identifier_missing);
CD.Id := Empty_Alfa;
end if;
CD.Entries_Count := CD.Entries_Count + 1;
if CD.Entries_Count > EntryMax then
Fatal (ENTRIES); -- Exception is raised there.
end if;
Enter (CD, Level, CD.Id, CD.Id_with_case, aEntry);
CD.Entries_Table (CD.Entries_Count) := CD.Id_Count; -- point to identifier table location
T0 := CD.Id_Count; -- of TaskID
InSymbol;
Block (CD, FSys, False, False, Level + 1, CD.Id_Count,
CD.IdTab (CD.Id_Count).Name, CD.IdTab (CD.Id_Count).Name_with_case);
CD.IdTab (T0).Adr_or_Sz := CD.Tasks_Definitions_Count;
if CD.Sy = Semicolon then
InSymbol;
else
Error (CD, err_semicolon_missing);
end if;
end loop; -- while CD.Sy = ENTRY_Symbol
Level := Level - 1;
Test_END_Symbol (CD);
if CD.Sy = IDent and CD.Id = TaskID then
InSymbol;
else
Skip (CD, Semicolon, err_incorrect_block_name);
end if;
Test_Semicolon_in_Declaration (CD, FSys);
end if;
end if;
pragma Assert (Level = Initial_Level);
end Task_Declaration;
end HAC_Sys.Parser.Tasking;
|
reznikmm/matreshka | Ada | 4,735 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Db_Auto_Increment_Elements;
package Matreshka.ODF_Db.Auto_Increment_Elements is
type Db_Auto_Increment_Element_Node is
new Matreshka.ODF_Db.Abstract_Db_Element_Node
and ODF.DOM.Db_Auto_Increment_Elements.ODF_Db_Auto_Increment
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Db_Auto_Increment_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Db_Auto_Increment_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Db_Auto_Increment_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Db_Auto_Increment_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Db_Auto_Increment_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Db.Auto_Increment_Elements;
|
zhmu/ananas | Ada | 7,526 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M --
-- --
-- S p e c --
-- (GNU-Linux/x86 Version) --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package System is
pragma Pure;
-- Note that we take advantage of the implementation permission to make
-- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-- 2005, this is Pure in any case (AI-362).
pragma No_Elaboration_Code_All;
-- Allow the use of that restriction in units that WITH this unit
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
-- System-Dependent Named Numbers
Min_Int : constant := -2 ** (Standard'Max_Integer_Size - 1);
Max_Int : constant := 2 ** (Standard'Max_Integer_Size - 1) - 1;
Max_Binary_Modulus : constant := 2 ** Standard'Max_Integer_Size;
Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
Max_Base_Digits : constant := Long_Long_Float'Digits;
Max_Digits : constant := Long_Long_Float'Digits;
Max_Mantissa : constant := Standard'Max_Integer_Size - 1;
Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
Tick : constant := 0.000_001;
-- Storage-related Declarations
type Address is private;
pragma Preelaborable_Initialization (Address);
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := Standard'Word_Size;
Memory_Size : constant := 2 ** Long_Integer'Size;
-- Address comparison
function "<" (Left, Right : Address) return Boolean;
function "<=" (Left, Right : Address) return Boolean;
function ">" (Left, Right : Address) return Boolean;
function ">=" (Left, Right : Address) return Boolean;
function "=" (Left, Right : Address) return Boolean;
pragma Import (Intrinsic, "<");
pragma Import (Intrinsic, "<=");
pragma Import (Intrinsic, ">");
pragma Import (Intrinsic, ">=");
pragma Import (Intrinsic, "=");
-- Other System-Dependent Declarations
type Bit_Order is (High_Order_First, Low_Order_First);
Default_Bit_Order : constant Bit_Order := Low_Order_First;
pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-- Priority-related Declarations (RM D.1)
-- 0 .. 98 corresponds to the system priority range 1 .. 99.
--
-- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
-- of the entire range provided by the system.
--
-- If the scheduling policy is SCHED_OTHER the only valid system priority
-- is 1 and other values are simply ignored.
Max_Priority : constant Positive := 97;
Max_Interrupt_Priority : constant Positive := 98;
subtype Any_Priority is Integer range 0 .. 98;
subtype Priority is Any_Priority range 0 .. 97;
subtype Interrupt_Priority is Any_Priority range 98 .. 98;
Default_Priority : constant Priority := 48;
private
type Address is mod Memory_Size;
Null_Address : constant Address := 0;
--------------------------------------
-- System Implementation Parameters --
--------------------------------------
-- These parameters provide information about the target that is used
-- by the compiler. They are in the private part of System, where they
-- can be accessed using the special circuitry in the Targparm unit
-- whose source should be consulted for more detailed descriptions
-- of the individual switch values.
Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := False;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Exit_Status_Supported : constant Boolean := True;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
Preallocated_Stacks : constant Boolean := False;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := True;
Stack_Check_Limits : constant Boolean := False;
Support_Aggregates : constant Boolean := True;
Support_Atomic_Primitives : constant Boolean := True;
Support_Composite_Assign : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts : constant Boolean := True;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
|
hergin/ada2fuml | Ada | 195 | ads | package Md_Example4.Nested is
type T is new Md_Example4.T with record
Child_Attribute : Globals_Example1.Itype;
end record;
procedure Do_It (The_T : T);
end Md_Example4.Nested;
|
onox/orka | Ada | 1,196 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2022 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Unchecked_Conversion;
with Orka.SIMD.SSE2.Longs;
with Orka.SIMD.SSSE3.Longs.Shift;
package body Orka.SIMD.SSSE3.Integers.Shift is
use SIMD.SSE2.Longs;
use SIMD.SSSE3.Longs.Shift;
function Convert is new Ada.Unchecked_Conversion (m128i, m128l);
function Convert is new Ada.Unchecked_Conversion (m128l, m128i);
function Align_Right_Bytes (Left, Right : m128i; Mask : Integer_32) return m128i is
(Convert (Align_Right_Bytes (Convert (Left), Convert (Right), Mask)));
end Orka.SIMD.SSSE3.Integers.Shift;
|
zhmu/ananas | Ada | 18,323 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O . F I X E D _ I O --
-- --
-- B o d y --
-- --
-- Copyright (C) 2020-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- -------------------
-- - Fixed point I/O -
-- -------------------
-- The following text documents implementation details of the fixed point
-- input/output routines in the GNAT runtime. The first part describes the
-- general properties of fixed point types as defined by the Ada standard,
-- including the Information Systems Annex.
-- Subsequently these are reduced to implementation constraints and the impact
-- of these constraints on a few possible approaches to input/output is given.
-- Based on this analysis, a specific implementation is selected for use in
-- the GNAT runtime. Finally the chosen algorithms are analyzed numerically in
-- order to provide user-level documentation on limits for range and precision
-- of fixed point types as well as accuracy of input/output conversions.
-- -------------------------------------------
-- - General Properties of Fixed Point Types -
-- -------------------------------------------
-- Operations on fixed point types, other than input/output, are not important
-- for the purpose of this document. Only the set of values that a fixed point
-- type can represent and the input/output operations are significant.
-- Values
-- ------
-- The set of values of a fixed point type comprise the integral multiples of
-- a number called the small of the type. The small can be either a power of
-- two, a power of ten or (if the implementation allows) an arbitrary strictly
-- positive real value.
-- Implementations need to support ordinary fixed point types with a precision
-- of at least 24 bits, and (in order to comply with the Information Systems
-- Annex) decimal fixed point types with at least 18 digits. For the rest, no
-- requirements exist for the minimal small and range that must be supported.
-- Operations
-- ----------
-- [Wide_[Wide_]]Image attribute (see RM 3.5(27.1/2))
-- These attributes return a decimal real literal best approximating
-- the value (rounded away from zero if halfway between) with a
-- single leading character that is either a minus sign or a space,
-- one or more digits before the decimal point (with no redundant
-- leading zeros), a decimal point, and N digits after the decimal
-- point. For a subtype S, the value of N is S'Aft, the smallest
-- positive integer such that (10**N)*S'Delta is greater or equal to
-- one, see RM 3.5.10(5).
-- For an arbitrary small, this means large number arithmetic needs
-- to be performed.
-- Put (see RM A.10.9(22-26))
-- The requirements for Put add no extra constraints over the image
-- attributes, although it would be nice to be able to output more
-- than S'Aft digits after the decimal point for values of subtype S.
-- [Wide_[Wide_]]Value attribute (RM 3.5(39.1/2))
-- Since the input can be given in any base in the range 2..16,
-- accurate conversion to a fixed point number may require
-- arbitrary precision arithmetic if there is no limit on the
-- magnitude of the small of the fixed point type.
-- Get (see RM A.10.9(12-21))
-- The requirements for Get are identical to those of the Value
-- attribute.
-- ------------------------------
-- - Implementation Constraints -
-- ------------------------------
-- The requirements listed above for the input/output operations lead to
-- significant complexity, if no constraints are put on supported smalls.
-- Implementation Strategies
-- -------------------------
-- * Floating point arithmetic
-- * Arbitrary-precision integer arithmetic
-- * Fixed-precision integer arithmetic
-- Although it seems convenient to convert fixed point numbers to floating
-- point and then print them, this leads to a number of restrictions.
-- The first one is precision. The widest floating-point type generally
-- available has 53 bits of mantissa. This means that Fine_Delta cannot
-- be less than 2.0**(-53).
-- In GNAT, Fine_Delta is 2.0**(-127), and Duration for example is a 64-bit
-- type. This means that a floating-point type with 128 bits of mantissa needs
-- to be used, which currently does not exist in any common architecture. It
-- would still be possible to use multi-precision floating point to perform
-- calculations using longer mantissas, but this is a much harder approach.
-- The base conversions needed for input/output of (non-decimal) fixed point
-- types can be seen as pairs of integer multiplications and divisions.
-- Arbitrary-precision integer arithmetic would be suitable for the job at
-- hand, but has the drawback that it is very heavy implementation-wise.
-- Especially in embedded systems, where fixed point types are often used,
-- it may not be desirable to require large amounts of storage and time
-- for fixed I/O operations.
-- Fixed-precision integer arithmetic has the advantage of simplicity and
-- speed. For the most common fixed point types this would be a perfect
-- solution. The downside however may be a restricted set of acceptable
-- fixed point types.
-- Implementation Choices
-- ----------------------
-- The current implementation in the GNAT runtime uses fixed-precision integer
-- arithmetic for fixed point types whose Small is the ratio of two integers
-- whose magnitude is bounded relatively to the size of the mantissa, with a
-- three-tiered approach for 32-bit, 64-bit and 128-bit fixed point types. For
-- other fixed point types, the implementation uses floating-point arithmetic.
-- The exact requirements of the algorithms are analyzed and documented along
-- with the implementation in their respective units.
with Interfaces;
with Ada.Text_IO.Fixed_Aux;
with Ada.Text_IO.Float_Aux;
with System.Img_Fixed_32; use System.Img_Fixed_32;
with System.Img_Fixed_64; use System.Img_Fixed_64;
with System.Img_Fixed_128; use System.Img_Fixed_128;
with System.Img_LFlt; use System.Img_LFlt;
with System.Val_Fixed_32; use System.Val_Fixed_32;
with System.Val_Fixed_64; use System.Val_Fixed_64;
with System.Val_Fixed_128; use System.Val_Fixed_128;
with System.Val_LFlt; use System.Val_LFlt;
package body Ada.Text_IO.Fixed_IO with SPARK_Mode => Off is
-- Note: we still use the floating-point I/O routines for types whose small
-- is not the ratio of two sufficiently small integers. This will result in
-- inaccuracies for fixed point types that require more precision than is
-- available in Long_Float.
subtype Int32 is Interfaces.Integer_32; use type Int32;
subtype Int64 is Interfaces.Integer_64; use type Int64;
subtype Int128 is Interfaces.Integer_128; use type Int128;
package Aux32 is new
Ada.Text_IO.Fixed_Aux (Int32, Scan_Fixed32, Set_Image_Fixed32);
package Aux64 is new
Ada.Text_IO.Fixed_Aux (Int64, Scan_Fixed64, Set_Image_Fixed64);
package Aux128 is new
Ada.Text_IO.Fixed_Aux (Int128, Scan_Fixed128, Set_Image_Fixed128);
package Aux_Long_Float is new
Ada.Text_IO.Float_Aux (Long_Float, Scan_Long_Float, Set_Image_Long_Float);
-- Throughout this generic body, we distinguish between the case where type
-- Int32 is OK, where type Int64 is OK and where type Int128 is OK. These
-- boolean constants are used to test for this, such that only code for the
-- relevant case is included in the instance; that's why the computation of
-- their value must be fully static (although it is not a static expression
-- in the RM sense).
OK_Get_32 : constant Boolean :=
Num'Base'Object_Size <= 32
and then
((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
or else
(Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
or else
(Num'Small_Numerator <= 2**27
and then Num'Small_Denominator <= 2**27));
-- These conditions are derived from the prerequisites of System.Value_F
OK_Put_32 : constant Boolean :=
Num'Base'Object_Size <= 32
and then
((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
or else
(Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
or else
(Num'Small_Numerator < Num'Small_Denominator
and then Num'Small_Denominator <= 2**27)
or else
(Num'Small_Denominator < Num'Small_Numerator
and then Num'Small_Numerator <= 2**25));
-- These conditions are derived from the prerequisites of System.Image_F
OK_Get_64 : constant Boolean :=
Num'Base'Object_Size <= 64
and then
((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
or else
(Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
or else
(Num'Small_Numerator <= 2**59
and then Num'Small_Denominator <= 2**59));
-- These conditions are derived from the prerequisites of System.Value_F
OK_Put_64 : constant Boolean :=
Num'Base'Object_Size <= 64
and then
((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
or else
(Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
or else
(Num'Small_Numerator < Num'Small_Denominator
and then Num'Small_Denominator <= 2**59)
or else
(Num'Small_Denominator < Num'Small_Numerator
and then Num'Small_Numerator <= 2**53));
-- These conditions are derived from the prerequisites of System.Image_F
OK_Get_128 : constant Boolean :=
Num'Base'Object_Size <= 128
and then
((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
or else
(Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
or else
(Num'Small_Numerator <= 2**123
and then Num'Small_Denominator <= 2**123));
-- These conditions are derived from the prerequisites of System.Value_F
OK_Put_128 : constant Boolean :=
Num'Base'Object_Size <= 128
and then
((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
or else
(Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
or else
(Num'Small_Numerator < Num'Small_Denominator
and then Num'Small_Denominator <= 2**123)
or else
(Num'Small_Denominator < Num'Small_Numerator
and then Num'Small_Numerator <= 2**122));
-- These conditions are derived from the prerequisites of System.Image_F
E : constant Natural :=
127 - 64 * Boolean'Pos (OK_Put_64) - 32 * Boolean'Pos (OK_Put_32);
-- T'Size - 1 for the selected Int{32,64,128}
F0 : constant Natural := 0;
F1 : constant Natural :=
F0 + 38 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F0) >= 1.0E+38);
F2 : constant Natural :=
F1 + 19 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F1) >= 1.0E+19);
F3 : constant Natural :=
F2 + 9 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F2) >= 1.0E+9);
F4 : constant Natural :=
F3 + 5 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F3) >= 1.0E+5);
F5 : constant Natural :=
F4 + 3 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F4) >= 1.0E+3);
F6 : constant Natural :=
F5 + 2 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F5) >= 1.0E+2);
F7 : constant Natural :=
F6 + 1 * Boolean'Pos (2.0**E * Num'Small * 10.0**(-F6) >= 1.0E+1);
-- Binary search for the number of digits - 1 before the decimal point of
-- the product 2.0**E * Num'Small.
For0 : constant Natural := 2 + F7;
-- Fore value for the fixed point type whose mantissa is Int{32,64,128} and
-- whose small is Num'Small.
---------
-- Get --
---------
procedure Get
(File : File_Type;
Item : out Num;
Width : Field := 0)
is
pragma Unsuppress (Range_Check);
begin
if OK_Get_32 then
Item := Num'Fixed_Value
(Aux32.Get (File, Width,
-Num'Small_Numerator,
-Num'Small_Denominator));
elsif OK_Get_64 then
Item := Num'Fixed_Value
(Aux64.Get (File, Width,
-Num'Small_Numerator,
-Num'Small_Denominator));
elsif OK_Get_128 then
Item := Num'Fixed_Value
(Aux128.Get (File, Width,
-Num'Small_Numerator,
-Num'Small_Denominator));
else
Aux_Long_Float.Get (File, Long_Float (Item), Width);
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
procedure Get
(Item : out Num;
Width : Field := 0)
is
begin
Get (Current_In, Item, Width);
end Get;
procedure Get
(From : String;
Item : out Num;
Last : out Positive)
is
pragma Unsuppress (Range_Check);
begin
if OK_Get_32 then
Item := Num'Fixed_Value
(Aux32.Gets (From, Last,
-Num'Small_Numerator,
-Num'Small_Denominator));
elsif OK_Get_64 then
Item := Num'Fixed_Value
(Aux64.Gets (From, Last,
-Num'Small_Numerator,
-Num'Small_Denominator));
elsif OK_Get_128 then
Item := Num'Fixed_Value
(Aux128.Gets (From, Last,
-Num'Small_Numerator,
-Num'Small_Denominator));
else
Aux_Long_Float.Gets (From, Long_Float (Item), Last);
end if;
exception
when Constraint_Error => raise Data_Error;
end Get;
---------
-- Put --
---------
procedure Put
(File : File_Type;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
if OK_Put_32 then
Aux32.Put (File, Int32'Integer_Value (Item), Fore, Aft, Exp,
-Num'Small_Numerator, -Num'Small_Denominator,
For0, Num'Aft);
elsif OK_Put_64 then
Aux64.Put (File, Int64'Integer_Value (Item), Fore, Aft, Exp,
-Num'Small_Numerator, -Num'Small_Denominator,
For0, Num'Aft);
elsif OK_Put_128 then
Aux128.Put (File, Int128'Integer_Value (Item), Fore, Aft, Exp,
-Num'Small_Numerator, -Num'Small_Denominator,
For0, Num'Aft);
else
Aux_Long_Float.Put (File, Long_Float (Item), Fore, Aft, Exp);
end if;
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Put (Current_Out, Item, Fore, Aft, Exp);
end Put;
procedure Put
(To : out String;
Item : Num;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
if OK_Put_32 then
Aux32.Puts (To, Int32'Integer_Value (Item), Aft, Exp,
-Num'Small_Numerator, -Num'Small_Denominator,
For0, Num'Aft);
elsif OK_Put_64 then
Aux64.Puts (To, Int64'Integer_Value (Item), Aft, Exp,
-Num'Small_Numerator, -Num'Small_Denominator,
For0, Num'Aft);
elsif OK_Put_128 then
Aux128.Puts (To, Int128'Integer_Value (Item), Aft, Exp,
-Num'Small_Numerator, -Num'Small_Denominator,
For0, Num'Aft);
else
Aux_Long_Float.Puts (To, Long_Float (Item), Aft, Exp);
end if;
end Put;
end Ada.Text_IO.Fixed_IO;
|
ZinebZaad/ENSEEIHT | Ada | 2,400 | adb | with Ada.Unchecked_Deallocation;
package body TH is
procedure Initialiser(Sda: out T_TH; Capacite: in Integer) is
begin
Sda.Elements := new T_Tab_LCA(1..Capacite);
Sda.Capacite := Capacite;
for i in 1..Capacite loop
T_LCA_C.Initialiser(Sda.Elements(i));
end loop;
end Initialiser;
function Est_Vide (Sda : T_TH) return Boolean is
begin
for i in 1..Sda.Capacite loop
if not T_LCA_C.Est_Vide(Sda.Elements(i)) then
return False;
end if;
end loop;
return True;
end Est_Vide;
function Block(Sda: in T_TH; Cle: in T_Cle) return Integer is
begin
return (Hachage(Cle) - 1) mod Sda.Capacite + 1;
end Block;
function Taille (Sda : in T_TH) return Integer is
Length: Integer;
begin
Length := 0;
for i in 1..Sda.Capacite loop
Length := Length + T_LCA_C.Taille(Sda.Elements(i));
end loop;
return Length;
end Taille;
procedure Enregistrer (Sda : in out T_TH ; Cle : in T_Cle ; Donnee : in T_Donnee) is
begin
T_LCA_C.Enregistrer(Sda.Elements(Block(Sda, Cle)), Cle, Donnee);
end Enregistrer;
function Cle_Presente (Sda : in T_TH ; Cle : in T_Cle) return Boolean is
begin
return T_LCA_C.Cle_Presente(Sda.Elements(Block(Sda, Cle)), Cle);
end Cle_Presente;
function LCA(Sda: in T_TH; Cle: in T_Cle) return T_LCA_C.T_LCA is
begin
return Sda.Elements(Block(Sda, Cle));
end LCA;
function La_Donnee (Sda : in T_TH ; Cle : in T_Cle) return T_Donnee is
begin
return T_LCA_C.La_Donnee(Sda.Elements(Block(Sda, Cle)), Cle);
end La_Donnee;
procedure Supprimer (Sda : in out T_TH ; Cle : in T_Cle) is
begin
T_LCA_C.Supprimer(Sda.Elements(Block(Sda, Cle)), Cle);
end Supprimer;
procedure Vider (Sda : in out T_TH) is
begin
for i in 1..Sda.Capacite loop
T_LCA_C.Vider(Sda.Elements(i));
end loop;
end Vider;
procedure Detruire(Sda: in out T_TH) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => T_Tab_LCA, Name => T_Tab_LCA_Access);
begin
if not Est_Vide(Sda) then
Vider(Sda);
end if;
Free(Sda.Elements);
end Detruire;
procedure Pour_Chaque (Sda : in T_TH) is
procedure LCA_Pour_Chaque is
new T_LCA_C.Pour_Chaque (Traiter);
begin
for i in 1..Sda.Capacite loop
LCA_Pour_Chaque(Sda.Elements(i));
end loop;
end Pour_Chaque;
end TH;
|
reznikmm/matreshka | Ada | 4,117 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Number_Min_Denominator_Digits_Attributes;
package Matreshka.ODF_Number.Min_Denominator_Digits_Attributes is
type Number_Min_Denominator_Digits_Attribute_Node is
new Matreshka.ODF_Number.Abstract_Number_Attribute_Node
and ODF.DOM.Number_Min_Denominator_Digits_Attributes.ODF_Number_Min_Denominator_Digits_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Number_Min_Denominator_Digits_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Number_Min_Denominator_Digits_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Number.Min_Denominator_Digits_Attributes;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 1,995 | ads | generic
HSE_Value : HSE_Range := 8_000_000;
PLL_Source : PLL_Source_Type := HSI;
SYSCLK_Source : SYSCLK_Source_Type := MSI;
RTC_Source : RTC_Source_Type := LSI;
PLL_Prediv : PLL_Prediv_Range := 1;
PLL_Mul : PLL_Mul_Range := 1;
AHB_Prescaler : AHB_Prescaler_Type := DIV1;
APB1_Prescaler : APB1_Prescaler_Type := DIV1;
APB2_Prescaler : APB2_Prescaler_Type := DIV1;
LSI_Enabled : Boolean := True;
LSE_Enabled : Boolean := False;
package STM32GD.Clock.Tree is
pragma Preelaborate;
PLL_Value : constant Integer := (
case PLL_Source is
when HSI => HSI_Value / 2,
when HSE => HSE_Value / PLL_Prediv);
PLL_Output_Value : constant Integer := (PLL_Value / PLL_Prediv) * PLL_Mul;
SYSCLK : constant Integer := (
case SYSCLK_Source is
when HSI => HSI_Value,
when MSI => MSI_Value,
when PLL => PLL_Output_Value,
when HSE => HSE_Value);
HCLK : constant Integer := (
case AHB_Prescaler is
when DIV1 => SYSCLK,
when DIV2 => SYSCLK / 2,
when DIV4 => SYSCLK / 4,
when DIV8 => SYSCLK / 8,
when DIV16 => SYSCLK / 16,
when DIV64 => SYSCLK / 64,
when DIV128 => SYSCLK / 128,
when DIV256 => SYSCLK / 256,
when DIV512 => SYSCLK / 512);
PCLK1 : constant Integer := (
case APB1_Prescaler is
when DIV1 => HCLK,
when DIV2 => HCLK / 2,
when DIV4 => HCLK / 4,
when DIV8 => HCLK / 8,
when DIV16 => HCLK / 16);
PCLK2 : constant Integer := (
case APB2_Prescaler is
when DIV1 => HCLK,
when DIV2 => HCLK / 2,
when DIV4 => HCLK / 4,
when DIV8 => HCLK / 8,
when DIV16 => HCLK / 16);
RTCCLK : constant Integer := (
case RTC_Source is
when LSI => LSI_Value,
when LSE => LSE_Value,
when HSE => HSE_Value / 32);
function Frequency (Clock : Clock_Type) return Integer;
procedure Init;
end STM32GD.Clock.Tree;
|
charlie5/lace | Ada | 1,280 | adb | with
ada.Numerics.Float_random,
ada.Numerics.Discrete_random;
package body any_Math.any_Random
is
use ada.Numerics;
package Boolean_random is new ada.numerics.discrete_Random (Boolean);
real_Generator : Float_random .Generator;
boolean_Generator : Boolean_random.Generator;
function random_Boolean return Boolean
is
begin
return Boolean_random.Random (boolean_Generator);
end random_Boolean;
function random_Real (Lower : in Real := Real'First;
Upper : in Real := Real'Last) return Real
is
base_Roll : constant Float := Float_random.Random (Real_Generator);
begin
return Lower
+ Real (base_Roll) * (Upper - Lower);
end random_Real;
function random_Integer (Lower : in Integer := Integer'First;
Upper : in Integer := Integer'Last) return Integer
is
Modulus : constant Positive := Upper - Lower + 1;
base_Roll : constant Float := Float_random.Random (Real_Generator);
begin
return Lower
+ Integer (Float (Modulus) * base_Roll) mod Modulus;
end random_Integer;
begin
Boolean_random.reset (boolean_Generator);
Float_random .reset ( real_Generator);
end any_math.any_Random;
|
Lucretia/Cherry | Ada | 1,499 | adb | --
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
with Symbols;
package body Rules is
-- type Symbol_Proxy_Type is
-- record
-- Symbol : sySymbol_Access;
-- end record;
procedure Assing_Sequential_Rule_Numbers
(Lemon_Rule : in Rule_Access;
Start_Rule : out Rule_Access)
is
use Symbols;
I : Symbols.Symbol_Index;
RP : Rules.Rule_Access;
begin
I := 0;
RP := Lemon_Rule;
loop
exit when RP /= null;
if RP.Code /= Null_Code then
RP.Rule := Integer (I);
I := I + 1;
else
RP.Rule := -1;
end if;
RP := RP.Next;
end loop;
-- Does this section do anything at all ..?
I := 0;
RP := Lemon_Rule;
loop
exit when RP = null;
RP := RP.Next;
end loop;
-- Assign Rule numbers when Rule < 0 stop when Rule = 0.
RP := Lemon_Rule;
loop
exit when RP = null;
if RP.Rule < 0 then
RP.Rule := Integer (I);
I := I + 1;
end if;
RP := RP.Next;
end loop;
Start_Rule := Lemon_Rule;
-- Lemon.Rule := Rule_Sort (Lemon.Rule);
end Assing_Sequential_Rule_Numbers;
end Rules;
|
charlie5/lace | Ada | 2,972 | ads | generic
package any_Math.any_Geometry.any_d2.any_Hexagon with Pure
--
-- Models a regular, flat-topped hexagon.
--
-- https://en.wikipedia.org/wiki/Hexagon
--
--
-- 5 6
-- ---
-- 4/ \1
-- \ /
-- ---
-- 3 2
--
is
-------------
--- vertex_Id
--
subtype vertex_Id is any_Geometry.vertex_Id range 1 .. 6;
function prior_Vertex (to_Vertex : in vertex_Id) return vertex_Id;
function next_Vertex (to_Vertex : in vertex_Id) return vertex_Id;
--------
--- Item
--
type Item is private;
function to_Hexagon (circumRadius : in Real) return Item;
function maximal_Diameter (Self : in Item) return Real;
function minimal_Diameter (Self : in Item) return Real; -- 'd'
function circumRadius (Self : in Item) return Real; -- 'r'
function inRadius (Self : in Item) return Real; -- 'r'
function Area (Self : in Item) return Real;
function Perimeter (Self : in Item) return Real;
function Width (Self : in Item) return Real renames maximal_Diameter;
function Height (Self : in Item) return Real renames minimal_Diameter;
function side_Length (Self : in Item) return Real;
function Site (Self : in Item; of_Vertex : in vertex_Id) return any_d2.Site;
function Angle (Self : in Item; at_Vertex : in vertex_Id) return Radians;
function R (Self : in Item) return Real renames circumRadius;
function D (Self : in Item) return Real renames maximal_Diameter;
function t (Self : in Item) return Real renames side_Length;
function horizontal_Distance (Self : in Item) return Real; -- The distance between adjacent
function vertical_Distance (Self : in Item) return Real; -- hexagon centers.
--------
--- Grid
--
-- Origin is at the top left corner.
-- X increases to the right.
-- Y increases downwards.
--
type Grid (Rows : Positive;
Cols : Positive) is private;
type Coordinates is
record
Row, Col: Positive;
end record;
function to_Grid (Rows, Cols : in Positive;
circumRadius : in Real) return Grid;
function hex_Center (Grid : in any_Hexagon.Grid; Coords : in Coordinates) return any_d2.Site;
--
-- Returns the centre of the hexagon at the given co-ordinates.
function vertex_Site (Self : in Grid; hex_Id : in any_Hexagon.Coordinates;
Which : in any_Hexagon.vertex_Id) return any_d2.Site;
private
type Item is
record
circumRadius : Real;
end record;
type Grid (Rows : Positive;
Cols : Positive) is
record
circumRadius : Real;
Centers : any_d2.Grid (1 .. Rows,
1 .. Cols);
end record;
end any_Math.any_Geometry.any_d2.any_Hexagon;
|
charlie5/cBound | Ada | 1,541 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_glx_get_error_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
context_tag : aliased xcb.xcb_glx_context_tag_t;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_error_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_error_request_t.Item,
Element_Array => xcb.xcb_glx_get_error_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_error_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_error_request_t.Pointer,
Element_Array => xcb.xcb_glx_get_error_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_get_error_request_t;
|
reznikmm/matreshka | Ada | 3,605 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
separate (AMF.Internals.Factories.Utp_Factories)
function Create_Timezone_From_String
(Image : League.Strings.Universal_String) return League.Holders.Holder is
begin
raise Program_Error;
return League.Holders.Empty_Holder;
end Create_Timezone_From_String;
|
kjseefried/coreland-cgbc | Ada | 7,653 | adb | package body CGBC.Bounded_Generic_Strings is
procedure Append_Base
(Left : in out Bounded_String;
Right : in String_Type;
Drop : in Ada.Strings.Truncation);
procedure Check_Slice
(Source : in Bounded_String;
Low : in Positive;
High : in Positive);
--
-- Append
--
function Append
(Source : in Bounded_String;
New_Item : in Bounded_String;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) return Bounded_String
is
Temp : Bounded_String (Source.Data_Size) := Source;
begin
Append_Base
(Left => Temp,
Right => New_Item.Data (1 .. New_Item.Data_Used),
Drop => Drop);
return Temp;
end Append;
function Append
(Source : in Bounded_String;
New_Item : in String_Type;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) return Bounded_String
is
Temp : Bounded_String (Source.Data_Size) := Source;
begin
Append_Base
(Left => Temp,
Right => New_Item,
Drop => Drop);
return Temp;
end Append;
function Append
(Source : in String_Type;
New_Item : in Bounded_String;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) return Bounded_String
is
Temp : Bounded_String (Source'Last);
begin
Temp.Data (1 .. Source'Length) := Source (Source'First .. Source'Last);
Append_Base
(Left => Temp,
Right => New_Item.Data (1 .. New_Item.Data_Used),
Drop => Drop);
return Temp;
end Append;
function Append
(Source : in Bounded_String;
New_Item : in Character_Type;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) return Bounded_String
is
Temp_L : Bounded_String (Source.Data_Size) := Source;
Temp_R : String_Type (1 .. 1);
begin
Temp_R (1) := New_Item;
Append_Base
(Left => Temp_L,
Right => Temp_R,
Drop => Drop);
return Temp_L;
end Append;
procedure Append
(Source : in out Bounded_String;
New_Item : in Bounded_String;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) is
begin
Append_Base
(Left => Source,
Right => New_Item.Data (1 .. New_Item.Data_Used),
Drop => Drop);
end Append;
procedure Append
(Source : in out Bounded_String;
New_Item : in String_Type;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) is
begin
Append_Base
(Left => Source,
Right => New_Item,
Drop => Drop);
end Append;
--
-- Append_Base
--
procedure Append_Base
(Left : in out Bounded_String;
Right : in String_Type;
Drop : in Ada.Strings.Truncation)
is
Result_Length : Natural;
begin
-- Right does not require truncation of any kind?
if Left.Data_Used + Right'Length <= Left.Data_Size then
Result_Length := Left.Data_Used + Right'Length;
Left.Data (Left.Data_Used + 1 .. Result_Length) := Right (Right'First .. Right'Last);
Left.Data_Used := Result_Length;
else
case Drop is
when Ada.Strings.Error => raise Ada.Strings.Length_Error;
when Ada.Strings.Right =>
declare
Right_High : constant Natural := Right'First + ((Left.Data_Size - Left.Data_Used) - 1);
Left_Low : constant Natural := Left.Data_Used + 1;
begin
Left.Data (Left_Low .. Left.Data_Size) := Right (Right'First .. Right_High);
end;
when Ada.Strings.Left =>
-- String length is greater than or equal to maximum possible size?
if Right'Length >= Left.Data_Size then
declare
Right_Low : constant Natural := (Right'Last - Left.Data_Size) + 1;
begin
Left.Data (1 .. Left.Data_Size) := Right (Right_Low .. Right'Last);
end;
else
declare
Left_High : constant Natural := Left.Data_Size - Right'Length;
Left_Low : constant Natural := (Left.Data_Size - Left_High) + 1;
begin
Left.Data (1 .. Left_High) := Left.Data (Left_Low .. Left.Data_Used);
Left.Data (Left_High + 1 .. Left.Data_Size) := Right (Right'First .. Right'Last);
end;
end if;
end case;
Left.Data_Used := Left.Data_Size;
end if;
end Append_Base;
--
-- Bounded_Slice
--
function Bounded_Slice
(Source : in Bounded_String;
Low : in Positive;
High : in Positive) return Bounded_String is
begin
Check_Slice (Source, Low, High);
return To_Bounded_String (Source.Data (Low .. High));
end Bounded_Slice;
--
-- Check_Index
--
procedure Check_Index
(Source : in Bounded_String;
Index : in Positive) is
begin
if Index > Source.Data_Used then
raise Ada.Strings.Index_Error;
end if;
end Check_Index;
--
-- Check_Slice
--
procedure Check_Slice
(Source : in Bounded_String;
Low : in Positive;
High : in Positive) is
begin
if Low > Length (Source) + 1 or High > Length (Source) then
raise Ada.Strings.Index_Error;
end if;
end Check_Slice;
--
-- Element
--
function Element
(Source : in Bounded_String;
Index : in Positive) return Character_Type is
begin
Check_Index (Source, Index);
return Source.Data (Index);
end Element;
--
-- Equivalent
--
function Equivalent
(Left : in Bounded_String;
Right : in Bounded_String) return Boolean is
begin
if Left.Data_Used /= Right.Data_Used then
return False;
end if;
return
Left.Data (1 .. Left.Data_Used) =
Right.Data (1 .. Right.Data_Used);
end Equivalent;
--
-- Length
--
function Length (Source : in Bounded_String) return Natural is
begin
return Source.Data_Used;
end Length;
--
-- Maximum_Length
--
function Maximum_Length (Source : in Bounded_String) return Natural is
begin
return Source.Data_Size;
end Maximum_Length;
--
-- Replace_Element
--
procedure Replace_Element
(Source : in out Bounded_String;
Index : in Positive;
By : in Character_Type) is
begin
Check_Index (Source, Index);
Source.Data (Index) := By;
end Replace_Element;
--
-- Set_Bounded_String
--
procedure Set_Bounded_String
(Target : out Bounded_String;
Source : in String_Type;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) is
begin
Truncate (Target);
Append_Base
(Left => Target,
Right => Source,
Drop => Drop);
end Set_Bounded_String;
--
-- Slice
--
function Slice
(Source : in Bounded_String;
Low : in Positive;
High : in Positive) return String_Type is
begin
Check_Slice (Source, Low, High);
return Source.Data (Low .. High);
end Slice;
--
-- To_Bounded_String
--
function To_Bounded_String
(Source : in String_Type;
Drop : in Ada.Strings.Truncation := Ada.Strings.Error) return Bounded_String
is
Temp : Bounded_String (Source'Length);
begin
Append_Base
(Left => Temp,
Right => Source,
Drop => Drop);
return Temp;
end To_Bounded_String;
--
-- To_String
--
function To_String (Source : in Bounded_String) return String_Type is
begin
return Source.Data (1 .. Source.Data_Used);
end To_String;
--
-- Truncate
--
procedure Truncate (Target : out Bounded_String) is
begin
Target.Data_Used := 0;
end Truncate;
end CGBC.Bounded_Generic_Strings;
|
optikos/oasis | Ada | 265,854 | adb | -- Copyright (c) 2019 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Pragmas;
with Program.Elements.Defining_Names;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Defining_Expanded_Names;
with Program.Elements.Type_Declarations;
with Program.Elements.Task_Type_Declarations;
with Program.Elements.Protected_Type_Declarations;
with Program.Elements.Subtype_Declarations;
with Program.Elements.Object_Declarations;
with Program.Elements.Single_Task_Declarations;
with Program.Elements.Single_Protected_Declarations;
with Program.Elements.Number_Declarations;
with Program.Elements.Enumeration_Literal_Specifications;
with Program.Elements.Discriminant_Specifications;
with Program.Elements.Component_Declarations;
with Program.Elements.Loop_Parameter_Specifications;
with Program.Elements.Generalized_Iterator_Specifications;
with Program.Elements.Element_Iterator_Specifications;
with Program.Elements.Procedure_Declarations;
with Program.Elements.Function_Declarations;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Procedure_Body_Declarations;
with Program.Elements.Function_Body_Declarations;
with Program.Elements.Return_Object_Specifications;
with Program.Elements.Package_Declarations;
with Program.Elements.Package_Body_Declarations;
with Program.Elements.Object_Renaming_Declarations;
with Program.Elements.Exception_Renaming_Declarations;
with Program.Elements.Procedure_Renaming_Declarations;
with Program.Elements.Function_Renaming_Declarations;
with Program.Elements.Package_Renaming_Declarations;
with Program.Elements.Generic_Package_Renaming_Declarations;
with Program.Elements.Generic_Procedure_Renaming_Declarations;
with Program.Elements.Generic_Function_Renaming_Declarations;
with Program.Elements.Task_Body_Declarations;
with Program.Elements.Protected_Body_Declarations;
with Program.Elements.Entry_Declarations;
with Program.Elements.Entry_Body_Declarations;
with Program.Elements.Entry_Index_Specifications;
with Program.Elements.Procedure_Body_Stubs;
with Program.Elements.Function_Body_Stubs;
with Program.Elements.Package_Body_Stubs;
with Program.Elements.Task_Body_Stubs;
with Program.Elements.Protected_Body_Stubs;
with Program.Elements.Exception_Declarations;
with Program.Elements.Choice_Parameter_Specifications;
with Program.Elements.Generic_Package_Declarations;
with Program.Elements.Generic_Procedure_Declarations;
with Program.Elements.Generic_Function_Declarations;
with Program.Elements.Package_Instantiations;
with Program.Elements.Procedure_Instantiations;
with Program.Elements.Function_Instantiations;
with Program.Elements.Formal_Object_Declarations;
with Program.Elements.Formal_Type_Declarations;
with Program.Elements.Formal_Procedure_Declarations;
with Program.Elements.Formal_Function_Declarations;
with Program.Elements.Formal_Package_Declarations;
with Program.Elements.Definitions;
with Program.Elements.Subtype_Indications;
with Program.Elements.Constraints;
with Program.Elements.Component_Definitions;
with Program.Elements.Discrete_Ranges;
with Program.Elements.Discrete_Subtype_Indications;
with Program.Elements.Discrete_Range_Attribute_References;
with Program.Elements.Discrete_Simple_Expression_Ranges;
with Program.Elements.Known_Discriminant_Parts;
with Program.Elements.Record_Definitions;
with Program.Elements.Variant_Parts;
with Program.Elements.Variants;
with Program.Elements.Anonymous_Access_To_Objects;
with Program.Elements.Anonymous_Access_To_Procedures;
with Program.Elements.Anonymous_Access_To_Functions;
with Program.Elements.Private_Extension_Definitions;
with Program.Elements.Task_Definitions;
with Program.Elements.Protected_Definitions;
with Program.Elements.Formal_Type_Definitions;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Real_Range_Specifications;
with Program.Elements.Expressions;
with Program.Elements.Identifiers;
with Program.Elements.Operator_Symbols;
with Program.Elements.Explicit_Dereferences;
with Program.Elements.Infix_Operators;
with Program.Elements.Function_Calls;
with Program.Elements.Indexed_Components;
with Program.Elements.Slices;
with Program.Elements.Selected_Components;
with Program.Elements.Attribute_References;
with Program.Elements.Record_Aggregates;
with Program.Elements.Extension_Aggregates;
with Program.Elements.Array_Aggregates;
with Program.Elements.Short_Circuit_Operations;
with Program.Elements.Membership_Tests;
with Program.Elements.Parenthesized_Expressions;
with Program.Elements.Raise_Expressions;
with Program.Elements.Type_Conversions;
with Program.Elements.Qualified_Expressions;
with Program.Elements.Allocators;
with Program.Elements.Case_Expressions;
with Program.Elements.If_Expressions;
with Program.Elements.Quantified_Expressions;
with Program.Elements.Discriminant_Associations;
with Program.Elements.Record_Component_Associations;
with Program.Elements.Array_Component_Associations;
with Program.Elements.Parameter_Associations;
with Program.Elements.Formal_Package_Associations;
with Program.Elements.Assignment_Statements;
with Program.Elements.If_Statements;
with Program.Elements.Case_Statements;
with Program.Elements.Loop_Statements;
with Program.Elements.While_Loop_Statements;
with Program.Elements.For_Loop_Statements;
with Program.Elements.Block_Statements;
with Program.Elements.Exit_Statements;
with Program.Elements.Goto_Statements;
with Program.Elements.Call_Statements;
with Program.Elements.Simple_Return_Statements;
with Program.Elements.Extended_Return_Statements;
with Program.Elements.Accept_Statements;
with Program.Elements.Requeue_Statements;
with Program.Elements.Delay_Statements;
with Program.Elements.Select_Statements;
with Program.Elements.Abort_Statements;
with Program.Elements.Raise_Statements;
with Program.Elements.Code_Statements;
with Program.Elements.Elsif_Paths;
with Program.Elements.Case_Paths;
with Program.Elements.Select_Paths;
with Program.Elements.Case_Expression_Paths;
with Program.Elements.Elsif_Expression_Paths;
with Program.Elements.Use_Clauses;
with Program.Elements.With_Clauses;
with Program.Elements.Component_Clauses;
with Program.Elements.Derived_Types;
with Program.Elements.Derived_Record_Extensions;
with Program.Elements.Enumeration_Types;
with Program.Elements.Signed_Integer_Types;
with Program.Elements.Modular_Types;
with Program.Elements.Floating_Point_Types;
with Program.Elements.Ordinary_Fixed_Point_Types;
with Program.Elements.Decimal_Fixed_Point_Types;
with Program.Elements.Unconstrained_Array_Types;
with Program.Elements.Constrained_Array_Types;
with Program.Elements.Record_Types;
with Program.Elements.Interface_Types;
with Program.Elements.Object_Access_Types;
with Program.Elements.Procedure_Access_Types;
with Program.Elements.Function_Access_Types;
with Program.Elements.Formal_Derived_Type_Definitions;
with Program.Elements.Formal_Unconstrained_Array_Types;
with Program.Elements.Formal_Constrained_Array_Types;
with Program.Elements.Formal_Object_Access_Types;
with Program.Elements.Formal_Procedure_Access_Types;
with Program.Elements.Formal_Function_Access_Types;
with Program.Elements.Formal_Interface_Types;
with Program.Elements.Range_Attribute_References;
with Program.Elements.Simple_Expression_Ranges;
with Program.Elements.Digits_Constraints;
with Program.Elements.Delta_Constraints;
with Program.Elements.Index_Constraints;
with Program.Elements.Discriminant_Constraints;
with Program.Elements.Attribute_Definition_Clauses;
with Program.Elements.Enumeration_Representation_Clauses;
with Program.Elements.Record_Representation_Clauses;
with Program.Elements.At_Clauses;
with Program.Elements.Exception_Handlers;
with Program.Element_Visitors;
separate (Program.Element_Iterators)
package body Internal is
type Visitor is
new Program.Element_Visitors.Element_Visitor
with record
Result : access constant Getter_Array := Empty'Access;
end record;
overriding procedure Pragma_Element
(Self : in out Visitor;
Element : not null Program.Elements.Pragmas.Pragma_Access);
overriding procedure Defining_Expanded_Name
(Self : in out Visitor;
Element : not null Program.Elements.Defining_Expanded_Names
.Defining_Expanded_Name_Access);
overriding procedure Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Type_Declarations
.Type_Declaration_Access);
overriding procedure Task_Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Task_Type_Declarations
.Task_Type_Declaration_Access);
overriding procedure Protected_Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration_Access);
overriding procedure Subtype_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Subtype_Declarations
.Subtype_Declaration_Access);
overriding procedure Object_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Object_Declarations
.Object_Declaration_Access);
overriding procedure Single_Task_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Single_Task_Declarations
.Single_Task_Declaration_Access);
overriding procedure Single_Protected_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Access);
overriding procedure Number_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Number_Declarations
.Number_Declaration_Access);
overriding procedure Enumeration_Literal_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access);
overriding procedure Discriminant_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access);
overriding procedure Component_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Component_Declarations
.Component_Declaration_Access);
overriding procedure Loop_Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access);
overriding procedure Generalized_Iterator_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access);
overriding procedure Element_Iterator_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access);
overriding procedure Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access);
overriding procedure Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Declarations
.Function_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 Function_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Body_Declarations
.Function_Body_Declaration_Access);
overriding procedure Return_Object_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Return_Object_Specifications
.Return_Object_Specification_Access);
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access);
overriding procedure Package_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Body_Declarations
.Package_Body_Declaration_Access);
overriding procedure Object_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration_Access);
overriding procedure Exception_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration_Access);
overriding procedure Procedure_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration_Access);
overriding procedure Function_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration_Access);
overriding procedure Package_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration_Access);
overriding procedure Generic_Package_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration_Access);
overriding procedure Generic_Procedure_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements
.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration_Access);
overriding procedure Generic_Function_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration_Access);
overriding procedure Task_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Task_Body_Declarations
.Task_Body_Declaration_Access);
overriding procedure Protected_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration_Access);
overriding procedure Entry_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Entry_Declarations
.Entry_Declaration_Access);
overriding procedure Entry_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Entry_Body_Declarations
.Entry_Body_Declaration_Access);
overriding procedure Entry_Index_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Entry_Index_Specifications
.Entry_Index_Specification_Access);
overriding procedure Procedure_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Stubs
.Procedure_Body_Stub_Access);
overriding procedure Function_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Function_Body_Stubs
.Function_Body_Stub_Access);
overriding procedure Package_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Package_Body_Stubs
.Package_Body_Stub_Access);
overriding procedure Task_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Task_Body_Stubs
.Task_Body_Stub_Access);
overriding procedure Protected_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Body_Stubs
.Protected_Body_Stub_Access);
overriding procedure Exception_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Declarations
.Exception_Declaration_Access);
overriding procedure Choice_Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access);
overriding procedure Generic_Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Access);
overriding procedure Generic_Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration_Access);
overriding procedure Generic_Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration_Access);
overriding procedure Package_Instantiation
(Self : in out Visitor;
Element : not null Program.Elements.Package_Instantiations
.Package_Instantiation_Access);
overriding procedure Procedure_Instantiation
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Instantiations
.Procedure_Instantiation_Access);
overriding procedure Function_Instantiation
(Self : in out Visitor;
Element : not null Program.Elements.Function_Instantiations
.Function_Instantiation_Access);
overriding procedure Formal_Object_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Object_Declarations
.Formal_Object_Declaration_Access);
overriding procedure Formal_Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Access);
overriding procedure Formal_Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration_Access);
overriding procedure Formal_Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration_Access);
overriding procedure Formal_Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration_Access);
overriding procedure Subtype_Indication
(Self : in out Visitor;
Element : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access);
overriding procedure Component_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Component_Definitions
.Component_Definition_Access);
overriding procedure Discrete_Subtype_Indication
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication_Access);
overriding procedure Discrete_Range_Attribute_Reference
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Access);
overriding procedure Discrete_Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access);
overriding procedure Known_Discriminant_Part
(Self : in out Visitor;
Element : not null Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access);
overriding procedure Record_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Record_Definitions
.Record_Definition_Access);
overriding procedure Variant_Part
(Self : in out Visitor;
Element : not null Program.Elements.Variant_Parts.Variant_Part_Access);
overriding procedure Variant
(Self : in out Visitor;
Element : not null Program.Elements.Variants.Variant_Access);
overriding procedure Anonymous_Access_To_Object
(Self : in out Visitor;
Element : not null Program.Elements.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object_Access);
overriding procedure Anonymous_Access_To_Procedure
(Self : in out Visitor;
Element : not null Program.Elements.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure_Access);
overriding procedure Anonymous_Access_To_Function
(Self : in out Visitor;
Element : not null Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function_Access);
overriding procedure Private_Extension_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition_Access);
overriding procedure Task_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Task_Definitions
.Task_Definition_Access);
overriding procedure Protected_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access);
overriding procedure Aspect_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Aspect_Specifications
.Aspect_Specification_Access);
overriding procedure Real_Range_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access);
overriding procedure Explicit_Dereference
(Self : in out Visitor;
Element : not null Program.Elements.Explicit_Dereferences
.Explicit_Dereference_Access);
overriding procedure Infix_Operator
(Self : in out Visitor;
Element : not null Program.Elements.Infix_Operators
.Infix_Operator_Access);
overriding procedure Function_Call
(Self : in out Visitor;
Element : not null Program.Elements.Function_Calls.Function_Call_Access);
overriding procedure Indexed_Component
(Self : in out Visitor;
Element : not null Program.Elements.Indexed_Components
.Indexed_Component_Access);
overriding procedure Slice
(Self : in out Visitor;
Element : not null Program.Elements.Slices.Slice_Access);
overriding procedure Selected_Component
(Self : in out Visitor;
Element : not null Program.Elements.Selected_Components
.Selected_Component_Access);
overriding procedure Attribute_Reference
(Self : in out Visitor;
Element : not null Program.Elements.Attribute_References
.Attribute_Reference_Access);
overriding procedure Record_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access);
overriding procedure Extension_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Extension_Aggregates
.Extension_Aggregate_Access);
overriding procedure Array_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Array_Aggregates
.Array_Aggregate_Access);
overriding procedure Short_Circuit_Operation
(Self : in out Visitor;
Element : not null Program.Elements.Short_Circuit_Operations
.Short_Circuit_Operation_Access);
overriding procedure Membership_Test
(Self : in out Visitor;
Element : not null Program.Elements.Membership_Tests
.Membership_Test_Access);
overriding procedure Parenthesized_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access);
overriding procedure Raise_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Raise_Expressions
.Raise_Expression_Access);
overriding procedure Type_Conversion
(Self : in out Visitor;
Element : not null Program.Elements.Type_Conversions
.Type_Conversion_Access);
overriding procedure Qualified_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Qualified_Expressions
.Qualified_Expression_Access);
overriding procedure Allocator
(Self : in out Visitor;
Element : not null Program.Elements.Allocators.Allocator_Access);
overriding procedure Case_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Case_Expressions
.Case_Expression_Access);
overriding procedure If_Expression
(Self : in out Visitor;
Element : not null Program.Elements.If_Expressions.If_Expression_Access);
overriding procedure Quantified_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Quantified_Expressions
.Quantified_Expression_Access);
overriding procedure Discriminant_Association
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Associations
.Discriminant_Association_Access);
overriding procedure Record_Component_Association
(Self : in out Visitor;
Element : not null Program.Elements.Record_Component_Associations
.Record_Component_Association_Access);
overriding procedure Array_Component_Association
(Self : in out Visitor;
Element : not null Program.Elements.Array_Component_Associations
.Array_Component_Association_Access);
overriding procedure Parameter_Association
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Associations
.Parameter_Association_Access);
overriding procedure Formal_Package_Association
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Access);
overriding procedure Assignment_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Assignment_Statements
.Assignment_Statement_Access);
overriding procedure If_Statement
(Self : in out Visitor;
Element : not null Program.Elements.If_Statements.If_Statement_Access);
overriding procedure Case_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Case_Statements
.Case_Statement_Access);
overriding procedure Loop_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Loop_Statements
.Loop_Statement_Access);
overriding procedure While_Loop_Statement
(Self : in out Visitor;
Element : not null Program.Elements.While_Loop_Statements
.While_Loop_Statement_Access);
overriding procedure For_Loop_Statement
(Self : in out Visitor;
Element : not null Program.Elements.For_Loop_Statements
.For_Loop_Statement_Access);
overriding procedure Block_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Block_Statements
.Block_Statement_Access);
overriding procedure Exit_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Exit_Statements
.Exit_Statement_Access);
overriding procedure Goto_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Goto_Statements
.Goto_Statement_Access);
overriding procedure Call_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Call_Statements
.Call_Statement_Access);
overriding procedure Simple_Return_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Simple_Return_Statements
.Simple_Return_Statement_Access);
overriding procedure Extended_Return_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Extended_Return_Statements
.Extended_Return_Statement_Access);
overriding procedure Accept_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Accept_Statements
.Accept_Statement_Access);
overriding procedure Requeue_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Requeue_Statements
.Requeue_Statement_Access);
overriding procedure Delay_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Delay_Statements
.Delay_Statement_Access);
overriding procedure Select_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Select_Statements
.Select_Statement_Access);
overriding procedure Abort_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Abort_Statements
.Abort_Statement_Access);
overriding procedure Raise_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Raise_Statements
.Raise_Statement_Access);
overriding procedure Code_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Code_Statements
.Code_Statement_Access);
overriding procedure Elsif_Path
(Self : in out Visitor;
Element : not null Program.Elements.Elsif_Paths.Elsif_Path_Access);
overriding procedure Case_Path
(Self : in out Visitor;
Element : not null Program.Elements.Case_Paths.Case_Path_Access);
overriding procedure Select_Path
(Self : in out Visitor;
Element : not null Program.Elements.Select_Paths.Select_Path_Access);
overriding procedure Case_Expression_Path
(Self : in out Visitor;
Element : not null Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Access);
overriding procedure Elsif_Expression_Path
(Self : in out Visitor;
Element : not null Program.Elements.Elsif_Expression_Paths
.Elsif_Expression_Path_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);
overriding procedure Component_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Component_Clauses
.Component_Clause_Access);
overriding procedure Derived_Type
(Self : in out Visitor;
Element : not null Program.Elements.Derived_Types.Derived_Type_Access);
overriding procedure Derived_Record_Extension
(Self : in out Visitor;
Element : not null Program.Elements.Derived_Record_Extensions
.Derived_Record_Extension_Access);
overriding procedure Enumeration_Type
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Types
.Enumeration_Type_Access);
overriding procedure Signed_Integer_Type
(Self : in out Visitor;
Element : not null Program.Elements.Signed_Integer_Types
.Signed_Integer_Type_Access);
overriding procedure Modular_Type
(Self : in out Visitor;
Element : not null Program.Elements.Modular_Types.Modular_Type_Access);
overriding procedure Floating_Point_Type
(Self : in out Visitor;
Element : not null Program.Elements.Floating_Point_Types
.Floating_Point_Type_Access);
overriding procedure Ordinary_Fixed_Point_Type
(Self : in out Visitor;
Element : not null Program.Elements.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type_Access);
overriding procedure Decimal_Fixed_Point_Type
(Self : in out Visitor;
Element : not null Program.Elements.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type_Access);
overriding procedure Unconstrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access);
overriding procedure Constrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Constrained_Array_Types
.Constrained_Array_Type_Access);
overriding procedure Record_Type
(Self : in out Visitor;
Element : not null Program.Elements.Record_Types.Record_Type_Access);
overriding procedure Interface_Type
(Self : in out Visitor;
Element : not null Program.Elements.Interface_Types
.Interface_Type_Access);
overriding procedure Object_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Object_Access_Types
.Object_Access_Type_Access);
overriding procedure Procedure_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Access_Types
.Procedure_Access_Type_Access);
overriding procedure Function_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Function_Access_Types
.Function_Access_Type_Access);
overriding procedure Formal_Derived_Type_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition_Access);
overriding procedure Formal_Unconstrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type_Access);
overriding procedure Formal_Constrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type_Access);
overriding procedure Formal_Object_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Object_Access_Types
.Formal_Object_Access_Type_Access);
overriding procedure Formal_Procedure_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type_Access);
overriding procedure Formal_Function_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type_Access);
overriding procedure Formal_Interface_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Access);
overriding procedure Range_Attribute_Reference
(Self : in out Visitor;
Element : not null Program.Elements.Range_Attribute_References
.Range_Attribute_Reference_Access);
overriding procedure Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access);
overriding procedure Digits_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Digits_Constraints
.Digits_Constraint_Access);
overriding procedure Delta_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Delta_Constraints
.Delta_Constraint_Access);
overriding procedure Index_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Index_Constraints
.Index_Constraint_Access);
overriding procedure Discriminant_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Constraints
.Discriminant_Constraint_Access);
overriding procedure Attribute_Definition_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Access);
overriding procedure Enumeration_Representation_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause_Access);
overriding procedure Record_Representation_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause_Access);
overriding procedure At_Clause
(Self : in out Visitor;
Element : not null Program.Elements.At_Clauses.At_Clause_Access);
overriding procedure Exception_Handler
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Handlers
.Exception_Handler_Access);
function F1_1 is new Generic_Child
(Element => Program.Elements.Pragmas.Pragma_Element,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Pragmas.Name);
function F1_2 is new Generic_Vector
(Parent => Program.Elements.Pragmas.Pragma_Element,
Vector =>
Program.Elements.Parameter_Associations.Parameter_Association_Vector,
Vector_Access =>
Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access,
Get_Vector => Program.Elements.Pragmas.Arguments);
F1 : aliased constant Getter_Array :=
(1 => (False, Name, F1_1'Access),
2 => (True, Arguments, F1_2'Access));
overriding procedure Pragma_Element
(Self : in out Visitor;
Element : not null Program.Elements.Pragmas.Pragma_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F1'Access;
end Pragma_Element;
function F5_1 is new Generic_Child
(Element =>
Program.Elements.Defining_Expanded_Names.Defining_Expanded_Name,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Defining_Expanded_Names.Prefix);
function F5_2 is new Generic_Child
(Element =>
Program.Elements.Defining_Expanded_Names.Defining_Expanded_Name,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Defining_Expanded_Names.Selector);
F5 : aliased constant Getter_Array :=
(1 => (False, Prefix, F5_1'Access),
2 => (False, Selector, F5_2'Access));
overriding procedure Defining_Expanded_Name
(Self : in out Visitor;
Element : not null Program.Elements.Defining_Expanded_Names
.Defining_Expanded_Name_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F5'Access;
end Defining_Expanded_Name;
function F6_1 is new Generic_Child
(Element => Program.Elements.Type_Declarations.Type_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Type_Declarations.Name);
function F6_2 is new Generic_Child
(Element => Program.Elements.Type_Declarations.Type_Declaration,
Child => Program.Elements.Definitions.Definition,
Child_Access => Program.Elements.Definitions.Definition_Access,
Get_Child => Program.Elements.Type_Declarations.Discriminant_Part);
function F6_3 is new Generic_Child
(Element => Program.Elements.Type_Declarations.Type_Declaration,
Child => Program.Elements.Definitions.Definition,
Child_Access => Program.Elements.Definitions.Definition_Access,
Get_Child => Program.Elements.Type_Declarations.Definition);
function F6_4 is new Generic_Vector
(Parent => Program.Elements.Type_Declarations.Type_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Type_Declarations.Aspects);
F6 : aliased constant Getter_Array :=
(1 => (False, Name, F6_1'Access),
2 => (False, Discriminant_Part, F6_2'Access),
3 => (False, Definition, F6_3'Access),
4 => (True, Aspects, F6_4'Access));
overriding procedure Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Type_Declarations
.Type_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F6'Access;
end Type_Declaration;
function F7_1 is new Generic_Child
(Element =>
Program.Elements.Task_Type_Declarations.Task_Type_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Task_Type_Declarations.Name);
function F7_2 is new Generic_Child
(Element =>
Program.Elements.Task_Type_Declarations.Task_Type_Declaration,
Child =>
Program.Elements.Known_Discriminant_Parts.Known_Discriminant_Part,
Child_Access =>
Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access,
Get_Child =>
Program.Elements.Task_Type_Declarations.Discriminant_Part);
function F7_3 is new Generic_Vector
(Parent =>
Program.Elements.Task_Type_Declarations.Task_Type_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Task_Type_Declarations.Aspects);
function F7_4 is new Generic_Vector
(Parent =>
Program.Elements.Task_Type_Declarations.Task_Type_Declaration,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Task_Type_Declarations.Progenitors);
function F7_5 is new Generic_Child
(Element =>
Program.Elements.Task_Type_Declarations.Task_Type_Declaration,
Child => Program.Elements.Task_Definitions.Task_Definition,
Child_Access => Program.Elements.Task_Definitions.Task_Definition_Access,
Get_Child => Program.Elements.Task_Type_Declarations.Definition);
F7 : aliased constant Getter_Array :=
(1 => (False, Name, F7_1'Access),
2 => (False, Discriminant_Part, F7_2'Access),
3 => (True, Aspects, F7_3'Access),
4 => (True, Progenitors, F7_4'Access),
5 => (False, Definition, F7_5'Access));
overriding procedure Task_Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Task_Type_Declarations
.Task_Type_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F7'Access;
end Task_Type_Declaration;
function F8_1 is new Generic_Child
(Element =>
Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Protected_Type_Declarations.Name);
function F8_2 is new Generic_Child
(Element =>
Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration,
Child =>
Program.Elements.Known_Discriminant_Parts.Known_Discriminant_Part,
Child_Access =>
Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access,
Get_Child =>
Program.Elements.Protected_Type_Declarations.Discriminant_Part);
function F8_3 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Protected_Type_Declarations.Aspects);
function F8_4 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector =>
Program.Elements.Protected_Type_Declarations.Progenitors);
function F8_5 is new Generic_Child
(Element =>
Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration,
Child =>
Program.Elements.Protected_Definitions.Protected_Definition,
Child_Access =>
Program.Elements.Protected_Definitions.Protected_Definition_Access,
Get_Child => Program.Elements.Protected_Type_Declarations.Definition);
F8 : aliased constant Getter_Array :=
(1 => (False, Name, F8_1'Access),
2 => (False, Discriminant_Part, F8_2'Access),
3 => (True, Aspects, F8_3'Access),
4 => (True, Progenitors, F8_4'Access),
5 => (False, Definition, F8_5'Access));
overriding procedure Protected_Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F8'Access;
end Protected_Type_Declaration;
function F9_1 is new Generic_Child
(Element =>
Program.Elements.Subtype_Declarations.Subtype_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Subtype_Declarations.Name);
function F9_2 is new Generic_Child
(Element =>
Program.Elements.Subtype_Declarations.Subtype_Declaration,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child =>
Program.Elements.Subtype_Declarations.Subtype_Indication);
function F9_3 is new Generic_Vector
(Parent =>
Program.Elements.Subtype_Declarations.Subtype_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Subtype_Declarations.Aspects);
F9 : aliased constant Getter_Array :=
(1 => (False, Name, F9_1'Access),
2 => (False, Subtype_Indication, F9_2'Access),
3 => (True, Aspects, F9_3'Access));
overriding procedure Subtype_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Subtype_Declarations
.Subtype_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F9'Access;
end Subtype_Declaration;
function F10_1 is new Generic_Vector
(Parent => Program.Elements.Object_Declarations.Object_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Object_Declarations.Names);
function F10_2 is new Generic_Child
(Element => Program.Elements.Object_Declarations.Object_Declaration,
Child => Program.Elements.Definitions.Definition,
Child_Access => Program.Elements.Definitions.Definition_Access,
Get_Child => Program.Elements.Object_Declarations.Object_Subtype);
function F10_3 is new Generic_Child
(Element => Program.Elements.Object_Declarations.Object_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Object_Declarations.Initialization_Expression);
function F10_4 is new Generic_Vector
(Parent => Program.Elements.Object_Declarations.Object_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Object_Declarations.Aspects);
F10 : aliased constant Getter_Array :=
(1 => (True, Names, F10_1'Access),
2 => (False, Object_Subtype, F10_2'Access),
3 =>
(False,
Initialization_Expression,
F10_3'Access),
4 => (True, Aspects, F10_4'Access));
overriding procedure Object_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Object_Declarations
.Object_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F10'Access;
end Object_Declaration;
function F11_1 is new Generic_Child
(Element =>
Program.Elements.Single_Task_Declarations.Single_Task_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Single_Task_Declarations.Name);
function F11_2 is new Generic_Vector
(Parent =>
Program.Elements.Single_Task_Declarations.Single_Task_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Single_Task_Declarations.Aspects);
function F11_3 is new Generic_Vector
(Parent =>
Program.Elements.Single_Task_Declarations.Single_Task_Declaration,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Single_Task_Declarations.Progenitors);
function F11_4 is new Generic_Child
(Element =>
Program.Elements.Single_Task_Declarations.Single_Task_Declaration,
Child => Program.Elements.Task_Definitions.Task_Definition,
Child_Access => Program.Elements.Task_Definitions.Task_Definition_Access,
Get_Child => Program.Elements.Single_Task_Declarations.Definition);
F11 : aliased constant Getter_Array :=
(1 => (False, Name, F11_1'Access),
2 => (True, Aspects, F11_2'Access),
3 => (True, Progenitors, F11_3'Access),
4 => (False, Definition, F11_4'Access));
overriding procedure Single_Task_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Single_Task_Declarations
.Single_Task_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F11'Access;
end Single_Task_Declaration;
function F12_1 is new Generic_Child
(Element =>
Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Single_Protected_Declarations.Name);
function F12_2 is new Generic_Vector
(Parent =>
Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Single_Protected_Declarations.Aspects);
function F12_3 is new Generic_Vector
(Parent =>
Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector =>
Program.Elements.Single_Protected_Declarations.Progenitors);
function F12_4 is new Generic_Child
(Element =>
Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration,
Child =>
Program.Elements.Protected_Definitions.Protected_Definition,
Child_Access =>
Program.Elements.Protected_Definitions.Protected_Definition_Access,
Get_Child =>
Program.Elements.Single_Protected_Declarations.Definition);
F12 : aliased constant Getter_Array :=
(1 => (False, Name, F12_1'Access),
2 => (True, Aspects, F12_2'Access),
3 => (True, Progenitors, F12_3'Access),
4 => (False, Definition, F12_4'Access));
overriding procedure Single_Protected_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F12'Access;
end Single_Protected_Declaration;
function F13_1 is new Generic_Vector
(Parent => Program.Elements.Number_Declarations.Number_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Number_Declarations.Names);
function F13_2 is new Generic_Child
(Element => Program.Elements.Number_Declarations.Number_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Number_Declarations.Expression);
F13 : aliased constant Getter_Array :=
(1 => (True, Names, F13_1'Access),
2 => (False, Expression, F13_2'Access));
overriding procedure Number_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Number_Declarations
.Number_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F13'Access;
end Number_Declaration;
function F14_1 is new Generic_Child
(Element =>
Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child =>
Program.Elements.Enumeration_Literal_Specifications.Name);
F14 : aliased constant Getter_Array :=
(1 => (False, Name, F14_1'Access));
overriding procedure Enumeration_Literal_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F14'Access;
end Enumeration_Literal_Specification;
function F15_1 is new Generic_Vector
(Parent =>
Program.Elements.Discriminant_Specifications
.Discriminant_Specification,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Discriminant_Specifications.Names);
function F15_2 is new Generic_Child
(Element =>
Program.Elements.Discriminant_Specifications
.Discriminant_Specification,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Discriminant_Specifications.Object_Subtype);
function F15_3 is new Generic_Child
(Element =>
Program.Elements.Discriminant_Specifications
.Discriminant_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Discriminant_Specifications.Default_Expression);
F15 : aliased constant Getter_Array :=
(1 => (True, Names, F15_1'Access),
2 => (False, Object_Subtype, F15_2'Access),
3 => (False, Default_Expression, F15_3'Access));
overriding procedure Discriminant_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F15'Access;
end Discriminant_Specification;
function F16_1 is new Generic_Vector
(Parent =>
Program.Elements.Component_Declarations.Component_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Component_Declarations.Names);
function F16_2 is new Generic_Child
(Element =>
Program.Elements.Component_Declarations.Component_Declaration,
Child =>
Program.Elements.Component_Definitions.Component_Definition,
Child_Access =>
Program.Elements.Component_Definitions.Component_Definition_Access,
Get_Child => Program.Elements.Component_Declarations.Object_Subtype);
function F16_3 is new Generic_Child
(Element =>
Program.Elements.Component_Declarations.Component_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Component_Declarations.Default_Expression);
function F16_4 is new Generic_Vector
(Parent =>
Program.Elements.Component_Declarations.Component_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Component_Declarations.Aspects);
F16 : aliased constant Getter_Array :=
(1 => (True, Names, F16_1'Access),
2 => (False, Object_Subtype, F16_2'Access),
3 => (False, Default_Expression, F16_3'Access),
4 => (True, Aspects, F16_4'Access));
overriding procedure Component_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Component_Declarations
.Component_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F16'Access;
end Component_Declaration;
function F17_1 is new Generic_Child
(Element =>
Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Loop_Parameter_Specifications.Name);
function F17_2 is new Generic_Child
(Element =>
Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification,
Child => Program.Elements.Discrete_Ranges.Discrete_Range,
Child_Access => Program.Elements.Discrete_Ranges.Discrete_Range_Access,
Get_Child =>
Program.Elements.Loop_Parameter_Specifications.Definition);
F17 : aliased constant Getter_Array :=
(1 => (False, Name, F17_1'Access),
2 => (False, Definition, F17_2'Access));
overriding procedure Loop_Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F17'Access;
end Loop_Parameter_Specification;
function F18_1 is new Generic_Child
(Element =>
Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child =>
Program.Elements.Generalized_Iterator_Specifications.Name);
function F18_2 is new Generic_Child
(Element =>
Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Generalized_Iterator_Specifications.Iterator_Name);
F18 : aliased constant Getter_Array :=
(1 => (False, Name, F18_1'Access),
2 => (False, Iterator_Name, F18_2'Access));
overriding procedure Generalized_Iterator_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F18'Access;
end Generalized_Iterator_Specification;
function F19_1 is new Generic_Child
(Element =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Element_Iterator_Specifications.Name);
function F19_2 is new Generic_Child
(Element =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child =>
Program.Elements.Element_Iterator_Specifications.Subtype_Indication);
function F19_3 is new Generic_Child
(Element =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Element_Iterator_Specifications.Iterable_Name);
F19 : aliased constant Getter_Array :=
(1 => (False, Name, F19_1'Access),
2 => (False, Subtype_Indication, F19_2'Access),
3 => (False, Iterable_Name, F19_3'Access));
overriding procedure Element_Iterator_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F19'Access;
end Element_Iterator_Specification;
function F20_1 is new Generic_Child
(Element =>
Program.Elements.Procedure_Declarations.Procedure_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Procedure_Declarations.Name);
function F20_2 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Declarations.Procedure_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Declarations.Parameters);
function F20_3 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Declarations.Procedure_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Declarations.Aspects);
F20 : aliased constant Getter_Array :=
(1 => (False, Name, F20_1'Access),
2 => (True, Parameters, F20_2'Access),
3 => (True, Aspects, F20_3'Access));
overriding procedure Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F20'Access;
end Procedure_Declaration;
function F21_1 is new Generic_Child
(Element =>
Program.Elements.Function_Declarations.Function_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Function_Declarations.Name);
function F21_2 is new Generic_Vector
(Parent =>
Program.Elements.Function_Declarations.Function_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Declarations.Parameters);
function F21_3 is new Generic_Child
(Element =>
Program.Elements.Function_Declarations.Function_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child => Program.Elements.Function_Declarations.Result_Subtype);
function F21_4 is new Generic_Child
(Element =>
Program.Elements.Function_Declarations.Function_Declaration,
Child =>
Program.Elements.Parenthesized_Expressions.Parenthesized_Expression,
Child_Access =>
Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access,
Get_Child =>
Program.Elements.Function_Declarations.Result_Expression);
function F21_5 is new Generic_Vector
(Parent =>
Program.Elements.Function_Declarations.Function_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Declarations.Aspects);
F21 : aliased constant Getter_Array :=
(1 => (False, Name, F21_1'Access),
2 => (True, Parameters, F21_2'Access),
3 => (False, Result_Subtype, F21_3'Access),
4 => (False, Result_Expression, F21_4'Access),
5 => (True, Aspects, F21_5'Access));
overriding procedure Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Declarations
.Function_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F21'Access;
end Function_Declaration;
function F22_1 is new Generic_Vector
(Parent =>
Program.Elements.Parameter_Specifications.Parameter_Specification,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Parameter_Specifications.Names);
function F22_2 is new Generic_Child
(Element =>
Program.Elements.Parameter_Specifications.Parameter_Specification,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Parameter_Specifications.Parameter_Subtype);
function F22_3 is new Generic_Child
(Element =>
Program.Elements.Parameter_Specifications.Parameter_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Parameter_Specifications.Default_Expression);
F22 : aliased constant Getter_Array :=
(1 => (True, Names, F22_1'Access),
2 => (False, Parameter_Subtype, F22_2'Access),
3 => (False, Default_Expression, F22_3'Access));
overriding procedure Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Specifications
.Parameter_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F22'Access;
end Parameter_Specification;
function F23_1 is new Generic_Child
(Element =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Procedure_Body_Declarations.Name);
function F23_2 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Procedure_Body_Declarations.Parameters);
function F23_3 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Body_Declarations.Aspects);
function F23_4 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Procedure_Body_Declarations.Declarations);
function F23_5 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Procedure_Body_Declarations.Statements);
function F23_6 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector =>
Program.Elements.Procedure_Body_Declarations.Exception_Handlers);
function F23_7 is new Generic_Child
(Element =>
Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Procedure_Body_Declarations.End_Name);
F23 : aliased constant Getter_Array :=
(1 => (False, Name, F23_1'Access),
2 => (True, Parameters, F23_2'Access),
3 => (True, Aspects, F23_3'Access),
4 => (True, Declarations, F23_4'Access),
5 => (True, Statements, F23_5'Access),
6 => (True, Exception_Handlers, F23_6'Access),
7 => (False, End_Name, F23_7'Access));
overriding procedure Procedure_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F23'Access;
end Procedure_Body_Declaration;
function F24_1 is new Generic_Child
(Element =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Function_Body_Declarations.Name);
function F24_2 is new Generic_Vector
(Parent =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Body_Declarations.Parameters);
function F24_3 is new Generic_Child
(Element =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Function_Body_Declarations.Result_Subtype);
function F24_4 is new Generic_Vector
(Parent =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Body_Declarations.Aspects);
function F24_5 is new Generic_Vector
(Parent =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Function_Body_Declarations.Declarations);
function F24_6 is new Generic_Vector
(Parent =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Function_Body_Declarations.Statements);
function F24_7 is new Generic_Vector
(Parent =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector =>
Program.Elements.Function_Body_Declarations.Exception_Handlers);
function F24_8 is new Generic_Child
(Element =>
Program.Elements.Function_Body_Declarations.Function_Body_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Function_Body_Declarations.End_Name);
F24 : aliased constant Getter_Array :=
(1 => (False, Name, F24_1'Access),
2 => (True, Parameters, F24_2'Access),
3 => (False, Result_Subtype, F24_3'Access),
4 => (True, Aspects, F24_4'Access),
5 => (True, Declarations, F24_5'Access),
6 => (True, Statements, F24_6'Access),
7 => (True, Exception_Handlers, F24_7'Access),
8 => (False, End_Name, F24_8'Access));
overriding procedure Function_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Body_Declarations
.Function_Body_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F24'Access;
end Function_Body_Declaration;
function F25_1 is new Generic_Child
(Element =>
Program.Elements.Return_Object_Specifications
.Return_Object_Specification,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Return_Object_Specifications.Name);
function F25_2 is new Generic_Child
(Element =>
Program.Elements.Return_Object_Specifications
.Return_Object_Specification,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Return_Object_Specifications.Object_Subtype);
function F25_3 is new Generic_Child
(Element =>
Program.Elements.Return_Object_Specifications
.Return_Object_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Return_Object_Specifications.Expression);
F25 : aliased constant Getter_Array :=
(1 => (False, Name, F25_1'Access),
2 => (False, Object_Subtype, F25_2'Access),
3 => (False, Expression, F25_3'Access));
overriding procedure Return_Object_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Return_Object_Specifications
.Return_Object_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F25'Access;
end Return_Object_Specification;
function F26_1 is new Generic_Child
(Element =>
Program.Elements.Package_Declarations.Package_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Package_Declarations.Name);
function F26_2 is new Generic_Vector
(Parent =>
Program.Elements.Package_Declarations.Package_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Package_Declarations.Aspects);
function F26_3 is new Generic_Vector
(Parent =>
Program.Elements.Package_Declarations.Package_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Package_Declarations.Visible_Declarations);
function F26_4 is new Generic_Vector
(Parent =>
Program.Elements.Package_Declarations.Package_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Package_Declarations.Private_Declarations);
function F26_5 is new Generic_Child
(Element =>
Program.Elements.Package_Declarations.Package_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Package_Declarations.End_Name);
F26 : aliased constant Getter_Array :=
(1 => (False, Name, F26_1'Access),
2 => (True, Aspects, F26_2'Access),
3 => (True, Visible_Declarations, F26_3'Access),
4 => (True, Private_Declarations, F26_4'Access),
5 => (False, End_Name, F26_5'Access));
overriding procedure Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Declarations
.Package_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F26'Access;
end Package_Declaration;
function F27_1 is new Generic_Child
(Element =>
Program.Elements.Package_Body_Declarations.Package_Body_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Package_Body_Declarations.Name);
function F27_2 is new Generic_Vector
(Parent =>
Program.Elements.Package_Body_Declarations.Package_Body_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Package_Body_Declarations.Aspects);
function F27_3 is new Generic_Vector
(Parent =>
Program.Elements.Package_Body_Declarations.Package_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Package_Body_Declarations.Declarations);
function F27_4 is new Generic_Vector
(Parent =>
Program.Elements.Package_Body_Declarations.Package_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Package_Body_Declarations.Statements);
function F27_5 is new Generic_Vector
(Parent =>
Program.Elements.Package_Body_Declarations.Package_Body_Declaration,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector =>
Program.Elements.Package_Body_Declarations.Exception_Handlers);
function F27_6 is new Generic_Child
(Element =>
Program.Elements.Package_Body_Declarations.Package_Body_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Package_Body_Declarations.End_Name);
F27 : aliased constant Getter_Array :=
(1 => (False, Name, F27_1'Access),
2 => (True, Aspects, F27_2'Access),
3 => (True, Declarations, F27_3'Access),
4 => (True, Statements, F27_4'Access),
5 => (True, Exception_Handlers, F27_5'Access),
6 => (False, End_Name, F27_6'Access));
overriding procedure Package_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Body_Declarations
.Package_Body_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F27'Access;
end Package_Body_Declaration;
function F28_1 is new Generic_Vector
(Parent =>
Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Object_Renaming_Declarations.Names);
function F28_2 is new Generic_Child
(Element =>
Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Object_Renaming_Declarations.Object_Subtype);
function F28_3 is new Generic_Child
(Element =>
Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Object_Renaming_Declarations.Renamed_Object);
function F28_4 is new Generic_Vector
(Parent =>
Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Object_Renaming_Declarations.Aspects);
F28 : aliased constant Getter_Array :=
(1 => (True, Names, F28_1'Access),
2 => (False, Object_Subtype, F28_2'Access),
3 => (False, Renamed_Object, F28_3'Access),
4 => (True, Aspects, F28_4'Access));
overriding procedure Object_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F28'Access;
end Object_Renaming_Declaration;
function F29_1 is new Generic_Vector
(Parent =>
Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Exception_Renaming_Declarations.Names);
function F29_2 is new Generic_Child
(Element =>
Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Exception_Renaming_Declarations.Renamed_Exception);
function F29_3 is new Generic_Vector
(Parent =>
Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Exception_Renaming_Declarations.Aspects);
F29 : aliased constant Getter_Array :=
(1 => (True, Names, F29_1'Access),
2 => (False, Renamed_Exception, F29_2'Access),
3 => (True, Aspects, F29_3'Access));
overriding procedure Exception_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F29'Access;
end Exception_Renaming_Declaration;
function F30_1 is new Generic_Child
(Element =>
Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Procedure_Renaming_Declarations.Name);
function F30_2 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Procedure_Renaming_Declarations.Parameters);
function F30_3 is new Generic_Child
(Element =>
Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Procedure_Renaming_Declarations.Renamed_Procedure);
function F30_4 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Procedure_Renaming_Declarations.Aspects);
F30 : aliased constant Getter_Array :=
(1 => (False, Name, F30_1'Access),
2 => (True, Parameters, F30_2'Access),
3 => (False, Renamed_Procedure, F30_3'Access),
4 => (True, Aspects, F30_4'Access));
overriding procedure Procedure_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F30'Access;
end Procedure_Renaming_Declaration;
function F31_1 is new Generic_Child
(Element =>
Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Function_Renaming_Declarations.Name);
function F31_2 is new Generic_Vector
(Parent =>
Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Function_Renaming_Declarations.Parameters);
function F31_3 is new Generic_Child
(Element =>
Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Function_Renaming_Declarations.Result_Subtype);
function F31_4 is new Generic_Child
(Element =>
Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Function_Renaming_Declarations.Renamed_Function);
function F31_5 is new Generic_Vector
(Parent =>
Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Function_Renaming_Declarations.Aspects);
F31 : aliased constant Getter_Array :=
(1 => (False, Name, F31_1'Access),
2 => (True, Parameters, F31_2'Access),
3 => (False, Result_Subtype, F31_3'Access),
4 => (False, Renamed_Function, F31_4'Access),
5 => (True, Aspects, F31_5'Access));
overriding procedure Function_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F31'Access;
end Function_Renaming_Declaration;
function F32_1 is new Generic_Child
(Element =>
Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Package_Renaming_Declarations.Name);
function F32_2 is new Generic_Child
(Element =>
Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Package_Renaming_Declarations.Renamed_Package);
function F32_3 is new Generic_Vector
(Parent =>
Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Package_Renaming_Declarations.Aspects);
F32 : aliased constant Getter_Array :=
(1 => (False, Name, F32_1'Access),
2 => (False, Renamed_Package, F32_2'Access),
3 => (True, Aspects, F32_3'Access));
overriding procedure Package_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F32'Access;
end Package_Renaming_Declaration;
function F33_1 is new Generic_Child
(Element =>
Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child =>
Program.Elements.Generic_Package_Renaming_Declarations.Name);
function F33_2 is new Generic_Child
(Element =>
Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Generic_Package_Renaming_Declarations
.Renamed_Package);
function F33_3 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Package_Renaming_Declarations.Aspects);
F33 : aliased constant Getter_Array :=
(1 => (False, Name, F33_1'Access),
2 => (False, Renamed_Package, F33_2'Access),
3 => (True, Aspects, F33_3'Access));
overriding procedure Generic_Package_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F33'Access;
end Generic_Package_Renaming_Declaration;
function F34_1 is new Generic_Child
(Element =>
Program.Elements.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child =>
Program.Elements.Generic_Procedure_Renaming_Declarations.Name);
function F34_2 is new Generic_Child
(Element =>
Program.Elements.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Generic_Procedure_Renaming_Declarations
.Renamed_Procedure);
function F34_3 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Procedure_Renaming_Declarations.Aspects);
F34 : aliased constant Getter_Array :=
(1 => (False, Name, F34_1'Access),
2 => (False, Renamed_Procedure, F34_2'Access),
3 => (True, Aspects, F34_3'Access));
overriding procedure Generic_Procedure_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements
.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F34'Access;
end Generic_Procedure_Renaming_Declaration;
function F35_1 is new Generic_Child
(Element =>
Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child =>
Program.Elements.Generic_Function_Renaming_Declarations.Name);
function F35_2 is new Generic_Child
(Element =>
Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Generic_Function_Renaming_Declarations
.Renamed_Function);
function F35_3 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Function_Renaming_Declarations.Aspects);
F35 : aliased constant Getter_Array :=
(1 => (False, Name, F35_1'Access),
2 => (False, Renamed_Function, F35_2'Access),
3 => (True, Aspects, F35_3'Access));
overriding procedure Generic_Function_Renaming_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F35'Access;
end Generic_Function_Renaming_Declaration;
function F36_1 is new Generic_Child
(Element =>
Program.Elements.Task_Body_Declarations.Task_Body_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Task_Body_Declarations.Name);
function F36_2 is new Generic_Vector
(Parent =>
Program.Elements.Task_Body_Declarations.Task_Body_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Task_Body_Declarations.Aspects);
function F36_3 is new Generic_Vector
(Parent =>
Program.Elements.Task_Body_Declarations.Task_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Task_Body_Declarations.Declarations);
function F36_4 is new Generic_Vector
(Parent =>
Program.Elements.Task_Body_Declarations.Task_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Task_Body_Declarations.Statements);
function F36_5 is new Generic_Vector
(Parent =>
Program.Elements.Task_Body_Declarations.Task_Body_Declaration,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector =>
Program.Elements.Task_Body_Declarations.Exception_Handlers);
function F36_6 is new Generic_Child
(Element =>
Program.Elements.Task_Body_Declarations.Task_Body_Declaration,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Task_Body_Declarations.End_Name);
F36 : aliased constant Getter_Array :=
(1 => (False, Name, F36_1'Access),
2 => (True, Aspects, F36_2'Access),
3 => (True, Declarations, F36_3'Access),
4 => (True, Statements, F36_4'Access),
5 => (True, Exception_Handlers, F36_5'Access),
6 => (False, End_Name, F36_6'Access));
overriding procedure Task_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Task_Body_Declarations
.Task_Body_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F36'Access;
end Task_Body_Declaration;
function F37_1 is new Generic_Child
(Element =>
Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Protected_Body_Declarations.Name);
function F37_2 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Protected_Body_Declarations.Aspects);
function F37_3 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Protected_Body_Declarations.Protected_Operations);
function F37_4 is new Generic_Child
(Element =>
Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Protected_Body_Declarations.End_Name);
F37 : aliased constant Getter_Array :=
(1 => (False, Name, F37_1'Access),
2 => (True, Aspects, F37_2'Access),
3 => (True, Protected_Operations, F37_3'Access),
4 => (False, End_Name, F37_4'Access));
overriding procedure Protected_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F37'Access;
end Protected_Body_Declaration;
function F38_1 is new Generic_Child
(Element => Program.Elements.Entry_Declarations.Entry_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Entry_Declarations.Name);
function F38_2 is new Generic_Child
(Element => Program.Elements.Entry_Declarations.Entry_Declaration,
Child => Program.Elements.Discrete_Ranges.Discrete_Range,
Child_Access => Program.Elements.Discrete_Ranges.Discrete_Range_Access,
Get_Child =>
Program.Elements.Entry_Declarations.Entry_Family_Definition);
function F38_3 is new Generic_Vector
(Parent => Program.Elements.Entry_Declarations.Entry_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Entry_Declarations.Parameters);
function F38_4 is new Generic_Vector
(Parent => Program.Elements.Entry_Declarations.Entry_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Entry_Declarations.Aspects);
F38 : aliased constant Getter_Array :=
(1 => (False, Name, F38_1'Access),
2 =>
(False,
Entry_Family_Definition,
F38_2'Access),
3 => (True, Parameters, F38_3'Access),
4 => (True, Aspects, F38_4'Access));
overriding procedure Entry_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Entry_Declarations
.Entry_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F38'Access;
end Entry_Declaration;
function F39_1 is new Generic_Child
(Element =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Entry_Body_Declarations.Name);
function F39_2 is new Generic_Child
(Element =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Child =>
Program.Elements.Entry_Index_Specifications.Entry_Index_Specification,
Child_Access =>
Program.Elements.Entry_Index_Specifications
.Entry_Index_Specification_Access,
Get_Child => Program.Elements.Entry_Body_Declarations.Entry_Index);
function F39_3 is new Generic_Vector
(Parent =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Entry_Body_Declarations.Parameters);
function F39_4 is new Generic_Child
(Element =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Entry_Body_Declarations.Entry_Barrier);
function F39_5 is new Generic_Vector
(Parent =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Entry_Body_Declarations.Declarations);
function F39_6 is new Generic_Vector
(Parent =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Entry_Body_Declarations.Statements);
function F39_7 is new Generic_Vector
(Parent =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector =>
Program.Elements.Entry_Body_Declarations.Exception_Handlers);
function F39_8 is new Generic_Child
(Element =>
Program.Elements.Entry_Body_Declarations.Entry_Body_Declaration,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Entry_Body_Declarations.End_Name);
F39 : aliased constant Getter_Array :=
(1 => (False, Name, F39_1'Access),
2 => (False, Entry_Index, F39_2'Access),
3 => (True, Parameters, F39_3'Access),
4 => (False, Entry_Barrier, F39_4'Access),
5 => (True, Declarations, F39_5'Access),
6 => (True, Statements, F39_6'Access),
7 => (True, Exception_Handlers, F39_7'Access),
8 => (False, End_Name, F39_8'Access));
overriding procedure Entry_Body_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Entry_Body_Declarations
.Entry_Body_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F39'Access;
end Entry_Body_Declaration;
function F40_1 is new Generic_Child
(Element =>
Program.Elements.Entry_Index_Specifications.Entry_Index_Specification,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Entry_Index_Specifications.Name);
function F40_2 is new Generic_Child
(Element =>
Program.Elements.Entry_Index_Specifications.Entry_Index_Specification,
Child => Program.Elements.Discrete_Ranges.Discrete_Range,
Child_Access => Program.Elements.Discrete_Ranges.Discrete_Range_Access,
Get_Child =>
Program.Elements.Entry_Index_Specifications.Entry_Index_Subtype);
F40 : aliased constant Getter_Array :=
(1 => (False, Name, F40_1'Access),
2 => (False, Entry_Index_Subtype, F40_2'Access));
overriding procedure Entry_Index_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Entry_Index_Specifications
.Entry_Index_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F40'Access;
end Entry_Index_Specification;
function F41_1 is new Generic_Child
(Element =>
Program.Elements.Procedure_Body_Stubs.Procedure_Body_Stub,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Procedure_Body_Stubs.Name);
function F41_2 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Stubs.Procedure_Body_Stub,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Body_Stubs.Parameters);
function F41_3 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Body_Stubs.Procedure_Body_Stub,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Body_Stubs.Aspects);
F41 : aliased constant Getter_Array :=
(1 => (False, Name, F41_1'Access),
2 => (True, Parameters, F41_2'Access),
3 => (True, Aspects, F41_3'Access));
overriding procedure Procedure_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Body_Stubs
.Procedure_Body_Stub_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F41'Access;
end Procedure_Body_Stub;
function F42_1 is new Generic_Child
(Element => Program.Elements.Function_Body_Stubs.Function_Body_Stub,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Function_Body_Stubs.Name);
function F42_2 is new Generic_Vector
(Parent => Program.Elements.Function_Body_Stubs.Function_Body_Stub,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Body_Stubs.Parameters);
function F42_3 is new Generic_Child
(Element => Program.Elements.Function_Body_Stubs.Function_Body_Stub,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child => Program.Elements.Function_Body_Stubs.Result_Subtype);
function F42_4 is new Generic_Vector
(Parent => Program.Elements.Function_Body_Stubs.Function_Body_Stub,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Body_Stubs.Aspects);
F42 : aliased constant Getter_Array :=
(1 => (False, Name, F42_1'Access),
2 => (True, Parameters, F42_2'Access),
3 => (False, Result_Subtype, F42_3'Access),
4 => (True, Aspects, F42_4'Access));
overriding procedure Function_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Function_Body_Stubs
.Function_Body_Stub_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F42'Access;
end Function_Body_Stub;
function F43_1 is new Generic_Child
(Element => Program.Elements.Package_Body_Stubs.Package_Body_Stub,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Package_Body_Stubs.Name);
function F43_2 is new Generic_Vector
(Parent => Program.Elements.Package_Body_Stubs.Package_Body_Stub,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Package_Body_Stubs.Aspects);
F43 : aliased constant Getter_Array :=
(1 => (False, Name, F43_1'Access),
2 => (True, Aspects, F43_2'Access));
overriding procedure Package_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Package_Body_Stubs
.Package_Body_Stub_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F43'Access;
end Package_Body_Stub;
function F44_1 is new Generic_Child
(Element => Program.Elements.Task_Body_Stubs.Task_Body_Stub,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Task_Body_Stubs.Name);
function F44_2 is new Generic_Vector
(Parent => Program.Elements.Task_Body_Stubs.Task_Body_Stub,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Task_Body_Stubs.Aspects);
F44 : aliased constant Getter_Array :=
(1 => (False, Name, F44_1'Access),
2 => (True, Aspects, F44_2'Access));
overriding procedure Task_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Task_Body_Stubs
.Task_Body_Stub_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F44'Access;
end Task_Body_Stub;
function F45_1 is new Generic_Child
(Element =>
Program.Elements.Protected_Body_Stubs.Protected_Body_Stub,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Protected_Body_Stubs.Name);
function F45_2 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Body_Stubs.Protected_Body_Stub,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Protected_Body_Stubs.Aspects);
F45 : aliased constant Getter_Array :=
(1 => (False, Name, F45_1'Access),
2 => (True, Aspects, F45_2'Access));
overriding procedure Protected_Body_Stub
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Body_Stubs
.Protected_Body_Stub_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F45'Access;
end Protected_Body_Stub;
function F46_1 is new Generic_Vector
(Parent =>
Program.Elements.Exception_Declarations.Exception_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Exception_Declarations.Names);
function F46_2 is new Generic_Vector
(Parent =>
Program.Elements.Exception_Declarations.Exception_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Exception_Declarations.Aspects);
F46 : aliased constant Getter_Array :=
(1 => (True, Names, F46_1'Access),
2 => (True, Aspects, F46_2'Access));
overriding procedure Exception_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Declarations
.Exception_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F46'Access;
end Exception_Declaration;
function F47_1 is new Generic_Child
(Element =>
Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Choice_Parameter_Specifications.Name);
F47 : aliased constant Getter_Array :=
(1 => (False, Name, F47_1'Access));
overriding procedure Choice_Parameter_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F47'Access;
end Choice_Parameter_Specification;
function F48_1 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Package_Declarations.Formal_Parameters);
function F48_2 is new Generic_Child
(Element =>
Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Generic_Package_Declarations.Name);
function F48_3 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Generic_Package_Declarations.Aspects);
function F48_4 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Package_Declarations.Visible_Declarations);
function F48_5 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Package_Declarations.Private_Declarations);
function F48_6 is new Generic_Child
(Element =>
Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Generic_Package_Declarations.End_Name);
F48 : aliased constant Getter_Array :=
(1 => (True, Formal_Parameters, F48_1'Access),
2 => (False, Name, F48_2'Access),
3 => (True, Aspects, F48_3'Access),
4 => (True, Visible_Declarations, F48_4'Access),
5 => (True, Private_Declarations, F48_5'Access),
6 => (False, End_Name, F48_6'Access));
overriding procedure Generic_Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F48'Access;
end Generic_Package_Declaration;
function F49_1 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Procedure_Declarations.Formal_Parameters);
function F49_2 is new Generic_Child
(Element =>
Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Generic_Procedure_Declarations.Name);
function F49_3 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Procedure_Declarations.Parameters);
function F49_4 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Procedure_Declarations.Aspects);
F49 : aliased constant Getter_Array :=
(1 => (True, Formal_Parameters, F49_1'Access),
2 => (False, Name, F49_2'Access),
3 => (True, Parameters, F49_3'Access),
4 => (True, Aspects, F49_4'Access));
overriding procedure Generic_Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F49'Access;
end Generic_Procedure_Declaration;
function F50_1 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Function_Declarations.Formal_Parameters);
function F50_2 is new Generic_Child
(Element =>
Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Generic_Function_Declarations.Name);
function F50_3 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Generic_Function_Declarations.Parameters);
function F50_4 is new Generic_Child
(Element =>
Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Generic_Function_Declarations.Result_Subtype);
function F50_5 is new Generic_Vector
(Parent =>
Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Generic_Function_Declarations.Aspects);
F50 : aliased constant Getter_Array :=
(1 => (True, Formal_Parameters, F50_1'Access),
2 => (False, Name, F50_2'Access),
3 => (True, Parameters, F50_3'Access),
4 => (False, Result_Subtype, F50_4'Access),
5 => (True, Aspects, F50_5'Access));
overriding procedure Generic_Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F50'Access;
end Generic_Function_Declaration;
function F51_1 is new Generic_Child
(Element =>
Program.Elements.Package_Instantiations.Package_Instantiation,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Package_Instantiations.Name);
function F51_2 is new Generic_Child
(Element =>
Program.Elements.Package_Instantiations.Package_Instantiation,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Package_Instantiations.Generic_Package_Name);
function F51_3 is new Generic_Vector
(Parent =>
Program.Elements.Package_Instantiations.Package_Instantiation,
Vector =>
Program.Elements.Parameter_Associations.Parameter_Association_Vector,
Vector_Access =>
Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access,
Get_Vector => Program.Elements.Package_Instantiations.Parameters);
function F51_4 is new Generic_Vector
(Parent =>
Program.Elements.Package_Instantiations.Package_Instantiation,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Package_Instantiations.Aspects);
F51 : aliased constant Getter_Array :=
(1 => (False, Name, F51_1'Access),
2 => (False, Generic_Package_Name, F51_2'Access),
3 => (True, Parameters, F51_3'Access),
4 => (True, Aspects, F51_4'Access));
overriding procedure Package_Instantiation
(Self : in out Visitor;
Element : not null Program.Elements.Package_Instantiations
.Package_Instantiation_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F51'Access;
end Package_Instantiation;
function F52_1 is new Generic_Child
(Element =>
Program.Elements.Procedure_Instantiations.Procedure_Instantiation,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Procedure_Instantiations.Name);
function F52_2 is new Generic_Child
(Element =>
Program.Elements.Procedure_Instantiations.Procedure_Instantiation,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Procedure_Instantiations.Generic_Procedure_Name);
function F52_3 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Instantiations.Procedure_Instantiation,
Vector =>
Program.Elements.Parameter_Associations.Parameter_Association_Vector,
Vector_Access =>
Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access,
Get_Vector => Program.Elements.Procedure_Instantiations.Parameters);
function F52_4 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Instantiations.Procedure_Instantiation,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Instantiations.Aspects);
F52 : aliased constant Getter_Array :=
(1 => (False, Name, F52_1'Access),
2 =>
(False,
Generic_Procedure_Name,
F52_2'Access),
3 => (True, Parameters, F52_3'Access),
4 => (True, Aspects, F52_4'Access));
overriding procedure Procedure_Instantiation
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Instantiations
.Procedure_Instantiation_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F52'Access;
end Procedure_Instantiation;
function F53_1 is new Generic_Child
(Element =>
Program.Elements.Function_Instantiations.Function_Instantiation,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Function_Instantiations.Name);
function F53_2 is new Generic_Child
(Element =>
Program.Elements.Function_Instantiations.Function_Instantiation,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Function_Instantiations.Generic_Function_Name);
function F53_3 is new Generic_Vector
(Parent =>
Program.Elements.Function_Instantiations.Function_Instantiation,
Vector =>
Program.Elements.Parameter_Associations.Parameter_Association_Vector,
Vector_Access =>
Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access,
Get_Vector => Program.Elements.Function_Instantiations.Parameters);
function F53_4 is new Generic_Vector
(Parent =>
Program.Elements.Function_Instantiations.Function_Instantiation,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Instantiations.Aspects);
F53 : aliased constant Getter_Array :=
(1 => (False, Name, F53_1'Access),
2 =>
(False, Generic_Function_Name, F53_2'Access),
3 => (True, Parameters, F53_3'Access),
4 => (True, Aspects, F53_4'Access));
overriding procedure Function_Instantiation
(Self : in out Visitor;
Element : not null Program.Elements.Function_Instantiations
.Function_Instantiation_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F53'Access;
end Function_Instantiation;
function F54_1 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Object_Declarations.Formal_Object_Declaration,
Vector =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Vector,
Vector_Access =>
Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access,
Get_Vector => Program.Elements.Formal_Object_Declarations.Names);
function F54_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Object_Declarations.Formal_Object_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Formal_Object_Declarations.Object_Subtype);
function F54_3 is new Generic_Child
(Element =>
Program.Elements.Formal_Object_Declarations.Formal_Object_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Object_Declarations.Default_Expression);
function F54_4 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Object_Declarations.Formal_Object_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Formal_Object_Declarations.Aspects);
F54 : aliased constant Getter_Array :=
(1 => (True, Names, F54_1'Access),
2 => (False, Object_Subtype, F54_2'Access),
3 => (False, Default_Expression, F54_3'Access),
4 => (True, Aspects, F54_4'Access));
overriding procedure Formal_Object_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Object_Declarations
.Formal_Object_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F54'Access;
end Formal_Object_Declaration;
function F55_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Formal_Type_Declarations.Name);
function F55_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration,
Child => Program.Elements.Definitions.Definition,
Child_Access => Program.Elements.Definitions.Definition_Access,
Get_Child =>
Program.Elements.Formal_Type_Declarations.Discriminant_Part);
function F55_3 is new Generic_Child
(Element =>
Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration,
Child =>
Program.Elements.Formal_Type_Definitions.Formal_Type_Definition,
Child_Access =>
Program.Elements.Formal_Type_Definitions.Formal_Type_Definition_Access,
Get_Child => Program.Elements.Formal_Type_Declarations.Definition);
function F55_4 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Type_Declarations.Formal_Type_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Formal_Type_Declarations.Aspects);
F55 : aliased constant Getter_Array :=
(1 => (False, Name, F55_1'Access),
2 => (False, Discriminant_Part, F55_2'Access),
3 => (False, Definition, F55_3'Access),
4 => (True, Aspects, F55_4'Access));
overriding procedure Formal_Type_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F55'Access;
end Formal_Type_Declaration;
function F56_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Formal_Procedure_Declarations.Name);
function F56_2 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Procedure_Declarations.Parameters);
function F56_3 is new Generic_Child
(Element =>
Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Procedure_Declarations.Subprogram_Default);
function F56_4 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Formal_Procedure_Declarations.Aspects);
F56 : aliased constant Getter_Array :=
(1 => (False, Name, F56_1'Access),
2 => (True, Parameters, F56_2'Access),
3 => (False, Subprogram_Default, F56_3'Access),
4 => (True, Aspects, F56_4'Access));
overriding procedure Formal_Procedure_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F56'Access;
end Formal_Procedure_Declaration;
function F57_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration,
Child => Program.Elements.Defining_Names.Defining_Name,
Child_Access => Program.Elements.Defining_Names.Defining_Name_Access,
Get_Child => Program.Elements.Formal_Function_Declarations.Name);
function F57_2 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Function_Declarations.Parameters);
function F57_3 is new Generic_Child
(Element =>
Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Formal_Function_Declarations.Result_Subtype);
function F57_4 is new Generic_Child
(Element =>
Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Function_Declarations.Subprogram_Default);
function F57_5 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Formal_Function_Declarations.Aspects);
F57 : aliased constant Getter_Array :=
(1 => (False, Name, F57_1'Access),
2 => (True, Parameters, F57_2'Access),
3 => (False, Result_Subtype, F57_3'Access),
4 => (False, Subprogram_Default, F57_4'Access),
5 => (True, Aspects, F57_5'Access));
overriding procedure Formal_Function_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F57'Access;
end Formal_Function_Declaration;
function F58_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Formal_Package_Declarations.Name);
function F58_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Package_Declarations.Generic_Package_Name);
function F58_3 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration,
Vector =>
Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Vector,
Vector_Access =>
Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Package_Declarations.Parameters);
function F58_4 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration,
Vector =>
Program.Elements.Aspect_Specifications.Aspect_Specification_Vector,
Vector_Access =>
Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access,
Get_Vector => Program.Elements.Formal_Package_Declarations.Aspects);
F58 : aliased constant Getter_Array :=
(1 => (False, Name, F58_1'Access),
2 => (False, Generic_Package_Name, F58_2'Access),
3 => (True, Parameters, F58_3'Access),
4 => (True, Aspects, F58_4'Access));
overriding procedure Formal_Package_Declaration
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F58'Access;
end Formal_Package_Declaration;
function F59_1 is new Generic_Child
(Element => Program.Elements.Subtype_Indications.Subtype_Indication,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Subtype_Indications.Subtype_Mark);
function F59_2 is new Generic_Child
(Element => Program.Elements.Subtype_Indications.Subtype_Indication,
Child => Program.Elements.Constraints.Constraint,
Child_Access => Program.Elements.Constraints.Constraint_Access,
Get_Child => Program.Elements.Subtype_Indications.Constraint);
F59 : aliased constant Getter_Array :=
(1 => (False, Subtype_Mark, F59_1'Access),
2 => (False, Constraint, F59_2'Access));
overriding procedure Subtype_Indication
(Self : in out Visitor;
Element : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F59'Access;
end Subtype_Indication;
function F60_1 is new Generic_Child
(Element =>
Program.Elements.Component_Definitions.Component_Definition,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Component_Definitions.Subtype_Indication);
F60 : aliased constant Getter_Array :=
(1 => (False, Subtype_Indication, F60_1'Access));
overriding procedure Component_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Component_Definitions
.Component_Definition_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F60'Access;
end Component_Definition;
function F61_1 is new Generic_Child
(Element =>
Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Discrete_Subtype_Indications.Subtype_Mark);
function F61_2 is new Generic_Child
(Element =>
Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication,
Child => Program.Elements.Constraints.Constraint,
Child_Access => Program.Elements.Constraints.Constraint_Access,
Get_Child =>
Program.Elements.Discrete_Subtype_Indications.Constraint);
F61 : aliased constant Getter_Array :=
(1 => (False, Subtype_Mark, F61_1'Access),
2 => (False, Constraint, F61_2'Access));
overriding procedure Discrete_Subtype_Indication
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F61'Access;
end Discrete_Subtype_Indication;
function F62_1 is new Generic_Child
(Element =>
Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference,
Child =>
Program.Elements.Attribute_References.Attribute_Reference,
Child_Access =>
Program.Elements.Attribute_References.Attribute_Reference_Access,
Get_Child =>
Program.Elements.Discrete_Range_Attribute_References.Range_Attribute);
F62 : aliased constant Getter_Array :=
(1 => (False, Range_Attribute, F62_1'Access));
overriding procedure Discrete_Range_Attribute_Reference
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F62'Access;
end Discrete_Range_Attribute_Reference;
function F63_1 is new Generic_Child
(Element =>
Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Discrete_Simple_Expression_Ranges.Lower_Bound);
function F63_2 is new Generic_Child
(Element =>
Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Discrete_Simple_Expression_Ranges.Upper_Bound);
F63 : aliased constant Getter_Array :=
(1 => (False, Lower_Bound, F63_1'Access),
2 => (False, Upper_Bound, F63_2'Access));
overriding procedure Discrete_Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F63'Access;
end Discrete_Simple_Expression_Range;
function F65_1 is new Generic_Vector
(Parent =>
Program.Elements.Known_Discriminant_Parts.Known_Discriminant_Part,
Vector =>
Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Vector,
Vector_Access =>
Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Known_Discriminant_Parts.Discriminants);
F65 : aliased constant Getter_Array :=
(1 => (True, Discriminants, F65_1'Access));
overriding procedure Known_Discriminant_Part
(Self : in out Visitor;
Element : not null Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F65'Access;
end Known_Discriminant_Part;
function F66_1 is new Generic_Vector
(Parent => Program.Elements.Record_Definitions.Record_Definition,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Record_Definitions.Components);
F66 : aliased constant Getter_Array :=
(1 => (True, Components, F66_1'Access));
overriding procedure Record_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Record_Definitions
.Record_Definition_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F66'Access;
end Record_Definition;
function F68_1 is new Generic_Child
(Element => Program.Elements.Variant_Parts.Variant_Part,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Variant_Parts.Discriminant);
function F68_2 is new Generic_Vector
(Parent => Program.Elements.Variant_Parts.Variant_Part,
Vector => Program.Elements.Variants.Variant_Vector,
Vector_Access => Program.Elements.Variants.Variant_Vector_Access,
Get_Vector => Program.Elements.Variant_Parts.Variants);
F68 : aliased constant Getter_Array :=
(1 => (False, Discriminant, F68_1'Access),
2 => (True, Variants, F68_2'Access));
overriding procedure Variant_Part
(Self : in out Visitor;
Element : not null Program.Elements.Variant_Parts.Variant_Part_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F68'Access;
end Variant_Part;
function F69_1 is new Generic_Vector
(Parent => Program.Elements.Variants.Variant,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Variants.Choices);
function F69_2 is new Generic_Vector
(Parent => Program.Elements.Variants.Variant,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Variants.Components);
F69 : aliased constant Getter_Array :=
(1 => (True, Choices, F69_1'Access),
2 => (True, Components, F69_2'Access));
overriding procedure Variant
(Self : in out Visitor;
Element : not null Program.Elements.Variants.Variant_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F69'Access;
end Variant;
function F71_1 is new Generic_Child
(Element =>
Program.Elements.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child =>
Program.Elements.Anonymous_Access_To_Objects.Subtype_Indication);
F71 : aliased constant Getter_Array :=
(1 => (False, Subtype_Indication, F71_1'Access));
overriding procedure Anonymous_Access_To_Object
(Self : in out Visitor;
Element : not null Program.Elements.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F71'Access;
end Anonymous_Access_To_Object;
function F72_1 is new Generic_Vector
(Parent =>
Program.Elements.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Anonymous_Access_To_Procedures.Parameters);
F72 : aliased constant Getter_Array :=
(1 => (True, Parameters, F72_1'Access));
overriding procedure Anonymous_Access_To_Procedure
(Self : in out Visitor;
Element : not null Program.Elements.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F72'Access;
end Anonymous_Access_To_Procedure;
function F73_1 is new Generic_Vector
(Parent =>
Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Anonymous_Access_To_Functions.Parameters);
function F73_2 is new Generic_Child
(Element =>
Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Anonymous_Access_To_Functions.Result_Subtype);
F73 : aliased constant Getter_Array :=
(1 => (True, Parameters, F73_1'Access),
2 => (False, Result_Subtype, F73_2'Access));
overriding procedure Anonymous_Access_To_Function
(Self : in out Visitor;
Element : not null Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F73'Access;
end Anonymous_Access_To_Function;
function F75_1 is new Generic_Child
(Element =>
Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child => Program.Elements.Private_Extension_Definitions.Ancestor);
function F75_2 is new Generic_Vector
(Parent =>
Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector =>
Program.Elements.Private_Extension_Definitions.Progenitors);
F75 : aliased constant Getter_Array :=
(1 => (False, Ancestor, F75_1'Access),
2 => (True, Progenitors, F75_2'Access));
overriding procedure Private_Extension_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F75'Access;
end Private_Extension_Definition;
function F77_1 is new Generic_Vector
(Parent => Program.Elements.Task_Definitions.Task_Definition,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Task_Definitions.Visible_Declarations);
function F77_2 is new Generic_Vector
(Parent => Program.Elements.Task_Definitions.Task_Definition,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Task_Definitions.Private_Declarations);
function F77_3 is new Generic_Child
(Element => Program.Elements.Task_Definitions.Task_Definition,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Task_Definitions.End_Name);
F77 : aliased constant Getter_Array :=
(1 => (True, Visible_Declarations, F77_1'Access),
2 => (True, Private_Declarations, F77_2'Access),
3 => (False, End_Name, F77_3'Access));
overriding procedure Task_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Task_Definitions
.Task_Definition_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F77'Access;
end Task_Definition;
function F78_1 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Definitions.Protected_Definition,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Protected_Definitions.Visible_Declarations);
function F78_2 is new Generic_Vector
(Parent =>
Program.Elements.Protected_Definitions.Protected_Definition,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Protected_Definitions.Private_Declarations);
function F78_3 is new Generic_Child
(Element =>
Program.Elements.Protected_Definitions.Protected_Definition,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Protected_Definitions.End_Name);
F78 : aliased constant Getter_Array :=
(1 => (True, Visible_Declarations, F78_1'Access),
2 => (True, Private_Declarations, F78_2'Access),
3 => (False, End_Name, F78_3'Access));
overriding procedure Protected_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F78'Access;
end Protected_Definition;
function F79_1 is new Generic_Child
(Element =>
Program.Elements.Aspect_Specifications.Aspect_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Aspect_Specifications.Aspect_Mark);
function F79_2 is new Generic_Child
(Element =>
Program.Elements.Aspect_Specifications.Aspect_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Aspect_Specifications.Aspect_Definition);
F79 : aliased constant Getter_Array :=
(1 => (False, Aspect_Mark, F79_1'Access),
2 => (False, Aspect_Definition, F79_2'Access));
overriding procedure Aspect_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Aspect_Specifications
.Aspect_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F79'Access;
end Aspect_Specification;
function F80_1 is new Generic_Child
(Element =>
Program.Elements.Real_Range_Specifications.Real_Range_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Real_Range_Specifications.Lower_Bound);
function F80_2 is new Generic_Child
(Element =>
Program.Elements.Real_Range_Specifications.Real_Range_Specification,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Real_Range_Specifications.Upper_Bound);
F80 : aliased constant Getter_Array :=
(1 => (False, Lower_Bound, F80_1'Access),
2 => (False, Upper_Bound, F80_2'Access));
overriding procedure Real_Range_Specification
(Self : in out Visitor;
Element : not null Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F80'Access;
end Real_Range_Specification;
function F86_1 is new Generic_Child
(Element =>
Program.Elements.Explicit_Dereferences.Explicit_Dereference,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Explicit_Dereferences.Prefix);
F86 : aliased constant Getter_Array :=
(1 => (False, Prefix, F86_1'Access));
overriding procedure Explicit_Dereference
(Self : in out Visitor;
Element : not null Program.Elements.Explicit_Dereferences
.Explicit_Dereference_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F86'Access;
end Explicit_Dereference;
function F87_1 is new Generic_Child
(Element => Program.Elements.Infix_Operators.Infix_Operator,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Infix_Operators.Left);
function F87_2 is new Generic_Child
(Element => Program.Elements.Infix_Operators.Infix_Operator,
Child => Program.Elements.Operator_Symbols.Operator_Symbol,
Child_Access => Program.Elements.Operator_Symbols.Operator_Symbol_Access,
Get_Child => Program.Elements.Infix_Operators.Operator);
function F87_3 is new Generic_Child
(Element => Program.Elements.Infix_Operators.Infix_Operator,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Infix_Operators.Right);
F87 : aliased constant Getter_Array :=
(1 => (False, Left, F87_1'Access),
2 => (False, Operator, F87_2'Access),
3 => (False, Right, F87_3'Access));
overriding procedure Infix_Operator
(Self : in out Visitor;
Element : not null Program.Elements.Infix_Operators
.Infix_Operator_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F87'Access;
end Infix_Operator;
function F88_1 is new Generic_Child
(Element => Program.Elements.Function_Calls.Function_Call,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Function_Calls.Prefix);
function F88_2 is new Generic_Vector
(Parent => Program.Elements.Function_Calls.Function_Call,
Vector =>
Program.Elements.Parameter_Associations.Parameter_Association_Vector,
Vector_Access =>
Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access,
Get_Vector => Program.Elements.Function_Calls.Parameters);
F88 : aliased constant Getter_Array :=
(1 => (False, Prefix, F88_1'Access),
2 => (True, Parameters, F88_2'Access));
overriding procedure Function_Call
(Self : in out Visitor;
Element : not null Program.Elements.Function_Calls
.Function_Call_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F88'Access;
end Function_Call;
function F89_1 is new Generic_Child
(Element => Program.Elements.Indexed_Components.Indexed_Component,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Indexed_Components.Prefix);
function F89_2 is new Generic_Vector
(Parent => Program.Elements.Indexed_Components.Indexed_Component,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Indexed_Components.Expressions);
F89 : aliased constant Getter_Array :=
(1 => (False, Prefix, F89_1'Access),
2 => (True, Expressions, F89_2'Access));
overriding procedure Indexed_Component
(Self : in out Visitor;
Element : not null Program.Elements.Indexed_Components
.Indexed_Component_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F89'Access;
end Indexed_Component;
function F90_1 is new Generic_Child
(Element => Program.Elements.Slices.Slice,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Slices.Prefix);
function F90_2 is new Generic_Child
(Element => Program.Elements.Slices.Slice,
Child => Program.Elements.Discrete_Ranges.Discrete_Range,
Child_Access => Program.Elements.Discrete_Ranges.Discrete_Range_Access,
Get_Child => Program.Elements.Slices.Slice_Range);
F90 : aliased constant Getter_Array :=
(1 => (False, Prefix, F90_1'Access),
2 => (False, Slice_Range, F90_2'Access));
overriding procedure Slice
(Self : in out Visitor;
Element : not null Program.Elements.Slices.Slice_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F90'Access;
end Slice;
function F91_1 is new Generic_Child
(Element => Program.Elements.Selected_Components.Selected_Component,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Selected_Components.Prefix);
function F91_2 is new Generic_Child
(Element => Program.Elements.Selected_Components.Selected_Component,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Selected_Components.Selector);
F91 : aliased constant Getter_Array :=
(1 => (False, Prefix, F91_1'Access),
2 => (False, Selector, F91_2'Access));
overriding procedure Selected_Component
(Self : in out Visitor;
Element : not null Program.Elements.Selected_Components
.Selected_Component_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F91'Access;
end Selected_Component;
function F92_1 is new Generic_Child
(Element =>
Program.Elements.Attribute_References.Attribute_Reference,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Attribute_References.Prefix);
function F92_2 is new Generic_Child
(Element =>
Program.Elements.Attribute_References.Attribute_Reference,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child =>
Program.Elements.Attribute_References.Attribute_Designator);
function F92_3 is new Generic_Child
(Element =>
Program.Elements.Attribute_References.Attribute_Reference,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Attribute_References.Expressions);
F92 : aliased constant Getter_Array :=
(1 => (False, Prefix, F92_1'Access),
2 => (False, Attribute_Designator, F92_2'Access),
3 => (False, Expressions, F92_3'Access));
overriding procedure Attribute_Reference
(Self : in out Visitor;
Element : not null Program.Elements.Attribute_References
.Attribute_Reference_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F92'Access;
end Attribute_Reference;
function F93_1 is new Generic_Vector
(Parent => Program.Elements.Record_Aggregates.Record_Aggregate,
Vector =>
Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector,
Vector_Access =>
Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector_Access,
Get_Vector => Program.Elements.Record_Aggregates.Components);
F93 : aliased constant Getter_Array :=
(1 => (True, Components, F93_1'Access));
overriding procedure Record_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F93'Access;
end Record_Aggregate;
function F94_1 is new Generic_Child
(Element =>
Program.Elements.Extension_Aggregates.Extension_Aggregate,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Extension_Aggregates.Ancestor);
function F94_2 is new Generic_Vector
(Parent =>
Program.Elements.Extension_Aggregates.Extension_Aggregate,
Vector =>
Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector,
Vector_Access =>
Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector_Access,
Get_Vector => Program.Elements.Extension_Aggregates.Components);
F94 : aliased constant Getter_Array :=
(1 => (False, Ancestor, F94_1'Access),
2 => (True, Components, F94_2'Access));
overriding procedure Extension_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Extension_Aggregates
.Extension_Aggregate_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F94'Access;
end Extension_Aggregate;
function F95_1 is new Generic_Vector
(Parent => Program.Elements.Array_Aggregates.Array_Aggregate,
Vector =>
Program.Elements.Array_Component_Associations
.Array_Component_Association_Vector,
Vector_Access =>
Program.Elements.Array_Component_Associations
.Array_Component_Association_Vector_Access,
Get_Vector => Program.Elements.Array_Aggregates.Components);
F95 : aliased constant Getter_Array :=
(1 => (True, Components, F95_1'Access));
overriding procedure Array_Aggregate
(Self : in out Visitor;
Element : not null Program.Elements.Array_Aggregates
.Array_Aggregate_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F95'Access;
end Array_Aggregate;
function F96_1 is new Generic_Child
(Element =>
Program.Elements.Short_Circuit_Operations.Short_Circuit_Operation,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Short_Circuit_Operations.Left);
function F96_2 is new Generic_Child
(Element =>
Program.Elements.Short_Circuit_Operations.Short_Circuit_Operation,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Short_Circuit_Operations.Right);
F96 : aliased constant Getter_Array :=
(1 => (False, Left, F96_1'Access),
2 => (False, Right, F96_2'Access));
overriding procedure Short_Circuit_Operation
(Self : in out Visitor;
Element : not null Program.Elements.Short_Circuit_Operations
.Short_Circuit_Operation_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F96'Access;
end Short_Circuit_Operation;
function F97_1 is new Generic_Child
(Element => Program.Elements.Membership_Tests.Membership_Test,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Membership_Tests.Expression);
function F97_2 is new Generic_Vector
(Parent => Program.Elements.Membership_Tests.Membership_Test,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Membership_Tests.Choices);
F97 : aliased constant Getter_Array :=
(1 => (False, Expression, F97_1'Access),
2 => (True, Choices, F97_2'Access));
overriding procedure Membership_Test
(Self : in out Visitor;
Element : not null Program.Elements.Membership_Tests
.Membership_Test_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F97'Access;
end Membership_Test;
function F99_1 is new Generic_Child
(Element =>
Program.Elements.Parenthesized_Expressions.Parenthesized_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Parenthesized_Expressions.Expression);
F99 : aliased constant Getter_Array :=
(1 => (False, Expression, F99_1'Access));
overriding procedure Parenthesized_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F99'Access;
end Parenthesized_Expression;
function F100_1 is new Generic_Child
(Element => Program.Elements.Raise_Expressions.Raise_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Raise_Expressions.Exception_Name);
function F100_2 is new Generic_Child
(Element => Program.Elements.Raise_Expressions.Raise_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Raise_Expressions.Associated_Message);
F100 : aliased constant Getter_Array :=
(1 => (False, Exception_Name, F100_1'Access),
2 => (False, Associated_Message, F100_2'Access));
overriding procedure Raise_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Raise_Expressions
.Raise_Expression_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F100'Access;
end Raise_Expression;
function F101_1 is new Generic_Child
(Element => Program.Elements.Type_Conversions.Type_Conversion,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Type_Conversions.Subtype_Mark);
function F101_2 is new Generic_Child
(Element => Program.Elements.Type_Conversions.Type_Conversion,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Type_Conversions.Operand);
F101 : aliased constant Getter_Array :=
(1 => (False, Subtype_Mark, F101_1'Access),
2 => (False, Operand, F101_2'Access));
overriding procedure Type_Conversion
(Self : in out Visitor;
Element : not null Program.Elements.Type_Conversions
.Type_Conversion_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F101'Access;
end Type_Conversion;
function F102_1 is new Generic_Child
(Element =>
Program.Elements.Qualified_Expressions.Qualified_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Qualified_Expressions.Subtype_Mark);
function F102_2 is new Generic_Child
(Element =>
Program.Elements.Qualified_Expressions.Qualified_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Qualified_Expressions.Operand);
F102 : aliased constant Getter_Array :=
(1 => (False, Subtype_Mark, F102_1'Access),
2 => (False, Operand, F102_2'Access));
overriding procedure Qualified_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Qualified_Expressions
.Qualified_Expression_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F102'Access;
end Qualified_Expression;
function F103_1 is new Generic_Child
(Element => Program.Elements.Allocators.Allocator,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Allocators.Subpool_Name);
function F103_2 is new Generic_Child
(Element => Program.Elements.Allocators.Allocator,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child => Program.Elements.Allocators.Subtype_Indication);
function F103_3 is new Generic_Child
(Element => Program.Elements.Allocators.Allocator,
Child =>
Program.Elements.Qualified_Expressions.Qualified_Expression,
Child_Access =>
Program.Elements.Qualified_Expressions.Qualified_Expression_Access,
Get_Child => Program.Elements.Allocators.Qualified_Expression);
F103 : aliased constant Getter_Array :=
(1 => (False, Subpool_Name, F103_1'Access),
2 => (False, Subtype_Indication, F103_2'Access),
3 => (False, Qualified_Expression, F103_3'Access));
overriding procedure Allocator
(Self : in out Visitor;
Element : not null Program.Elements.Allocators.Allocator_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F103'Access;
end Allocator;
function F104_1 is new Generic_Child
(Element => Program.Elements.Case_Expressions.Case_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Case_Expressions.Selecting_Expression);
function F104_2 is new Generic_Vector
(Parent => Program.Elements.Case_Expressions.Case_Expression,
Vector =>
Program.Elements.Case_Expression_Paths.Case_Expression_Path_Vector,
Vector_Access =>
Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Vector_Access,
Get_Vector => Program.Elements.Case_Expressions.Paths);
F104 : aliased constant Getter_Array :=
(1 => (False, Selecting_Expression, F104_1'Access),
2 => (True, Paths, F104_2'Access));
overriding procedure Case_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Case_Expressions
.Case_Expression_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F104'Access;
end Case_Expression;
function F105_1 is new Generic_Child
(Element => Program.Elements.If_Expressions.If_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.If_Expressions.Condition);
function F105_2 is new Generic_Child
(Element => Program.Elements.If_Expressions.If_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.If_Expressions.Then_Expression);
function F105_3 is new Generic_Vector
(Parent => Program.Elements.If_Expressions.If_Expression,
Vector => Program.Elements.Elsif_Paths.Elsif_Path_Vector,
Vector_Access => Program.Elements.Elsif_Paths.Elsif_Path_Vector_Access,
Get_Vector => Program.Elements.If_Expressions.Elsif_Paths);
function F105_4 is new Generic_Child
(Element => Program.Elements.If_Expressions.If_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.If_Expressions.Else_Expression);
F105 : aliased constant Getter_Array :=
(1 => (False, Condition, F105_1'Access),
2 => (False, Then_Expression, F105_2'Access),
3 => (True, Elsif_Paths, F105_3'Access),
4 => (False, Else_Expression, F105_4'Access));
overriding procedure If_Expression
(Self : in out Visitor;
Element : not null Program.Elements.If_Expressions
.If_Expression_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F105'Access;
end If_Expression;
function F106_1 is new Generic_Child
(Element =>
Program.Elements.Quantified_Expressions.Quantified_Expression,
Child =>
Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification,
Child_Access =>
Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access,
Get_Child => Program.Elements.Quantified_Expressions.Parameter);
function F106_2 is new Generic_Child
(Element =>
Program.Elements.Quantified_Expressions.Quantified_Expression,
Child =>
Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification,
Child_Access =>
Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access,
Get_Child =>
Program.Elements.Quantified_Expressions.Generalized_Iterator);
function F106_3 is new Generic_Child
(Element =>
Program.Elements.Quantified_Expressions.Quantified_Expression,
Child =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification,
Child_Access =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access,
Get_Child =>
Program.Elements.Quantified_Expressions.Element_Iterator);
function F106_4 is new Generic_Child
(Element =>
Program.Elements.Quantified_Expressions.Quantified_Expression,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Quantified_Expressions.Predicate);
F106 : aliased constant Getter_Array :=
(1 => (False, Parameter, F106_1'Access),
2 => (False, Generalized_Iterator, F106_2'Access),
3 => (False, Element_Iterator, F106_3'Access),
4 => (False, Predicate, F106_4'Access));
overriding procedure Quantified_Expression
(Self : in out Visitor;
Element : not null Program.Elements.Quantified_Expressions
.Quantified_Expression_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F106'Access;
end Quantified_Expression;
function F107_1 is new Generic_Vector
(Parent =>
Program.Elements.Discriminant_Associations.Discriminant_Association,
Vector => Program.Elements.Identifiers.Identifier_Vector,
Vector_Access => Program.Elements.Identifiers.Identifier_Vector_Access,
Get_Vector =>
Program.Elements.Discriminant_Associations.Selector_Names);
function F107_2 is new Generic_Child
(Element =>
Program.Elements.Discriminant_Associations.Discriminant_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Discriminant_Associations.Expression);
F107 : aliased constant Getter_Array :=
(1 => (True, Selector_Names, F107_1'Access),
2 => (False, Expression, F107_2'Access));
overriding procedure Discriminant_Association
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Associations
.Discriminant_Association_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F107'Access;
end Discriminant_Association;
function F108_1 is new Generic_Vector
(Parent =>
Program.Elements.Record_Component_Associations
.Record_Component_Association,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Record_Component_Associations.Choices);
function F108_2 is new Generic_Child
(Element =>
Program.Elements.Record_Component_Associations
.Record_Component_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Record_Component_Associations.Expression);
F108 : aliased constant Getter_Array :=
(1 => (True, Choices, F108_1'Access),
2 => (False, Expression, F108_2'Access));
overriding procedure Record_Component_Association
(Self : in out Visitor;
Element : not null Program.Elements.Record_Component_Associations
.Record_Component_Association_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F108'Access;
end Record_Component_Association;
function F109_1 is new Generic_Vector
(Parent =>
Program.Elements.Array_Component_Associations
.Array_Component_Association,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Array_Component_Associations.Choices);
function F109_2 is new Generic_Child
(Element =>
Program.Elements.Array_Component_Associations
.Array_Component_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Array_Component_Associations.Expression);
F109 : aliased constant Getter_Array :=
(1 => (True, Choices, F109_1'Access),
2 => (False, Expression, F109_2'Access));
overriding procedure Array_Component_Association
(Self : in out Visitor;
Element : not null Program.Elements.Array_Component_Associations
.Array_Component_Association_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F109'Access;
end Array_Component_Association;
function F110_1 is new Generic_Child
(Element =>
Program.Elements.Parameter_Associations.Parameter_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Parameter_Associations.Formal_Parameter);
function F110_2 is new Generic_Child
(Element =>
Program.Elements.Parameter_Associations.Parameter_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Parameter_Associations.Actual_Parameter);
F110 : aliased constant Getter_Array :=
(1 => (False, Formal_Parameter, F110_1'Access),
2 => (False, Actual_Parameter, F110_2'Access));
overriding procedure Parameter_Association
(Self : in out Visitor;
Element : not null Program.Elements.Parameter_Associations
.Parameter_Association_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F110'Access;
end Parameter_Association;
function F111_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Package_Associations
.Formal_Package_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Package_Associations.Formal_Parameter);
function F111_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Package_Associations
.Formal_Package_Association,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Package_Associations.Actual_Parameter);
F111 : aliased constant Getter_Array :=
(1 => (False, Formal_Parameter, F111_1'Access),
2 => (False, Actual_Parameter, F111_2'Access));
overriding procedure Formal_Package_Association
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F111'Access;
end Formal_Package_Association;
function F113_1 is new Generic_Child
(Element =>
Program.Elements.Assignment_Statements.Assignment_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Assignment_Statements.Variable_Name);
function F113_2 is new Generic_Child
(Element =>
Program.Elements.Assignment_Statements.Assignment_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Assignment_Statements.Expression);
F113 : aliased constant Getter_Array :=
(1 => (False, Variable_Name, F113_1'Access),
2 => (False, Expression, F113_2'Access));
overriding procedure Assignment_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Assignment_Statements
.Assignment_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F113'Access;
end Assignment_Statement;
function F114_1 is new Generic_Child
(Element => Program.Elements.If_Statements.If_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.If_Statements.Condition);
function F114_2 is new Generic_Vector
(Parent => Program.Elements.If_Statements.If_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.If_Statements.Then_Statements);
function F114_3 is new Generic_Vector
(Parent => Program.Elements.If_Statements.If_Statement,
Vector => Program.Elements.Elsif_Paths.Elsif_Path_Vector,
Vector_Access => Program.Elements.Elsif_Paths.Elsif_Path_Vector_Access,
Get_Vector => Program.Elements.If_Statements.Elsif_Paths);
function F114_4 is new Generic_Vector
(Parent => Program.Elements.If_Statements.If_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.If_Statements.Else_Statements);
F114 : aliased constant Getter_Array :=
(1 => (False, Condition, F114_1'Access),
2 => (True, Then_Statements, F114_2'Access),
3 => (True, Elsif_Paths, F114_3'Access),
4 => (True, Else_Statements, F114_4'Access));
overriding procedure If_Statement
(Self : in out Visitor;
Element : not null Program.Elements.If_Statements.If_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F114'Access;
end If_Statement;
function F115_1 is new Generic_Child
(Element => Program.Elements.Case_Statements.Case_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Case_Statements.Selecting_Expression);
function F115_2 is new Generic_Vector
(Parent => Program.Elements.Case_Statements.Case_Statement,
Vector => Program.Elements.Case_Paths.Case_Path_Vector,
Vector_Access => Program.Elements.Case_Paths.Case_Path_Vector_Access,
Get_Vector => Program.Elements.Case_Statements.Paths);
F115 : aliased constant Getter_Array :=
(1 => (False, Selecting_Expression, F115_1'Access),
2 => (True, Paths, F115_2'Access));
overriding procedure Case_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Case_Statements
.Case_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F115'Access;
end Case_Statement;
function F116_1 is new Generic_Child
(Element => Program.Elements.Loop_Statements.Loop_Statement,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Loop_Statements.Statement_Identifier);
function F116_2 is new Generic_Vector
(Parent => Program.Elements.Loop_Statements.Loop_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Loop_Statements.Statements);
function F116_3 is new Generic_Child
(Element => Program.Elements.Loop_Statements.Loop_Statement,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child =>
Program.Elements.Loop_Statements.End_Statement_Identifier);
F116 : aliased constant Getter_Array :=
(1 => (False, Statement_Identifier, F116_1'Access),
2 => (True, Statements, F116_2'Access),
3 =>
(False,
End_Statement_Identifier,
F116_3'Access));
overriding procedure Loop_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Loop_Statements
.Loop_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F116'Access;
end Loop_Statement;
function F117_1 is new Generic_Child
(Element =>
Program.Elements.While_Loop_Statements.While_Loop_Statement,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child =>
Program.Elements.While_Loop_Statements.Statement_Identifier);
function F117_2 is new Generic_Child
(Element =>
Program.Elements.While_Loop_Statements.While_Loop_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.While_Loop_Statements.Condition);
function F117_3 is new Generic_Vector
(Parent =>
Program.Elements.While_Loop_Statements.While_Loop_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.While_Loop_Statements.Statements);
function F117_4 is new Generic_Child
(Element =>
Program.Elements.While_Loop_Statements.While_Loop_Statement,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child =>
Program.Elements.While_Loop_Statements.End_Statement_Identifier);
F117 : aliased constant Getter_Array :=
(1 => (False, Statement_Identifier, F117_1'Access),
2 => (False, Condition, F117_2'Access),
3 => (True, Statements, F117_3'Access),
4 =>
(False,
End_Statement_Identifier,
F117_4'Access));
overriding procedure While_Loop_Statement
(Self : in out Visitor;
Element : not null Program.Elements.While_Loop_Statements
.While_Loop_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F117'Access;
end While_Loop_Statement;
function F118_1 is new Generic_Child
(Element => Program.Elements.For_Loop_Statements.For_Loop_Statement,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child =>
Program.Elements.For_Loop_Statements.Statement_Identifier);
function F118_2 is new Generic_Child
(Element => Program.Elements.For_Loop_Statements.For_Loop_Statement,
Child =>
Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification,
Child_Access =>
Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access,
Get_Child => Program.Elements.For_Loop_Statements.Loop_Parameter);
function F118_3 is new Generic_Child
(Element => Program.Elements.For_Loop_Statements.For_Loop_Statement,
Child =>
Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification,
Child_Access =>
Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access,
Get_Child =>
Program.Elements.For_Loop_Statements.Generalized_Iterator);
function F118_4 is new Generic_Child
(Element => Program.Elements.For_Loop_Statements.For_Loop_Statement,
Child =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification,
Child_Access =>
Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access,
Get_Child => Program.Elements.For_Loop_Statements.Element_Iterator);
function F118_5 is new Generic_Vector
(Parent => Program.Elements.For_Loop_Statements.For_Loop_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.For_Loop_Statements.Statements);
function F118_6 is new Generic_Child
(Element => Program.Elements.For_Loop_Statements.For_Loop_Statement,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child =>
Program.Elements.For_Loop_Statements.End_Statement_Identifier);
F118 : aliased constant Getter_Array :=
(1 => (False, Statement_Identifier, F118_1'Access),
2 => (False, Loop_Parameter, F118_2'Access),
3 => (False, Generalized_Iterator, F118_3'Access),
4 => (False, Element_Iterator, F118_4'Access),
5 => (True, Statements, F118_5'Access),
6 =>
(False,
End_Statement_Identifier,
F118_6'Access));
overriding procedure For_Loop_Statement
(Self : in out Visitor;
Element : not null Program.Elements.For_Loop_Statements
.For_Loop_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F118'Access;
end For_Loop_Statement;
function F119_1 is new Generic_Child
(Element => Program.Elements.Block_Statements.Block_Statement,
Child =>
Program.Elements.Defining_Identifiers.Defining_Identifier,
Child_Access =>
Program.Elements.Defining_Identifiers.Defining_Identifier_Access,
Get_Child => Program.Elements.Block_Statements.Statement_Identifier);
function F119_2 is new Generic_Vector
(Parent => Program.Elements.Block_Statements.Block_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Block_Statements.Declarations);
function F119_3 is new Generic_Vector
(Parent => Program.Elements.Block_Statements.Block_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Block_Statements.Statements);
function F119_4 is new Generic_Vector
(Parent => Program.Elements.Block_Statements.Block_Statement,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector => Program.Elements.Block_Statements.Exception_Handlers);
function F119_5 is new Generic_Child
(Element => Program.Elements.Block_Statements.Block_Statement,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child =>
Program.Elements.Block_Statements.End_Statement_Identifier);
F119 : aliased constant Getter_Array :=
(1 => (False, Statement_Identifier, F119_1'Access),
2 => (True, Declarations, F119_2'Access),
3 => (True, Statements, F119_3'Access),
4 => (True, Exception_Handlers, F119_4'Access),
5 =>
(False,
End_Statement_Identifier,
F119_5'Access));
overriding procedure Block_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Block_Statements
.Block_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F119'Access;
end Block_Statement;
function F120_1 is new Generic_Child
(Element => Program.Elements.Exit_Statements.Exit_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Exit_Statements.Exit_Loop_Name);
function F120_2 is new Generic_Child
(Element => Program.Elements.Exit_Statements.Exit_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Exit_Statements.Condition);
F120 : aliased constant Getter_Array :=
(1 => (False, Exit_Loop_Name, F120_1'Access),
2 => (False, Condition, F120_2'Access));
overriding procedure Exit_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Exit_Statements
.Exit_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F120'Access;
end Exit_Statement;
function F121_1 is new Generic_Child
(Element => Program.Elements.Goto_Statements.Goto_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Goto_Statements.Goto_Label);
F121 : aliased constant Getter_Array :=
(1 => (False, Goto_Label, F121_1'Access));
overriding procedure Goto_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Goto_Statements
.Goto_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F121'Access;
end Goto_Statement;
function F122_1 is new Generic_Child
(Element => Program.Elements.Call_Statements.Call_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Call_Statements.Called_Name);
function F122_2 is new Generic_Vector
(Parent => Program.Elements.Call_Statements.Call_Statement,
Vector =>
Program.Elements.Parameter_Associations.Parameter_Association_Vector,
Vector_Access =>
Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access,
Get_Vector => Program.Elements.Call_Statements.Parameters);
F122 : aliased constant Getter_Array :=
(1 => (False, Called_Name, F122_1'Access),
2 => (True, Parameters, F122_2'Access));
overriding procedure Call_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Call_Statements
.Call_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F122'Access;
end Call_Statement;
function F123_1 is new Generic_Child
(Element =>
Program.Elements.Simple_Return_Statements.Simple_Return_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Simple_Return_Statements.Expression);
F123 : aliased constant Getter_Array :=
(1 => (False, Expression, F123_1'Access));
overriding procedure Simple_Return_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Simple_Return_Statements
.Simple_Return_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F123'Access;
end Simple_Return_Statement;
function F124_1 is new Generic_Child
(Element =>
Program.Elements.Extended_Return_Statements.Extended_Return_Statement,
Child =>
Program.Elements.Return_Object_Specifications
.Return_Object_Specification,
Child_Access =>
Program.Elements.Return_Object_Specifications
.Return_Object_Specification_Access,
Get_Child =>
Program.Elements.Extended_Return_Statements.Return_Object);
function F124_2 is new Generic_Vector
(Parent =>
Program.Elements.Extended_Return_Statements.Extended_Return_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Extended_Return_Statements.Statements);
function F124_3 is new Generic_Vector
(Parent =>
Program.Elements.Extended_Return_Statements.Extended_Return_Statement,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector =>
Program.Elements.Extended_Return_Statements.Exception_Handlers);
F124 : aliased constant Getter_Array :=
(1 => (False, Return_Object, F124_1'Access),
2 => (True, Statements, F124_2'Access),
3 => (True, Exception_Handlers, F124_3'Access));
overriding procedure Extended_Return_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Extended_Return_Statements
.Extended_Return_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F124'Access;
end Extended_Return_Statement;
function F125_1 is new Generic_Child
(Element => Program.Elements.Accept_Statements.Accept_Statement,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Accept_Statements.Entry_Name);
function F125_2 is new Generic_Child
(Element => Program.Elements.Accept_Statements.Accept_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Accept_Statements.Entry_Index);
function F125_3 is new Generic_Vector
(Parent => Program.Elements.Accept_Statements.Accept_Statement,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Accept_Statements.Parameters);
function F125_4 is new Generic_Vector
(Parent => Program.Elements.Accept_Statements.Accept_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Accept_Statements.Statements);
function F125_5 is new Generic_Vector
(Parent => Program.Elements.Accept_Statements.Accept_Statement,
Vector =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector,
Vector_Access =>
Program.Elements.Exception_Handlers.Exception_Handler_Vector_Access,
Get_Vector => Program.Elements.Accept_Statements.Exception_Handlers);
function F125_6 is new Generic_Child
(Element => Program.Elements.Accept_Statements.Accept_Statement,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child =>
Program.Elements.Accept_Statements.End_Statement_Identifier);
F125 : aliased constant Getter_Array :=
(1 => (False, Entry_Name, F125_1'Access),
2 => (False, Entry_Index, F125_2'Access),
3 => (True, Parameters, F125_3'Access),
4 => (True, Statements, F125_4'Access),
5 => (True, Exception_Handlers, F125_5'Access),
6 =>
(False,
End_Statement_Identifier,
F125_6'Access));
overriding procedure Accept_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Accept_Statements
.Accept_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F125'Access;
end Accept_Statement;
function F126_1 is new Generic_Child
(Element => Program.Elements.Requeue_Statements.Requeue_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Requeue_Statements.Entry_Name);
F126 : aliased constant Getter_Array :=
(1 => (False, Entry_Name, F126_1'Access));
overriding procedure Requeue_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Requeue_Statements
.Requeue_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F126'Access;
end Requeue_Statement;
function F127_1 is new Generic_Child
(Element => Program.Elements.Delay_Statements.Delay_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Delay_Statements.Expression);
F127 : aliased constant Getter_Array :=
(1 => (False, Expression, F127_1'Access));
overriding procedure Delay_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Delay_Statements
.Delay_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F127'Access;
end Delay_Statement;
function F129_1 is new Generic_Vector
(Parent => Program.Elements.Select_Statements.Select_Statement,
Vector => Program.Elements.Select_Paths.Select_Path_Vector,
Vector_Access => Program.Elements.Select_Paths.Select_Path_Vector_Access,
Get_Vector => Program.Elements.Select_Statements.Paths);
function F129_2 is new Generic_Vector
(Parent => Program.Elements.Select_Statements.Select_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector =>
Program.Elements.Select_Statements.Then_Abort_Statements);
function F129_3 is new Generic_Vector
(Parent => Program.Elements.Select_Statements.Select_Statement,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Select_Statements.Else_Statements);
F129 : aliased constant Getter_Array :=
(1 => (True, Paths, F129_1'Access),
2 =>
(True, Then_Abort_Statements, F129_2'Access),
3 => (True, Else_Statements, F129_3'Access));
overriding procedure Select_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Select_Statements
.Select_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F129'Access;
end Select_Statement;
function F130_1 is new Generic_Vector
(Parent => Program.Elements.Abort_Statements.Abort_Statement,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Abort_Statements.Aborted_Tasks);
F130 : aliased constant Getter_Array :=
(1 => (True, Aborted_Tasks, F130_1'Access));
overriding procedure Abort_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Abort_Statements
.Abort_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F130'Access;
end Abort_Statement;
function F131_1 is new Generic_Child
(Element => Program.Elements.Raise_Statements.Raise_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Raise_Statements.Raised_Exception);
function F131_2 is new Generic_Child
(Element => Program.Elements.Raise_Statements.Raise_Statement,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Raise_Statements.Associated_Message);
F131 : aliased constant Getter_Array :=
(1 => (False, Raised_Exception, F131_1'Access),
2 => (False, Associated_Message, F131_2'Access));
overriding procedure Raise_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Raise_Statements
.Raise_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F131'Access;
end Raise_Statement;
function F132_1 is new Generic_Child
(Element => Program.Elements.Code_Statements.Code_Statement,
Child =>
Program.Elements.Qualified_Expressions.Qualified_Expression,
Child_Access =>
Program.Elements.Qualified_Expressions.Qualified_Expression_Access,
Get_Child => Program.Elements.Code_Statements.Expression);
F132 : aliased constant Getter_Array :=
(1 => (False, Expression, F132_1'Access));
overriding procedure Code_Statement
(Self : in out Visitor;
Element : not null Program.Elements.Code_Statements
.Code_Statement_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F132'Access;
end Code_Statement;
function F133_1 is new Generic_Child
(Element => Program.Elements.Elsif_Paths.Elsif_Path,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Elsif_Paths.Condition);
function F133_2 is new Generic_Vector
(Parent => Program.Elements.Elsif_Paths.Elsif_Path,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Elsif_Paths.Statements);
F133 : aliased constant Getter_Array :=
(1 => (False, Condition, F133_1'Access),
2 => (True, Statements, F133_2'Access));
overriding procedure Elsif_Path
(Self : in out Visitor;
Element : not null Program.Elements.Elsif_Paths.Elsif_Path_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F133'Access;
end Elsif_Path;
function F134_1 is new Generic_Vector
(Parent => Program.Elements.Case_Paths.Case_Path,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Case_Paths.Choices);
function F134_2 is new Generic_Vector
(Parent => Program.Elements.Case_Paths.Case_Path,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Case_Paths.Statements);
F134 : aliased constant Getter_Array :=
(1 => (True, Choices, F134_1'Access),
2 => (True, Statements, F134_2'Access));
overriding procedure Case_Path
(Self : in out Visitor;
Element : not null Program.Elements.Case_Paths.Case_Path_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F134'Access;
end Case_Path;
function F135_1 is new Generic_Child
(Element => Program.Elements.Select_Paths.Select_Path,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Select_Paths.Guard);
function F135_2 is new Generic_Vector
(Parent => Program.Elements.Select_Paths.Select_Path,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Select_Paths.Statements);
F135 : aliased constant Getter_Array :=
(1 => (False, Guard, F135_1'Access),
2 => (True, Statements, F135_2'Access));
overriding procedure Select_Path
(Self : in out Visitor;
Element : not null Program.Elements.Select_Paths.Select_Path_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F135'Access;
end Select_Path;
function F136_1 is new Generic_Vector
(Parent =>
Program.Elements.Case_Expression_Paths.Case_Expression_Path,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Case_Expression_Paths.Choices);
function F136_2 is new Generic_Child
(Element =>
Program.Elements.Case_Expression_Paths.Case_Expression_Path,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Case_Expression_Paths.Expression);
F136 : aliased constant Getter_Array :=
(1 => (True, Choices, F136_1'Access),
2 => (False, Expression, F136_2'Access));
overriding procedure Case_Expression_Path
(Self : in out Visitor;
Element : not null Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F136'Access;
end Case_Expression_Path;
function F137_1 is new Generic_Child
(Element =>
Program.Elements.Elsif_Expression_Paths.Elsif_Expression_Path,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Elsif_Expression_Paths.Condition);
function F137_2 is new Generic_Child
(Element =>
Program.Elements.Elsif_Expression_Paths.Elsif_Expression_Path,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Elsif_Expression_Paths.Expression);
F137 : aliased constant Getter_Array :=
(1 => (False, Condition, F137_1'Access),
2 => (False, Expression, F137_2'Access));
overriding procedure Elsif_Expression_Path
(Self : in out Visitor;
Element : not null Program.Elements.Elsif_Expression_Paths
.Elsif_Expression_Path_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F137'Access;
end Elsif_Expression_Path;
function F138_1 is new Generic_Vector
(Parent => Program.Elements.Use_Clauses.Use_Clause,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Use_Clauses.Clause_Names);
F138 : aliased constant Getter_Array :=
(1 => (True, Clause_Names, F138_1'Access));
overriding procedure Use_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Use_Clauses.Use_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F138'Access;
end Use_Clause;
function F139_1 is new Generic_Vector
(Parent => Program.Elements.With_Clauses.With_Clause,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.With_Clauses.Clause_Names);
F139 : aliased constant Getter_Array :=
(1 => (True, Clause_Names, F139_1'Access));
overriding procedure With_Clause
(Self : in out Visitor;
Element : not null Program.Elements.With_Clauses.With_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F139'Access;
end With_Clause;
function F140_1 is new Generic_Child
(Element => Program.Elements.Component_Clauses.Component_Clause,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.Component_Clauses.Clause_Name);
function F140_2 is new Generic_Child
(Element => Program.Elements.Component_Clauses.Component_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Component_Clauses.Position);
function F140_3 is new Generic_Child
(Element => Program.Elements.Component_Clauses.Component_Clause,
Child =>
Program.Elements.Simple_Expression_Ranges.Simple_Expression_Range,
Child_Access =>
Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access,
Get_Child => Program.Elements.Component_Clauses.Clause_Range);
F140 : aliased constant Getter_Array :=
(1 => (False, Clause_Name, F140_1'Access),
2 => (False, Position, F140_2'Access),
3 => (False, Clause_Range, F140_3'Access));
overriding procedure Component_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Component_Clauses
.Component_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F140'Access;
end Component_Clause;
function F141_1 is new Generic_Child
(Element => Program.Elements.Derived_Types.Derived_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Derived_Types.Parent);
F141 : aliased constant Getter_Array :=
(1 => (False, Parent, F141_1'Access));
overriding procedure Derived_Type
(Self : in out Visitor;
Element : not null Program.Elements.Derived_Types.Derived_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F141'Access;
end Derived_Type;
function F142_1 is new Generic_Child
(Element =>
Program.Elements.Derived_Record_Extensions.Derived_Record_Extension,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Derived_Record_Extensions.Parent);
function F142_2 is new Generic_Vector
(Parent =>
Program.Elements.Derived_Record_Extensions.Derived_Record_Extension,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Derived_Record_Extensions.Progenitors);
function F142_3 is new Generic_Child
(Element =>
Program.Elements.Derived_Record_Extensions.Derived_Record_Extension,
Child => Program.Elements.Definitions.Definition,
Child_Access => Program.Elements.Definitions.Definition_Access,
Get_Child =>
Program.Elements.Derived_Record_Extensions.Record_Definition);
F142 : aliased constant Getter_Array :=
(1 => (False, Parent, F142_1'Access),
2 => (True, Progenitors, F142_2'Access),
3 => (False, Record_Definition, F142_3'Access));
overriding procedure Derived_Record_Extension
(Self : in out Visitor;
Element : not null Program.Elements.Derived_Record_Extensions
.Derived_Record_Extension_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F142'Access;
end Derived_Record_Extension;
function F143_1 is new Generic_Vector
(Parent => Program.Elements.Enumeration_Types.Enumeration_Type,
Vector =>
Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Vector,
Vector_Access =>
Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Vector_Access,
Get_Vector => Program.Elements.Enumeration_Types.Literals);
F143 : aliased constant Getter_Array :=
(1 => (True, Literals, F143_1'Access));
overriding procedure Enumeration_Type
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Types
.Enumeration_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F143'Access;
end Enumeration_Type;
function F144_1 is new Generic_Child
(Element =>
Program.Elements.Signed_Integer_Types.Signed_Integer_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Signed_Integer_Types.Lower_Bound);
function F144_2 is new Generic_Child
(Element =>
Program.Elements.Signed_Integer_Types.Signed_Integer_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Signed_Integer_Types.Upper_Bound);
F144 : aliased constant Getter_Array :=
(1 => (False, Lower_Bound, F144_1'Access),
2 => (False, Upper_Bound, F144_2'Access));
overriding procedure Signed_Integer_Type
(Self : in out Visitor;
Element : not null Program.Elements.Signed_Integer_Types
.Signed_Integer_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F144'Access;
end Signed_Integer_Type;
function F145_1 is new Generic_Child
(Element => Program.Elements.Modular_Types.Modular_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Modular_Types.Modulus);
F145 : aliased constant Getter_Array :=
(1 => (False, Modulus, F145_1'Access));
overriding procedure Modular_Type
(Self : in out Visitor;
Element : not null Program.Elements.Modular_Types.Modular_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F145'Access;
end Modular_Type;
function F147_1 is new Generic_Child
(Element =>
Program.Elements.Floating_Point_Types.Floating_Point_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Floating_Point_Types.Digits_Expression);
function F147_2 is new Generic_Child
(Element =>
Program.Elements.Floating_Point_Types.Floating_Point_Type,
Child =>
Program.Elements.Real_Range_Specifications.Real_Range_Specification,
Child_Access =>
Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access,
Get_Child => Program.Elements.Floating_Point_Types.Real_Range);
F147 : aliased constant Getter_Array :=
(1 => (False, Digits_Expression, F147_1'Access),
2 => (False, Real_Range, F147_2'Access));
overriding procedure Floating_Point_Type
(Self : in out Visitor;
Element : not null Program.Elements.Floating_Point_Types
.Floating_Point_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F147'Access;
end Floating_Point_Type;
function F148_1 is new Generic_Child
(Element =>
Program.Elements.Ordinary_Fixed_Point_Types.Ordinary_Fixed_Point_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Ordinary_Fixed_Point_Types.Delta_Expression);
function F148_2 is new Generic_Child
(Element =>
Program.Elements.Ordinary_Fixed_Point_Types.Ordinary_Fixed_Point_Type,
Child =>
Program.Elements.Real_Range_Specifications.Real_Range_Specification,
Child_Access =>
Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access,
Get_Child => Program.Elements.Ordinary_Fixed_Point_Types.Real_Range);
F148 : aliased constant Getter_Array :=
(1 => (False, Delta_Expression, F148_1'Access),
2 => (False, Real_Range, F148_2'Access));
overriding procedure Ordinary_Fixed_Point_Type
(Self : in out Visitor;
Element : not null Program.Elements.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F148'Access;
end Ordinary_Fixed_Point_Type;
function F149_1 is new Generic_Child
(Element =>
Program.Elements.Decimal_Fixed_Point_Types.Decimal_Fixed_Point_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Decimal_Fixed_Point_Types.Delta_Expression);
function F149_2 is new Generic_Child
(Element =>
Program.Elements.Decimal_Fixed_Point_Types.Decimal_Fixed_Point_Type,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Decimal_Fixed_Point_Types.Digits_Expression);
function F149_3 is new Generic_Child
(Element =>
Program.Elements.Decimal_Fixed_Point_Types.Decimal_Fixed_Point_Type,
Child =>
Program.Elements.Real_Range_Specifications.Real_Range_Specification,
Child_Access =>
Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access,
Get_Child => Program.Elements.Decimal_Fixed_Point_Types.Real_Range);
F149 : aliased constant Getter_Array :=
(1 => (False, Delta_Expression, F149_1'Access),
2 => (False, Digits_Expression, F149_2'Access),
3 => (False, Real_Range, F149_3'Access));
overriding procedure Decimal_Fixed_Point_Type
(Self : in out Visitor;
Element : not null Program.Elements.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F149'Access;
end Decimal_Fixed_Point_Type;
function F150_1 is new Generic_Vector
(Parent =>
Program.Elements.Unconstrained_Array_Types.Unconstrained_Array_Type,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector =>
Program.Elements.Unconstrained_Array_Types.Index_Subtypes);
function F150_2 is new Generic_Child
(Element =>
Program.Elements.Unconstrained_Array_Types.Unconstrained_Array_Type,
Child =>
Program.Elements.Component_Definitions.Component_Definition,
Child_Access =>
Program.Elements.Component_Definitions.Component_Definition_Access,
Get_Child =>
Program.Elements.Unconstrained_Array_Types.Component_Definition);
F150 : aliased constant Getter_Array :=
(1 => (True, Index_Subtypes, F150_1'Access),
2 => (False, Component_Definition, F150_2'Access));
overriding procedure Unconstrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F150'Access;
end Unconstrained_Array_Type;
function F151_1 is new Generic_Vector
(Parent =>
Program.Elements.Constrained_Array_Types.Constrained_Array_Type,
Vector => Program.Elements.Discrete_Ranges.Discrete_Range_Vector,
Vector_Access =>
Program.Elements.Discrete_Ranges.Discrete_Range_Vector_Access,
Get_Vector =>
Program.Elements.Constrained_Array_Types.Index_Subtypes);
function F151_2 is new Generic_Child
(Element =>
Program.Elements.Constrained_Array_Types.Constrained_Array_Type,
Child =>
Program.Elements.Component_Definitions.Component_Definition,
Child_Access =>
Program.Elements.Component_Definitions.Component_Definition_Access,
Get_Child =>
Program.Elements.Constrained_Array_Types.Component_Definition);
F151 : aliased constant Getter_Array :=
(1 => (True, Index_Subtypes, F151_1'Access),
2 => (False, Component_Definition, F151_2'Access));
overriding procedure Constrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Constrained_Array_Types
.Constrained_Array_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F151'Access;
end Constrained_Array_Type;
function F152_1 is new Generic_Child
(Element => Program.Elements.Record_Types.Record_Type,
Child => Program.Elements.Definitions.Definition,
Child_Access => Program.Elements.Definitions.Definition_Access,
Get_Child => Program.Elements.Record_Types.Record_Definition);
F152 : aliased constant Getter_Array :=
(1 => (False, Record_Definition, F152_1'Access));
overriding procedure Record_Type
(Self : in out Visitor;
Element : not null Program.Elements.Record_Types.Record_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F152'Access;
end Record_Type;
function F153_1 is new Generic_Vector
(Parent => Program.Elements.Interface_Types.Interface_Type,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Interface_Types.Progenitors);
F153 : aliased constant Getter_Array :=
(1 => (True, Progenitors, F153_1'Access));
overriding procedure Interface_Type
(Self : in out Visitor;
Element : not null Program.Elements.Interface_Types
.Interface_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F153'Access;
end Interface_Type;
function F154_1 is new Generic_Child
(Element => Program.Elements.Object_Access_Types.Object_Access_Type,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child => Program.Elements.Object_Access_Types.Subtype_Indication);
F154 : aliased constant Getter_Array :=
(1 => (False, Subtype_Indication, F154_1'Access));
overriding procedure Object_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Object_Access_Types
.Object_Access_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F154'Access;
end Object_Access_Type;
function F155_1 is new Generic_Vector
(Parent =>
Program.Elements.Procedure_Access_Types.Procedure_Access_Type,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Procedure_Access_Types.Parameters);
F155 : aliased constant Getter_Array :=
(1 => (True, Parameters, F155_1'Access));
overriding procedure Procedure_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Procedure_Access_Types
.Procedure_Access_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F155'Access;
end Procedure_Access_Type;
function F156_1 is new Generic_Vector
(Parent =>
Program.Elements.Function_Access_Types.Function_Access_Type,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector => Program.Elements.Function_Access_Types.Parameters);
function F156_2 is new Generic_Child
(Element =>
Program.Elements.Function_Access_Types.Function_Access_Type,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child => Program.Elements.Function_Access_Types.Result_Subtype);
F156 : aliased constant Getter_Array :=
(1 => (True, Parameters, F156_1'Access),
2 => (False, Result_Subtype, F156_2'Access));
overriding procedure Function_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Function_Access_Types
.Function_Access_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F156'Access;
end Function_Access_Type;
function F158_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Formal_Derived_Type_Definitions.Subtype_Mark);
function F158_2 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Derived_Type_Definitions.Progenitors);
F158 : aliased constant Getter_Array :=
(1 => (False, Subtype_Mark, F158_1'Access),
2 => (True, Progenitors, F158_2'Access));
overriding procedure Formal_Derived_Type_Definition
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F158'Access;
end Formal_Derived_Type_Definition;
function F165_1 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Unconstrained_Array_Types.Index_Subtypes);
function F165_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type,
Child =>
Program.Elements.Component_Definitions.Component_Definition,
Child_Access =>
Program.Elements.Component_Definitions.Component_Definition_Access,
Get_Child =>
Program.Elements.Formal_Unconstrained_Array_Types
.Component_Definition);
F165 : aliased constant Getter_Array :=
(1 => (True, Index_Subtypes, F165_1'Access),
2 => (False, Component_Definition, F165_2'Access));
overriding procedure Formal_Unconstrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F165'Access;
end Formal_Unconstrained_Array_Type;
function F166_1 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type,
Vector => Program.Elements.Discrete_Ranges.Discrete_Range_Vector,
Vector_Access =>
Program.Elements.Discrete_Ranges.Discrete_Range_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Constrained_Array_Types.Index_Subtypes);
function F166_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type,
Child =>
Program.Elements.Component_Definitions.Component_Definition,
Child_Access =>
Program.Elements.Component_Definitions.Component_Definition_Access,
Get_Child =>
Program.Elements.Formal_Constrained_Array_Types.Component_Definition);
F166 : aliased constant Getter_Array :=
(1 => (True, Index_Subtypes, F166_1'Access),
2 => (False, Component_Definition, F166_2'Access));
overriding procedure Formal_Constrained_Array_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F166'Access;
end Formal_Constrained_Array_Type;
function F167_1 is new Generic_Child
(Element =>
Program.Elements.Formal_Object_Access_Types.Formal_Object_Access_Type,
Child => Program.Elements.Subtype_Indications.Subtype_Indication,
Child_Access =>
Program.Elements.Subtype_Indications.Subtype_Indication_Access,
Get_Child =>
Program.Elements.Formal_Object_Access_Types.Subtype_Indication);
F167 : aliased constant Getter_Array :=
(1 => (False, Subtype_Indication, F167_1'Access));
overriding procedure Formal_Object_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Object_Access_Types
.Formal_Object_Access_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F167'Access;
end Formal_Object_Access_Type;
function F168_1 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Procedure_Access_Types.Parameters);
F168 : aliased constant Getter_Array :=
(1 => (True, Parameters, F168_1'Access));
overriding procedure Formal_Procedure_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F168'Access;
end Formal_Procedure_Access_Type;
function F169_1 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type,
Vector =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector,
Vector_Access =>
Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access,
Get_Vector =>
Program.Elements.Formal_Function_Access_Types.Parameters);
function F169_2 is new Generic_Child
(Element =>
Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type,
Child => Program.Elements.Element,
Child_Access => Program.Elements.Element_Access,
Get_Child =>
Program.Elements.Formal_Function_Access_Types.Result_Subtype);
F169 : aliased constant Getter_Array :=
(1 => (True, Parameters, F169_1'Access),
2 => (False, Result_Subtype, F169_2'Access));
overriding procedure Formal_Function_Access_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F169'Access;
end Formal_Function_Access_Type;
function F170_1 is new Generic_Vector
(Parent =>
Program.Elements.Formal_Interface_Types.Formal_Interface_Type,
Vector => Program.Elements.Expressions.Expression_Vector,
Vector_Access => Program.Elements.Expressions.Expression_Vector_Access,
Get_Vector => Program.Elements.Formal_Interface_Types.Progenitors);
F170 : aliased constant Getter_Array :=
(1 => (True, Progenitors, F170_1'Access));
overriding procedure Formal_Interface_Type
(Self : in out Visitor;
Element : not null Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F170'Access;
end Formal_Interface_Type;
function F171_1 is new Generic_Child
(Element =>
Program.Elements.Range_Attribute_References.Range_Attribute_Reference,
Child =>
Program.Elements.Attribute_References.Attribute_Reference,
Child_Access =>
Program.Elements.Attribute_References.Attribute_Reference_Access,
Get_Child =>
Program.Elements.Range_Attribute_References.Range_Attribute);
F171 : aliased constant Getter_Array :=
(1 => (False, Range_Attribute, F171_1'Access));
overriding procedure Range_Attribute_Reference
(Self : in out Visitor;
Element : not null Program.Elements.Range_Attribute_References
.Range_Attribute_Reference_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F171'Access;
end Range_Attribute_Reference;
function F172_1 is new Generic_Child
(Element =>
Program.Elements.Simple_Expression_Ranges.Simple_Expression_Range,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Simple_Expression_Ranges.Lower_Bound);
function F172_2 is new Generic_Child
(Element =>
Program.Elements.Simple_Expression_Ranges.Simple_Expression_Range,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Simple_Expression_Ranges.Upper_Bound);
F172 : aliased constant Getter_Array :=
(1 => (False, Lower_Bound, F172_1'Access),
2 => (False, Upper_Bound, F172_2'Access));
overriding procedure Simple_Expression_Range
(Self : in out Visitor;
Element : not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F172'Access;
end Simple_Expression_Range;
function F173_1 is new Generic_Child
(Element => Program.Elements.Digits_Constraints.Digits_Constraint,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Digits_Constraints.Digits_Expression);
function F173_2 is new Generic_Child
(Element => Program.Elements.Digits_Constraints.Digits_Constraint,
Child => Program.Elements.Constraints.Constraint,
Child_Access => Program.Elements.Constraints.Constraint_Access,
Get_Child =>
Program.Elements.Digits_Constraints.Real_Range_Constraint);
F173 : aliased constant Getter_Array :=
(1 => (False, Digits_Expression, F173_1'Access),
2 =>
(False, Real_Range_Constraint, F173_2'Access));
overriding procedure Digits_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Digits_Constraints
.Digits_Constraint_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F173'Access;
end Digits_Constraint;
function F174_1 is new Generic_Child
(Element => Program.Elements.Delta_Constraints.Delta_Constraint,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Delta_Constraints.Delta_Expression);
function F174_2 is new Generic_Child
(Element => Program.Elements.Delta_Constraints.Delta_Constraint,
Child => Program.Elements.Constraints.Constraint,
Child_Access => Program.Elements.Constraints.Constraint_Access,
Get_Child =>
Program.Elements.Delta_Constraints.Real_Range_Constraint);
F174 : aliased constant Getter_Array :=
(1 => (False, Delta_Expression, F174_1'Access),
2 =>
(False, Real_Range_Constraint, F174_2'Access));
overriding procedure Delta_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Delta_Constraints
.Delta_Constraint_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F174'Access;
end Delta_Constraint;
function F175_1 is new Generic_Vector
(Parent => Program.Elements.Index_Constraints.Index_Constraint,
Vector => Program.Elements.Discrete_Ranges.Discrete_Range_Vector,
Vector_Access =>
Program.Elements.Discrete_Ranges.Discrete_Range_Vector_Access,
Get_Vector => Program.Elements.Index_Constraints.Ranges);
F175 : aliased constant Getter_Array :=
(1 => (True, Ranges, F175_1'Access));
overriding procedure Index_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Index_Constraints
.Index_Constraint_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F175'Access;
end Index_Constraint;
function F176_1 is new Generic_Vector
(Parent =>
Program.Elements.Discriminant_Constraints.Discriminant_Constraint,
Vector =>
Program.Elements.Discriminant_Associations
.Discriminant_Association_Vector,
Vector_Access =>
Program.Elements.Discriminant_Associations
.Discriminant_Association_Vector_Access,
Get_Vector =>
Program.Elements.Discriminant_Constraints.Discriminants);
F176 : aliased constant Getter_Array :=
(1 => (True, Discriminants, F176_1'Access));
overriding procedure Discriminant_Constraint
(Self : in out Visitor;
Element : not null Program.Elements.Discriminant_Constraints
.Discriminant_Constraint_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F176'Access;
end Discriminant_Constraint;
function F177_1 is new Generic_Child
(Element =>
Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Attribute_Definition_Clauses.Name);
function F177_2 is new Generic_Child
(Element =>
Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Attribute_Definition_Clauses.Expression);
F177 : aliased constant Getter_Array :=
(1 => (False, Name, F177_1'Access),
2 => (False, Expression, F177_2'Access));
overriding procedure Attribute_Definition_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F177'Access;
end Attribute_Definition_Clause;
function F178_1 is new Generic_Child
(Element =>
Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Enumeration_Representation_Clauses.Name);
function F178_2 is new Generic_Child
(Element =>
Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause,
Child => Program.Elements.Array_Aggregates.Array_Aggregate,
Child_Access => Program.Elements.Array_Aggregates.Array_Aggregate_Access,
Get_Child =>
Program.Elements.Enumeration_Representation_Clauses.Expression);
F178 : aliased constant Getter_Array :=
(1 => (False, Name, F178_1'Access),
2 => (False, Expression, F178_2'Access));
overriding procedure Enumeration_Representation_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F178'Access;
end Enumeration_Representation_Clause;
function F179_1 is new Generic_Child
(Element =>
Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.Record_Representation_Clauses.Name);
function F179_2 is new Generic_Child
(Element =>
Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child =>
Program.Elements.Record_Representation_Clauses.Mod_Clause_Expression);
function F179_3 is new Generic_Vector
(Parent =>
Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause,
Vector =>
Program.Elements.Component_Clauses.Component_Clause_Vector,
Vector_Access =>
Program.Elements.Component_Clauses.Component_Clause_Vector_Access,
Get_Vector =>
Program.Elements.Record_Representation_Clauses.Component_Clauses);
F179 : aliased constant Getter_Array :=
(1 => (False, Name, F179_1'Access),
2 =>
(False, Mod_Clause_Expression, F179_2'Access),
3 => (True, Component_Clauses, F179_3'Access));
overriding procedure Record_Representation_Clause
(Self : in out Visitor;
Element : not null Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F179'Access;
end Record_Representation_Clause;
function F180_1 is new Generic_Child
(Element => Program.Elements.At_Clauses.At_Clause,
Child => Program.Elements.Identifiers.Identifier,
Child_Access => Program.Elements.Identifiers.Identifier_Access,
Get_Child => Program.Elements.At_Clauses.Name);
function F180_2 is new Generic_Child
(Element => Program.Elements.At_Clauses.At_Clause,
Child => Program.Elements.Expressions.Expression,
Child_Access => Program.Elements.Expressions.Expression_Access,
Get_Child => Program.Elements.At_Clauses.Expression);
F180 : aliased constant Getter_Array :=
(1 => (False, Name, F180_1'Access),
2 => (False, Expression, F180_2'Access));
overriding procedure At_Clause
(Self : in out Visitor;
Element : not null Program.Elements.At_Clauses.At_Clause_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F180'Access;
end At_Clause;
function F181_1 is new Generic_Child
(Element => Program.Elements.Exception_Handlers.Exception_Handler,
Child =>
Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification,
Child_Access =>
Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access,
Get_Child => Program.Elements.Exception_Handlers.Choice_Parameter);
function F181_2 is new Generic_Vector
(Parent => Program.Elements.Exception_Handlers.Exception_Handler,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Exception_Handlers.Choices);
function F181_3 is new Generic_Vector
(Parent => Program.Elements.Exception_Handlers.Exception_Handler,
Vector => Program.Element_Vectors.Element_Vector,
Vector_Access => Program.Element_Vectors.Element_Vector_Access,
Get_Vector => Program.Elements.Exception_Handlers.Statements);
F181 : aliased constant Getter_Array :=
(1 => (False, Choice_Parameter, F181_1'Access),
2 => (True, Choices, F181_2'Access),
3 => (True, Statements, F181_3'Access));
overriding procedure Exception_Handler
(Self : in out Visitor;
Element : not null Program.Elements.Exception_Handlers
.Exception_Handler_Access) is
pragma Unreferenced (Element);
begin
Self.Result := F181'Access;
end Exception_Handler;
function Get
(Parent : Program.Elements.Element_Access)
return access constant Getter_Array is
V : Visitor;
begin
Parent.Visit (V);
return V.Result;
end Get;
end Internal;
|
zhmu/ananas | Ada | 9,056 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ I O . G E N E R I C _ A U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains a set of auxiliary routines used by Wide_Text_IO
-- generic children, including for reading and writing numeric strings.
-- Note: although this is the Wide version of the package, the interface
-- here is still in terms of Character and String rather than Wide_Character
-- and Wide_String, since all numeric strings are composed entirely of
-- characters in the range of type Standard.Character, and the basic
-- conversion routines work with Character rather than Wide_Character.
package Ada.Wide_Text_IO.Generic_Aux is
-- Note: for all the Load routines, File indicates the file to be read,
-- Buf is the string into which data is stored, Ptr is the index of the
-- last character stored so far, and is updated if additional characters
-- are stored. Data_Error is raised if the input overflows Buf. The only
-- Load routines that do a file status check are Load_Skip and Load_Width
-- so one of these two routines must be called first.
procedure Check_End_Of_Field
(Buf : String;
Stop : Integer;
Ptr : Integer;
Width : Field);
-- This routine is used after doing a get operations on a numeric value.
-- Buf is the string being scanned, and Stop is the last character of
-- the field being scanned. Ptr is as set by the call to the scan routine
-- that scanned out the numeric value, i.e. it points one past the last
-- character scanned, and Width is the width parameter from the Get call.
--
-- There are two cases, if Width is non-zero, then a check is made that
-- the remainder of the field is all blanks. If Width is zero, then it
-- means that the scan routine scanned out only part of the field. We
-- have already scanned out the field that the ACVC tests seem to expect
-- us to read (even if it does not follow the syntax of the type being
-- scanned, e.g. allowing negative exponents in integers, and underscores
-- at the end of the string), so we just raise Data_Error.
procedure Check_On_One_Line (File : File_Type; Length : Integer);
-- Check to see if item of length Integer characters can fit on
-- current line. Call New_Line if not, first checking that the
-- line length can accommodate Length characters, raise Layout_Error
-- if item is too large for a single line.
function Is_Blank (C : Character) return Boolean;
-- Determines if C is a blank (space or tab)
procedure Load_Width
(File : File_Type;
Width : Field;
Buf : out String;
Ptr : in out Integer);
-- Loads exactly Width characters, unless a line mark is encountered first
procedure Load_Skip (File : File_Type);
-- Skips leading blanks and line and page marks, if the end of file is
-- read without finding a non-blank character, then End_Error is raised.
-- Note: a blank is defined as a space or horizontal tab (RM A.10.6(5)).
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char : Character;
Loaded : out Boolean);
-- If next character is Char, loads it, otherwise no characters are loaded
-- Loaded is set to indicate whether or not the character was found.
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char : Character);
-- Same as above, but no indication if character is loaded
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char1 : Character;
Char2 : Character;
Loaded : out Boolean);
-- If next character is Char1 or Char2, loads it, otherwise no characters
-- are loaded. Loaded is set to indicate whether or not one of the two
-- characters was found.
procedure Load
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Char1 : Character;
Char2 : Character);
-- Same as above, but no indication if character is loaded
procedure Load_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Loaded : out Boolean);
-- Loads a sequence of zero or more decimal digits. Loaded is set if
-- at least one digit is loaded.
procedure Load_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer);
-- Same as above, but no indication if character is loaded
procedure Load_Extended_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer;
Loaded : out Boolean);
-- Like Load_Digits, but also allows extended digits a-f and A-F
procedure Load_Extended_Digits
(File : File_Type;
Buf : out String;
Ptr : in out Integer);
-- Same as above, but no indication if character is loaded
procedure Load_Integer
(File : File_Type;
Buf : out String;
Ptr : in out Natural);
-- Loads a possibly signed integer literal value
procedure Load_Real
(File : File_Type;
Buf : out String;
Ptr : in out Natural);
-- Loads a possibly signed real literal value
procedure Put_Item (File : File_Type; Str : String);
-- This routine is like Wide_Text_IO.Put, except that it checks for
-- overflow of bounded lines, as described in (RM A.10.6(8)). It is used
-- for all output of numeric values and of enumeration values. Note that
-- the buffer is of type String. Put_Item deals with converting this to
-- Wide_Characters as required.
procedure Store_Char
(File : File_Type;
ch : Integer;
Buf : out String;
Ptr : in out Integer);
-- Store a single character in buffer, checking for overflow and
-- adjusting the column number in the file to reflect the fact
-- that a character has been acquired from the input stream.
-- The pos value of the character to store is in ch on entry.
procedure String_Skip (Str : String; Ptr : out Integer);
-- Used in the Get from string procedures to skip leading blanks in the
-- string. Ptr is set to the index of the first non-blank. If the string
-- is all blanks, then the exception End_Error is raised, Note that blank
-- is defined as a space or horizontal tab (RM A.10.6(5)).
procedure Ungetc (ch : Integer; File : File_Type);
-- Pushes back character into stream, using ungetc. The caller has
-- checked that the file is in read status. Device_Error is raised
-- if the character cannot be pushed back. An attempt to push back
-- an end of file (EOF) is ignored.
private
pragma Inline (Is_Blank);
end Ada.Wide_Text_IO.Generic_Aux;
|
reznikmm/matreshka | Ada | 4,309 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Nodes;
with XML.DOM.Attributes.Internals;
package body ODF.DOM.Attributes.Style.Font_Size_Asian.Internals is
------------
-- Create --
------------
function Create
(Node : Matreshka.ODF_Attributes.Style.Font_Size_Asian.Style_Font_Size_Asian_Access)
return ODF.DOM.Attributes.Style.Font_Size_Asian.ODF_Style_Font_Size_Asian is
begin
return
(XML.DOM.Attributes.Internals.Create
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Create;
----------
-- Wrap --
----------
function Wrap
(Node : Matreshka.ODF_Attributes.Style.Font_Size_Asian.Style_Font_Size_Asian_Access)
return ODF.DOM.Attributes.Style.Font_Size_Asian.ODF_Style_Font_Size_Asian is
begin
return
(XML.DOM.Attributes.Internals.Wrap
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Wrap;
end ODF.DOM.Attributes.Style.Font_Size_Asian.Internals;
|
reznikmm/matreshka | Ada | 4,130 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.OCL.Literal_Exps;
limited with AMF.OCL.Tuple_Literal_Parts.Collections;
package AMF.OCL.Tuple_Literal_Exps is
pragma Preelaborate;
type OCL_Tuple_Literal_Exp is limited interface
and AMF.OCL.Literal_Exps.OCL_Literal_Exp;
type OCL_Tuple_Literal_Exp_Access is
access all OCL_Tuple_Literal_Exp'Class;
for OCL_Tuple_Literal_Exp_Access'Storage_Size use 0;
not overriding function Get_Part
(Self : not null access constant OCL_Tuple_Literal_Exp)
return AMF.OCL.Tuple_Literal_Parts.Collections.Ordered_Set_Of_OCL_Tuple_Literal_Part is abstract;
-- Getter of TupleLiteralExp::part.
--
end AMF.OCL.Tuple_Literal_Exps;
|
onox/orka | Ada | 3,267 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2020 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
private with Ada.Finalization;
private with GL.Objects.Vertex_Arrays;
private with EGL.Debug;
private with EGL.Errors;
private with EGL.Objects.Displays;
private with EGL.Objects.Contexts;
with EGL.Objects.Devices;
package Orka.Contexts.EGL is
pragma Preelaborate;
type Device_EGL_Context is limited new Context with private;
overriding
function Create_Context
(Version : Context_Version;
Flags : Context_Flags := (others => False)) return Device_EGL_Context;
-- Return a surfaceless EGL context using the default device
function Create_Context
(Device : Standard.EGL.Objects.Devices.Device;
Version : Context_Version;
Flags : Context_Flags := (others => False)) return Device_EGL_Context;
-- Return a surfaceless EGL context using the given device
private
type EGL_Context is abstract
limited new Ada.Finalization.Limited_Controlled and Context with
record
Version : Context_Version;
Flags : Context_Flags;
Vertex_Array : GL.Objects.Vertex_Arrays.Vertex_Array_Object;
Previous_State : Orka.Rendering.States.State;
end record;
overriding
procedure Finalize (Object : in out EGL_Context);
overriding
function Version (Object : EGL_Context) return Context_Version is (Object.Version);
overriding
function Flags (Object : EGL_Context) return Context_Flags is (Object.Flags);
overriding
procedure Update_State (Object : in out EGL_Context; State : Orka.Rendering.States.State);
type Device_EGL_Context is limited new EGL_Context with record
Context : Standard.EGL.Objects.Contexts.Context (Standard.EGL.Objects.Displays.Device);
end record;
overriding
function Is_Current (Object : Device_EGL_Context; Kind : Task_Kind) return Boolean is
(Object.Context.Is_Current
(case Kind is
when Current_Task => Standard.EGL.Objects.Contexts.Current_Task,
when Any_Task => Standard.EGL.Objects.Contexts.Any_Task));
overriding
procedure Make_Current (Object : Device_EGL_Context);
overriding
procedure Make_Not_Current (Object : Device_EGL_Context);
----------------------------------------------------------------------------
procedure Print_Debug
(Display : Standard.EGL.Objects.Displays.Display;
Version : Context_Version;
Flags : Context_Flags);
procedure Print_Error
(Error : Standard.EGL.Errors.Error_Code;
Level : Standard.EGL.Debug.Severity;
Command, Message : String);
procedure Post_Initialize (Object : in out EGL_Context'Class);
end Orka.Contexts.EGL;
|
jhumphry/PRNG_Zoo | Ada | 4,721 | ads | --
-- PRNG Zoo
-- Copyright (c) 2014 - 2015, James Humphry
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
package PRNG_Zoo.Misc is
-- Duplicates glibc's random() function, based on the description
-- http://www.mscs.dal.ca/~selinger/random/
-- (Selinger, 2007)
type glibc_random is new PRNG_32Only with private;
function Strength (G : in glibc_random) return PRNG_Strength is (Low);
function Width(G: in glibc_random) return Positive is (31);
function Constructor(Params : not null access PRNG_Parameters'Class)
return glibc_random;
procedure Reset (G : in out glibc_random; S : in U64);
function Generate(G : in out glibc_random) return U32 with inline;
-- KISS generator - a combination of a multiply-with-carry, a 3-shift
-- register and a congruential generator
-- (Marsaglia, 1999)
type KISS is new PRNG_32Only with private;
function Strength (G : in KISS) return PRNG_Strength is (Medium);
function Constructor(Params : not null access PRNG_Parameters'Class)
return KISS;
-- S = 0 resets to Marsaglia's suggested starting parameters
procedure Reset (G : in out KISS; S : in U64);
function Generate(G : in out KISS) return U32 with inline;
-- MurmurHash3
-- This is the finalisation stage of MurmurHash3
-- (https://code.google.com/p/smhasher/wiki/MurmurHash3)
-- used iteratively as a PRNG as suggested by S Vigna. He comments:
-- The multipliers are invertible in Z/2^64Z, and the xor/shifts are
-- invertible in (Z/2Z)^64, so you'll never get zero starting from a
-- nonzero value. Nonetheless, we have no clue of the period. In
-- principle, hitting a bad seed you might get into a very short repeating
-- sequence. The interesting thing is that it passes very well the strongest
-- statistical tests. It can be useful to scramble user-provided 64-bit
-- seeds.
type MurmurHash3 is new PRNG_64Only with private;
function Strength (G : in MurmurHash3) return PRNG_Strength is (Medium);
function Constructor(Params : not null access PRNG_Parameters'Class)
return MurmurHash3;
procedure Reset (G : in out MurmurHash3; S : in U64);
function Generate(G : in out MurmurHash3) return U64 with inline;
-- Fast Splittable Pseudorandom Number Generators
-- based on the C version by Vigna
type SplitMix is new PRNG_64Only with private;
function Strength (G : in SplitMix) return PRNG_Strength is (High);
function Constructor(Params : not null access PRNG_Parameters'Class)
return SplitMix;
procedure Reset (G : in out SplitMix; S : in U64);
function Generate(G : in out SplitMix) return U64 with inline;
private
type glibc_random_index is mod 34;
type glibc_random_state is array (glibc_random_index) of U32;
type glibc_random is new PRNG_32Only with
record
s : glibc_random_state;
p : glibc_random_index := 0;
end record;
function Constructor(Params : not null access PRNG_Parameters'Class)
return glibc_random is
(glibc_random'(others => <>));
type KISS is new PRNG_32Only with
record
z : U32 := 362436069;
w : U32 := 521288629;
jsr : U32 := 123456789;
jcong : U32 := 380116160;
end record;
function Constructor(Params : not null access PRNG_Parameters'Class)
return KISS is
(KISS'(others => <>));
type MurmurHash3 is new PRNG_64Only with
record
s : U64 := 314159263;
end record;
function Constructor(Params : not null access PRNG_Parameters'Class)
return MurmurHash3 is
(MurmurHash3'(others => <>));
type SplitMix is new PRNG_64Only with
record
s : U64 := 314159263;
end record;
function Constructor(Params : not null access PRNG_Parameters'Class)
return SplitMix is
(SplitMix'(others => <>));
end PRNG_Zoo.Misc;
|
Componolit/libsparkcrypto | Ada | 2,308 | ads | -------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- @author Alexander Senier
-- @date 2019-01-16
--
-- Copyright (C) 2018 Componolit GmbH
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with AUnit; use AUnit;
with AUnit.Test_Cases; use AUnit.Test_Cases;
-- @summary Tests test utility functions
package Util_Tests is
type Test_Case is new Test_Cases.Test_Case with null record;
procedure Register_Tests (T: in out Test_Case);
-- Register routines to be run
function Name (T : Test_Case) return Message_String;
-- Provide name identifying the test case
end Util_Tests;
|
Letractively/ada-ado | Ada | 1,721 | ads | -----------------------------------------------------------------------
-- ADO Tests -- Database sequence generator
-- Copyright (C) 2009, 2010 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ADO.Databases;
with ADO.Sessions;
package Regtests is
-- ------------------------------
-- Get the database manager to be used for the unit tests
-- ------------------------------
function Get_Controller return ADO.Databases.DataSource'Class;
-- ------------------------------
-- Get the readonly connection database to be used for the unit tests
-- ------------------------------
function Get_Database return ADO.Sessions.Session;
-- ------------------------------
-- Get the writeable connection database to be used for the unit tests
-- ------------------------------
function Get_Master_Database return ADO.Sessions.Master_Session;
-- ------------------------------
-- Initialize the test database
-- ------------------------------
procedure Initialize (Name : in String);
end Regtests;
|
reznikmm/matreshka | Ada | 4,926 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XML.DOM.Visitors;
with ODF.DOM.Text_Alphabetical_Index_Mark_Start_Elements;
package Matreshka.ODF_Text.Alphabetical_Index_Mark_Start_Elements is
type Text_Alphabetical_Index_Mark_Start_Element_Node is
new Matreshka.ODF_Text.Abstract_Text_Element_Node
and ODF.DOM.Text_Alphabetical_Index_Mark_Start_Elements.ODF_Text_Alphabetical_Index_Mark_Start
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Text_Alphabetical_Index_Mark_Start_Element_Node;
overriding function Get_Local_Name
(Self : not null access constant Text_Alphabetical_Index_Mark_Start_Element_Node)
return League.Strings.Universal_String;
overriding procedure Enter_Node
(Self : not null access Text_Alphabetical_Index_Mark_Start_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Leave_Node
(Self : not null access Text_Alphabetical_Index_Mark_Start_Element_Node;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
overriding procedure Visit_Node
(Self : not null access Text_Alphabetical_Index_Mark_Start_Element_Node;
Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class;
Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class;
Control : in out XML.DOM.Visitors.Traverse_Control);
end Matreshka.ODF_Text.Alphabetical_Index_Mark_Start_Elements;
|
reznikmm/matreshka | Ada | 4,475 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Some initial tests of Index subprogram.
------------------------------------------------------------------------------
with League.Application;
pragma Unreferenced (League.Application);
with League.Strings; use League.Strings;
procedure Test_333 is
S1 : Universal_String := To_Universal_String ("ABCDEFGHIJKLMNO");
P1 : Universal_String := To_Universal_String ("ABC");
P2 : Universal_String := To_Universal_String ("DEF");
P3 : Universal_String := To_Universal_String ("NO");
P4 : Universal_String := To_Universal_String ("YES");
begin
if S1.Index (P1) /= 1 then
raise Program_Error;
end if;
if S1.Index (P2) /= 4 then
raise Program_Error;
end if;
if S1.Index (P3) /= 14 then
raise Program_Error;
end if;
if S1.Index (P4) /= 0 then
raise Program_Error;
end if;
if S1.Index (Empty_Universal_String) /= 0 then
raise Program_Error;
end if;
if Empty_Universal_String.Index (P1) /= 0 then
raise Program_Error;
end if;
if Empty_Universal_String.Index (Empty_Universal_String) /= 0 then
raise Program_Error;
end if;
end Test_333;
|
io7m/coreland-stack-ada | Ada | 1,571 | adb | package body Stack is
use type Count_t;
procedure Push
(Stack : in out Stack_t;
Element : in Element_Type) is
begin
Stack_Vectors.Append (Stack.Vector, Element);
end Push;
procedure Peek
(Stack : in Stack_t;
Process : not null access procedure (Element : Element_Type))
is
Length : constant Count_t := Stack_Vectors.Length (Stack.Vector);
begin
Stack_Vectors.Query_Element
(Container => Stack.Vector,
Index => Natural (Length - 1),
Process => Process);
exception
when Constraint_Error =>
raise Constraint_Error with "Stack underflow";
end Peek;
procedure Peek
(Stack : in Stack_t;
Element : out Element_Type)
is
procedure Peek_Process (Stack_Element : Element_Type) is
begin
Element := Stack_Element;
end Peek_Process;
begin
Peek (Stack, Peek_Process'Access);
end Peek;
procedure Pop
(Stack : in out Stack_t;
Element : out Element_Type) is
begin
Peek (Stack, Element);
Stack_Vectors.Delete_Last (Stack.Vector);
end Pop;
procedure Pop_Discard
(Stack : in out Stack_t)
is
Dummy : Element_Type;
begin
Pop (Stack, Dummy);
end Pop_Discard;
procedure Clear
(Stack : in out Stack_t) is
begin
Stack_Vectors.Delete_First
(Container => Stack.Vector,
Count => Stack_Vectors.Length (Stack.Vector));
end Clear;
function Size
(Stack : Stack_t) return Natural is
begin
return Natural (Stack_Vectors.Length (Stack.Vector));
end Size;
end Stack;
|
reznikmm/matreshka | Ada | 4,025 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with ODF.DOM.Dr3d_Lighting_Mode_Attributes;
package Matreshka.ODF_Dr3d.Lighting_Mode_Attributes is
type Dr3d_Lighting_Mode_Attribute_Node is
new Matreshka.ODF_Dr3d.Abstract_Dr3d_Attribute_Node
and ODF.DOM.Dr3d_Lighting_Mode_Attributes.ODF_Dr3d_Lighting_Mode_Attribute
with null record;
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Dr3d_Lighting_Mode_Attribute_Node;
overriding function Get_Local_Name
(Self : not null access constant Dr3d_Lighting_Mode_Attribute_Node)
return League.Strings.Universal_String;
end Matreshka.ODF_Dr3d.Lighting_Mode_Attributes;
|
reznikmm/matreshka | Ada | 4,712 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Documents;
with Matreshka.ODF_String_Constants;
with ODF.DOM.Iterators;
with ODF.DOM.Visitors;
package body Matreshka.ODF_Style.May_Break_Between_Rows_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Style_May_Break_Between_Rows_Attribute_Node is
begin
return Self : Style_May_Break_Between_Rows_Attribute_Node do
Matreshka.ODF_Style.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Style_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Style_May_Break_Between_Rows_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.May_Break_Between_Rows_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Style_URI,
Matreshka.ODF_String_Constants.May_Break_Between_Rows_Attribute,
Style_May_Break_Between_Rows_Attribute_Node'Tag);
end Matreshka.ODF_Style.May_Break_Between_Rows_Attributes;
|
faelys/natools | Ada | 4,134 | adb | ------------------------------------------------------------------------------
-- Copyright (c) 2016, 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. --
------------------------------------------------------------------------------
package body Natools.String_Escapes is
subtype Hex_Digit is Natural range 0 .. 15;
function C_Escape_Hex (C : Character) return String;
-- Return the string representing C in C-style escaped strings
function Image (N : Hex_Digit) return Character;
-- Return upper-case hexadecimal image of a digit
------------------------------
-- Local Helper Subprograms --
------------------------------
function C_Escape_Hex (C : Character) return String is
begin
case C is
when Character'Val (0) => return "\0";
when Character'Val (8) => return "\b";
when Character'Val (9) => return "\t";
when Character'Val (10) => return "\n";
when Character'Val (11) => return "\f";
when Character'Val (12) => return "\v";
when Character'Val (13) => return "\r";
when Character'Val (34) => return "\""";
when Character'Val (32) | Character'Val (33)
| Character'Val (35) .. Character'Val (126) =>
return String'(1 => C);
when others =>
declare
Code : constant Natural := Character'Pos (C);
begin
return "\x" & Image (Code / 16) & Image (Code mod 16);
end;
end case;
end C_Escape_Hex;
function Image (N : Hex_Digit) return Character is
begin
case N is
when 0 .. 9 =>
return Character'Val (Character'Pos ('0') + N);
when 10 .. 15 =>
return Character'Val (Character'Pos ('A') + N - 10);
end case;
end Image;
----------------------
-- Public Interface --
----------------------
function C_Escape_Hex
(S : String;
Add_Quotes : Boolean := False)
return String
is
Length : Natural := 0;
O : Positive := 1;
Sublength : Natural := 0;
begin
for I in S'Range loop
case S (I) is
when Character'Val (0) | '"'
| Character'Val (8) .. Character'Val (13) =>
Length := Length + 2;
when Character'Val (32) | Character'Val (33)
| Character'Val (35) .. Character'Val (126) =>
Length := Length + 1;
when others =>
Length := Length + 4;
end case;
end loop;
if Add_Quotes then
Length := Length + 2;
end if;
return Result : String (1 .. Length) do
if Add_Quotes then
O := O + 1;
Result (Result'First) := '"';
Result (Result'Last) := '"';
end if;
for I in S'Range loop
O := O + Sublength;
declare
Img : constant String := C_Escape_Hex (S (I));
begin
Sublength := Img'Length;
Result (O .. O + Sublength - 1) := Img;
end;
end loop;
end return;
end C_Escape_Hex;
end Natools.String_Escapes;
|
Rodeo-McCabe/orka | Ada | 2,627 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package Orka.SIMD.AVX.Singles.Math is
pragma Pure;
function Min (Left, Right : m256) return m256
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_minps256";
-- Compare each 32-bit float in Left and Right and take the minimum values.
--
-- Result (I) := Float'Min (Left (I), Right (I)) for I in 1 ..4
function Max (Left, Right : m256) return m256
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_maxps256";
-- Compare each 32-bit float in Left and Right and take the maximum values.
--
-- Result (I) := Float'Max (Left (I), Right (I)) for I in 1 ..4
function Reciprocal (Elements : m256) return m256
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_rcpps256";
-- Return the reciprocal (1/X) of each element
function Reciprocal_Sqrt (Elements : m256) return m256
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_rsqrtps256";
-- Return the reciprocal of the square root (1/Sqrt(X)) of each element
function Sqrt (Elements : m256) return m256
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_sqrtps256";
-- Return the square root (Sqrt(X)) of each element
function Round (Elements : m256; Rounding : Unsigned_32) return m256
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_roundps256";
function Round_Nearest_Integer (Elements : m256) return m256 is
(Round (Elements, 0));
-- Round each element to the nearest integer
function Floor (Elements : m256) return m256 is
(Round (Elements, 1));
-- Round each element down to an integer value
function Ceil (Elements : m256) return m256 is
(Round (Elements, 2));
-- Round each element up to an integer value
function Round_Truncate (Elements : m256) return m256 is
(Round (Elements, 3));
-- Round each element to zero
end Orka.SIMD.AVX.Singles.Math;
|
francesco-bongiovanni/ewok-kernel | Ada | 4,097 | ads | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- 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 ewok.tasks_shared; use ewok.tasks_shared;
with ewok.exported.dma;
package ewok.sanitize
with spark_mode => on
is
function is_word_in_data_slot
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
Global => null,
Post => (if (ptr + 4 not in system_address'range) then is_word_in_data_slot'Result = false);
function is_word_in_txt_slot
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id) return boolean
with
Global => null,
-- there is now hypothesis on input values, yet we impose some
-- specific behavior for various overflows
Post => (if (ptr + 4 not in system_address'range) then is_word_in_txt_slot'Result = false);
function is_word_in_allocated_device
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id)
return boolean;
function is_word_in_any_slot
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
Global => null,
-- there is now hypothesis on input values, yet we impose some
-- specific behavior for various overflows
Post => (if (ptr + 4 not in system_address'range) then is_word_in_any_slot'Result = false);
function is_range_in_data_slot
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
Global => null,
-- there is now hypothesis on input values, yet we impose some
-- specific behavior for various overflows
Post => (if (ptr + size not in system_address'range) then is_range_in_data_slot'Result = false);
function is_range_in_txt_slot
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id) return boolean
with
Global => null,
-- there is now hypothesis on input values, yet we impose some
-- specific behavior for various overflows
Post => (if (ptr + size not in system_address'range) then is_range_in_txt_slot'Result = false);
function is_range_in_any_slot
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
Global => null,
-- there is now hypothesis on input values, yet we impose some
-- specific behavior for various overflows
Post => (if (ptr + size not in system_address'range) then is_range_in_any_slot'Result = false);
function is_range_in_dma_shm
(ptr : system_address;
size : unsigned_32;
dma_access : ewok.exported.dma.t_dma_shm_access;
task_id : ewok.tasks_shared.t_task_id) return boolean
with
Spark_Mode => off,
Global => null,
-- there is now hypothesis on input values, yet we impose some
-- specific behavior for various overflows
Post => (if (ptr + size not in system_address'range) then is_range_in_dma_shm'Result = false);
end ewok.sanitize;
|
AdaCore/libadalang | Ada | 128 | adb | package body P is
pragma Test (Foo);
function Foo return T is
V : T;
begin
return V;
end Foo;
end P;
|
tum-ei-rcs/StratoX | Ada | 50,555 | ads | -- This spec has been automatically generated from STM32F40x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
with HAL;
with System;
package STM32_SVD.RCC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-----------------
-- CR_Register --
-----------------
subtype CR_HSITRIM_Field is HAL.UInt5;
subtype CR_HSICAL_Field is HAL.Byte;
-- clock control register
type CR_Register is record
-- Internal high-speed clock enable
HSION : Boolean := True;
-- Read-only. Internal high-speed clock ready flag
HSIRDY : Boolean := True;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Internal high-speed clock trimming
HSITRIM : CR_HSITRIM_Field := 16#10#;
-- Read-only. Internal high-speed clock calibration
HSICAL : CR_HSICAL_Field := 16#0#;
-- HSE clock enable
HSEON : Boolean := False;
-- Read-only. HSE clock ready flag
HSERDY : Boolean := False;
-- HSE clock bypass
HSEBYP : Boolean := False;
-- Clock security system enable
CSSON : Boolean := False;
-- unspecified
Reserved_20_23 : HAL.UInt4 := 16#0#;
-- Main PLL (PLL) enable
PLLON : Boolean := False;
-- Read-only. Main PLL (PLL) clock ready flag
PLLRDY : Boolean := False;
-- PLLI2S enable
PLLI2SON : Boolean := False;
-- Read-only. PLLI2S clock ready flag
PLLI2SRDY : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
HSION at 0 range 0 .. 0;
HSIRDY at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
HSITRIM at 0 range 3 .. 7;
HSICAL at 0 range 8 .. 15;
HSEON at 0 range 16 .. 16;
HSERDY at 0 range 17 .. 17;
HSEBYP at 0 range 18 .. 18;
CSSON at 0 range 19 .. 19;
Reserved_20_23 at 0 range 20 .. 23;
PLLON at 0 range 24 .. 24;
PLLRDY at 0 range 25 .. 25;
PLLI2SON at 0 range 26 .. 26;
PLLI2SRDY at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
----------------------
-- PLLCFGR_Register --
----------------------
subtype PLLCFGR_PLLM_Field is HAL.UInt6;
subtype PLLCFGR_PLLN_Field is HAL.UInt9;
subtype PLLCFGR_PLLP_Field is HAL.UInt2;
subtype PLLCFGR_PLLQ_Field is HAL.UInt4;
-- PLL configuration register
type PLLCFGR_Register is record
-- Division factor for the main PLL (PLL) and audio PLL (PLLI2S) input
-- clock
PLLM : PLLCFGR_PLLM_Field := 16#10#;
-- Main PLL (PLL) multiplication factor for VCO
PLLN : PLLCFGR_PLLN_Field := 16#C0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- Main PLL (PLL) division factor for main system clock
PLLP : PLLCFGR_PLLP_Field := 16#0#;
-- unspecified
Reserved_18_21 : HAL.UInt4 := 16#0#;
-- Main PLL(PLL) and audio PLL (PLLI2S) entry clock source
PLLSRC : Boolean := False;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- Main PLL (PLL) division factor for USB OTG FS, SDIO and random number
-- generator clocks
PLLQ : PLLCFGR_PLLQ_Field := 16#4#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#2#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PLLCFGR_Register use record
PLLM at 0 range 0 .. 5;
PLLN at 0 range 6 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
PLLP at 0 range 16 .. 17;
Reserved_18_21 at 0 range 18 .. 21;
PLLSRC at 0 range 22 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
PLLQ at 0 range 24 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-------------------
-- CFGR_Register --
-------------------
subtype CFGR_SW_Field is HAL.UInt2;
subtype CFGR_SWS_Field is HAL.UInt2;
subtype CFGR_HPRE_Field is HAL.UInt4;
---------------
-- CFGR.PPRE --
---------------
-- CFGR_PPRE array element
subtype CFGR_PPRE_Element is HAL.UInt3;
-- CFGR_PPRE array
type CFGR_PPRE_Field_Array is array (1 .. 2) of CFGR_PPRE_Element
with Component_Size => 3, Size => 6;
-- Type definition for CFGR_PPRE
type CFGR_PPRE_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PPRE as a value
Val : HAL.UInt6;
when True =>
-- PPRE as an array
Arr : CFGR_PPRE_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for CFGR_PPRE_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
subtype CFGR_RTCPRE_Field is HAL.UInt5;
subtype CFGR_MCO1_Field is HAL.UInt2;
subtype CFGR_MCO1PRE_Field is HAL.UInt3;
subtype CFGR_MCO2PRE_Field is HAL.UInt3;
subtype CFGR_MCO2_Field is HAL.UInt2;
-- clock configuration register
type CFGR_Register is record
-- System clock switch
SW : CFGR_SW_Field := 16#0#;
-- Read-only. System clock switch status
SWS : CFGR_SWS_Field := 16#0#;
-- AHB prescaler
HPRE : CFGR_HPRE_Field := 16#0#;
-- unspecified
Reserved_8_9 : HAL.UInt2 := 16#0#;
-- APB Low speed prescaler (APB1)
PPRE : CFGR_PPRE_Field := (As_Array => False, Val => 16#0#);
-- HSE division factor for RTC clock
RTCPRE : CFGR_RTCPRE_Field := 16#0#;
-- Microcontroller clock output 1
MCO1 : CFGR_MCO1_Field := 16#0#;
-- I2S clock selection
I2SSRC : Boolean := False;
-- MCO1 prescaler
MCO1PRE : CFGR_MCO1PRE_Field := 16#0#;
-- MCO2 prescaler
MCO2PRE : CFGR_MCO2PRE_Field := 16#0#;
-- Microcontroller clock output 2
MCO2 : CFGR_MCO2_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR_Register use record
SW at 0 range 0 .. 1;
SWS at 0 range 2 .. 3;
HPRE at 0 range 4 .. 7;
Reserved_8_9 at 0 range 8 .. 9;
PPRE at 0 range 10 .. 15;
RTCPRE at 0 range 16 .. 20;
MCO1 at 0 range 21 .. 22;
I2SSRC at 0 range 23 .. 23;
MCO1PRE at 0 range 24 .. 26;
MCO2PRE at 0 range 27 .. 29;
MCO2 at 0 range 30 .. 31;
end record;
------------------
-- CIR_Register --
------------------
-- clock interrupt register
type CIR_Register is record
-- Read-only. LSI ready interrupt flag
LSIRDYF : Boolean := False;
-- Read-only. LSE ready interrupt flag
LSERDYF : Boolean := False;
-- Read-only. HSI ready interrupt flag
HSIRDYF : Boolean := False;
-- Read-only. HSE ready interrupt flag
HSERDYF : Boolean := False;
-- Read-only. Main PLL (PLL) ready interrupt flag
PLLRDYF : Boolean := False;
-- Read-only. PLLI2S ready interrupt flag
PLLI2SRDYF : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Read-only. Clock security system interrupt flag
CSSF : Boolean := False;
-- LSI ready interrupt enable
LSIRDYIE : Boolean := False;
-- LSE ready interrupt enable
LSERDYIE : Boolean := False;
-- HSI ready interrupt enable
HSIRDYIE : Boolean := False;
-- HSE ready interrupt enable
HSERDYIE : Boolean := False;
-- Main PLL (PLL) ready interrupt enable
PLLRDYIE : Boolean := False;
-- PLLI2S ready interrupt enable
PLLI2SRDYIE : Boolean := False;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Write-only. LSI ready interrupt clear
LSIRDYC : Boolean := False;
-- Write-only. LSE ready interrupt clear
LSERDYC : Boolean := False;
-- Write-only. HSI ready interrupt clear
HSIRDYC : Boolean := False;
-- Write-only. HSE ready interrupt clear
HSERDYC : Boolean := False;
-- Write-only. Main PLL(PLL) ready interrupt clear
PLLRDYC : Boolean := False;
-- Write-only. PLLI2S ready interrupt clear
PLLI2SRDYC : Boolean := False;
-- unspecified
Reserved_22_22 : HAL.Bit := 16#0#;
-- Write-only. Clock security system interrupt clear
CSSC : Boolean := False;
-- unspecified
Reserved_24_31 : HAL.Byte := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CIR_Register use record
LSIRDYF at 0 range 0 .. 0;
LSERDYF at 0 range 1 .. 1;
HSIRDYF at 0 range 2 .. 2;
HSERDYF at 0 range 3 .. 3;
PLLRDYF at 0 range 4 .. 4;
PLLI2SRDYF at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
CSSF at 0 range 7 .. 7;
LSIRDYIE at 0 range 8 .. 8;
LSERDYIE at 0 range 9 .. 9;
HSIRDYIE at 0 range 10 .. 10;
HSERDYIE at 0 range 11 .. 11;
PLLRDYIE at 0 range 12 .. 12;
PLLI2SRDYIE at 0 range 13 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
LSIRDYC at 0 range 16 .. 16;
LSERDYC at 0 range 17 .. 17;
HSIRDYC at 0 range 18 .. 18;
HSERDYC at 0 range 19 .. 19;
PLLRDYC at 0 range 20 .. 20;
PLLI2SRDYC at 0 range 21 .. 21;
Reserved_22_22 at 0 range 22 .. 22;
CSSC at 0 range 23 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-----------------------
-- AHB1RSTR_Register --
-----------------------
-- AHB1 peripheral reset register
type AHB1RSTR_Register is record
-- IO port A reset
GPIOARST : Boolean := False;
-- IO port B reset
GPIOBRST : Boolean := False;
-- IO port C reset
GPIOCRST : Boolean := False;
-- IO port D reset
GPIODRST : Boolean := False;
-- IO port E reset
GPIOERST : Boolean := False;
-- IO port F reset
GPIOFRST : Boolean := False;
-- IO port G reset
GPIOGRST : Boolean := False;
-- IO port H reset
GPIOHRST : Boolean := False;
-- IO port I reset
GPIOIRST : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- CRC reset
CRCRST : Boolean := False;
-- unspecified
Reserved_13_20 : HAL.Byte := 16#0#;
-- DMA2 reset
DMA1RST : Boolean := False;
-- DMA2 reset
DMA2RST : Boolean := False;
-- unspecified
Reserved_23_24 : HAL.UInt2 := 16#0#;
-- Ethernet MAC reset
ETHMACRST : Boolean := False;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- USB OTG HS module reset
OTGHSRST : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB1RSTR_Register use record
GPIOARST at 0 range 0 .. 0;
GPIOBRST at 0 range 1 .. 1;
GPIOCRST at 0 range 2 .. 2;
GPIODRST at 0 range 3 .. 3;
GPIOERST at 0 range 4 .. 4;
GPIOFRST at 0 range 5 .. 5;
GPIOGRST at 0 range 6 .. 6;
GPIOHRST at 0 range 7 .. 7;
GPIOIRST at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
CRCRST at 0 range 12 .. 12;
Reserved_13_20 at 0 range 13 .. 20;
DMA1RST at 0 range 21 .. 21;
DMA2RST at 0 range 22 .. 22;
Reserved_23_24 at 0 range 23 .. 24;
ETHMACRST at 0 range 25 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
OTGHSRST at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-----------------------
-- AHB2RSTR_Register --
-----------------------
-- AHB2 peripheral reset register
type AHB2RSTR_Register is record
-- Camera interface reset
DCMIRST : Boolean := False;
-- unspecified
Reserved_1_5 : HAL.UInt5 := 16#0#;
-- Random number generator module reset
RNGRST : Boolean := False;
-- USB OTG FS module reset
OTGFSRST : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB2RSTR_Register use record
DCMIRST at 0 range 0 .. 0;
Reserved_1_5 at 0 range 1 .. 5;
RNGRST at 0 range 6 .. 6;
OTGFSRST at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-----------------------
-- AHB3RSTR_Register --
-----------------------
-- AHB3 peripheral reset register
type AHB3RSTR_Register is record
-- Flexible static memory controller module reset
FSMCRST : Boolean := False;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB3RSTR_Register use record
FSMCRST at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-----------------------
-- APB1RSTR_Register --
-----------------------
-- APB1 peripheral reset register
type APB1RSTR_Register is record
-- TIM2 reset
TIM2RST : Boolean := False;
-- TIM3 reset
TIM3RST : Boolean := False;
-- TIM4 reset
TIM4RST : Boolean := False;
-- TIM5 reset
TIM5RST : Boolean := False;
-- TIM6 reset
TIM6RST : Boolean := False;
-- TIM7 reset
TIM7RST : Boolean := False;
-- TIM12 reset
TIM12RST : Boolean := False;
-- TIM13 reset
TIM13RST : Boolean := False;
-- TIM14 reset
TIM14RST : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- Window watchdog reset
WWDGRST : Boolean := False;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- SPI 2 reset
SPI2RST : Boolean := False;
-- SPI 3 reset
SPI3RST : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- USART 2 reset
UART2RST : Boolean := False;
-- USART 3 reset
UART3RST : Boolean := False;
-- USART 4 reset
UART4RST : Boolean := False;
-- USART 5 reset
UART5RST : Boolean := False;
-- I2C 1 reset
I2C1RST : Boolean := False;
-- I2C 2 reset
I2C2RST : Boolean := False;
-- I2C3 reset
I2C3RST : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- CAN1 reset
CAN1RST : Boolean := False;
-- CAN2 reset
CAN2RST : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Power interface reset
PWRRST : Boolean := False;
-- DAC reset
DACRST : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB1RSTR_Register use record
TIM2RST at 0 range 0 .. 0;
TIM3RST at 0 range 1 .. 1;
TIM4RST at 0 range 2 .. 2;
TIM5RST at 0 range 3 .. 3;
TIM6RST at 0 range 4 .. 4;
TIM7RST at 0 range 5 .. 5;
TIM12RST at 0 range 6 .. 6;
TIM13RST at 0 range 7 .. 7;
TIM14RST at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
WWDGRST at 0 range 11 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
SPI2RST at 0 range 14 .. 14;
SPI3RST at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
UART2RST at 0 range 17 .. 17;
UART3RST at 0 range 18 .. 18;
UART4RST at 0 range 19 .. 19;
UART5RST at 0 range 20 .. 20;
I2C1RST at 0 range 21 .. 21;
I2C2RST at 0 range 22 .. 22;
I2C3RST at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
CAN1RST at 0 range 25 .. 25;
CAN2RST at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
PWRRST at 0 range 28 .. 28;
DACRST at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-----------------------
-- APB2RSTR_Register --
-----------------------
-- APB2 peripheral reset register
type APB2RSTR_Register is record
-- TIM1 reset
TIM1RST : Boolean := False;
-- TIM8 reset
TIM8RST : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- USART1 reset
USART1RST : Boolean := False;
-- USART6 reset
USART6RST : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADC interface reset (common to all ADCs)
ADCRST : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- SDIO reset
SDIORST : Boolean := False;
-- SPI 1 reset
SPI1RST : Boolean := False;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- System configuration controller reset
SYSCFGRST : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- TIM9 reset
TIM9RST : Boolean := False;
-- TIM10 reset
TIM10RST : Boolean := False;
-- TIM11 reset
TIM11RST : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB2RSTR_Register use record
TIM1RST at 0 range 0 .. 0;
TIM8RST at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
USART1RST at 0 range 4 .. 4;
USART6RST at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADCRST at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
SDIORST at 0 range 11 .. 11;
SPI1RST at 0 range 12 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
SYSCFGRST at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
TIM9RST at 0 range 16 .. 16;
TIM10RST at 0 range 17 .. 17;
TIM11RST at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
----------------------
-- AHB1ENR_Register --
----------------------
-- AHB1 peripheral clock register
type AHB1ENR_Register is record
-- IO port A clock enable
GPIOAEN : Boolean := False;
-- IO port B clock enable
GPIOBEN : Boolean := False;
-- IO port C clock enable
GPIOCEN : Boolean := False;
-- IO port D clock enable
GPIODEN : Boolean := False;
-- IO port E clock enable
GPIOEEN : Boolean := False;
-- IO port F clock enable
GPIOFEN : Boolean := False;
-- IO port G clock enable
GPIOGEN : Boolean := False;
-- IO port H clock enable
GPIOHEN : Boolean := False;
-- IO port I clock enable
GPIOIEN : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- CRC clock enable
CRCEN : Boolean := False;
-- unspecified
Reserved_13_17 : HAL.UInt5 := 16#0#;
-- Backup SRAM interface clock enable
BKPSRAMEN : Boolean := False;
-- unspecified
Reserved_19_20 : HAL.UInt2 := 16#2#;
-- DMA1 clock enable
DMA1EN : Boolean := False;
-- DMA2 clock enable
DMA2EN : Boolean := False;
-- unspecified
Reserved_23_24 : HAL.UInt2 := 16#0#;
-- Ethernet MAC clock enable
ETHMACEN : Boolean := False;
-- Ethernet Transmission clock enable
ETHMACTXEN : Boolean := False;
-- Ethernet Reception clock enable
ETHMACRXEN : Boolean := False;
-- Ethernet PTP clock enable
ETHMACPTPEN : Boolean := False;
-- USB OTG HS clock enable
OTGHSEN : Boolean := False;
-- USB OTG HSULPI clock enable
OTGHSULPIEN : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB1ENR_Register use record
GPIOAEN at 0 range 0 .. 0;
GPIOBEN at 0 range 1 .. 1;
GPIOCEN at 0 range 2 .. 2;
GPIODEN at 0 range 3 .. 3;
GPIOEEN at 0 range 4 .. 4;
GPIOFEN at 0 range 5 .. 5;
GPIOGEN at 0 range 6 .. 6;
GPIOHEN at 0 range 7 .. 7;
GPIOIEN at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
CRCEN at 0 range 12 .. 12;
Reserved_13_17 at 0 range 13 .. 17;
BKPSRAMEN at 0 range 18 .. 18;
Reserved_19_20 at 0 range 19 .. 20;
DMA1EN at 0 range 21 .. 21;
DMA2EN at 0 range 22 .. 22;
Reserved_23_24 at 0 range 23 .. 24;
ETHMACEN at 0 range 25 .. 25;
ETHMACTXEN at 0 range 26 .. 26;
ETHMACRXEN at 0 range 27 .. 27;
ETHMACPTPEN at 0 range 28 .. 28;
OTGHSEN at 0 range 29 .. 29;
OTGHSULPIEN at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
----------------------
-- AHB2ENR_Register --
----------------------
-- AHB2 peripheral clock enable register
type AHB2ENR_Register is record
-- Camera interface enable
DCMIEN : Boolean := False;
-- unspecified
Reserved_1_5 : HAL.UInt5 := 16#0#;
-- Random number generator clock enable
RNGEN : Boolean := False;
-- USB OTG FS clock enable
OTGFSEN : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB2ENR_Register use record
DCMIEN at 0 range 0 .. 0;
Reserved_1_5 at 0 range 1 .. 5;
RNGEN at 0 range 6 .. 6;
OTGFSEN at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
----------------------
-- AHB3ENR_Register --
----------------------
-- AHB3 peripheral clock enable register
type AHB3ENR_Register is record
-- Flexible static memory controller module clock enable
FSMCEN : Boolean := False;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB3ENR_Register use record
FSMCEN at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
----------------------
-- APB1ENR_Register --
----------------------
-- APB1 peripheral clock enable register
type APB1ENR_Register is record
-- TIM2 clock enable
TIM2EN : Boolean := False;
-- TIM3 clock enable
TIM3EN : Boolean := False;
-- TIM4 clock enable
TIM4EN : Boolean := False;
-- TIM5 clock enable
TIM5EN : Boolean := False;
-- TIM6 clock enable
TIM6EN : Boolean := False;
-- TIM7 clock enable
TIM7EN : Boolean := False;
-- TIM12 clock enable
TIM12EN : Boolean := False;
-- TIM13 clock enable
TIM13EN : Boolean := False;
-- TIM14 clock enable
TIM14EN : Boolean := False;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- Window watchdog clock enable
WWDGEN : Boolean := False;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- SPI2 clock enable
SPI2EN : Boolean := False;
-- SPI3 clock enable
SPI3EN : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- USART 2 clock enable
USART2EN : Boolean := False;
-- USART3 clock enable
USART3EN : Boolean := False;
-- UART4 clock enable
UART4EN : Boolean := False;
-- UART5 clock enable
UART5EN : Boolean := False;
-- I2C1 clock enable
I2C1EN : Boolean := False;
-- I2C2 clock enable
I2C2EN : Boolean := False;
-- I2C3 clock enable
I2C3EN : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- CAN 1 clock enable
CAN1EN : Boolean := False;
-- CAN 2 clock enable
CAN2EN : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Power interface clock enable
PWREN : Boolean := False;
-- DAC interface clock enable
DACEN : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB1ENR_Register use record
TIM2EN at 0 range 0 .. 0;
TIM3EN at 0 range 1 .. 1;
TIM4EN at 0 range 2 .. 2;
TIM5EN at 0 range 3 .. 3;
TIM6EN at 0 range 4 .. 4;
TIM7EN at 0 range 5 .. 5;
TIM12EN at 0 range 6 .. 6;
TIM13EN at 0 range 7 .. 7;
TIM14EN at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
WWDGEN at 0 range 11 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
SPI2EN at 0 range 14 .. 14;
SPI3EN at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
USART2EN at 0 range 17 .. 17;
USART3EN at 0 range 18 .. 18;
UART4EN at 0 range 19 .. 19;
UART5EN at 0 range 20 .. 20;
I2C1EN at 0 range 21 .. 21;
I2C2EN at 0 range 22 .. 22;
I2C3EN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
CAN1EN at 0 range 25 .. 25;
CAN2EN at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
PWREN at 0 range 28 .. 28;
DACEN at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
----------------------
-- APB2ENR_Register --
----------------------
-- APB2 peripheral clock enable register
type APB2ENR_Register is record
-- TIM1 clock enable
TIM1EN : Boolean := False;
-- TIM8 clock enable
TIM8EN : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- USART1 clock enable
USART1EN : Boolean := False;
-- USART6 clock enable
USART6EN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADC1 clock enable
ADC1EN : Boolean := False;
-- ADC2 clock enable
ADC2EN : Boolean := False;
-- ADC3 clock enable
ADC3EN : Boolean := False;
-- SDIO clock enable
SDIOEN : Boolean := False;
-- SPI1 clock enable
SPI1EN : Boolean := False;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- System configuration controller clock enable
SYSCFGEN : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- TIM9 clock enable
TIM9EN : Boolean := False;
-- TIM10 clock enable
TIM10EN : Boolean := False;
-- TIM11 clock enable
TIM11EN : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB2ENR_Register use record
TIM1EN at 0 range 0 .. 0;
TIM8EN at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
USART1EN at 0 range 4 .. 4;
USART6EN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADC1EN at 0 range 8 .. 8;
ADC2EN at 0 range 9 .. 9;
ADC3EN at 0 range 10 .. 10;
SDIOEN at 0 range 11 .. 11;
SPI1EN at 0 range 12 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
SYSCFGEN at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
TIM9EN at 0 range 16 .. 16;
TIM10EN at 0 range 17 .. 17;
TIM11EN at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
------------------------
-- AHB1LPENR_Register --
------------------------
-- AHB1 peripheral clock enable in low power mode register
type AHB1LPENR_Register is record
-- IO port A clock enable during sleep mode
GPIOALPEN : Boolean := True;
-- IO port B clock enable during Sleep mode
GPIOBLPEN : Boolean := True;
-- IO port C clock enable during Sleep mode
GPIOCLPEN : Boolean := True;
-- IO port D clock enable during Sleep mode
GPIODLPEN : Boolean := True;
-- IO port E clock enable during Sleep mode
GPIOELPEN : Boolean := True;
-- IO port F clock enable during Sleep mode
GPIOFLPEN : Boolean := True;
-- IO port G clock enable during Sleep mode
GPIOGLPEN : Boolean := True;
-- IO port H clock enable during Sleep mode
GPIOHLPEN : Boolean := True;
-- IO port I clock enable during Sleep mode
GPIOILPEN : Boolean := True;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- CRC clock enable during Sleep mode
CRCLPEN : Boolean := True;
-- unspecified
Reserved_13_14 : HAL.UInt2 := 16#0#;
-- Flash interface clock enable during Sleep mode
FLITFLPEN : Boolean := True;
-- SRAM 1interface clock enable during Sleep mode
SRAM1LPEN : Boolean := True;
-- SRAM 2 interface clock enable during Sleep mode
SRAM2LPEN : Boolean := True;
-- Backup SRAM interface clock enable during Sleep mode
BKPSRAMLPEN : Boolean := True;
-- unspecified
Reserved_19_20 : HAL.UInt2 := 16#0#;
-- DMA1 clock enable during Sleep mode
DMA1LPEN : Boolean := True;
-- DMA2 clock enable during Sleep mode
DMA2LPEN : Boolean := True;
-- unspecified
Reserved_23_24 : HAL.UInt2 := 16#0#;
-- Ethernet MAC clock enable during Sleep mode
ETHMACLPEN : Boolean := True;
-- Ethernet transmission clock enable during Sleep mode
ETHMACTXLPEN : Boolean := True;
-- Ethernet reception clock enable during Sleep mode
ETHMACRXLPEN : Boolean := True;
-- Ethernet PTP clock enable during Sleep mode
ETHMACPTPLPEN : Boolean := True;
-- USB OTG HS clock enable during Sleep mode
OTGHSLPEN : Boolean := True;
-- USB OTG HS ULPI clock enable during Sleep mode
OTGHSULPILPEN : Boolean := True;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB1LPENR_Register use record
GPIOALPEN at 0 range 0 .. 0;
GPIOBLPEN at 0 range 1 .. 1;
GPIOCLPEN at 0 range 2 .. 2;
GPIODLPEN at 0 range 3 .. 3;
GPIOELPEN at 0 range 4 .. 4;
GPIOFLPEN at 0 range 5 .. 5;
GPIOGLPEN at 0 range 6 .. 6;
GPIOHLPEN at 0 range 7 .. 7;
GPIOILPEN at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
CRCLPEN at 0 range 12 .. 12;
Reserved_13_14 at 0 range 13 .. 14;
FLITFLPEN at 0 range 15 .. 15;
SRAM1LPEN at 0 range 16 .. 16;
SRAM2LPEN at 0 range 17 .. 17;
BKPSRAMLPEN at 0 range 18 .. 18;
Reserved_19_20 at 0 range 19 .. 20;
DMA1LPEN at 0 range 21 .. 21;
DMA2LPEN at 0 range 22 .. 22;
Reserved_23_24 at 0 range 23 .. 24;
ETHMACLPEN at 0 range 25 .. 25;
ETHMACTXLPEN at 0 range 26 .. 26;
ETHMACRXLPEN at 0 range 27 .. 27;
ETHMACPTPLPEN at 0 range 28 .. 28;
OTGHSLPEN at 0 range 29 .. 29;
OTGHSULPILPEN at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
------------------------
-- AHB2LPENR_Register --
------------------------
-- AHB2 peripheral clock enable in low power mode register
type AHB2LPENR_Register is record
-- Camera interface enable during Sleep mode
DCMILPEN : Boolean := True;
-- unspecified
Reserved_1_5 : HAL.UInt5 := 16#18#;
-- Random number generator clock enable during Sleep mode
RNGLPEN : Boolean := True;
-- USB OTG FS clock enable during Sleep mode
OTGFSLPEN : Boolean := True;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB2LPENR_Register use record
DCMILPEN at 0 range 0 .. 0;
Reserved_1_5 at 0 range 1 .. 5;
RNGLPEN at 0 range 6 .. 6;
OTGFSLPEN at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
------------------------
-- AHB3LPENR_Register --
------------------------
-- AHB3 peripheral clock enable in low power mode register
type AHB3LPENR_Register is record
-- Flexible static memory controller module clock enable during Sleep
-- mode
FSMCLPEN : Boolean := True;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AHB3LPENR_Register use record
FSMCLPEN at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
------------------------
-- APB1LPENR_Register --
------------------------
-- APB1 peripheral clock enable in low power mode register
type APB1LPENR_Register is record
-- TIM2 clock enable during Sleep mode
TIM2LPEN : Boolean := True;
-- TIM3 clock enable during Sleep mode
TIM3LPEN : Boolean := True;
-- TIM4 clock enable during Sleep mode
TIM4LPEN : Boolean := True;
-- TIM5 clock enable during Sleep mode
TIM5LPEN : Boolean := True;
-- TIM6 clock enable during Sleep mode
TIM6LPEN : Boolean := True;
-- TIM7 clock enable during Sleep mode
TIM7LPEN : Boolean := True;
-- TIM12 clock enable during Sleep mode
TIM12LPEN : Boolean := True;
-- TIM13 clock enable during Sleep mode
TIM13LPEN : Boolean := True;
-- TIM14 clock enable during Sleep mode
TIM14LPEN : Boolean := True;
-- unspecified
Reserved_9_10 : HAL.UInt2 := 16#0#;
-- Window watchdog clock enable during Sleep mode
WWDGLPEN : Boolean := True;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- SPI2 clock enable during Sleep mode
SPI2LPEN : Boolean := True;
-- SPI3 clock enable during Sleep mode
SPI3LPEN : Boolean := True;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- USART2 clock enable during Sleep mode
USART2LPEN : Boolean := True;
-- USART3 clock enable during Sleep mode
USART3LPEN : Boolean := True;
-- UART4 clock enable during Sleep mode
UART4LPEN : Boolean := True;
-- UART5 clock enable during Sleep mode
UART5LPEN : Boolean := True;
-- I2C1 clock enable during Sleep mode
I2C1LPEN : Boolean := True;
-- I2C2 clock enable during Sleep mode
I2C2LPEN : Boolean := True;
-- I2C3 clock enable during Sleep mode
I2C3LPEN : Boolean := True;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
-- CAN 1 clock enable during Sleep mode
CAN1LPEN : Boolean := True;
-- CAN 2 clock enable during Sleep mode
CAN2LPEN : Boolean := True;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Power interface clock enable during Sleep mode
PWRLPEN : Boolean := True;
-- DAC interface clock enable during Sleep mode
DACLPEN : Boolean := True;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB1LPENR_Register use record
TIM2LPEN at 0 range 0 .. 0;
TIM3LPEN at 0 range 1 .. 1;
TIM4LPEN at 0 range 2 .. 2;
TIM5LPEN at 0 range 3 .. 3;
TIM6LPEN at 0 range 4 .. 4;
TIM7LPEN at 0 range 5 .. 5;
TIM12LPEN at 0 range 6 .. 6;
TIM13LPEN at 0 range 7 .. 7;
TIM14LPEN at 0 range 8 .. 8;
Reserved_9_10 at 0 range 9 .. 10;
WWDGLPEN at 0 range 11 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
SPI2LPEN at 0 range 14 .. 14;
SPI3LPEN at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
USART2LPEN at 0 range 17 .. 17;
USART3LPEN at 0 range 18 .. 18;
UART4LPEN at 0 range 19 .. 19;
UART5LPEN at 0 range 20 .. 20;
I2C1LPEN at 0 range 21 .. 21;
I2C2LPEN at 0 range 22 .. 22;
I2C3LPEN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
CAN1LPEN at 0 range 25 .. 25;
CAN2LPEN at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
PWRLPEN at 0 range 28 .. 28;
DACLPEN at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
------------------------
-- APB2LPENR_Register --
------------------------
-- APB2 peripheral clock enabled in low power mode register
type APB2LPENR_Register is record
-- TIM1 clock enable during Sleep mode
TIM1LPEN : Boolean := True;
-- TIM8 clock enable during Sleep mode
TIM8LPEN : Boolean := True;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- USART1 clock enable during Sleep mode
USART1LPEN : Boolean := True;
-- USART6 clock enable during Sleep mode
USART6LPEN : Boolean := True;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADC1 clock enable during Sleep mode
ADC1LPEN : Boolean := True;
-- ADC2 clock enable during Sleep mode
ADC2LPEN : Boolean := True;
-- ADC 3 clock enable during Sleep mode
ADC3LPEN : Boolean := True;
-- SDIO clock enable during Sleep mode
SDIOLPEN : Boolean := True;
-- SPI 1 clock enable during Sleep mode
SPI1LPEN : Boolean := True;
-- unspecified
Reserved_13_13 : HAL.Bit := 16#0#;
-- System configuration controller clock enable during Sleep mode
SYSCFGLPEN : Boolean := True;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- TIM9 clock enable during sleep mode
TIM9LPEN : Boolean := True;
-- TIM10 clock enable during Sleep mode
TIM10LPEN : Boolean := True;
-- TIM11 clock enable during Sleep mode
TIM11LPEN : Boolean := True;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for APB2LPENR_Register use record
TIM1LPEN at 0 range 0 .. 0;
TIM8LPEN at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
USART1LPEN at 0 range 4 .. 4;
USART6LPEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADC1LPEN at 0 range 8 .. 8;
ADC2LPEN at 0 range 9 .. 9;
ADC3LPEN at 0 range 10 .. 10;
SDIOLPEN at 0 range 11 .. 11;
SPI1LPEN at 0 range 12 .. 12;
Reserved_13_13 at 0 range 13 .. 13;
SYSCFGLPEN at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
TIM9LPEN at 0 range 16 .. 16;
TIM10LPEN at 0 range 17 .. 17;
TIM11LPEN at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
-------------------
-- BDCR_Register --
-------------------
-----------------
-- BDCR.RTCSEL --
-----------------
-- BDCR_RTCSEL array
type BDCR_RTCSEL_Field_Array is array (0 .. 1) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for BDCR_RTCSEL
type BDCR_RTCSEL_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- RTCSEL as a value
Val : HAL.UInt2;
when True =>
-- RTCSEL as an array
Arr : BDCR_RTCSEL_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for BDCR_RTCSEL_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- Backup domain control register
type BDCR_Register is record
-- External low-speed oscillator enable
LSEON : Boolean := False;
-- Read-only. External low-speed oscillator ready
LSERDY : Boolean := False;
-- External low-speed oscillator bypass
LSEBYP : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- RTC clock source selection
RTCSEL : BDCR_RTCSEL_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_10_14 : HAL.UInt5 := 16#0#;
-- RTC clock enable
RTCEN : Boolean := False;
-- Backup domain software reset
BDRST : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BDCR_Register use record
LSEON at 0 range 0 .. 0;
LSERDY at 0 range 1 .. 1;
LSEBYP at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
RTCSEL at 0 range 8 .. 9;
Reserved_10_14 at 0 range 10 .. 14;
RTCEN at 0 range 15 .. 15;
BDRST at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
------------------
-- CSR_Register --
------------------
-- clock control & status register
type CSR_Register is record
-- Internal low-speed oscillator enable
LSION : Boolean := False;
-- Read-only. Internal low-speed oscillator ready
LSIRDY : Boolean := False;
-- unspecified
Reserved_2_23 : HAL.UInt22 := 16#0#;
-- Remove reset flag
RMVF : Boolean := False;
-- BOR reset flag
BORRSTF : Boolean := True;
-- PIN reset flag
PADRSTF : Boolean := True;
-- POR/PDR reset flag
PORRSTF : Boolean := True;
-- Software reset flag
SFTRSTF : Boolean := False;
-- Independent watchdog reset flag
WDGRSTF : Boolean := False;
-- Window watchdog reset flag
WWDGRSTF : Boolean := False;
-- Low-power reset flag
LPWRRSTF : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CSR_Register use record
LSION at 0 range 0 .. 0;
LSIRDY at 0 range 1 .. 1;
Reserved_2_23 at 0 range 2 .. 23;
RMVF at 0 range 24 .. 24;
BORRSTF at 0 range 25 .. 25;
PADRSTF at 0 range 26 .. 26;
PORRSTF at 0 range 27 .. 27;
SFTRSTF at 0 range 28 .. 28;
WDGRSTF at 0 range 29 .. 29;
WWDGRSTF at 0 range 30 .. 30;
LPWRRSTF at 0 range 31 .. 31;
end record;
--------------------
-- SSCGR_Register --
--------------------
subtype SSCGR_MODPER_Field is HAL.UInt13;
subtype SSCGR_INCSTEP_Field is HAL.UInt15;
-- spread spectrum clock generation register
type SSCGR_Register is record
-- Modulation period
MODPER : SSCGR_MODPER_Field := 16#0#;
-- Incrementation step
INCSTEP : SSCGR_INCSTEP_Field := 16#0#;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- Spread Select
SPREADSEL : Boolean := False;
-- Spread spectrum modulation enable
SSCGEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SSCGR_Register use record
MODPER at 0 range 0 .. 12;
INCSTEP at 0 range 13 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
SPREADSEL at 0 range 30 .. 30;
SSCGEN at 0 range 31 .. 31;
end record;
-------------------------
-- PLLI2SCFGR_Register --
-------------------------
subtype PLLI2SCFGR_PLLI2SNx_Field is HAL.UInt9;
subtype PLLI2SCFGR_PLLI2SRx_Field is HAL.UInt3;
-- PLLI2S configuration register
type PLLI2SCFGR_Register is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- PLLI2S multiplication factor for VCO
PLLI2SNx : PLLI2SCFGR_PLLI2SNx_Field := 16#C0#;
-- unspecified
Reserved_15_27 : HAL.UInt13 := 16#0#;
-- PLLI2S division factor for I2S clocks
PLLI2SRx : PLLI2SCFGR_PLLI2SRx_Field := 16#2#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PLLI2SCFGR_Register use record
Reserved_0_5 at 0 range 0 .. 5;
PLLI2SNx at 0 range 6 .. 14;
Reserved_15_27 at 0 range 15 .. 27;
PLLI2SRx at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Reset and clock control
type RCC_Peripheral is record
-- clock control register
CR : CR_Register;
-- PLL configuration register
PLLCFGR : PLLCFGR_Register;
-- clock configuration register
CFGR : CFGR_Register;
-- clock interrupt register
CIR : CIR_Register;
-- AHB1 peripheral reset register
AHB1RSTR : AHB1RSTR_Register;
-- AHB2 peripheral reset register
AHB2RSTR : AHB2RSTR_Register;
-- AHB3 peripheral reset register
AHB3RSTR : AHB3RSTR_Register;
-- APB1 peripheral reset register
APB1RSTR : APB1RSTR_Register;
-- APB2 peripheral reset register
APB2RSTR : APB2RSTR_Register;
-- AHB1 peripheral clock register
AHB1ENR : AHB1ENR_Register;
-- AHB2 peripheral clock enable register
AHB2ENR : AHB2ENR_Register;
-- AHB3 peripheral clock enable register
AHB3ENR : AHB3ENR_Register;
-- APB1 peripheral clock enable register
APB1ENR : APB1ENR_Register;
-- APB2 peripheral clock enable register
APB2ENR : APB2ENR_Register;
-- AHB1 peripheral clock enable in low power mode register
AHB1LPENR : AHB1LPENR_Register;
-- AHB2 peripheral clock enable in low power mode register
AHB2LPENR : AHB2LPENR_Register;
-- AHB3 peripheral clock enable in low power mode register
AHB3LPENR : AHB3LPENR_Register;
-- APB1 peripheral clock enable in low power mode register
APB1LPENR : APB1LPENR_Register;
-- APB2 peripheral clock enabled in low power mode register
APB2LPENR : APB2LPENR_Register;
-- Backup domain control register
BDCR : BDCR_Register;
-- clock control & status register
CSR : CSR_Register;
-- spread spectrum clock generation register
SSCGR : SSCGR_Register;
-- PLLI2S configuration register
PLLI2SCFGR : PLLI2SCFGR_Register;
end record
with Volatile;
for RCC_Peripheral use record
CR at 0 range 0 .. 31;
PLLCFGR at 4 range 0 .. 31;
CFGR at 8 range 0 .. 31;
CIR at 12 range 0 .. 31;
AHB1RSTR at 16 range 0 .. 31;
AHB2RSTR at 20 range 0 .. 31;
AHB3RSTR at 24 range 0 .. 31;
APB1RSTR at 32 range 0 .. 31;
APB2RSTR at 36 range 0 .. 31;
AHB1ENR at 48 range 0 .. 31;
AHB2ENR at 52 range 0 .. 31;
AHB3ENR at 56 range 0 .. 31;
APB1ENR at 64 range 0 .. 31;
APB2ENR at 68 range 0 .. 31;
AHB1LPENR at 80 range 0 .. 31;
AHB2LPENR at 84 range 0 .. 31;
AHB3LPENR at 88 range 0 .. 31;
APB1LPENR at 96 range 0 .. 31;
APB2LPENR at 100 range 0 .. 31;
BDCR at 112 range 0 .. 31;
CSR at 116 range 0 .. 31;
SSCGR at 128 range 0 .. 31;
PLLI2SCFGR at 132 range 0 .. 31;
end record;
-- Reset and clock control
RCC_Periph : aliased RCC_Peripheral
with Import, Address => RCC_Base;
end STM32_SVD.RCC;
|
reznikmm/increment | Ada | 1,033 | ads | -- Copyright (c) 2015-2017 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Matreshka.Internals.Unicode;
generic
with function To_Class (Value : Matreshka.Internals.Unicode.Code_Point)
return Character_Class;
with function Switch (S : State; Class : Character_Class) return State;
with function Rule (S : State) return Rule_Index;
First_Final : State;
Last_Looping : State;
Error_State : State;
package Incr.Lexers.Batch_Lexers.Generic_Lexers is
-- @summary
-- Generic Batch Lexer
--
-- @description
-- This is an implementation of batch lexical analyser. It gets functions
-- generated by uaflex as tables subunut.
type Batch_Lexer is new Batch_Lexers.Batch_Lexer with null record;
overriding procedure Get_Token
(Self : access Batch_Lexer;
Result : out Rule_Index);
end Incr.Lexers.Batch_Lexers.Generic_Lexers;
|
onox/orka | Ada | 1,879 | ads | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package Orka.SIMD.SSE2.Doubles.Swizzle is
pragma Pure;
function Shuffle (Left, Right : m128d; Mask : Integer_32) return m128d
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_shufpd";
-- Shuffle the 64-bit doubles in Left and Right using the given Mask. The first
-- double (lower half) is retrieved from Left, the second double (upper half)
-- from Right.
--
-- The compiler needs access to the Mask at compile-time, thus construct it
-- as follows:
--
-- Mask_a_b : constant Unsigned_32 := a or b * 2;
--
-- a selects the double to use from Left, b from Right.
function Unpack_High (Left, Right : m128d) return m128d
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_unpckhpd";
-- Unpack and interleave the 64-bit doubles from the upper halves of
-- Left and Right as follows: Left (2), Right (2)
function Unpack_Low (Left, Right : m128d) return m128d
with Import, Convention => Intrinsic, External_Name => "__builtin_ia32_unpcklpd";
-- Unpack and interleave the 64-bit doubles from the lower halves of
-- Left and Right as follows: Left (1), Right (1)
end Orka.SIMD.SSE2.Doubles.Swizzle;
|
charlie5/aIDE | Ada | 1,486 | ads | with
aIDE.Palette.of_types,
gtk.Widget;
private
with
gtk.Frame,
gtk.Scrolled_Window;
with Gtk.Box;
with Gtk.Button;
with Gtk.Notebook;
package aIDE.Palette.of_types_package
is
type Item is new Palette.item with private;
type View is access all Item'Class;
function to_types_Palette_package return View;
function new_Button (Named : in String;
package_Name : in String;
types_Palette : in palette.of_types.view;
use_simple_Name : in Boolean) return Gtk.Button.gtk_Button;
procedure Parent_is (Self : in out Item; Now : in aIDE.Palette.of_types.view);
function top_Widget (Self : in Item) return gtk.Widget.Gtk_Widget;
function children_Notebook (Self : in Item) return gtk.Notebook.gtk_Notebook;
procedure add_Type (Self : access Item; Named : in String;
package_Name : in String);
private
use --gtk.Window,
gtk.Button,
gtk.Box,
gtk.Notebook,
gtk.Frame,
gtk.Scrolled_Window;
type Item is new Palette.item with
record
Parent : Palette.of_types.view;
Top : gtk_Frame;
children_Notebook : gtk_Notebook;
types_Box : gtk_Box;
types_Window : Gtk_Scrolled_Window;
end record;
end aIDE.Palette.of_types_package;
|
coopht/axmpp | Ada | 5,890 | adb | ------------------------------------------------------------------------------
-- --
-- AXMPP Project --
-- --
-- XMPP Library for Ada --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2016, Alexander Basov <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Alexander Basov, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with XMPP.Logger;
package body XMPP.Binds is
use League.Strings;
--------------
-- Create --
--------------
function Create return not null XMPP_Bind_Access is
begin
return new XMPP_Bind;
end Create;
---------------
-- Get_JID --
---------------
function Get_JID (Self : XMPP_Bind) return League.Strings.Universal_String
is
begin
return Self.JID;
end Get_JID;
----------------
-- Get_Kind --
----------------
overriding function Get_Kind (Self : XMPP_Bind) return Object_Kind
is
pragma Unreferenced (Self);
begin
return XMPP.Bind;
end Get_Kind;
--------------------
-- Get_Resource --
--------------------
function Get_Resource (Self : XMPP_Bind)
return League.Strings.Universal_String is
begin
return Self.Resource;
end Get_Resource;
-----------------
-- Serialize --
-----------------
overriding procedure Serialize
(Self : XMPP_Bind;
Writer : in out XML.SAX.Pretty_Writers.XML_Pretty_Writer'Class) is
begin
Self.Start_IQ (Writer);
Writer.Start_Prefix_Mapping (Namespace_URI => Bind_URI);
Writer.Start_Element
(Namespace_URI => Bind_URI,
Local_Name => Bind_Element);
if not Self.Get_Resource.Is_Empty then
Writer.Start_Element (Qualified_Name => Resource_Element);
Writer.Characters (Self.Get_Resource);
Writer.End_Element (Qualified_Name => Resource_Element);
end if;
Writer.End_Element (Namespace_URI => Bind_URI,
Local_Name => Bind_Element);
Writer.End_Prefix_Mapping;
Self.End_IQ (Writer);
end Serialize;
-------------------
-- Set_Content --
-------------------
overriding
procedure Set_Content (Self : in out XMPP_Bind;
Parameter : League.Strings.Universal_String;
Value : League.Strings.Universal_String) is
begin
if Parameter = To_Universal_String ("jid") then
Self.JID := Value;
else
XMPP.Logger.Log
("Unknown parameter : " & Parameter.To_Wide_Wide_String);
end if;
end Set_Content;
---------------
-- Set_JID --
---------------
procedure Set_JID (Self : in out XMPP_Bind;
JID : League.Strings.Universal_String) is
begin
Self.JID := JID;
end Set_JID;
--------------------
-- Set_Resource --
--------------------
procedure Set_Resource (Self : in out XMPP_Bind;
Res : League.Strings.Universal_String) is
begin
Self.Resource := Res;
end Set_Resource;
end XMPP.Binds;
|
ekoeppen/MSP430_Generic_Ada_Drivers | Ada | 2,910 | adb | with MSP430_SVD; use MSP430_SVD;
with MSPGD.Board; use MSPGD.Board;
with MSPGD.Clock; use MSPGD.Clock;
with MSPGD.Clock.Source;
with MSPGD.GPIO; use MSPGD.GPIO;
with MSPGD.GPIO.Pin;
with Drivers.Text_IO;
with Drivers.NTC;
with Drivers.RFM69;
with Interfaces; use Interfaces;
procedure Main is
pragma Preelaborate;
package IRQ is new MSPGD.GPIO.Pin (Port => 2, Pin => 2);
package Text_IO is new Drivers.Text_IO (USART => UART);
package Radio is new Drivers.RFM69 (SPI => SPI, Chip_Select => SSEL, IRQ => IRQ, Packet_Size => 62, Frequency => 915_000_000);
package Delay_Clock is new MSPGD.Clock.Source (Frequency => 3000, Input => VLO, Source => ACLK);
package NTC is new Drivers.NTC;
procedure Print_Registers is new Radio.Print_Registers(Put_Line => Text_IO.Put_Line);
procedure TX_Test is
TX_Data : Radio.Packet_Type;
Input : String (1 .. 16);
Len : Natural;
Counter : Unsigned_8 := 0;
Temperature, Voltage : Unsigned_32;
Send_Temperature : Boolean := True;
begin
TX_Data (1) := 16#D8#; TX_Data (2) := 16#40#; TX_Data (3) := 16#1A#;
loop
-- Text_IO.Get_Line (Input, Len);
Temperature := NTC.Value (Integer (Read_NTC));
Voltage := Unsigned_32 (Read_VCC);
Text_IO.Put ("NTC value: ");
Text_IO.Put_Hex (Temperature);
Text_IO.Put (" Voltage: ");
Text_IO.Put_Hex (Voltage);
Text_IO.New_Line;
if Send_Temperature then
TX_Data (4) := Unsigned_8 ((Temperature / 2 ** 24) mod 2 ** 8);
TX_Data (5) := Unsigned_8 ((Temperature / 2 ** 16) mod 2 ** 8);
TX_Data (6) := Unsigned_8 ((Temperature / 2 ** 8) mod 2 ** 8);
TX_Data (7) := Unsigned_8 (Temperature mod 2 ** 8);
else
TX_Data (4) := Unsigned_8 ((Voltage / 2 ** 24) mod 2 ** 8);
TX_Data (5) := Unsigned_8 ((Voltage / 2 ** 16) mod 2 ** 8);
TX_Data (6) := Unsigned_8 ((Voltage / 2 ** 8) mod 2 ** 8);
TX_Data (7) := Unsigned_8 (Voltage mod 2 ** 8);
end if;
Send_Temperature := not Send_Temperature;
Radio.TX (TX_Data);
-- Print_Registers;
Counter := Counter + 1; if Counter > 23 then Counter := 0; end if;
Radio.Power_Down;
Delay_Clock.Delay_Slow_Periods (1);
end loop;
end TX_Test;
procedure Sleep_Test is
begin
Radio.Power_Down;
while true loop
Delay_Clock.Delay_Slow_Periods (1);
end loop;
end Sleep_Test;
begin
Init;
Delay_Clock.Init;
SPI.Init;
SCLK.Init;
MISO.Init;
MOSI.Init;
SSEL.Init;
IRQ.Init;
SSEL.Set;
Text_IO.Put_Line ("RFM69 sender starting...");
Radio.Init;
Text_IO.Put_Hex (Unsigned_32 (Read_NTC)); Text_IO.New_Line;
Text_IO.Put_Hex (Unsigned_32 (Read_VCC)); Text_IO.New_Line;
Print_Registers;
TX_Test;
-- Sleep_Test;
end Main;
|
zhmu/ananas | Ada | 9,051 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 8 8 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
with System.Unsigned_Types;
package body System.Pack_88 is
subtype Bit_Order is System.Bit_Order;
Reverse_Bit_Order : constant Bit_Order :=
Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order));
subtype Ofs is System.Storage_Elements.Storage_Offset;
subtype Uns is System.Unsigned_Types.Unsigned;
subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
use type System.Storage_Elements.Storage_Offset;
use type System.Unsigned_Types.Unsigned;
type Cluster is record
E0, E1, E2, E3, E4, E5, E6, E7 : Bits_88;
end record;
for Cluster use record
E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
end record;
for Cluster'Size use Bits * 8;
for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment,
1 +
1 * Boolean'Pos (Bits mod 2 = 0) +
2 * Boolean'Pos (Bits mod 4 = 0));
-- Use maximum possible alignment, given the bit field size, since this
-- will result in the most efficient code possible for the field.
type Cluster_Ref is access Cluster;
type Rev_Cluster is new Cluster
with Bit_Order => Reverse_Bit_Order,
Scalar_Storage_Order => Reverse_Bit_Order;
type Rev_Cluster_Ref is access Rev_Cluster;
-- The following declarations are for the case where the address
-- passed to GetU_88 or SetU_88 is not guaranteed to be aligned.
-- These routines are used when the packed array is itself a
-- component of a packed record, and therefore may not be aligned.
type ClusterU is new Cluster;
for ClusterU'Alignment use 1;
type ClusterU_Ref is access ClusterU;
type Rev_ClusterU is new ClusterU
with Bit_Order => Reverse_Bit_Order,
Scalar_Storage_Order => Reverse_Bit_Order;
type Rev_ClusterU_Ref is access Rev_ClusterU;
------------
-- Get_88 --
------------
function Get_88
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_88
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => return RC.E0;
when 1 => return RC.E1;
when 2 => return RC.E2;
when 3 => return RC.E3;
when 4 => return RC.E4;
when 5 => return RC.E5;
when 6 => return RC.E6;
when 7 => return RC.E7;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end if;
end Get_88;
-------------
-- GetU_88 --
-------------
function GetU_88
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_88
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : ClusterU_Ref with Address => A'Address, Import;
RC : Rev_ClusterU_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => return RC.E0;
when 1 => return RC.E1;
when 2 => return RC.E2;
when 3 => return RC.E3;
when 4 => return RC.E4;
when 5 => return RC.E5;
when 6 => return RC.E6;
when 7 => return RC.E7;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end if;
end GetU_88;
------------
-- Set_88 --
------------
procedure Set_88
(Arr : System.Address;
N : Natural;
E : Bits_88;
Rev_SSO : Boolean)
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => RC.E0 := E;
when 1 => RC.E1 := E;
when 2 => RC.E2 := E;
when 3 => RC.E3 := E;
when 4 => RC.E4 := E;
when 5 => RC.E5 := E;
when 6 => RC.E6 := E;
when 7 => RC.E7 := E;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end if;
end Set_88;
-------------
-- SetU_88 --
-------------
procedure SetU_88
(Arr : System.Address;
N : Natural;
E : Bits_88;
Rev_SSO : Boolean)
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : ClusterU_Ref with Address => A'Address, Import;
RC : Rev_ClusterU_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => RC.E0 := E;
when 1 => RC.E1 := E;
when 2 => RC.E2 := E;
when 3 => RC.E3 := E;
when 4 => RC.E4 := E;
when 5 => RC.E5 := E;
when 6 => RC.E6 := E;
when 7 => RC.E7 := E;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end if;
end SetU_88;
end System.Pack_88;
|
burratoo/Acton | Ada | 6,504 | ads | ------------------------------------------------------------------------------------------
-- --
-- OAK CORE SUPPORT PACKAGE --
-- ARM CORTEX M4F --
-- --
-- ISA.ARM.CORTEX_M4.EXCEPTIONS --
-- --
-- Copyright (C) 2014-2021, Patrick Bernardi --
-- --
------------------------------------------------------------------------------------------
package ISA.ARM.Cortex_M4.Exceptions with Pure is
type Exception_Id is mod 2 ** 9 with Size => 9;
subtype System_Exception_Id is Exception_Id range 4 .. 15;
-- Actually only the system exceptions which can have their priorities set.
type Exception_Priority is mod 2 ** 8 with Size => 8;
function Current_Exception return Exception_Id with Inline_Always;
function Current_IRQ return Exception_Id with Inline_Always;
function To_Exception (IRQ : Exception_Id) return Exception_Id;
function To_IRQ (E : Exception_Id) return Exception_Id;
Thread_Mode : constant Exception_Id := 0;
Stack_Address : constant Exception_Id := 0;
Reset : constant Exception_Id := 1;
NMI : constant Exception_Id := 2;
Hard_Fault : constant Exception_Id := 3;
Mem_Manage : constant Exception_Id := 4;
Bus_Fault : constant Exception_Id := 5;
Usage_Fault : constant Exception_Id := 6;
Reserved2 : constant Exception_Id := 7;
Reserved3 : constant Exception_Id := 8;
Reserved4 : constant Exception_Id := 9;
Reserved5 : constant Exception_Id := 10;
SVCall : constant Exception_Id := 11;
Reserved6 : constant Exception_Id := 12;
Reserved7 : constant Exception_Id := 13;
PendSV : constant Exception_Id := 14;
SysTick : constant Exception_Id := 15;
IRQ0 : constant Exception_Id := 16;
IRQ1 : constant Exception_Id := 17;
IRQ2 : constant Exception_Id := 18;
IRQ3 : constant Exception_Id := 19;
IRQ4 : constant Exception_Id := 20;
IRQ5 : constant Exception_Id := 21;
IRQ6 : constant Exception_Id := 22;
IRQ7 : constant Exception_Id := 23;
IRQ8 : constant Exception_Id := 24;
IRQ9 : constant Exception_Id := 25;
IRQ10 : constant Exception_Id := 26;
IRQ11 : constant Exception_Id := 27;
IRQ12 : constant Exception_Id := 28;
IRQ13 : constant Exception_Id := 29;
IRQ14 : constant Exception_Id := 30;
IRQ15 : constant Exception_Id := 31;
IRQ16 : constant Exception_Id := 32;
IRQ17 : constant Exception_Id := 33;
IRQ18 : constant Exception_Id := 34;
IRQ19 : constant Exception_Id := 35;
IRQ20 : constant Exception_Id := 36;
IRQ21 : constant Exception_Id := 37;
IRQ22 : constant Exception_Id := 38;
IRQ23 : constant Exception_Id := 39;
IRQ24 : constant Exception_Id := 40;
IRQ25 : constant Exception_Id := 41;
IRQ26 : constant Exception_Id := 42;
IRQ27 : constant Exception_Id := 43;
IRQ28 : constant Exception_Id := 44;
IRQ29 : constant Exception_Id := 45;
IRQ30 : constant Exception_Id := 46;
IRQ31 : constant Exception_Id := 47;
IRQ32 : constant Exception_Id := 48;
IRQ33 : constant Exception_Id := 49;
IRQ34 : constant Exception_Id := 50;
IRQ35 : constant Exception_Id := 51;
IRQ36 : constant Exception_Id := 52;
IRQ37 : constant Exception_Id := 53;
IRQ38 : constant Exception_Id := 54;
IRQ39 : constant Exception_Id := 55;
IRQ40 : constant Exception_Id := 56;
IRQ41 : constant Exception_Id := 57;
IRQ42 : constant Exception_Id := 58;
IRQ43 : constant Exception_Id := 59;
IRQ44 : constant Exception_Id := 60;
IRQ45 : constant Exception_Id := 61;
IRQ46 : constant Exception_Id := 62;
IRQ47 : constant Exception_Id := 63;
IRQ48 : constant Exception_Id := 64;
IRQ49 : constant Exception_Id := 65;
IRQ50 : constant Exception_Id := 66;
IRQ51 : constant Exception_Id := 67;
IRQ52 : constant Exception_Id := 68;
IRQ53 : constant Exception_Id := 69;
IRQ54 : constant Exception_Id := 70;
IRQ55 : constant Exception_Id := 71;
IRQ56 : constant Exception_Id := 72;
IRQ57 : constant Exception_Id := 73;
IRQ58 : constant Exception_Id := 74;
IRQ59 : constant Exception_Id := 75;
IRQ60 : constant Exception_Id := 76;
IRQ61 : constant Exception_Id := 77;
IRQ62 : constant Exception_Id := 78;
IRQ63 : constant Exception_Id := 79;
IRQ64 : constant Exception_Id := 80;
IRQ65 : constant Exception_Id := 81;
IRQ66 : constant Exception_Id := 82;
IRQ67 : constant Exception_Id := 83;
IRQ68 : constant Exception_Id := 84;
IRQ69 : constant Exception_Id := 85;
IRQ70 : constant Exception_Id := 86;
IRQ71 : constant Exception_Id := 87;
IRQ72 : constant Exception_Id := 88;
IRQ73 : constant Exception_Id := 89;
IRQ74 : constant Exception_Id := 90;
IRQ75 : constant Exception_Id := 91;
IRQ76 : constant Exception_Id := 92;
IRQ77 : constant Exception_Id := 93;
IRQ78 : constant Exception_Id := 94;
IRQ79 : constant Exception_Id := 95;
IRQ80 : constant Exception_Id := 96;
IRQ81 : constant Exception_Id := 97;
private
function Current_IRQ return Exception_Id is (Current_Exception - IRQ0);
function To_Exception (IRQ : Exception_Id) return Exception_Id is
(IRQ + IRQ0);
function To_IRQ (E : Exception_Id) return Exception_Id is
(E - IRQ0);
end ISA.ARM.Cortex_M4.Exceptions;
|
reznikmm/matreshka | Ada | 4,887 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Base class for diagram views. It updates own windowTitle property on
-- changes of name property of diagram.
------------------------------------------------------------------------------
with Qt4.Graphics_Scenes;
with Qt4.Graphics_Views;
private with Qt4.Graphics_Views.Directors;
with Qt4.Widgets;
private with AMF.CMOF.Properties;
private with AMF.Elements;
with AMF.Listeners;
with AMF.UMLDI.UML_Diagrams;
private with League.Holders;
package Modeler.Diagram_Views is
type Diagram_View is
limited new Qt4.Graphics_Views.Q_Graphics_View
and AMF.Listeners.Abstract_Listener with private;
type Diagram_View_Access is access all Diagram_View;
package Constructors is
function Create
(Scene : not null Qt4.Graphics_Scenes.Q_Graphics_Scene_Access;
Diagram : not null AMF.UMLDI.UML_Diagrams.UMLDI_UML_Diagram_Access;
Parent : access Qt4.Widgets.Q_Widget'Class := null)
return not null Diagram_View_Access;
end Constructors;
private
type Diagram_View is
limited new Qt4.Graphics_Views.Directors.Q_Graphics_View_Director
and AMF.Listeners.Abstract_Listener with
record
null;
end record;
overriding procedure Attribute_Set
(Self : not null access Diagram_View;
Element : not null AMF.Elements.Element_Access;
Property : not null AMF.CMOF.Properties.CMOF_Property_Access;
Position : AMF.Optional_Integer;
Old_Value : League.Holders.Holder;
New_Value : League.Holders.Holder);
end Modeler.Diagram_Views;
|
Ximalas/synth | Ada | 25,253 | adb | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with Ada.Text_IO;
with JohnnyText;
with Signals;
with Unix;
package body Display is
package JT renames JohnnyText;
package SIG renames Signals;
package TIO renames Ada.Text_IO;
----------------------
-- launch_monitor --
----------------------
function launch_monitor (num_builders : builders) return Boolean is
begin
if not Start_Curses_Mode then
TIO.Put_Line ("Failed to enter curses modes");
return False;
end if;
if not TIC.Has_Colors or else not establish_colors then
Return_To_Text_Mode;
TIO.Put_Line ("The TERM environment variable value (" &
Unix.env_variable_value ("TERM") &
") does not support colors.");
TIO.Put_Line ("Falling back to text mode.");
return False;
end if;
begin
TIC.Set_Echo_Mode (False);
TIC.Set_Raw_Mode (True);
TIC.Set_Cbreak_Mode (True);
TIC.Set_Cursor_Visibility (Visibility => cursor_vis);
exception
when TIC.Curses_Exception =>
Return_To_Text_Mode;
return False;
end;
builders_used := Integer (num_builders);
if not launch_summary_zone or else
not launch_builders_zone or else
not launch_actions_zone
then
terminate_monitor;
return False;
end if;
draw_static_summary_zone;
draw_static_builders_zone;
Refresh_Zone (summary);
Refresh_Zone (builder);
return True;
end launch_monitor;
-------------------------
-- terminate_monitor --
-------------------------
procedure terminate_monitor
is
ok : Boolean := True;
begin
-- zone_window can't be used because Delete will modify Win variable
begin
TIC.Delete (Win => zone_summary);
TIC.Delete (Win => zone_builders);
TIC.Delete (Win => zone_actions);
exception
when TIC.Curses_Exception => ok := False;
end;
if ok then
Return_To_Text_Mode;
end if;
end terminate_monitor;
-----------------------------------
-- set_full_redraw_next_update --
-----------------------------------
procedure set_full_redraw_next_update is
begin
draw_static_summary_zone;
draw_static_builders_zone;
for zone in zones'Range loop
begin
TIC.Redraw (Win => zone_window (zone));
exception
when TIC.Curses_Exception => null;
end;
end loop;
end set_full_redraw_next_update;
---------------------------
-- launch_summary_zone --
---------------------------
function launch_summary_zone return Boolean is
begin
zone_summary := TIC.Create (Number_Of_Lines => 2,
Number_Of_Columns => app_width,
First_Line_Position => 0,
First_Column_Position => 0);
return True;
exception
when TIC.Curses_Exception => return False;
end launch_summary_zone;
--------------------------------
-- draw_static_summary_zone --
--------------------------------
procedure draw_static_summary_zone
is
line1 : constant appline :=
custom_message (message => " Total Built Ignored " &
" Load 0.00 Pkg/hour ",
attribute => bright,
pen_color => c_sumlabel);
line2 : constant appline :=
custom_message (message => " Left Failed Skipped " &
" Swap 0.0% Impulse 00:00:00 ",
attribute => bright,
pen_color => c_sumlabel);
begin
Scrawl (summary, line1, 0);
Scrawl (summary, line2, 1);
end draw_static_summary_zone;
----------------------------
-- launch_builders_zone --
----------------------------
function launch_builders_zone return Boolean
is
hghtint : constant Integer := 4 + builders_used;
height : constant TIC.Line_Position := TIC.Line_Position (hghtint);
begin
zone_builders := TIC.Create (Number_Of_Lines => height,
Number_Of_Columns => app_width,
First_Line_Position => 2,
First_Column_Position => 0);
return True;
exception
when TIC.Curses_Exception => return False;
end launch_builders_zone;
---------------------------------
-- draw_static_builders_zone --
---------------------------------
procedure draw_static_builders_zone
is
hghtint : constant Integer := 4 + builders_used;
height : constant TIC.Line_Position := TIC.Line_Position (hghtint);
lastrow : constant TIC.Line_Position := inc (height, -1);
dmsg : constant String (appline'Range) := (others => '=');
dashes : constant appline := custom_message (message => dmsg,
attribute => bright,
pen_color => c_dashes);
headtxt : constant appline :=
custom_message (message => " ID Duration Build Phase Origin " &
" Lines ",
attribute => normal,
pen_color => c_tableheader);
begin
Scrawl (builder, dashes, 0);
Scrawl (builder, dashes, 2);
Scrawl (builder, dashes, lastrow);
if SIG.graceful_shutdown_requested then
Scrawl (builder, shutdown_message, 1);
else
Scrawl (builder, headtxt, 1);
end if;
for z in 3 .. inc (lastrow, -1) loop
Scrawl (builder, blank_line, z);
end loop;
end draw_static_builders_zone;
---------------------------
-- launch_actions_zone --
---------------------------
function launch_actions_zone return Boolean
is
consumed : constant Integer := builders_used + 4 + 2;
viewpos : constant TIC.Line_Position := TIC.Line_Position (consumed);
difference : Integer := 0 - consumed;
use type TIC.Line_Position;
begin
historyheight := inc (TIC.Lines, difference);
-- Make sure history window lines range from 10 to 50
if historyheight < 10 then
historyheight := 10;
elsif historyheight > TIC.Line_Position (cyclic_range'Last) then
historyheight := TIC.Line_Position (cyclic_range'Last);
end if;
zone_actions := TIC.Create (Number_Of_Lines => historyheight,
Number_Of_Columns => app_width,
First_Line_Position => viewpos,
First_Column_Position => 0);
return True;
exception
when TIC.Curses_Exception => return False;
end launch_actions_zone;
-----------
-- inc --
-----------
function inc (X : TIC.Line_Position; by : Integer) return TIC.Line_Position
is
use type TIC.Line_Position;
begin
return X + TIC.Line_Position (by);
end inc;
-----------------
-- summarize --
-----------------
procedure summarize (data : summary_rec)
is
function pad (S : String; amount : Positive := 5) return String;
procedure colorado (S : String; color : TIC.Color_Pair;
col : TIC.Column_Position;
row : TIC.Line_Position;
dim : Boolean := False);
remaining : constant Integer := data.Initially - data.Built -
data.Failed - data.Ignored - data.Skipped;
function pad (S : String; amount : Positive := 5) return String
is
result : String (1 .. amount) := (others => ' ');
slen : constant Natural := S'Length;
begin
if slen <= amount then
result (1 .. slen) := S;
else
result := S (S'First .. S'First + amount - 1);
end if;
return result;
end pad;
procedure colorado (S : String; color : TIC.Color_Pair;
col : TIC.Column_Position;
row : TIC.Line_Position;
dim : Boolean := False)
is
info : TIC.Attributed_String := custom_message (message => S,
attribute => emphasis (dim),
pen_color => color);
begin
Scrawl (summary, info, row, col);
end colorado;
L1F1 : constant String := pad (JT.int2str (data.Initially));
L1F2 : constant String := pad (JT.int2str (data.Built));
L1F3 : constant String := pad (JT.int2str (data.Ignored));
L1F4 : fivelong;
L1F5 : constant String := pad (JT.int2str (data.pkg_hour), 4);
L2F1 : constant String := pad (JT.int2str (remaining));
L2F2 : constant String := pad (JT.int2str (data.Failed));
L2F3 : constant String := pad (JT.int2str (data.Skipped));
L2F4 : fivelong;
L2F5 : constant String := pad (JT.int2str (data.impulse), 4);
begin
if data.swap = 100.0 then
L2F4 := " 100%";
elsif data.swap > 100.0 then
L2F4 := " n/a";
else
L2F4 := fmtpc (data.swap, True);
end if;
if data.load >= 100.0 then
L1F4 := pad (JT.int2str (Integer (data.load)));
else
L1F4 := fmtpc (data.load, False);
end if;
colorado (L1F1, c_standard, 7, 0);
colorado (L1F2, c_success, 21, 0);
colorado (L1F3, c_ignored, 36, 0);
colorado (L1F4, c_standard, 48, 0, True);
colorado (L1F5, c_standard, 64, 0, True);
colorado (L2F1, c_standard, 7, 1);
colorado (L2F2, c_failure, 21, 1);
colorado (L2F3, c_skipped, 36, 1);
colorado (L2F4, c_standard, 48, 1, True);
colorado (L2F5, c_standard, 64, 1, True);
colorado (data.elapsed, c_elapsed, 70, 1);
Refresh_Zone (summary);
end summarize;
-----------------------
-- update_builder --
-----------------------
procedure update_builder (BR : builder_rec)
is
procedure colorado (S : String; color : TIC.Color_Pair;
col : TIC.Column_Position;
row : TIC.Line_Position;
dim : Boolean := False);
procedure print_id;
row : TIC.Line_Position := inc (TIC.Line_Position (BR.id), 2);
procedure print_id
is
info : TIC.Attributed_String := custom_message (message => BR.slavid,
attribute => c_slave (BR.id).attribute,
pen_color => c_slave (BR.id).palette);
begin
Scrawl (builder, info, row, 1);
end print_id;
procedure colorado (S : String; color : TIC.Color_Pair;
col : TIC.Column_Position;
row : TIC.Line_Position;
dim : Boolean := False)
is
info : TIC.Attributed_String := custom_message (message => S,
attribute => emphasis (dim),
pen_color => color);
begin
Scrawl (builder, info, row, col);
end colorado;
begin
if SIG.graceful_shutdown_requested then
Scrawl (builder, shutdown_message, 1);
end if;
print_id;
colorado (BR.Elapsed, c_standard, 5, row, True);
colorado (BR.phase, c_bldphase, 15, row, True);
colorado (BR.origin, c_origin, 32, row, False);
colorado (BR.LLines, c_standard, 71, row, True);
end update_builder;
------------------------------
-- refresh_builder_window --
------------------------------
procedure refresh_builder_window is
begin
Refresh_Zone (builder);
end refresh_builder_window;
----------------------
-- insert_history --
----------------------
procedure insert_history (HR : history_rec) is
begin
if history_arrow = cyclic_range'Last then
history_arrow := cyclic_range'First;
else
history_arrow := history_arrow + 1;
end if;
history (history_arrow) := HR;
end insert_history;
------------------------------
-- refresh_history_window --
------------------------------
procedure refresh_history_window
is
procedure clear_row (row : TIC.Line_Position);
procedure colorado (S : String; color : TIC.Color_Pair;
col : TIC.Column_Position;
row : TIC.Line_Position;
dim : Boolean := False);
function col_action (status : String) return TIC.Color_Pair;
procedure print_id (id : builders; sid : String; row : TIC.Line_Position;
status : String);
procedure clear_row (row : TIC.Line_Position) is
begin
Scrawl (action, blank_line, row);
end clear_row;
procedure colorado (S : String; color : TIC.Color_Pair;
col : TIC.Column_Position;
row : TIC.Line_Position;
dim : Boolean := False)
is
info : TIC.Attributed_String := custom_message (message => S,
attribute => emphasis (dim),
pen_color => color);
begin
Scrawl (action, info, row, col);
end colorado;
function col_action (status : String) return TIC.Color_Pair is
begin
if status = "shutdown" then
return c_shutdown;
elsif status = "success " then
return c_success;
elsif status = "failure " then
return c_failure;
elsif status = "skipped " then
return c_skipped;
elsif status = "ignored " then
return c_ignored;
else
return c_standard;
end if;
end col_action;
procedure print_id (id : builders; sid : String; row : TIC.Line_Position;
status : String)
is
bracket : TIC.Attributed_String := custom_message (message => "[--]",
attribute => normal,
pen_color => c_standard);
bindex : Positive := 2;
begin
if status /= "skipped " and then status /= "ignored "
then
for index in sid'Range loop
bracket (bindex) := (Attr => c_slave (id).attribute,
Color => c_slave (id).palette,
Ch => sid (index));
bindex := bindex + 1;
end loop;
end if;
Scrawl (action, bracket, row, 10);
end print_id;
arrow : cyclic_range := history_arrow;
maxrow : Natural;
row : TIC.Line_Position;
begin
-- historyheight guaranteed to be no bigger than cyclic_range
maxrow := Integer (historyheight) - 1;
for rowindex in 0 .. maxrow loop
row := TIC.Line_Position (rowindex);
if history (arrow).established then
colorado (history (arrow).run_elapsed, c_standard, 1, row, True);
print_id (id => history (arrow).id,
sid => history (arrow).slavid,
row => row,
status => history (arrow).action);
colorado (history (arrow).action,
col_action (history (arrow).action), 15, row);
colorado (history (arrow).origin, c_origin, 24, row);
colorado (history (arrow).pkg_elapsed, c_standard, 70, row, True);
else
clear_row (row);
end if;
if arrow = cyclic_range'First then
arrow := cyclic_range'Last;
else
arrow := arrow - 1;
end if;
end loop;
Refresh_Zone (action);
end refresh_history_window;
------------------------
-- establish_colors --
------------------------
function establish_colors return Boolean is
begin
TIC.Start_Color;
begin
TIC.Init_Pair (TIC.Color_Pair (1), TIC.White, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (2), TIC.Green, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (3), TIC.Red, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (4), TIC.Yellow, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (5), TIC.Black, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (6), TIC.Cyan, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (7), TIC.Blue, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (8), TIC.Magenta, TIC.Black);
TIC.Init_Pair (TIC.Color_Pair (9), TIC.Blue, TIC.White);
exception
when TIC.Curses_Exception => return False;
end;
c_standard := TIC.Color_Pair (1);
c_success := TIC.Color_Pair (2);
c_failure := TIC.Color_Pair (3);
c_ignored := TIC.Color_Pair (4);
c_skipped := TIC.Color_Pair (5);
c_sumlabel := TIC.Color_Pair (6);
c_dashes := TIC.Color_Pair (7);
c_elapsed := TIC.Color_Pair (4);
c_tableheader := TIC.Color_Pair (1);
c_origin := TIC.Color_Pair (6);
c_bldphase := TIC.Color_Pair (4);
c_shutdown := TIC.Color_Pair (1);
c_advisory := TIC.Color_Pair (4);
c_slave (1).palette := TIC.Color_Pair (1); -- white / Black
c_slave (1).attribute := bright;
c_slave (2).palette := TIC.Color_Pair (2); -- light green / Black
c_slave (2).attribute := bright;
c_slave (3).palette := TIC.Color_Pair (4); -- yellow / Black
c_slave (3).attribute := bright;
c_slave (4).palette := TIC.Color_Pair (8); -- light magenta / Black
c_slave (4).attribute := bright;
c_slave (5).palette := TIC.Color_Pair (3); -- light red / Black
c_slave (5).attribute := bright;
c_slave (6).palette := TIC.Color_Pair (7); -- light blue / Black
c_slave (6).attribute := bright;
c_slave (7).palette := TIC.Color_Pair (6); -- light cyan / Black
c_slave (7).attribute := bright;
c_slave (8).palette := TIC.Color_Pair (5); -- dark grey / Black
c_slave (8).attribute := bright;
c_slave (9).palette := TIC.Color_Pair (1); -- light grey / Black
c_slave (9).attribute := normal;
c_slave (10).palette := TIC.Color_Pair (2); -- light green / Black
c_slave (10).attribute := normal;
c_slave (11).palette := TIC.Color_Pair (4); -- brown / Black
c_slave (11).attribute := normal;
c_slave (12).palette := TIC.Color_Pair (8); -- dark magenta / Black
c_slave (12).attribute := normal;
c_slave (13).palette := TIC.Color_Pair (3); -- dark red / Black
c_slave (13).attribute := normal;
c_slave (14).palette := TIC.Color_Pair (7); -- dark blue / Black
c_slave (14).attribute := normal;
c_slave (15).palette := TIC.Color_Pair (6); -- dark cyan / Black
c_slave (15).attribute := normal;
c_slave (16).palette := TIC.Color_Pair (9); -- white / dark blue
c_slave (16).attribute := normal;
for bld in builders (17) .. builders (32) loop
c_slave (bld) := c_slave (bld - 16);
c_slave (bld).attribute.Under_Line := True;
end loop;
for bld in builders (33) .. builders (64) loop
c_slave (bld) := c_slave (bld - 32);
end loop;
return True;
end establish_colors;
------------------------------------------------------------------------
-- zone_window
------------------------------------------------------------------------
function zone_window (zone : zones) return TIC.Window is
begin
case zone is
when builder => return zone_builders;
when summary => return zone_summary;
when action => return zone_actions;
end case;
end zone_window;
------------------------------------------------------------------------
-- Scrawl
------------------------------------------------------------------------
procedure Scrawl (zone : zones;
information : TIC.Attributed_String;
at_line : TIC.Line_Position;
at_column : TIC.Column_Position := 0) is
begin
TIC.Add (Win => zone_window (zone),
Line => at_line,
Column => at_column,
Str => information,
Len => information'Length);
exception
when TIC.Curses_Exception => null;
end Scrawl;
------------------------------------------------------------------------
-- Return_To_Text_Mode
------------------------------------------------------------------------
procedure Return_To_Text_Mode is
begin
TIC.End_Windows;
exception
when TIC.Curses_Exception => null;
end Return_To_Text_Mode;
------------------------------------------------------------------------
-- Refresh_Zone
------------------------------------------------------------------------
procedure Refresh_Zone (zone : zones) is
begin
TIC.Refresh (Win => zone_window (zone));
exception
when TIC.Curses_Exception => null;
end Refresh_Zone;
------------------------------------------------------------------------
-- Start_Curses_Mode
------------------------------------------------------------------------
function Start_Curses_Mode return Boolean is
begin
TIC.Init_Screen;
return True;
exception
when TIC.Curses_Exception => return False;
end Start_Curses_Mode;
------------------------------------------------------------------------
-- blank_line
------------------------------------------------------------------------
function blank_line return appline
is
space : TIC.Attributed_Character := (Attr => TIC.Normal_Video,
Color => c_standard,
Ch => ' ');
product : appline := (others => space);
begin
return product;
end blank_line;
------------------------------------------------------------------------
-- custom_message
------------------------------------------------------------------------
function custom_message (message : String;
attribute : TIC.Character_Attribute_Set;
pen_color : TIC.Color_Pair) return TIC.Attributed_String
is
product : TIC.Attributed_String (1 .. message'Length);
pindex : Positive := 1;
begin
for index in message'Range loop
product (pindex) := (Attr => attribute,
Color => pen_color,
Ch => message (index));
pindex := pindex + 1;
end loop;
return product;
end custom_message;
------------------------------------------------------------------------
-- shutdown_message
------------------------------------------------------------------------
function shutdown_message return appline
is
data : constant String := " Graceful shutdown in progress, " &
"so no new tasks will be started. ";
product : appline := custom_message (message => data,
attribute => bright,
pen_color => c_advisory);
begin
return product;
end shutdown_message;
------------------------------------------------------------------------
-- emphasis
------------------------------------------------------------------------
function emphasis (dimmed : Boolean) return TIC.Character_Attribute_Set is
begin
if dimmed then
return normal;
else
return bright;
end if;
end emphasis;
------------------------------------------------------------------------
-- fmtpc
------------------------------------------------------------------------
function fmtpc (f : Float; percent : Boolean) return fivelong
is
type loadtype is delta 0.01 digits 4;
result : fivelong := (others => ' ');
raw1 : constant loadtype := loadtype (f);
raw2 : constant String := raw1'Img;
raw3 : constant String := raw2 (2 .. raw2'Last);
rlen : constant Natural := raw3'Length;
start : constant Natural := 6 - rlen;
begin
result (start .. 5) := raw3;
if percent then
result (5) := '%';
end if;
return result;
end fmtpc;
end Display;
|
Holt59/Ada-SDL | Ada | 4,747 | ads | --------------------------------------------
-- --
-- PACKAGE GAME - PARTIE ADA --
-- --
-- GAME-GEVENT.ADS --
-- --
-- Gestion des évènements --
-- --
-- Créateur : CAPELLE Mikaël --
-- Adresse : [email protected] --
-- --
-- Dernière modification : 14 / 06 / 2011 --
-- --
--------------------------------------------
package Game.GEvent is
-- Voir plus bas
type Event;
-- Les différents types d'event possible
type Event_Type is (ACTIVE, KEYDOWN, KEYUP, MOUSE_MOTION, MOUSE_BUTTON_DOWN,
MOUSE_BUTTON_UP, QUIT,NONE);
-- Les différentes valeurs des touches du clavier (sur un clavier QWERTY !!)
type Event_Key is (K_BACKSPACE,K_TAB,K_CLEAR,K_RETURN,K_PAUSE,K_ESCAPE,K_SPACE,
K_EXCLAIM,K_QUOTEDBL,K_HASH,K_DOLLAR,K_AMPERSAND,K_QUOTE,
K_LEFTPAREN,K_RIGHTPAREN,K_ASTERISK,K_PLUS,K_COMMA,K_MINUS,
K_PERIOD,K_SLASH,
-- TOUCHE NOMBRE (AU DESSUS DES LETTRES)
K_0,K_1,K_2,K_3,K_4,K_5,K_6,K_7,K_8,K_9,
K_COLON,K_SEMICOLON,K_LESS,K_EQUALS,K_GREATER,K_QUESTION,
K_AT,K_LEFTBRACKET,K_BACKSLASH,K_RIGHTBRACKET,K_CARET,
K_UNDERSCORE,K_BACKQUOTE,
-- TOUCHE LETTRES (CLAVIER QWERTY !!)
K_A,K_B,K_C,K_D,K_E,K_F,K_G,K_H,K_I,K_J,K_K,K_L,K_M,K_N,K_O,K_P,K_Q,K_R,K_S,K_T,K_U,K_V,K_W,K_X,K_Y,K_Z,
K_DELETE,
-- TOUCHE DU PAVE NUMERIQUE (K_KP)
K_KP0,K_KP1,K_KP2,K_KP3,K_KP4,K_KP5,K_KP6,K_KP7,K_KP8,K_KP9,
K_KP_PERIOD,K_KP_DIVIDE,K_KP_MULTIPLY,K_KP_MINUS,K_KP_PLUS,K_KP_ENTER,K_KP_EQUALS,
-- FLECHES DIRECTIONNELLES
K_UP,K_DOWN,K_RIGHT,K_LEFT,
K_INSERT,K_HOME,K_END,K_PAGEUP,K_PAGEDOWN,
-- TOUCHE DE FONCTION (F1..F15)
K_F1,K_F2,K_F3,K_F4,K_F5,K_F6,K_F7,K_F8,K_F9,K_F10,K_F11,K_F12,K_F13,K_F14,K_F15,
K_NUMLOCK,K_CAPSLOCK,K_SCROLLOCK,K_RSHIFT,
K_LSHIFT,K_RCTRL,K_LCTRL,K_RALT,K_LALT,K_RMETA,K_LMETA,
K_LSUPER,K_RSUPER,K_MODE,K_HELP,K_PRINT,K_SYSREQ,
K_BREAK,K_MENU,K_POWER,K_EURO);
-- Les boutons de la souris
type Event_Mouse_Key is (LEFT,MIDDLE,RIGHT,WHEELUP,WHEELDOWN);
type Tab_Key is array (Event_Key) of Boolean;
type Tab_Mouse is array (Event_Mouse_Key) of Boolean;
-- Type contenant toutes les informations à propos des events
type Event is
record
Etype : Event_Type := NONE; -- Le type de l'event
Ekey : Tab_Key := (others => False); -- Array (Event_Key range K_BACKSPACE..K_EURO) of Boolean;
X,Y : Integer := -1; -- Les coordonnées de la souris, sinon (-1,-1)
X_Rel, Y_Rel : Integer := 0; -- Les coordonnées du mouvement de la souris
EMouseButton : Tab_Mouse := (others => False); -- Array (Event_Mouse_Key range LEFT..RIGHT) of Boolean;
end record;
-- Retourne un nouvel event (ré)initialisé par (NONE,(others => False),-1,-1,0,0,(others => False))
function New_Event return Event;
-- Attends qu'un event arrive et le retourne, cette fonction bloque le
-- programme tant qu'elle ne reçoit pas un évènement
procedure Wait_Event (E : in out Event);
-- Regarde si il y a des events en attente
-- Si il y en a, E est mis à jour avec le premier event de la queue et
-- En_Of_Queue est mis à False
-- Sinon E n'est pas modifié et End_Of_Queue est mis à True
procedure Poll_Event(E : in out Event;
End_Of_Queue : out Boolean);
-- Enable_Key_Repeat active la répétition lors de la génération d'event
-- au clavier : Lorsqu'il est activé, l'appuie sur une touche génère
-- un premier event, puis après Wait milliseconde, elle génère un event
-- toutes les Interval milliseconde tant qu'elle n'est pas relevé
-- Mettre Wait à 0 desactive la répétition, pour plus de clareté, il
-- est conseillé d'utiliser la fonction de désactivation
procedure Enable_Key_Repeat(Wait : in Positive := 500;
Interval : in Positive := 30);
procedure Disable_Key_Repeat;
end Game.GEvent;
|
tum-ei-rcs/StratoX | Ada | 2,863 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . M E M O R Y _ S E T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
with Interfaces.C;
package System.Memory_Set
with SPARK_Mode => On is
pragma Preelaborate;
function Memset
(M : Address; C : Interfaces.C.int; Size : Interfaces.C.size_t)
return Address;
pragma Export (C, Memset, "memset");
-- This function stores C converted to a Character in each of the elements
-- of the array of Characters beginning at M, with size Size. It returns a
-- pointer to M.
end System.Memory_Set;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 300 | ads | with STM32_SVD.SPI;
generic
SPI : in out STM32_SVD.SPI.SPI_Peripheral;
Data_Size : STM32GD.SPI.SPI_Data_Size;
package STM32GD.SPI.Peripheral is
procedure Init;
procedure Transfer (Data : in out SPI_Data_8b)
with
Pre => Data_Size = Data_Size_8b;
end STM32GD.SPI.Peripheral;
|
reznikmm/matreshka | Ada | 3,561 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Web API Definition --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package WebAPI.WebGL.Shaders is
pragma Preelaborate;
type WebGL_Shader is limited interface;
type WebGL_Shader_Access is access all WebGL_Shader'Class
with Storage_Size => 0;
end WebAPI.WebGL.Shaders;
|
kndtime/ada-spaceship | Ada | 496 | adb | package body Spaceship is
procedure set_dmg(s : in out Spaceship; dmg: Integer) is
begin
s.Life := s.Life - dmg;
end set_dmg;
procedure shoot (s : in out Spaceship) is
begin
s.Life := s.Life + 20;
end shoot;
procedure move (s : in out Spaceship; X: Integer; Y : Integer) is
begin
s.X := X;
s.Y := Y;
end move;
procedure test is
s : Spaceship := (ALIVE, 100, 100, 0, 0, 0, 0);
begin
set_dmg(s, 100);
end test;
end Spaceship;
|
jhumphry/auto_counters | Ada | 6,723 | ads | -- basic_refcounted_kvflyweights.ads
-- A package for ensuring resources are not duplicated in a manner similar
-- to the C++ Boost flyweight classes. This package provides a non-task-safe
-- implementation that uses reference counting to release resources when the
-- last reference is released. Resources are associated with a key that can
-- be used to create them if they have not already been created.
-- Copyright (c) 2016-2021, 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.Containers;
with KVFlyweights.Refcounted_Lists;
with KVFlyweights.Basic_Hashtables;
with KVFlyweights.Refcounted_Ptrs;
generic
type Key(<>) is private;
type Value(<>) is limited private;
type Value_Access is access Value;
with function Factory (K : in Key) return Value_Access;
with function Hash (K : in Key) return Ada.Containers.Hash_Type;
Capacity : Ada.Containers.Hash_Type := 256;
with function "=" (Left, Right : in Key) return Boolean is <>;
package Basic_Refcounted_KVFlyweights is
type Key_Access is access Key;
package Lists is
new KVFlyweights.Refcounted_Lists(Key => Key,
Key_Access => Key_Access,
Value => Value,
Value_Access => Value_Access,
Factory => Factory,
"=" => "=");
package Hashtables is
new KVFlyweights.Basic_Hashtables(Key => Key,
Key_Access => Key_Access,
Value => Value,
Value_Access => Value_Access,
Hash => Hash,
KVLists_Spec => Lists.Lists_Spec,
Capacity => Capacity);
package Ptrs is
new KVFlyweights.Refcounted_Ptrs(Key => Key,
Key_Access => Key_Access,
Value => Value,
Value_Access => Value_Access,
KVFlyweight_Hashtables => Hashtables.Hashtables_Spec);
subtype KVFlyweight is Hashtables.KVFlyweight;
-- This KVFlyweight type is an implementation of the key-value flyweight
-- pattern, which helps prevent the resource usage caused by the storage of
-- duplicate values. Reference counting is used to release resources when
-- they are no longer required. This implementation is not protected so it is
-- not safe to use if multiple tasks could attempt to add or remove resources
-- simultaneously.
subtype V_Ref is Ptrs.V_Ref;
-- This is a generic generalised reference type which is used to make
-- Value_Ptr easier to use and which should not be stored or reused.
subtype Value_Ptr is Ptrs.Refcounted_Value_Ptr;
-- The Value_Ptr type points to a resource inside a Flyweight. It is
-- reference-counted (shared with Value_Ref) so that when the last Value_Ptr
-- or Value_Ref pointing to a resource is destroyed, the resource will be
-- deallocated as well. The 'Get' function returns an access value to the
-- resource.
subtype Value_Ref is Ptrs.Refcounted_Value_Ref;
-- The Value_Ref type points to a resource inside a Flyweight. It is
-- reference-counted (shared with Value_Ptr) so that when the last Value_Ptr
-- or Value_Ref pointing to a resource is destroyed, the resource will be
-- deallocated as well. The Value_Ref type can be implicitly derefenced to
-- return the resource.
function P (P : Ptrs.Refcounted_Value_Ptr) return V_Ref
renames Ptrs.P;
-- P returns an V_Ref which is a generalised reference to the stored value.
-- This is an alternative to calling the Get function and dereferencing the
-- access value returned with '.all'.
function Get (P : Ptrs.Refcounted_Value_Ptr) return Value_Access
renames Ptrs.Get;
-- Get returns an access value that points to a resource inside a Flyweight.
function Get (P : Ptrs.Refcounted_Value_Ref) return Value_Access
renames Ptrs.Get;
-- Get returns an access value that points to a resource inside a Flyweight.
function Make_Ref (P : Ptrs.Refcounted_Value_Ptr'Class)
return Ptrs.Refcounted_Value_Ref
renames Ptrs.Make_Ref;
-- Make_Ref converts a Refcounted_Value_Ptr into a Refcounted_Value_Ref.
function Insert_Ptr (F : aliased in out Hashtables.KVFlyweight;
K : in Key)
return Ptrs.Refcounted_Value_Ptr
renames Ptrs.Insert_Ptr;
-- Insert_Ref looks to see if the Key K already exists inside the KVFlyweight
-- F. If not, F makes a new value from K using the specified Factory function
-- and stores it for future use. A Refcounted_Value_Ptr is returned.
function Make_Ptr (R : Ptrs.Refcounted_Value_Ref'Class)
return Ptrs.Refcounted_Value_Ptr
renames Ptrs.Make_Ptr;
-- Make_Ref converts a Refcounted_Value_Ref into a Refcounted_Value_Ptr.
function Insert_Ref (F : aliased in out Hashtables.KVFlyweight;
K : in Key)
return Ptrs.Refcounted_Value_Ref
renames Ptrs.Insert_Ref;
-- Insert_Ref looks to see if the Key K already exists inside the KVFlyweight
-- F. If not, F makes a new value from K using the specified Factory function
-- and stores it for future use. A Refcounted_Value_Ref is returned.
-- Note - ideally Insert_Ptr and Insert_Ref could both be overloadings of
-- Insert. However this seems to cause problems for GNAT GPL 2015 so for now
-- the type is suffixed to the name.
end Basic_Refcounted_KVFlyweights;
|
reznikmm/matreshka | Ada | 15,581 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Wide_Wide_Text_IO;
with System.Address_To_Access_Conversions;
with Qt4.Strings;
with AMF.CMOF.Named_Elements;
with AMF.CMOF.Properties.Collections;
with League.Strings;
with Modeler.Mime_Datas;
with Modeler.Containment_Tree_Models.MOC;
pragma Unreferenced (Modeler.Containment_Tree_Models.MOC);
package body Modeler.Containment_Tree_Models is
use type Qt4.Q_Integer;
package Node_Conversions is
new System.Address_To_Access_Conversions (Node);
function To_Node
(Self : not null access constant Containment_Tree_Model'Class;
Index : Qt4.Model_Indices.Q_Model_Index) return not null Node_Access;
function To_Index
(Self : not null access constant Containment_Tree_Model'Class;
Node : not null Node_Access) return Qt4.Model_Indices.Q_Model_Index;
-------------------
-- Attribute_Set --
-------------------
overriding procedure Attribute_Set
(Self : not null access Containment_Tree_Model;
Element : not null AMF.Elements.Element_Access;
Property : not null AMF.CMOF.Properties.CMOF_Property_Access;
Position : AMF.Optional_Integer;
Old_Value : League.Holders.Holder;
New_Value : League.Holders.Holder)
is
N : constant not null Node_Access
:= Self.Map (AMF.CMOF.Elements.CMOF_Element_Access (Element));
begin
if N.Element.all in AMF.CMOF.Named_Elements.CMOF_Named_Element'Class
and then Property.Get_Name.Value.To_Wide_Wide_String = "name"
then
Self.Emit_Data_Changed (Self.To_Index (N), Self.To_Index (N));
else
Ada.Wide_Wide_Text_IO.Put_Line ("attribute set");
end if;
end Attribute_Set;
------------------
-- Column_Count --
------------------
overriding function Column_Count
(Self : not null access constant Containment_Tree_Model;
Parent : Qt4.Model_Indices.Q_Model_Index) return Qt4.Q_Integer is
begin
return 1;
end Column_Count;
------------------
-- Constructors --
------------------
package body Constructors is
------------
-- Create --
------------
function Create
(Parent : access Qt4.Objects.Q_Object'Class := null)
return not null Containment_Tree_Model_Access is
begin
return Self : constant not null Containment_Tree_Model_Access
:= new Containment_Tree_Model
do
Qt4.Abstract_Item_Models.Directors.Constructors.Initialize
(Self, Parent);
AMF.Listeners.Register (AMF.Listeners.Listener_Access (Self));
end return;
end Create;
end Constructors;
----------
-- Data --
----------
overriding function Data
(Self : not null access Containment_Tree_Model;
Index : Qt4.Model_Indices.Q_Model_Index;
Role : Qt4.Item_Data_Role) return Qt4.Variants.Q_Variant
is
N : constant Node_Access := Self.To_Node (Index);
Name : AMF.Optional_String;
pragma Assert (N /= null);
begin
case Role is
when Qt4.Display_Role
| Qt4.Edit_Role
=>
if N.Element.all
in AMF.CMOF.Named_Elements.CMOF_Named_Element'Class
then
Name :=
AMF.CMOF.Named_Elements.CMOF_Named_Element'Class
(N.Element.all).Get_Name;
if not Name.Is_Empty then
return
Qt4.Variants.Create
(Qt4.Strings.From_Ucs_4 (Name.Value.To_Wide_Wide_String));
end if;
end if;
when others =>
null;
end case;
return Qt4.Variants.Create;
end Data;
-----------
-- Flags --
-----------
overriding function Flags
(Self : not null access constant Containment_Tree_Model;
Index : Qt4.Model_Indices.Q_Model_Index)
return Qt4.Item_Flags
is
use type Qt4.Item_Flags;
begin
if Index.Is_Valid then
return
Qt4.Item_Is_Selectable
+ Qt4.Item_Is_Editable
+ Qt4.Item_Is_Drag_Enabled
+ Qt4.Item_Is_Drop_Enabled
+ Qt4.Item_Is_Enabled;
else
return
Qt4.Item_Is_Selectable
+ Qt4.Item_Is_Editable
+ Qt4.Item_Is_Drop_Enabled
+ Qt4.Item_Is_Enabled;
end if;
end Flags;
-----------
-- Index --
-----------
overriding function Index
(Self : not null access constant Containment_Tree_Model;
Row : Qt4.Q_Integer;
Column : Qt4.Q_Integer;
Parent : Qt4.Model_Indices.Q_Model_Index)
return Qt4.Model_Indices.Q_Model_Index
is
N : constant Node_Access := Self.To_Node (Parent);
begin
if Column = 0 then
if Row <= N.Children.Last_Index then
return
Self.Create_Index
(Row,
Column,
Node_Conversions.To_Address
(Node_Conversions.Object_Pointer (N.Children.Element (Row))));
end if;
end if;
Ada.Wide_Wide_Text_IO.Put_Line ("index");
return Qt4.Model_Indices.Create;
end Index;
---------------------
-- Instance_Create --
---------------------
overriding procedure Instance_Create
(Self : not null access Containment_Tree_Model;
Element : not null AMF.Elements.Element_Access)
is
E : constant not null AMF.CMOF.Elements.CMOF_Element_Access
:= AMF.CMOF.Elements.CMOF_Element_Access (Element);
N : constant not null Node_Access
:= new Node'(Element => E, Parent => Self.Root, Children => <>);
L : constant Qt4.Q_Integer := Qt4.Q_Integer (Self.Root.Children.Length);
begin
-- New elements are added to root level always and are moved later when
-- containment link is established.
Self.Begin_Insert_Rows (Qt4.Model_Indices.Create, L, L);
Self.Map.Insert (E, N);
Self.Root.Children.Append (N);
Self.End_Insert_Rows;
end Instance_Create;
--------------
-- Link_Add --
--------------
overriding procedure Link_Add
(Self : not null access Containment_Tree_Model;
Association : not null AMF.CMOF.Associations.CMOF_Association_Access;
First_Element : not null AMF.Elements.Element_Access;
Second_Element : not null AMF.Elements.Element_Access)
is
FE : constant not null AMF.CMOF.Elements.CMOF_Element_Access
:= AMF.CMOF.Elements.CMOF_Element_Access (First_Element);
SE : constant not null AMF.CMOF.Elements.CMOF_Element_Access
:= AMF.CMOF.Elements.CMOF_Element_Access (Second_Element);
ME : constant
AMF.CMOF.Properties.Collections.Ordered_Set_Of_CMOF_Property
:= Association.Get_Member_End;
FN : constant not null Node_Access := Self.Map.Element (FE);
SN : constant not null Node_Access := Self.Map.Element (SE);
SP : Qt4.Model_Indices.Q_Model_Index;
DP : Qt4.Model_Indices.Q_Model_Index;
begin
if ME.Element (1).Get_Is_Composite then
-- Move second element to be child of first element.
if SN.Parent.Parent /= null then
Ada.Wide_Wide_Text_IO.Put_Line ("link add 1");
end if;
DP :=
Self.Create_Index
(FN.Parent.Children.Find_Index (FN),
0,
Node_Conversions.To_Address
(Node_Conversions.Object_Pointer (FN)));
if Self.Begin_Move_Rows
(SP,
SN.Parent.Children.Find_Index (SN),
SN.Parent.Children.Find_Index (SN),
DP,
FN.Children.Last_Index + 1)
then
SN.Parent.Children.Delete (SN.Parent.Children.Find_Index (SN));
FN.Children.Append (SN);
SN.Parent := FN;
Self.End_Move_Rows;
else
Ada.Wide_Wide_Text_IO.Put_Line ("link add 3");
end if;
elsif ME.Element (2).Get_Is_Composite then
Ada.Wide_Wide_Text_IO.Put_Line ("link add 2");
end if;
end Link_Add;
---------------
-- Mime_Data --
---------------
overriding function Mime_Data
(Self : not null access constant Containment_Tree_Model;
Indexes : Qt4.Model_Index_Lists.Q_Model_Index_List)
return access Qt4.Mime_Datas.Q_Mime_Data'Class
is
Data : Modeler.Mime_Datas.Modeler_Mime_Data_Access;
begin
if Indexes.Size = 1
and then Indexes.Item_At (0).Is_Valid
then
Data := Modeler.Mime_Datas.Constructors.Create;
Data.Set_Element (Self.To_Node (Indexes.Item_At (0)).Element);
end if;
return Data;
end Mime_Data;
----------------
-- Mime_Types --
----------------
overriding function Mime_Types
(Self : not null access constant Containment_Tree_Model)
return Qt4.String_Lists.Q_String_List is
begin
return Result : Qt4.String_Lists.Q_String_List do
Result.Append (Qt4.Strings.From_Ucs_4 (Drag_Drop_Mime_Type));
end return;
end Mime_Types;
------------
-- Parent --
------------
overriding function Parent
(Self : not null access constant Containment_Tree_Model;
Child : Qt4.Model_Indices.Q_Model_Index)
return Qt4.Model_Indices.Q_Model_Index
is
N : constant Node_Access := Self.To_Node (Child);
begin
if N.Parent /= null then
return Self.To_Index (N.Parent);
else
return Qt4.Model_Indices.Create;
end if;
end Parent;
---------------
-- Row_Count --
---------------
overriding function Row_Count
(Self : not null access constant Containment_Tree_Model;
Parent : Qt4.Model_Indices.Q_Model_Index) return Qt4.Q_Integer
is
N : constant Node_Access := Self.To_Node (Parent);
begin
return Qt4.Q_Integer (N.Children.Length);
end Row_Count;
--------------
-- Set_Data --
--------------
overriding function Set_Data
(Self : not null access Containment_Tree_Model;
Index : Qt4.Model_Indices.Q_Model_Index;
Value : Qt4.Variants.Q_Variant;
Role : Qt4.Item_Data_Role) return Boolean
is
N : constant not null Node_Access := Self.To_Node (Index);
begin
case Role is
when Qt4.Edit_Role =>
if N.Element.all
in AMF.CMOF.Named_Elements.CMOF_Named_Element'Class
then
if Value.To_String.Length = 0 then
AMF.CMOF.Named_Elements.CMOF_Named_Element'Class
(N.Element.all).Set_Name ((Is_Empty => True));
else
AMF.CMOF.Named_Elements.CMOF_Named_Element'Class
(N.Element.all).Set_Name
((False,
League.Strings.To_Universal_String
(Value.To_String.To_Ucs_4)));
end if;
return True;
end if;
Ada.Wide_Wide_Text_IO.Put_Line
("set data"
& Qt4.Item_Data_Role'Wide_Wide_Image (Role)
& Value.To_String.To_Ucs_4);
when others =>
null;
end case;
return False;
end Set_Data;
--------------
-- To_Index --
--------------
function To_Index
(Self : not null access constant Containment_Tree_Model'Class;
Node : not null Node_Access) return Qt4.Model_Indices.Q_Model_Index is
begin
if Node = Self.Root then
return Qt4.Model_Indices.Create;
else
return
Self.Create_Index
(Node.Parent.Children.Find_Index (Node),
0,
Node_Conversions.To_Address
(Node_Conversions.Object_Pointer (Node)));
end if;
end To_Index;
-------------
-- To_Node --
-------------
function To_Node
(Self : not null access constant Containment_Tree_Model'Class;
Index : Qt4.Model_Indices.Q_Model_Index) return not null Node_Access
is
N : constant Node_Access
:= Node_Access (Node_Conversions.To_Pointer (Index.Internal_Pointer));
begin
if N = null then
return Self.Root;
else
return N;
end if;
end To_Node;
end Modeler.Containment_Tree_Models;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.